\frac{1}{1 + e^{\frac{-x}{s}}}
\frac{1}{1 + {\left(e^{-1}\right)}^{\left(\frac{x}{s}\right)}}
(FPCore (x s) :precision binary32 (/ 1.0 (+ 1.0 (exp (/ (- x) s)))))
(FPCore (x s) :precision binary32 (/ 1.0 (+ 1.0 (pow (exp -1.0) (/ x s)))))
float code(float x, float s) {
return 1.0f / (1.0f + expf(-x / s));
}
float code(float x, float s) {
return 1.0f / (1.0f + powf(expf(-1.0f), (x / s)));
}



Bits error versus x



Bits error versus s
Results
Initial program 0.1
Applied *-un-lft-identity_binary320.1
Applied neg-mul-1_binary320.1
Applied times-frac_binary320.1
Applied exp-prod_binary320.1
Simplified0.1
Final simplification0.1
herbie shell --seed 2022068
(FPCore (x s)
:name "Logistic function"
:precision binary32
:pre (and (<= 0.0 s) (<= s 1.0651631))
(/ 1.0 (+ 1.0 (exp (/ (- x) s)))))