\frac{1}{1 + e^{\frac{-x}{s}}}
\frac{1}{1 + e^{\frac{-x}{s}}}
(FPCore (x s) :precision binary32 (/ 1.0 (+ 1.0 (exp (/ (- x) s)))))
(FPCore (x s) :precision binary32 (/ 1.0 (+ 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 1.0f / (1.0f + expf((-x / s)));
}



Bits error versus x



Bits error versus s
Results
Initial program 0.1
Final simplification0.1
herbie shell --seed 2022130
(FPCore (x s)
:name "Logistic function"
:precision binary32
:pre (and (<= 0.0 s) (<= s 1.0651631))
(/ 1.0 (+ 1.0 (exp (/ (- x) s)))))