tan_frule

Function tan_frule 

Source
pub fn tan_frule<S: ScalarAd>(x: S, dx: S) -> (S, S)
Expand description

Forward rule for tan.

ยงExamples

use chainrules::tan_frule;

let (y, dy) = tan_frule(0.25_f64, 1.0);
assert!((dy - (1.0 + 0.25_f64.tan().powi(2))).abs() < 1e-12);