pub fn sigmoid(a: f64) -> f64
Expand description
The sigmoid or logistic function
ยงExamples
use com_croftsoft_core::math::math_lib::sigmoid;
assert_eq!(
sigmoid(f64::NEG_INFINITY),
0.0);
assert_eq!(
sigmoid(-1.0),
0.2689414213699951);
assert_eq!(
sigmoid(0.0),
0.5);
assert_eq!(
sigmoid(1.0),
0.7310585786300049);
assert_eq!(
sigmoid(f64::INFINITY),
1.0);