Module secant

Module secant 

Source
Expand description

Secant method for root finding

Implements the secant method which approximates the derivative using two function evaluations. No analytical or numerical derivative required.

§Algorithm

Given two initial guesses x0 and x1: x(n+1) = x(n) - f(x(n)) * (x(n) - x(n-1)) / (f(x(n)) - f(x(n-1)))

§Convergence

  • Superlinear convergence rate: ≈ 1.618 (golden ratio)
  • Faster than bisection, slower than Newton-Raphson
  • No derivative calculation required
  • Requires two initial guesses (not necessarily a bracket)

Structs§

SecantMethod
Secant method for root finding