hypot_rrule

Function hypot_rrule 

Source
pub fn hypot_rrule<R: Float>(x: R, y: R, cotangent: R) -> (R, R)
Expand description

Reverse rule for hypot.

ยงExamples

use chainrules::hypot_rrule;

let (dx, dy) = hypot_rrule(3.0_f64, 4.0_f64, 1.0_f64);
assert!((dx - 0.6).abs() < 1e-12);
assert!((dy - 0.8).abs() < 1e-12);