mul_rrule

Function mul_rrule 

Source
pub fn mul_rrule<S: ScalarAd>(x: S, y: S, cotangent: S) -> (S, S)
Expand description

Reverse rule for mul.

Returns cotangents with respect to (x, y).

ยงExamples

use chainrules::mul_rrule;

let (dx, dy) = mul_rrule(2.0_f64, 4.0_f64, 1.0_f64);
assert_eq!(dx, 4.0_f64);
assert_eq!(dy, 2.0_f64);