zeroth_derivative

Function zeroth_derivative 

Source
pub fn zeroth_derivative<G, T: DualNum<F>, F: DualNumFloat, O: Mappable<Real<T, F>>>(
    g: G,
    x: T,
) -> O::Output<T>
where G: Fn(Real<T, F>) -> O,
Expand description

Calculate the zeroth derivative of a scalar function.

Only useful for specific generic cases in which the trait bound Real<T, F>: DualNum<F, Inner=T> is required.

let f = zeroth_derivative(|x| x.powi(2), 5.0);
assert_eq!(f, 25.0);