Function autodiff::forward_autodiff::diff
source · [−]Expand description
Evaluates the derivative of f
at x0
Examples
use autodiff::*;
// Define a function `f(x) = e^{-0.5*x^2}`
let f = |x: FT<f64>| (-x * x / F::cst(2.0)).exp();
// Differentiate `f` at zero.
println!("{}", diff(f, 0.0)); // prints `0`