D102: Adaptive Gaussian Quadrature

Author(s): F. James Library: MATHLIB
Submitter: Submitted: 01.12.1994
Language: Fortran Revised:

Subroutine subprograms RADAPT and DADAPT calculate, to an attempted specified accuracy, the value of the integral

displaymath89

by adaptive subdivision of the interval (a,b), calculating the integrals over the subintervals using RGS56P and DGS56P (D106).

On CDC and Cray computers, the double-precision version DADAPT is not available.

Structure:

SUBROUTINE subprograms
User Entry Names: RADAPT, DADAPT
External References: RGS56P, DGS56P, user-supplied FUNCTION subprogram.

Usage:

For tex2html_wrap_inline93 (type REAL), tex2html_wrap_inline95 (type DOUBLE PRECISION),

    CALL tADAPT(F,A,B,NSEG,RELTOL,ABSTOL,RES,ERR)
F
(type according to t) Name of a user-supplied FUNCTION subprogram, declared EXTERNAL in the calling program. This subprogram must set tex2html_wrap_inline97 .
A,B
(type according to t) End-points of integration interval. Note that B may be less than A.
NSEG
(INTEGER) Specifies how the adaptation is to be done:
tex2html_wrap_inline99 use the subdivisions as determined in the previous call to tADAPT,
tex2html_wrap_inline101 fully automatic, adapt until tolerance attained,
tex2html_wrap_inline103 first split interval into n equal segments, then adapt as necessary to attain tolerance.
RELTOL
(type according to t) Specified relative tolerance.
ABSTOL
(type according to t) Specified absolute tolerance.
The calculation comes to an end if either RELTOL or ABSTOL is satisfied, or the number of segments exceeds 100. Either RELTOL or ABSTOL can be set to zero, in which case only the other is used.
RES
(type according to t) The calculated approximation for I.
ERR
(type according to t) An estimated absolute uncertainty on this approximation.

Method:

The automatic adaption is done as follows: At each step, the total integral is estimated as the sum of the integrals over the subdivisions, and the squared uncertainty is estimated as the sum of the squares of the uncertainties over all subdivisions. If this uncertainty is too big (failing both the absolute and relative tolerance criteria) then the subinterval with the largest absolute uncertainty is divided in half.

Accuracy:

The true accuracy is usually very close to the uncertainty returned by the subroutine, sometimes it is much better, but very seldom worse. Even on functions with (integrable) singularities, the results are usually reliable, as long as the singularity is ``wide enough'' to be detected in the early stages, which can be controlled by the value of NSEG.
tex2html_wrap_inline107


Michel Goossens Tue Jun 4 23:27:14 METDST 1996