pub fn brent_root_find<F>( f: F, a: f64, b: f64, tolerance: f64, max_iterations: usize, ) -> Result<AngleResult, String>where F: Fn(f64) -> f64,
Brent’s method for root finding - optimized implementation