nag_quad_1d_fin_smooth (d01bdc)

+− Contents

1 Purpose

nag_quad_1d_fin_smooth (d01bdc) calculates an approximation to the integral of a function over a finite interval a,b:

I=∫abfxdx.

It is non-adaptive and as such is recommended for the integration of ‘smooth’ functions. These exclude integrands with singularities, derivative singularities or high peaks on a,b, or which oscillate too strongly on a,b.

2 Specification

3 Description

nag_quad_1d_fin_smooth (d01bdc) is based on the QUADPACK routine QNG (see Piessens et al. (1983)). It is a non-adaptive function which uses as its basic rules, the Gauss 10-point and 21-point formulae. If the accuracy criterion is not met, formulae using 43 and 87 points are used successively, stopping whenever the accuracy criterion is satisfied.

Pointer to structure of type Nag_Comm; the following members are relevant to f.

user – double *

iuser – Integer *

p – Pointer

The type Pointer will be void *. Before calling nag_quad_1d_fin_smooth (d01bdc) you may allocate memory and initialize these pointers with various quantities for use by f when called from nag_quad_1d_fin_smooth (d01bdc) (see Section 3.2.1 in the Essential Introduction).

2:
a – doubleInput

On entry: a, the lower limit of integration.

3:
b – doubleInput

On entry: b, the upper limit of integration. It is not necessary that a<b.

4:
epsabs – doubleInput

On entry: the absolute accuracy required. If epsabs is negative, the absolute value is used. See Section 7.

5:
epsrel – doubleInput

On entry: the relative accuracy required. If epsrel is negative, the absolute value is used. See Section 7.

6:
result – double *Output

On exit: the approximation to the integral I.

7:
abserr – double *Output

On exit: an estimate of the modulus of the absolute error, which should be an upper bound for I-result.

6 Error Indicators and Warnings

There are no specific errors detected by nag_quad_1d_fin_smooth (d01bdc). However, if abserr is greater than

maxepsabs,epsrel×result

this indicates that the function has probably failed to achieve the requested accuracy within 87 function evaluations.

7 Accuracy

nag_quad_1d_fin_smooth (d01bdc) attempts to compute an approximation, result, such that:

I-result≤tol,

where

tol=maxepsabs,epsrel×I,

and epsabs and epsrel are user-specified absolute and relative error tolerances. There can be no guarantee that this is achieved, and you are advised to subdivide the interval if you have any doubts about the accuracy obtained. Note that abserr contains an estimated bound on I-result.

8 Further Comments

The time taken by nag_quad_1d_fin_smooth (d01bdc) depends on the integrand and the accuracy required.