pub fn gradient(f: impl Fn(&[Dual]) -> Dual, xs: &[f64]) -> Vec<f64>
Compute the full gradient of f: Rⁿ → R at xs.
f: Rⁿ → R
xs
Makes n forward passes, one per variable.
n