macro_rules! newton { ($f:ident, $x:expr, $max_iter:expr, $tol:expr) => { ... }; }
High level macro for newton (using Automatic differentiation)
This macro requires the function with ad_function
ad_function
use peroxide::fuga::*; #[ad_function] fn f(x: f64) -> f64 { (x - 1f64).powi(3) }
f
fn(f64) -> f64
x
f64
max_iter
usize
tol