The secant method starts from two approximations . Replace the function near its zero of a function by the secant line through and ; the zero of that line is the next approximation:Stop immediately if ; otherwise the denominator must be nonzero. Each further step needs one new function evaluation and no derivative. There is no automatic bracketing or global convergence guarantee.[ref]
Use . Then , , and the secant method givesWriting , the next step isThus the requested approximation is to three significant figures. All intermediate logarithms should be retained at higher precision before this final rounding.
A small difference between successive secant method iterates alone does not certify a small absolute error. Instead use a residual root error bound. On ,and , so there is a unique root . For an iterate , the mean value theorem givesTherefore stop when and . This guarantees the desired absolute error in exact arithmetic; the evaluated residual of a root equation should include an allowance for its much smaller roundoff error. A safeguarded implementation can retain the bracket and use bisection if a proposed secant method step leaves it.
With the gap-at-one convention, machine epsilon is the difference between and the next larger representable floating-point number. The double-precision floating-point format has 53 significant binary digits, including the implicit leading digit, soA related convention uses unit roundoff, the worst relative rounding scale for round-to-nearest: . Stating the convention distinguishes these two common values.[ref]
IEEE arithmetic in Oracle's Numerical Computation Guide. Chapter 2, IEEE Arithmetic Model; Double Format and Table 2-5
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.