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



Bits error versus x



Bits error versus s
Results
Initial program 0.1
rmApplied add-exp-log_binary320.1
Applied 1-exp_binary320.1
Applied div-exp_binary320.1
Simplified0.1
Final simplification0.1
herbie shell --seed 2021173
(FPCore (x s)
:name "Logistic CDF"
:precision binary32
:pre (<= 0.0 s 1.0651631)
(/ 1.0 (+ 1.0 (exp (/ (- x) s)))))