The QROMB function evaluates the integral of a function over the closed interval [ A, B ] using Romberg integration. The result will have the same structure as the smaller of A and B , and the resulting type will be single- or double-precision floating, depending on the input types.
QROMB is based on the routine
qromb
described in section 4.3 of
Numerical Recipes in C: The Art of Scientific Computing
(Second Edition), published by Cambridge University Press, and is used by permission.
A scalar string specifying the name of a user-supplied IDL function to be integrated. This function must accept a single scalar argument X and return a scalar result. It must be defined over the closed interval [ A, B ].
For example, if we wish to integrate the cubic polynomial
we define a function CUBIC to express this relationship in the IDL language:
The desired fractional accuracy. For single-precision calculations, the default value is 1.0 ¥ 10 -6 . For double-precision calculations, the default value is 1.0 ¥ 10 -12 .
To integrate the CUBIC function (listed above) over the interval [0, 3] and print the result:
INT_2D , INT_3D , INT_TABULATED , QROMO , QSIMP