atan2_rrule

Function atan2_rrule 

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

Reverse rule for atan2(y, x).

Returns cotangents with respect to (y, x).

ยงExamples

use chainrules::atan2_rrule;

let (dy, dx) = atan2_rrule(3.0_f64, 4.0_f64, 2.0_f64);
assert!((dy - 0.32_f64).abs() < 1e-12);
assert!((dx + 0.24_f64).abs() < 1e-12);