Choose equation (1), evaluated by refined composite Simpson's rule. It gives directly as a one-dimensional definite integral with fixed endpoints and a smooth integrand. It therefore avoids root finding altogether. Before evaluating, use the trigonometric identityThis equivalent integrand is nonnegative throughout , avoiding cancellation between the original two terms. Equation (2) instead subtracts two potentially large exponential functions, while equation (3) would ordinarily put a numerical integration inside a root finding loop.
For even , let , , and computeThen double . The integrand has bounded derivatives of every fixed order on the integration interval; in the fourth-order error regime, the estimated remaining truncation error in is . The factor follows by eliminating the leading term between the two mesh widths.[ref]
Stop when this estimate is comparable to and further refinement shows stagnation at the roundoff error scale. Check that the differences previously decreased consistently with fourth-order convergence; differences alone are not a rigorous error certificate if cancellation or roundoff error dominates. Compensated summation helps keep the summation error near the precision limit. Refining indefinitely after this point increases work without reliably adding meaningful digits. This answers the requested choice and termination strategy without requiring an explicit value of .
Articles by others on the same topic
There are currently no matching articles.