min

Function min 

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

Primal min.

The primal follows Float::min. For differentiation, ties route the tangent/cotangent to the second argument. If exactly one input is NaN, the non-NaN input receives the gradient.

ยงExamples

use chainrules::min;

assert_eq!(min(1.5_f64, 2.5_f64), 1.5);
assert_eq!(min(2.0_f64, 2.0_f64), 2.0);