pub fn bisect(
f: impl Fn(f64) -> f64,
a: f64,
b: f64,
tol: f64,
max_iter: usize,
) -> Option<f64>Expand description
Bisection method. Requires f(a)*f(b) < 0.
Returns the root within tolerance tol, or None if bracket invalid or no convergence.