is approximated using static quadrature rules on adaptively refined subintervals of the region of integration.
Adaptive quadrature follows the general scheme An approximation
Either the initial estimate or the sum of the recursively computed halves is returned (line 7).
The important components are the quadrature rule itself the error estimator and the logic for deciding which interval to subdivide, and when to terminate.
The quadrature rules generally have the form where the nodes
In the simplest case, Newton–Cotes formulas of even degree are used, where the nodes
are evenly spaced in the interval: When such rules are used, the points at which
Some quadrature algorithms generate a sequence of results which should approach the correct value.
This criterion can be difficult to satisfy if the integrands are badly behaved at only a few points, for example with a few step discontinuities.
Global adaptive quadrature can be more efficient (using fewer evaluations of the integrand) but is generally more complex to program and may require more working space to record information on the current set of intervals.