pub fn brent<N, F>(initial: (N, N), f: F, tol: N) -> Result<N, String>Expand description
Use Brent’s method to find the root of a function
The initial guesses must bracket the root. That is, the function evaluations of the initial guesses must differ in sign.
§Examples
use bacon_sci::roots::brent;
fn cubic(x: f64) -> f64 {
x.powi(3)
}
//...
fn example() {
let solution = brent((0.1, -0.1), cubic, 1e-5).unwrap();
}