Macro peroxide::newton

source ·
macro_rules! newton {
    ($f:ident, $x:expr, $max_iter:expr, $tol:expr) => { ... };
}
Expand description

High level macro for newton (using Automatic differentiation)

§Requirements

  • This macro requires the function with ad_function

    use peroxide::fuga::*;
    
    #[ad_function]
    fn f(x: f64) -> f64 {
        (x - 1f64).powi(3)
    }

§Arguments

  • f: fn(f64) -> f64 (not allow closure)
  • x: f64
  • max_iter: usize
  • tol: f64