Expand description
Bisection method for root finding
Implements the bisection method which guarantees convergence for continuous functions with a sign change in the interval. Uses interval halving to iteratively narrow down the root location.
§Algorithm
Given f(a) and f(b) with opposite signs:
- Compute midpoint: c = (a + b) / 2
- If f(c) has same sign as f(a), replace a with c
- Otherwise, replace b with c
- Repeat until |b - a| < tolerance
§Convergence
- Guaranteed convergence if f is continuous and f(a)*f(b) < 0
- Linear convergence rate: error halves each iteration
- Requires O(log2((b-a)/tolerance)) iterations
§Tolerance Semantics
The algorithm stops when EITHER:
- |f(c)| < tolerance (function value criterion)
- |b - a| / 2 < tolerance (bracket width criterion)
The bracket width criterion guarantees the root is within tolerance distance of the returned value.
Structs§
- Bisection
Method - Bisection method root finder