// Example file for nag_intext4a which demonstrates the
// linking of nag_multid_quad_adapt_1 (d01wcc) into Scilab
// which uses a User defined function written in C

ndim = 4;
a = [0;
     0;
     0;
     0];

b = [1;
     1;
     1;
     1];

minpts = 0;
maxpts = 1e6;
eps = 0.0001;

finval_exp    =      0.5754;
acc_exp =    9.89e-05;
tol = 1e-3;

[finval,acc,minpts,fail] = nag_multid_quad_funa(ndim,a,b,minpts,maxpts,eps)


 ok1 = abs(finval - finval_exp)/abs(finval) < tol
 ok2 = abs(acc - acc_exp)/abs(acc) < tol

 if ~ok1; write(%io(2),'Error in expected output'); end;
 if ~ok2; write(%io(2),'Error in expected output'); end;

