Secant Method

Description

The secant method is an iterative procedure to estimate a root of an equation f(x) = 0 where the user gives two initial estimates and a tolerance. One of the two initial estimates is regarded as being older than the other, the procedure then calculates a new estimate and discards the oldest estimate until the distance between the two estimates is less than the preassigned tolerance. If xi-1 and xi are the two estimates with xi-1 being older than xi, the new estimate xi+1 is that point on the x-axis which is the intersection of the x-axis and the line joining the points ( xi-1, f(xi-1) ) and ( xi, f(xi) ) on the curve y = f(x). The subsequent estimate then uses the points ( xi, f(xi) ) and ( xi+1, f(xi+1) ) to estimate xi+1.
 
It is best to avoid using the secant method if there are local extrema near the root. The convergence of the secant method depends on the initial estimates. It is generally better if the two initial conditions are close so that the secant is approximately equal to the tangent.

Function List

C Source