
(FPCore (x s) :precision binary32 (let* ((t_0 (exp (/ (- (fabs x)) s))) (t_1 (+ 1.0 t_0))) (/ t_0 (* (* s t_1) t_1))))
float code(float x, float s) {
float t_0 = expf((-fabsf(x) / s));
float t_1 = 1.0f + t_0;
return t_0 / ((s * t_1) * t_1);
}
real(4) function code(x, s)
real(4), intent (in) :: x
real(4), intent (in) :: s
real(4) :: t_0
real(4) :: t_1
t_0 = exp((-abs(x) / s))
t_1 = 1.0e0 + t_0
code = t_0 / ((s * t_1) * t_1)
end function
function code(x, s) t_0 = exp(Float32(Float32(-abs(x)) / s)) t_1 = Float32(Float32(1.0) + t_0) return Float32(t_0 / Float32(Float32(s * t_1) * t_1)) end
function tmp = code(x, s) t_0 = exp((-abs(x) / s)); t_1 = single(1.0) + t_0; tmp = t_0 / ((s * t_1) * t_1); end
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\frac{-\left|x\right|}{s}}\\
t_1 := 1 + t\_0\\
\frac{t\_0}{\left(s \cdot t\_1\right) \cdot t\_1}
\end{array}
\end{array}
Sampling outcomes in binary32 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x s) :precision binary32 (let* ((t_0 (exp (/ (- (fabs x)) s))) (t_1 (+ 1.0 t_0))) (/ t_0 (* (* s t_1) t_1))))
float code(float x, float s) {
float t_0 = expf((-fabsf(x) / s));
float t_1 = 1.0f + t_0;
return t_0 / ((s * t_1) * t_1);
}
real(4) function code(x, s)
real(4), intent (in) :: x
real(4), intent (in) :: s
real(4) :: t_0
real(4) :: t_1
t_0 = exp((-abs(x) / s))
t_1 = 1.0e0 + t_0
code = t_0 / ((s * t_1) * t_1)
end function
function code(x, s) t_0 = exp(Float32(Float32(-abs(x)) / s)) t_1 = Float32(Float32(1.0) + t_0) return Float32(t_0 / Float32(Float32(s * t_1) * t_1)) end
function tmp = code(x, s) t_0 = exp((-abs(x) / s)); t_1 = single(1.0) + t_0; tmp = t_0 / ((s * t_1) * t_1); end
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\frac{-\left|x\right|}{s}}\\
t_1 := 1 + t\_0\\
\frac{t\_0}{\left(s \cdot t\_1\right) \cdot t\_1}
\end{array}
\end{array}
(FPCore (x s) :precision binary32 (let* ((t_0 (exp (/ (fabs x) (- s)))) (t_1 (+ t_0 1.0))) (/ t_0 (* s (* t_1 t_1)))))
float code(float x, float s) {
float t_0 = expf((fabsf(x) / -s));
float t_1 = t_0 + 1.0f;
return t_0 / (s * (t_1 * t_1));
}
real(4) function code(x, s)
real(4), intent (in) :: x
real(4), intent (in) :: s
real(4) :: t_0
real(4) :: t_1
t_0 = exp((abs(x) / -s))
t_1 = t_0 + 1.0e0
code = t_0 / (s * (t_1 * t_1))
end function
function code(x, s) t_0 = exp(Float32(abs(x) / Float32(-s))) t_1 = Float32(t_0 + Float32(1.0)) return Float32(t_0 / Float32(s * Float32(t_1 * t_1))) end
function tmp = code(x, s) t_0 = exp((abs(x) / -s)); t_1 = t_0 + single(1.0); tmp = t_0 / (s * (t_1 * t_1)); end
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\frac{\left|x\right|}{-s}}\\
t_1 := t\_0 + 1\\
\frac{t\_0}{s \cdot \left(t\_1 \cdot t\_1\right)}
\end{array}
\end{array}
Initial program 99.8%
fabs-neg99.8%
distribute-frac-neg99.8%
distribute-frac-neg299.8%
fabs-neg99.8%
*-commutative99.8%
fabs-neg99.8%
+-commutative99.8%
fabs-neg99.8%
Simplified99.9%
Final simplification99.9%
(FPCore (x s) :precision binary32 (let* ((t_0 (exp (/ x s)))) (/ (exp (fma x (/ 1.0 s) (- (log1p t_0)))) (+ s (* s t_0)))))
float code(float x, float s) {
float t_0 = expf((x / s));
return expf(fmaf(x, (1.0f / s), -log1pf(t_0))) / (s + (s * t_0));
}
function code(x, s) t_0 = exp(Float32(x / s)) return Float32(exp(fma(x, Float32(Float32(1.0) / s), Float32(-log1p(t_0)))) / Float32(s + Float32(s * t_0))) end
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\frac{x}{s}}\\
\frac{e^{\mathsf{fma}\left(x, \frac{1}{s}, -\mathsf{log1p}\left(t\_0\right)\right)}}{s + s \cdot t\_0}
\end{array}
\end{array}
Initial program 99.8%
fabs-neg99.8%
distribute-frac-neg99.8%
distribute-frac-neg299.8%
fabs-neg99.8%
*-commutative99.8%
fabs-neg99.8%
+-commutative99.8%
fabs-neg99.8%
Simplified99.9%
Applied egg-rr88.2%
associate-*r/88.1%
*-rgt-identity88.1%
Simplified88.1%
div-inv88.1%
fma-neg99.8%
Applied egg-rr99.8%
fma-undefine99.9%
Applied egg-rr99.9%
Final simplification99.9%
(FPCore (x s) :precision binary32 (/ (/ 0.5 s) (+ 1.0 (exp (/ x s)))))
float code(float x, float s) {
return (0.5f / s) / (1.0f + expf((x / s)));
}
real(4) function code(x, s)
real(4), intent (in) :: x
real(4), intent (in) :: s
code = (0.5e0 / s) / (1.0e0 + exp((x / s)))
end function
function code(x, s) return Float32(Float32(Float32(0.5) / s) / Float32(Float32(1.0) + exp(Float32(x / s)))) end
function tmp = code(x, s) tmp = (single(0.5) / s) / (single(1.0) + exp((x / s))); end
\begin{array}{l}
\\
\frac{\frac{0.5}{s}}{1 + e^{\frac{x}{s}}}
\end{array}
Initial program 99.8%
fabs-neg99.8%
distribute-frac-neg99.8%
distribute-frac-neg299.8%
fabs-neg99.8%
*-commutative99.8%
fabs-neg99.8%
+-commutative99.8%
fabs-neg99.8%
Simplified99.9%
Applied egg-rr88.2%
associate-*r/88.1%
*-rgt-identity88.1%
Simplified88.1%
Taylor expanded in x around 0 63.2%
neg-mul-163.2%
*-commutative63.2%
exp-to-pow63.2%
metadata-eval63.2%
Simplified63.2%
Taylor expanded in s around 0 63.2%
associate-/r*63.2%
Simplified63.2%
Final simplification63.2%
(FPCore (x s) :precision binary32 (if (<= x 60000000.0) (/ (+ (+ 0.25 (/ (* 0.25 (* x 0.5)) s)) (/ (* 0.25 (* x -0.5)) s)) s) (/ 1.0 (* s (+ 4.0 (/ 1.0 (* (/ s x) (/ s x))))))))
float code(float x, float s) {
float tmp;
if (x <= 60000000.0f) {
tmp = ((0.25f + ((0.25f * (x * 0.5f)) / s)) + ((0.25f * (x * -0.5f)) / s)) / s;
} else {
tmp = 1.0f / (s * (4.0f + (1.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 <= 60000000.0e0) then
tmp = ((0.25e0 + ((0.25e0 * (x * 0.5e0)) / s)) + ((0.25e0 * (x * (-0.5e0))) / s)) / s
else
tmp = 1.0e0 / (s * (4.0e0 + (1.0e0 / ((s / x) * (s / x)))))
end if
code = tmp
end function
function code(x, s) tmp = Float32(0.0) if (x <= Float32(60000000.0)) tmp = Float32(Float32(Float32(Float32(0.25) + Float32(Float32(Float32(0.25) * Float32(x * Float32(0.5))) / s)) + Float32(Float32(Float32(0.25) * Float32(x * Float32(-0.5))) / s)) / s); else tmp = Float32(Float32(1.0) / Float32(s * Float32(Float32(4.0) + Float32(Float32(1.0) / Float32(Float32(s / x) * Float32(s / x)))))); end return tmp end
function tmp_2 = code(x, s) tmp = single(0.0); if (x <= single(60000000.0)) tmp = ((single(0.25) + ((single(0.25) * (x * single(0.5))) / s)) + ((single(0.25) * (x * single(-0.5))) / s)) / s; else tmp = single(1.0) / (s * (single(4.0) + (single(1.0) / ((s / x) * (s / x))))); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 60000000:\\
\;\;\;\;\frac{\left(0.25 + \frac{0.25 \cdot \left(x \cdot 0.5\right)}{s}\right) + \frac{0.25 \cdot \left(x \cdot -0.5\right)}{s}}{s}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{s \cdot \left(4 + \frac{1}{\frac{s}{x} \cdot \frac{s}{x}}\right)}\\
\end{array}
\end{array}
if x < 6e7Initial program 99.8%
fabs-neg99.8%
distribute-frac-neg99.8%
distribute-frac-neg299.8%
fabs-neg99.8%
*-commutative99.8%
fabs-neg99.8%
+-commutative99.8%
fabs-neg99.8%
Simplified99.9%
Applied egg-rr99.3%
associate-*r/99.3%
*-rgt-identity99.3%
Simplified99.3%
div-inv99.3%
fma-neg99.8%
Applied egg-rr99.8%
fma-undefine99.8%
Applied egg-rr99.8%
Taylor expanded in s around inf 74.6%
Simplified74.6%
if 6e7 < x Initial program 100.0%
fabs-neg100.0%
distribute-frac-neg100.0%
distribute-frac-neg2100.0%
fabs-neg100.0%
*-commutative100.0%
fabs-neg100.0%
+-commutative100.0%
fabs-neg100.0%
Simplified100.0%
clear-num100.0%
inv-pow100.0%
Applied egg-rr-0.0%
unpow-1-0.0%
Simplified-0.0%
Taylor expanded in x around 0 98.4%
unpow298.4%
unpow298.4%
times-frac98.4%
unpow298.4%
Simplified98.4%
unpow298.4%
clear-num98.4%
clear-num98.4%
frac-times98.4%
metadata-eval98.4%
Applied egg-rr98.4%
Final simplification79.7%
(FPCore (x s) :precision binary32 (/ 1.0 (* s (+ 4.0 (* x (* (/ 1.0 s) (/ x s)))))))
float code(float x, float s) {
return 1.0f / (s * (4.0f + (x * ((1.0f / s) * (x / s)))));
}
real(4) function code(x, s)
real(4), intent (in) :: x
real(4), intent (in) :: s
code = 1.0e0 / (s * (4.0e0 + (x * ((1.0e0 / s) * (x / s)))))
end function
function code(x, s) return Float32(Float32(1.0) / Float32(s * Float32(Float32(4.0) + Float32(x * Float32(Float32(Float32(1.0) / s) * Float32(x / s)))))) end
function tmp = code(x, s) tmp = single(1.0) / (s * (single(4.0) + (x * ((single(1.0) / s) * (x / s))))); end
\begin{array}{l}
\\
\frac{1}{s \cdot \left(4 + x \cdot \left(\frac{1}{s} \cdot \frac{x}{s}\right)\right)}
\end{array}
Initial program 99.8%
fabs-neg99.8%
distribute-frac-neg99.8%
distribute-frac-neg299.8%
fabs-neg99.8%
*-commutative99.8%
fabs-neg99.8%
+-commutative99.8%
fabs-neg99.8%
Simplified99.9%
clear-num99.9%
inv-pow99.9%
Applied egg-rr60.0%
unpow-160.0%
Simplified60.0%
Taylor expanded in x around 0 77.6%
unpow277.6%
unpow277.6%
times-frac75.2%
unpow275.2%
Simplified75.2%
unpow275.2%
div-inv75.2%
associate-*l*81.9%
Applied egg-rr81.9%
Final simplification81.9%
(FPCore (x s) :precision binary32 (/ 0.5 (+ (* s 2.0) (* x (* x (/ 0.5 s))))))
float code(float x, float s) {
return 0.5f / ((s * 2.0f) + (x * (x * (0.5f / s))));
}
real(4) function code(x, s)
real(4), intent (in) :: x
real(4), intent (in) :: s
code = 0.5e0 / ((s * 2.0e0) + (x * (x * (0.5e0 / s))))
end function
function code(x, s) return Float32(Float32(0.5) / Float32(Float32(s * Float32(2.0)) + Float32(x * Float32(x * Float32(Float32(0.5) / s))))) end
function tmp = code(x, s) tmp = single(0.5) / ((s * single(2.0)) + (x * (x * (single(0.5) / s)))); end
\begin{array}{l}
\\
\frac{0.5}{s \cdot 2 + x \cdot \left(x \cdot \frac{0.5}{s}\right)}
\end{array}
Initial program 99.8%
fabs-neg99.8%
distribute-frac-neg99.8%
distribute-frac-neg299.8%
fabs-neg99.8%
*-commutative99.8%
fabs-neg99.8%
+-commutative99.8%
fabs-neg99.8%
Simplified99.9%
Applied egg-rr88.2%
associate-*r/88.1%
*-rgt-identity88.1%
Simplified88.1%
Taylor expanded in x around 0 63.2%
neg-mul-163.2%
*-commutative63.2%
exp-to-pow63.2%
metadata-eval63.2%
Simplified63.2%
Taylor expanded in x around 0 61.3%
Taylor expanded in x around inf 63.3%
associate-*r/63.3%
metadata-eval63.3%
rem-exp-log63.3%
exp-neg63.3%
*-commutative63.3%
associate-/l*63.3%
exp-neg63.3%
rem-exp-log63.3%
metadata-eval63.3%
Simplified63.3%
Final simplification63.3%
(FPCore (x s) :precision binary32 (/ 0.5 (+ (* s 2.0) (* x (/ (* x 0.5) s)))))
float code(float x, float s) {
return 0.5f / ((s * 2.0f) + (x * ((x * 0.5f) / s)));
}
real(4) function code(x, s)
real(4), intent (in) :: x
real(4), intent (in) :: s
code = 0.5e0 / ((s * 2.0e0) + (x * ((x * 0.5e0) / s)))
end function
function code(x, s) return Float32(Float32(0.5) / Float32(Float32(s * Float32(2.0)) + Float32(x * Float32(Float32(x * Float32(0.5)) / s)))) end
function tmp = code(x, s) tmp = single(0.5) / ((s * single(2.0)) + (x * ((x * single(0.5)) / s))); end
\begin{array}{l}
\\
\frac{0.5}{s \cdot 2 + x \cdot \frac{x \cdot 0.5}{s}}
\end{array}
Initial program 99.8%
fabs-neg99.8%
distribute-frac-neg99.8%
distribute-frac-neg299.8%
fabs-neg99.8%
*-commutative99.8%
fabs-neg99.8%
+-commutative99.8%
fabs-neg99.8%
Simplified99.9%
Applied egg-rr88.2%
associate-*r/88.1%
*-rgt-identity88.1%
Simplified88.1%
Taylor expanded in x around 0 63.2%
neg-mul-163.2%
*-commutative63.2%
exp-to-pow63.2%
metadata-eval63.2%
Simplified63.2%
Taylor expanded in x around 0 61.3%
Taylor expanded in x around inf 63.3%
associate-*r/63.3%
Simplified63.3%
Final simplification63.3%
(FPCore (x s) :precision binary32 (/ 1.0 (* s (+ 4.0 (* (/ x s) (/ x s))))))
float code(float x, float s) {
return 1.0f / (s * (4.0f + ((x / s) * (x / s))));
}
real(4) function code(x, s)
real(4), intent (in) :: x
real(4), intent (in) :: s
code = 1.0e0 / (s * (4.0e0 + ((x / s) * (x / s))))
end function
function code(x, s) return Float32(Float32(1.0) / Float32(s * Float32(Float32(4.0) + Float32(Float32(x / s) * Float32(x / s))))) end
function tmp = code(x, s) tmp = single(1.0) / (s * (single(4.0) + ((x / s) * (x / s)))); end
\begin{array}{l}
\\
\frac{1}{s \cdot \left(4 + \frac{x}{s} \cdot \frac{x}{s}\right)}
\end{array}
Initial program 99.8%
fabs-neg99.8%
distribute-frac-neg99.8%
distribute-frac-neg299.8%
fabs-neg99.8%
*-commutative99.8%
fabs-neg99.8%
+-commutative99.8%
fabs-neg99.8%
Simplified99.9%
clear-num99.9%
inv-pow99.9%
Applied egg-rr60.0%
unpow-160.0%
Simplified60.0%
Taylor expanded in x around 0 77.6%
unpow277.6%
unpow277.6%
times-frac75.2%
unpow275.2%
Simplified75.2%
unpow275.2%
Applied egg-rr75.2%
Final simplification75.2%
(FPCore (x s) :precision binary32 (/ 1.0 (* s (+ 4.0 (/ x (* s (/ s x)))))))
float code(float x, float s) {
return 1.0f / (s * (4.0f + (x / (s * (s / x)))));
}
real(4) function code(x, s)
real(4), intent (in) :: x
real(4), intent (in) :: s
code = 1.0e0 / (s * (4.0e0 + (x / (s * (s / x)))))
end function
function code(x, s) return Float32(Float32(1.0) / Float32(s * Float32(Float32(4.0) + Float32(x / Float32(s * Float32(s / x)))))) end
function tmp = code(x, s) tmp = single(1.0) / (s * (single(4.0) + (x / (s * (s / x))))); end
\begin{array}{l}
\\
\frac{1}{s \cdot \left(4 + \frac{x}{s \cdot \frac{s}{x}}\right)}
\end{array}
Initial program 99.8%
fabs-neg99.8%
distribute-frac-neg99.8%
distribute-frac-neg299.8%
fabs-neg99.8%
*-commutative99.8%
fabs-neg99.8%
+-commutative99.8%
fabs-neg99.8%
Simplified99.9%
clear-num99.9%
inv-pow99.9%
Applied egg-rr60.0%
unpow-160.0%
Simplified60.0%
Taylor expanded in x around 0 77.6%
unpow277.6%
unpow277.6%
times-frac75.2%
unpow275.2%
Simplified75.2%
unpow275.2%
clear-num75.2%
frac-times77.8%
*-un-lft-identity77.8%
Applied egg-rr77.8%
Final simplification77.8%
(FPCore (x s) :precision binary32 (/ 0.5 (* s (+ (/ x s) 2.0))))
float code(float x, float s) {
return 0.5f / (s * ((x / s) + 2.0f));
}
real(4) function code(x, s)
real(4), intent (in) :: x
real(4), intent (in) :: s
code = 0.5e0 / (s * ((x / s) + 2.0e0))
end function
function code(x, s) return Float32(Float32(0.5) / Float32(s * Float32(Float32(x / s) + Float32(2.0)))) end
function tmp = code(x, s) tmp = single(0.5) / (s * ((x / s) + single(2.0))); end
\begin{array}{l}
\\
\frac{0.5}{s \cdot \left(\frac{x}{s} + 2\right)}
\end{array}
Initial program 99.8%
fabs-neg99.8%
distribute-frac-neg99.8%
distribute-frac-neg299.8%
fabs-neg99.8%
*-commutative99.8%
fabs-neg99.8%
+-commutative99.8%
fabs-neg99.8%
Simplified99.9%
Applied egg-rr88.2%
associate-*r/88.1%
*-rgt-identity88.1%
Simplified88.1%
Taylor expanded in x around 0 63.2%
neg-mul-163.2%
*-commutative63.2%
exp-to-pow63.2%
metadata-eval63.2%
Simplified63.2%
Taylor expanded in s around inf 47.4%
Final simplification47.4%
(FPCore (x s) :precision binary32 (if (<= x 4.999999987376214e-7) (/ 0.25 s) (/ 0.5 x)))
float code(float x, float s) {
float tmp;
if (x <= 4.999999987376214e-7f) {
tmp = 0.25f / s;
} else {
tmp = 0.5f / x;
}
return tmp;
}
real(4) function code(x, s)
real(4), intent (in) :: x
real(4), intent (in) :: s
real(4) :: tmp
if (x <= 4.999999987376214e-7) then
tmp = 0.25e0 / s
else
tmp = 0.5e0 / x
end if
code = tmp
end function
function code(x, s) tmp = Float32(0.0) if (x <= Float32(4.999999987376214e-7)) tmp = Float32(Float32(0.25) / s); else tmp = Float32(Float32(0.5) / x); end return tmp end
function tmp_2 = code(x, s) tmp = single(0.0); if (x <= single(4.999999987376214e-7)) tmp = single(0.25) / s; else tmp = single(0.5) / x; end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 4.999999987376214 \cdot 10^{-7}:\\
\;\;\;\;\frac{0.25}{s}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.5}{x}\\
\end{array}
\end{array}
if x < 4.99999999e-7Initial program 99.7%
fabs-neg99.7%
distribute-frac-neg99.7%
distribute-frac-neg299.7%
fabs-neg99.7%
*-commutative99.7%
fabs-neg99.7%
+-commutative99.7%
fabs-neg99.7%
Simplified99.9%
Taylor expanded in s around inf 35.6%
if 4.99999999e-7 < x Initial program 100.0%
fabs-neg100.0%
distribute-frac-neg100.0%
distribute-frac-neg2100.0%
fabs-neg100.0%
*-commutative100.0%
fabs-neg100.0%
+-commutative100.0%
fabs-neg100.0%
Simplified100.0%
Applied egg-rr60.5%
associate-*r/60.5%
*-rgt-identity60.5%
Simplified60.5%
Taylor expanded in x around 0 100.0%
neg-mul-1100.0%
*-commutative100.0%
exp-to-pow100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 11.1%
Taylor expanded in x around inf 11.1%
Final simplification28.4%
(FPCore (x s) :precision binary32 (/ 0.5 (+ x (* s 2.0))))
float code(float x, float s) {
return 0.5f / (x + (s * 2.0f));
}
real(4) function code(x, s)
real(4), intent (in) :: x
real(4), intent (in) :: s
code = 0.5e0 / (x + (s * 2.0e0))
end function
function code(x, s) return Float32(Float32(0.5) / Float32(x + Float32(s * Float32(2.0)))) end
function tmp = code(x, s) tmp = single(0.5) / (x + (s * single(2.0))); end
\begin{array}{l}
\\
\frac{0.5}{x + s \cdot 2}
\end{array}
Initial program 99.8%
fabs-neg99.8%
distribute-frac-neg99.8%
distribute-frac-neg299.8%
fabs-neg99.8%
*-commutative99.8%
fabs-neg99.8%
+-commutative99.8%
fabs-neg99.8%
Simplified99.9%
Applied egg-rr88.2%
associate-*r/88.1%
*-rgt-identity88.1%
Simplified88.1%
Taylor expanded in x around 0 63.2%
neg-mul-163.2%
*-commutative63.2%
exp-to-pow63.2%
metadata-eval63.2%
Simplified63.2%
Taylor expanded in x around 0 28.8%
Final simplification28.8%
(FPCore (x s) :precision binary32 (/ 0.25 s))
float code(float x, float s) {
return 0.25f / s;
}
real(4) function code(x, s)
real(4), intent (in) :: x
real(4), intent (in) :: s
code = 0.25e0 / s
end function
function code(x, s) return Float32(Float32(0.25) / s) end
function tmp = code(x, s) tmp = single(0.25) / s; end
\begin{array}{l}
\\
\frac{0.25}{s}
\end{array}
Initial program 99.8%
fabs-neg99.8%
distribute-frac-neg99.8%
distribute-frac-neg299.8%
fabs-neg99.8%
*-commutative99.8%
fabs-neg99.8%
+-commutative99.8%
fabs-neg99.8%
Simplified99.9%
Taylor expanded in s around inf 26.4%
Final simplification26.4%
herbie shell --seed 2024066
(FPCore (x s)
:name "Logistic distribution"
:precision binary32
:pre (and (<= 0.0 s) (<= s 1.0651631))
(/ (exp (/ (- (fabs x)) s)) (* (* s (+ 1.0 (exp (/ (- (fabs x)) s)))) (+ 1.0 (exp (/ (- (fabs x)) s))))))