The Secant Method
The secant method mimics Newton's step using a finite-difference slope from two prior points, avoiding derivatives at a modest cost in convergence speed.
Newton without the derivative
When the derivative is unavailable or expensive, the secant method approximates it by the slope of the line through the two most recent points. The update is x_{n+1} = x_n - f(x_n)(x_n - x_{n-1})/(f(x_n) - f(x_{n-1})). It needs two starting values but only one new function evaluation per step.
def secant(f, x0, x1, tol=1e-12, nmax=100):
f0, f1 = f(x0), f(x1)
for _ in range(nmax):
if abs(f1) < tol:
return x1
x2 = x1 - f1*(x1 - x0)/(f1 - f0)
x0, f0, x1, f1 = x1, f1, x2, f(x2)
return x1
Superlinear convergence
The secant method converges with order equal to the golden ratio, about 1.618: faster than linear but slower than Newton's quadratic. Because it uses only one function evaluation per iteration while Newton uses two (function plus derivative), the secant method is often more efficient per unit of work when the derivative is costly.
Trade-offs
Like Newton's method, the secant method is an open method and can diverge from a poor start. It can also fail if two successive function values are nearly equal, making the denominator small and the step unstable. The regula falsi (false position) variant adds bracketing to guarantee convergence at the expense of speed.
The secant method and its safeguarded cousins are frequently the default for black-box functions in engineering codes, where derivatives are unavailable but robustness and reasonable speed are both needed, such as solving implicit relations in physics models supporting the breeder Hyperion.