Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Setting the Termination Condition for Integration

The integrate method for all three double-exponential quadratures supports tolerance argument that acts as the termination condition for integration.

The tolerance is met when two subsequent estimates of the integral have absolute error less than tolerance*L1.

It is highly recommended that the tolerance be left at the default value of √ε, or something similar. Since double exponential quadrature converges exponentially fast for functions in Hardy spaces, then once the routine has proved that the error is ~√ε, then the error should in fact be ~ε.

If you request that the error be ~ε, this tolerance might never be achieved (as the summation is not stabilized ala Kahan), and the routine will simply flounder, dividing the interval in half in order to increase the precision of the integrand, only to be thwarted by floating point roundoff.

If for some reason, the default value doesn't quite achieve full precision, then you could try something a little smaller such as √ε/4 or ε2/3. However, more likely, you need to check that your function to be integrated is able to return accurate values, and that there are no other issues with your integration scheme.


PrevUpHomeNext