third_derivative

Function third_derivative 

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

Calculate the third derivative of a univariate function.

let (f, df, d2f, d3f) = third_derivative(|x| x.powi(3), 5.0);
assert_eq!(f, 125.0);      // x³
assert_eq!(df, 75.0);      // 3x²
assert_eq!(d2f, 30.0);     // 6x
assert_eq!(d3f, 6.0);      // 6