
(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)));
}
real(4) function code(x, s)
real(4), intent (in) :: x
real(4), intent (in) :: s
code = 1.0e0 / (1.0e0 + exp((-x / s)))
end function
function code(x, s) return Float32(Float32(1.0) / Float32(Float32(1.0) + exp(Float32(Float32(-x) / s)))) end
function tmp = code(x, s) tmp = single(1.0) / (single(1.0) + exp((-x / s))); end
\begin{array}{l}
\\
\frac{1}{1 + e^{\frac{-x}{s}}}
\end{array}
Sampling outcomes in binary32 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(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)));
}
real(4) function code(x, s)
real(4), intent (in) :: x
real(4), intent (in) :: s
code = 1.0e0 / (1.0e0 + exp((-x / s)))
end function
function code(x, s) return Float32(Float32(1.0) / Float32(Float32(1.0) + exp(Float32(Float32(-x) / s)))) end
function tmp = code(x, s) tmp = single(1.0) / (single(1.0) + exp((-x / s))); end
\begin{array}{l}
\\
\frac{1}{1 + e^{\frac{-x}{s}}}
\end{array}
(FPCore (x s) :precision binary32 (/ 1.0 (+ 1.0 (pow (exp (cbrt (/ (* x (/ x s)) s))) (- (cbrt (/ x s)))))))
float code(float x, float s) {
return 1.0f / (1.0f + powf(expf(cbrtf(((x * (x / s)) / s))), -cbrtf((x / s))));
}
function code(x, s) return Float32(Float32(1.0) / Float32(Float32(1.0) + (exp(cbrt(Float32(Float32(x * Float32(x / s)) / s))) ^ Float32(-cbrt(Float32(x / s)))))) end
\begin{array}{l}
\\
\frac{1}{1 + {\left(e^{\sqrt[3]{\frac{x \cdot \frac{x}{s}}{s}}}\right)}^{\left(-\sqrt[3]{\frac{x}{s}}\right)}}
\end{array}
Initial program 99.9%
distribute-frac-neg99.9%
exp-neg99.9%
div-inv99.8%
add-sqr-sqrt53.1%
sqrt-unprod61.7%
sqr-neg61.7%
sqrt-unprod11.4%
add-sqr-sqrt26.8%
div-inv26.8%
add-cube-cbrt26.8%
exp-prod26.8%
pow-flip26.8%
Applied egg-rr99.9%
metadata-eval99.9%
pow-prod-up99.9%
inv-pow99.9%
clear-num99.9%
inv-pow99.9%
clear-num99.9%
associate-*r/99.9%
Applied egg-rr99.9%
Final simplification99.9%
(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)));
}
real(4) function code(x, s)
real(4), intent (in) :: x
real(4), intent (in) :: s
code = 1.0e0 / (1.0e0 + exp((-x / s)))
end function
function code(x, s) return Float32(Float32(1.0) / Float32(Float32(1.0) + exp(Float32(Float32(-x) / s)))) end
function tmp = code(x, s) tmp = single(1.0) / (single(1.0) + exp((-x / s))); end
\begin{array}{l}
\\
\frac{1}{1 + e^{\frac{-x}{s}}}
\end{array}
Initial program 99.9%
Final simplification99.9%
(FPCore (x s)
:precision binary32
(let* ((t_0 (/ (- x) s)))
(if (<= t_0 -5.0)
0.5
(if (<= t_0 4.0)
(+
0.5
(+
(* (/ x s) 0.25)
(* -0.020833333333333332 (/ (* x (/ x s)) (* s (/ s x))))))
(* 2.0 (/ 1.0 (* x (/ x (* s s)))))))))
float code(float x, float s) {
float t_0 = -x / s;
float tmp;
if (t_0 <= -5.0f) {
tmp = 0.5f;
} else if (t_0 <= 4.0f) {
tmp = 0.5f + (((x / s) * 0.25f) + (-0.020833333333333332f * ((x * (x / s)) / (s * (s / x)))));
} else {
tmp = 2.0f * (1.0f / (x * (x / (s * s))));
}
return tmp;
}
real(4) function code(x, s)
real(4), intent (in) :: x
real(4), intent (in) :: s
real(4) :: t_0
real(4) :: tmp
t_0 = -x / s
if (t_0 <= (-5.0e0)) then
tmp = 0.5e0
else if (t_0 <= 4.0e0) then
tmp = 0.5e0 + (((x / s) * 0.25e0) + ((-0.020833333333333332e0) * ((x * (x / s)) / (s * (s / x)))))
else
tmp = 2.0e0 * (1.0e0 / (x * (x / (s * s))))
end if
code = tmp
end function
function code(x, s) t_0 = Float32(Float32(-x) / s) tmp = Float32(0.0) if (t_0 <= Float32(-5.0)) tmp = Float32(0.5); elseif (t_0 <= Float32(4.0)) tmp = Float32(Float32(0.5) + Float32(Float32(Float32(x / s) * Float32(0.25)) + Float32(Float32(-0.020833333333333332) * Float32(Float32(x * Float32(x / s)) / Float32(s * Float32(s / x)))))); else tmp = Float32(Float32(2.0) * Float32(Float32(1.0) / Float32(x * Float32(x / Float32(s * s))))); end return tmp end
function tmp_2 = code(x, s) t_0 = -x / s; tmp = single(0.0); if (t_0 <= single(-5.0)) tmp = single(0.5); elseif (t_0 <= single(4.0)) tmp = single(0.5) + (((x / s) * single(0.25)) + (single(-0.020833333333333332) * ((x * (x / s)) / (s * (s / x))))); else tmp = single(2.0) * (single(1.0) / (x * (x / (s * s)))); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-x}{s}\\
\mathbf{if}\;t_0 \leq -5:\\
\;\;\;\;0.5\\
\mathbf{elif}\;t_0 \leq 4:\\
\;\;\;\;0.5 + \left(\frac{x}{s} \cdot 0.25 + -0.020833333333333332 \cdot \frac{x \cdot \frac{x}{s}}{s \cdot \frac{s}{x}}\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{1}{x \cdot \frac{x}{s \cdot s}}\\
\end{array}
\end{array}
if (/.f32 (neg.f32 x) s) < -5Initial program 100.0%
Taylor expanded in x around 0 28.1%
if -5 < (/.f32 (neg.f32 x) s) < 4Initial program 99.5%
Taylor expanded in x around 0 63.4%
unpow363.4%
cube-mult63.4%
times-frac82.8%
Applied egg-rr82.8%
associate-/l*83.1%
associate-/r*96.1%
frac-times96.1%
Applied egg-rr96.1%
if 4 < (/.f32 (neg.f32 x) s) Initial program 100.0%
Taylor expanded in x around 0 77.4%
mul-1-neg77.4%
unsub-neg77.4%
unpow277.4%
unpow277.4%
times-frac71.0%
Simplified71.0%
Taylor expanded in x around inf 77.2%
unpow277.2%
unpow277.2%
Simplified77.2%
associate-/r*80.4%
div-inv80.4%
Applied egg-rr80.4%
clear-num80.4%
frac-times80.7%
metadata-eval80.7%
Applied egg-rr80.7%
Final simplification65.6%
(FPCore (x s) :precision binary32 (if (<= (/ (- x) s) 0.20000000298023224) 0.5 (* 2.0 (* (/ (* s s) x) (/ 1.0 x)))))
float code(float x, float s) {
float tmp;
if ((-x / s) <= 0.20000000298023224f) {
tmp = 0.5f;
} else {
tmp = 2.0f * (((s * s) / x) * (1.0f / x));
}
return tmp;
}
real(4) function code(x, s)
real(4), intent (in) :: x
real(4), intent (in) :: s
real(4) :: tmp
if ((-x / s) <= 0.20000000298023224e0) then
tmp = 0.5e0
else
tmp = 2.0e0 * (((s * s) / x) * (1.0e0 / x))
end if
code = tmp
end function
function code(x, s) tmp = Float32(0.0) if (Float32(Float32(-x) / s) <= Float32(0.20000000298023224)) tmp = Float32(0.5); else tmp = Float32(Float32(2.0) * Float32(Float32(Float32(s * s) / x) * Float32(Float32(1.0) / x))); end return tmp end
function tmp_2 = code(x, s) tmp = single(0.0); if ((-x / s) <= single(0.20000000298023224)) tmp = single(0.5); else tmp = single(2.0) * (((s * s) / x) * (single(1.0) / x)); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{-x}{s} \leq 0.20000000298023224:\\
\;\;\;\;0.5\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\frac{s \cdot s}{x} \cdot \frac{1}{x}\right)\\
\end{array}
\end{array}
if (/.f32 (neg.f32 x) s) < 0.200000003Initial program 99.8%
Taylor expanded in x around 0 51.5%
if 0.200000003 < (/.f32 (neg.f32 x) s) Initial program 99.9%
Taylor expanded in x around 0 76.9%
mul-1-neg76.9%
unsub-neg76.9%
unpow276.9%
unpow276.9%
times-frac70.6%
Simplified70.6%
Taylor expanded in x around inf 76.6%
unpow276.6%
unpow276.6%
Simplified76.6%
associate-/r*79.8%
div-inv79.8%
Applied egg-rr79.8%
Final simplification61.8%
(FPCore (x s) :precision binary32 (if (<= (/ (- x) s) 0.20000000298023224) 0.5 (* 2.0 (/ 1.0 (* x (/ x (* s s)))))))
float code(float x, float s) {
float tmp;
if ((-x / s) <= 0.20000000298023224f) {
tmp = 0.5f;
} else {
tmp = 2.0f * (1.0f / (x * (x / (s * s))));
}
return tmp;
}
real(4) function code(x, s)
real(4), intent (in) :: x
real(4), intent (in) :: s
real(4) :: tmp
if ((-x / s) <= 0.20000000298023224e0) then
tmp = 0.5e0
else
tmp = 2.0e0 * (1.0e0 / (x * (x / (s * s))))
end if
code = tmp
end function
function code(x, s) tmp = Float32(0.0) if (Float32(Float32(-x) / s) <= Float32(0.20000000298023224)) tmp = Float32(0.5); else tmp = Float32(Float32(2.0) * Float32(Float32(1.0) / Float32(x * Float32(x / Float32(s * s))))); end return tmp end
function tmp_2 = code(x, s) tmp = single(0.0); if ((-x / s) <= single(0.20000000298023224)) tmp = single(0.5); else tmp = single(2.0) * (single(1.0) / (x * (x / (s * s)))); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{-x}{s} \leq 0.20000000298023224:\\
\;\;\;\;0.5\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{1}{x \cdot \frac{x}{s \cdot s}}\\
\end{array}
\end{array}
if (/.f32 (neg.f32 x) s) < 0.200000003Initial program 99.8%
Taylor expanded in x around 0 51.5%
if 0.200000003 < (/.f32 (neg.f32 x) s) Initial program 99.9%
Taylor expanded in x around 0 76.9%
mul-1-neg76.9%
unsub-neg76.9%
unpow276.9%
unpow276.9%
times-frac70.6%
Simplified70.6%
Taylor expanded in x around inf 76.6%
unpow276.6%
unpow276.6%
Simplified76.6%
associate-/r*79.8%
div-inv79.8%
Applied egg-rr79.8%
clear-num79.8%
frac-times80.1%
metadata-eval80.1%
Applied egg-rr80.1%
Final simplification61.9%
(FPCore (x s) :precision binary32 (if (<= (/ (- x) s) 0.20000000298023224) 0.5 (* 2.0 (* (/ s x) (/ s x)))))
float code(float x, float s) {
float tmp;
if ((-x / s) <= 0.20000000298023224f) {
tmp = 0.5f;
} else {
tmp = 2.0f * ((s / x) * (s / x));
}
return tmp;
}
real(4) function code(x, s)
real(4), intent (in) :: x
real(4), intent (in) :: s
real(4) :: tmp
if ((-x / s) <= 0.20000000298023224e0) then
tmp = 0.5e0
else
tmp = 2.0e0 * ((s / x) * (s / x))
end if
code = tmp
end function
function code(x, s) tmp = Float32(0.0) if (Float32(Float32(-x) / s) <= Float32(0.20000000298023224)) tmp = Float32(0.5); else tmp = Float32(Float32(2.0) * Float32(Float32(s / x) * Float32(s / x))); end return tmp end
function tmp_2 = code(x, s) tmp = single(0.0); if ((-x / s) <= single(0.20000000298023224)) tmp = single(0.5); else tmp = single(2.0) * ((s / x) * (s / x)); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{-x}{s} \leq 0.20000000298023224:\\
\;\;\;\;0.5\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\frac{s}{x} \cdot \frac{s}{x}\right)\\
\end{array}
\end{array}
if (/.f32 (neg.f32 x) s) < 0.200000003Initial program 99.8%
Taylor expanded in x around 0 51.5%
if 0.200000003 < (/.f32 (neg.f32 x) s) Initial program 99.9%
Taylor expanded in x around 0 76.9%
mul-1-neg76.9%
unsub-neg76.9%
unpow276.9%
unpow276.9%
times-frac70.6%
Simplified70.6%
Taylor expanded in x around inf 76.6%
unpow276.6%
unpow276.6%
Simplified76.6%
times-frac70.3%
Applied egg-rr70.3%
Final simplification58.3%
(FPCore (x s) :precision binary32 (if (<= (/ (- x) s) 20000.0) 0.5 (* 2.0 (/ (* s s) (* x x)))))
float code(float x, float s) {
float tmp;
if ((-x / s) <= 20000.0f) {
tmp = 0.5f;
} else {
tmp = 2.0f * ((s * s) / (x * x));
}
return tmp;
}
real(4) function code(x, s)
real(4), intent (in) :: x
real(4), intent (in) :: s
real(4) :: tmp
if ((-x / s) <= 20000.0e0) then
tmp = 0.5e0
else
tmp = 2.0e0 * ((s * s) / (x * x))
end if
code = tmp
end function
function code(x, s) tmp = Float32(0.0) if (Float32(Float32(-x) / s) <= Float32(20000.0)) tmp = Float32(0.5); else tmp = Float32(Float32(2.0) * Float32(Float32(s * s) / Float32(x * x))); end return tmp end
function tmp_2 = code(x, s) tmp = single(0.0); if ((-x / s) <= single(20000.0)) tmp = single(0.5); else tmp = single(2.0) * ((s * s) / (x * x)); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{-x}{s} \leq 20000:\\
\;\;\;\;0.5\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{s \cdot s}{x \cdot x}\\
\end{array}
\end{array}
if (/.f32 (neg.f32 x) s) < 2e4Initial program 99.8%
Taylor expanded in x around 0 50.3%
if 2e4 < (/.f32 (neg.f32 x) s) Initial program 100.0%
Taylor expanded in x around 0 80.8%
mul-1-neg80.8%
unsub-neg80.8%
unpow280.8%
unpow280.8%
times-frac73.9%
Simplified73.9%
Taylor expanded in x around inf 80.6%
unpow280.6%
unpow280.6%
Simplified80.6%
Final simplification60.7%
(FPCore (x s) :precision binary32 (if (<= (/ (- x) s) 0.20000000298023224) 0.5 (/ (/ 2.0 x) (/ x (* s s)))))
float code(float x, float s) {
float tmp;
if ((-x / s) <= 0.20000000298023224f) {
tmp = 0.5f;
} else {
tmp = (2.0f / x) / (x / (s * s));
}
return tmp;
}
real(4) function code(x, s)
real(4), intent (in) :: x
real(4), intent (in) :: s
real(4) :: tmp
if ((-x / s) <= 0.20000000298023224e0) then
tmp = 0.5e0
else
tmp = (2.0e0 / x) / (x / (s * s))
end if
code = tmp
end function
function code(x, s) tmp = Float32(0.0) if (Float32(Float32(-x) / s) <= Float32(0.20000000298023224)) tmp = Float32(0.5); else tmp = Float32(Float32(Float32(2.0) / x) / Float32(x / Float32(s * s))); end return tmp end
function tmp_2 = code(x, s) tmp = single(0.0); if ((-x / s) <= single(0.20000000298023224)) tmp = single(0.5); else tmp = (single(2.0) / x) / (x / (s * s)); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{-x}{s} \leq 0.20000000298023224:\\
\;\;\;\;0.5\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{2}{x}}{\frac{x}{s \cdot s}}\\
\end{array}
\end{array}
if (/.f32 (neg.f32 x) s) < 0.200000003Initial program 99.8%
Taylor expanded in x around 0 51.5%
if 0.200000003 < (/.f32 (neg.f32 x) s) Initial program 99.9%
Taylor expanded in x around 0 76.9%
mul-1-neg76.9%
unsub-neg76.9%
unpow276.9%
unpow276.9%
times-frac70.6%
Simplified70.6%
Taylor expanded in x around inf 76.6%
unpow276.6%
unpow276.6%
Simplified76.6%
associate-/r*79.8%
div-inv79.8%
Applied egg-rr79.8%
*-commutative79.8%
associate-*r*79.8%
clear-num79.8%
un-div-inv79.8%
un-div-inv79.8%
Applied egg-rr79.8%
Final simplification61.8%
(FPCore (x s) :precision binary32 (if (<= (/ (- x) s) -1.0) 0.5 (/ 1.0 (- 2.0 (/ x s)))))
float code(float x, float s) {
float tmp;
if ((-x / s) <= -1.0f) {
tmp = 0.5f;
} else {
tmp = 1.0f / (2.0f - (x / s));
}
return tmp;
}
real(4) function code(x, s)
real(4), intent (in) :: x
real(4), intent (in) :: s
real(4) :: tmp
if ((-x / s) <= (-1.0e0)) then
tmp = 0.5e0
else
tmp = 1.0e0 / (2.0e0 - (x / s))
end if
code = tmp
end function
function code(x, s) tmp = Float32(0.0) if (Float32(Float32(-x) / s) <= Float32(-1.0)) tmp = Float32(0.5); else tmp = Float32(Float32(1.0) / Float32(Float32(2.0) - Float32(x / s))); end return tmp end
function tmp_2 = code(x, s) tmp = single(0.0); if ((-x / s) <= single(-1.0)) tmp = single(0.5); else tmp = single(1.0) / (single(2.0) - (x / s)); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{-x}{s} \leq -1:\\
\;\;\;\;0.5\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{2 - \frac{x}{s}}\\
\end{array}
\end{array}
if (/.f32 (neg.f32 x) s) < -1Initial program 99.9%
Taylor expanded in x around 0 28.2%
if -1 < (/.f32 (neg.f32 x) s) Initial program 99.8%
Taylor expanded in x around 0 63.4%
mul-1-neg63.4%
unsub-neg63.4%
Simplified63.4%
Final simplification50.1%
(FPCore (x s) :precision binary32 (let* ((t_0 (/ (- x) s))) (if (<= t_0 0.20000000298023224) 0.5 (/ 1.0 t_0))))
float code(float x, float s) {
float t_0 = -x / s;
float tmp;
if (t_0 <= 0.20000000298023224f) {
tmp = 0.5f;
} else {
tmp = 1.0f / t_0;
}
return tmp;
}
real(4) function code(x, s)
real(4), intent (in) :: x
real(4), intent (in) :: s
real(4) :: t_0
real(4) :: tmp
t_0 = -x / s
if (t_0 <= 0.20000000298023224e0) then
tmp = 0.5e0
else
tmp = 1.0e0 / t_0
end if
code = tmp
end function
function code(x, s) t_0 = Float32(Float32(-x) / s) tmp = Float32(0.0) if (t_0 <= Float32(0.20000000298023224)) tmp = Float32(0.5); else tmp = Float32(Float32(1.0) / t_0); end return tmp end
function tmp_2 = code(x, s) t_0 = -x / s; tmp = single(0.0); if (t_0 <= single(0.20000000298023224)) tmp = single(0.5); else tmp = single(1.0) / t_0; end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-x}{s}\\
\mathbf{if}\;t_0 \leq 0.20000000298023224:\\
\;\;\;\;0.5\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t_0}\\
\end{array}
\end{array}
if (/.f32 (neg.f32 x) s) < 0.200000003Initial program 99.8%
Taylor expanded in x around 0 51.5%
if 0.200000003 < (/.f32 (neg.f32 x) s) Initial program 99.9%
Taylor expanded in x around 0 42.1%
mul-1-neg42.1%
unsub-neg42.1%
Simplified42.1%
Taylor expanded in x around inf 42.1%
neg-mul-142.1%
distribute-neg-frac42.1%
Simplified42.1%
Final simplification48.1%
(FPCore (x s) :precision binary32 (if (<= x -1.0000000116860974e-7) (/ s x) 0.5))
float code(float x, float s) {
float tmp;
if (x <= -1.0000000116860974e-7f) {
tmp = s / x;
} else {
tmp = 0.5f;
}
return tmp;
}
real(4) function code(x, s)
real(4), intent (in) :: x
real(4), intent (in) :: s
real(4) :: tmp
if (x <= (-1.0000000116860974e-7)) then
tmp = s / x
else
tmp = 0.5e0
end if
code = tmp
end function
function code(x, s) tmp = Float32(0.0) if (x <= Float32(-1.0000000116860974e-7)) tmp = Float32(s / x); else tmp = Float32(0.5); end return tmp end
function tmp_2 = code(x, s) tmp = single(0.0); if (x <= single(-1.0000000116860974e-7)) tmp = s / x; else tmp = single(0.5); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.0000000116860974 \cdot 10^{-7}:\\
\;\;\;\;\frac{s}{x}\\
\mathbf{else}:\\
\;\;\;\;0.5\\
\end{array}
\end{array}
if x < -1.00000001e-7Initial program 100.0%
Taylor expanded in x around 0 49.1%
mul-1-neg49.1%
unsub-neg49.1%
Simplified49.1%
Taylor expanded in x around inf 46.8%
associate-*r/46.8%
neg-mul-146.8%
Simplified46.8%
expm1-log1p-u46.8%
expm1-udef96.4%
frac-2neg96.4%
remove-double-neg96.4%
add-sqr-sqrt96.4%
sqrt-unprod96.4%
sqr-neg96.4%
sqrt-prod-0.0%
add-sqr-sqrt96.4%
Applied egg-rr96.4%
expm1-def46.8%
expm1-log1p46.8%
Simplified46.8%
if -1.00000001e-7 < x Initial program 99.8%
Taylor expanded in x around 0 47.6%
Final simplification47.4%
(FPCore (x s) :precision binary32 0.5)
float code(float x, float s) {
return 0.5f;
}
real(4) function code(x, s)
real(4), intent (in) :: x
real(4), intent (in) :: s
code = 0.5e0
end function
function code(x, s) return Float32(0.5) end
function tmp = code(x, s) tmp = single(0.5); end
\begin{array}{l}
\\
0.5
\end{array}
Initial program 99.9%
Taylor expanded in x around 0 35.2%
Final simplification35.2%
herbie shell --seed 2023255
(FPCore (x s)
:name "Logistic function"
:precision binary32
:pre (and (<= 0.0 s) (<= s 1.0651631))
(/ 1.0 (+ 1.0 (exp (/ (- x) s)))))