2 Specification

3 Description

D01FBF approximates a multidimensional integral by evaluating the summation

∑i1=1l1w1,i1∑i2=1l2w2,i2⋯∑in=1lnwn,infx1,i1,x2,i2,…,xn,in

given the weights wj,ij and abscissae xj,ij for a multidimensional product integration rule (see Davis and Rabinowitz (1975)). The number of dimensions may be anything from 1 to 20.

The weights and abscissae for each dimension must have been placed in successive segments of the arrays WEIGHT and ABSCIS; for example, by calling
D01BCF or D01TBF
once for each dimension using a quadrature formula and number of abscissae appropriate to the range of each xj and to the functional dependence of f on xj.

If normal weights are used, the summation will approximate the integral

∫w1x1∫w2x2⋯∫wnxnfx1,x2,…,xndxn⋯dx2dx1

where wjx is the weight function associated with the quadrature formula chosen for the jth dimension; while if adjusted weights are used, the summation will approximate the integral

On entry: the coordinates of the point at which the integrand f must be evaluated.

FUN must either be a module subprogram USEd by, or declared as EXTERNAL in, the (sub)program from which D01FBF is called. Parameters denoted as Input must not be changed by this procedure.

7: IFAIL – INTEGERInput/Output

On entry: IFAIL must be set to 0, -1​ or ​1. If you are unfamiliar with this parameter you should refer to Section 3.3 in the Essential Introduction for details.

For environments where it might be inappropriate to halt program execution when an error is detected, the value -1​ or ​1 is recommended. If the output of error messages is undesirable, then the value 1 is recommended. Otherwise, if you are not familiar with this parameter, the recommended value is 0. When the value -1​ or ​1 is used it is essential to test the value of IFAIL on exit.

On exit: IFAIL=0 unless the routine detects an error or a warning has been flagged (see Section 6).

6 Error Indicators and Warnings

If on entry IFAIL=0 or -1, explanatory error messages are output on the current error message unit (as defined by X04AAF).

Errors or warnings detected by the routine:

IFAIL=1

On entry,

NDIM<1,

or

NDIM>20,

or

LWA<NPTVEC1+NPTVEC2+⋯+NPTVECNDIM.

7 Accuracy

The accuracy of the computed multidimensional sum depends on the weights and the integrand values at the abscissae. If these numbers vary significantly in size and sign then considerable accuracy could be lost. If these numbers are all positive, then little accuracy will be lost in computing the sum.