pub fn powi_frule<S: ScalarAd>(x: S, exponent: i32, dx: S) -> (S, S)Expand description
Forward rule for powi with fixed integer exponent. Returns (primal, tangent).
use chainrules::powi_frule;
let (y, dy) = powi_frule(2.0_f64, 4, 1.0);
assert_eq!(y, 16.0);
assert_eq!(dy, 32.0);