Automatic Numerical Quadrature
01 November 1977
Automatic Numerical Quadrature By JAMES L. BLUE (Manuscript received April 15, 1977) An automatic numerical quadrature routine evaluate (ANQR) attempts to to absolute accuracy e, given only e, a, b, and a user-supplied subroutine which calculates f(x) for any x in [a,b]. An ANQR which guarantees success is impossible to construct, even disregarding the effects of finite computer precision, but the problem is nonetheless of interest. A reliable and efficient ANQR is a necessary part of any mathematical subroutine library. New single- and double-precision ANQRs, QUAD and DQUAD, have been constructed and tested. They are based on adaptive Romberg extrapolation, with cautious error estimation. An important practical feature is the automatic recognition of endpoint singularities, and a change of variable to handle them. QUAD and DQUAD also recognize the presence of noise in the function being integrated, and limit the attempted accuracy accordingly. Since guaranteed ANQRs are impossible, extensive testing of DQUAD is presented to demonstrate its efficiency and robustness. Comparable testing is not available for competitive ANQRs, but performance on a standard set of test integrals is presented for DQUAD and nine other ANQRs. DQUAD is generally better. QUAD and DQUAD are written in PFORT, a subset of American National Standard (ANS) Fortran. Machine-dependent constants are obtained from the PORT library machine-constants programs. A portable package of storage allocation routines is used.