atan2_frule

Function atan2_frule 

Source
pub fn atan2_frule<S>(y: S, x: S, dy: S, dx: S) -> (S, S)
where S: ScalarAd<Real = S> + Float,
Expand description

Forward rule for atan2(y, x).

Returns (primal, tangent).

ยงExamples

use chainrules::atan2_frule;

let (_y, dy) = atan2_frule(3.0_f64, 4.0_f64, 0.5_f64, 0.25_f64);
assert!((dy - 0.05_f64).abs() < 1e-12);