
(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 9 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}
NOTE: x should be positive before calling this function (FPCore (x s) :precision binary32 (/ (pow (exp -1.0) (/ x s)) (* s (pow (+ (exp (/ (- x) s)) 1.0) 2.0))))
x = abs(x);
float code(float x, float s) {
return powf(expf(-1.0f), (x / s)) / (s * powf((expf((-x / s)) + 1.0f), 2.0f));
}
NOTE: x should be positive before calling this function
real(4) function code(x, s)
real(4), intent (in) :: x
real(4), intent (in) :: s
code = (exp((-1.0e0)) ** (x / s)) / (s * ((exp((-x / s)) + 1.0e0) ** 2.0e0))
end function
x = abs(x) function code(x, s) return Float32((exp(Float32(-1.0)) ^ Float32(x / s)) / Float32(s * (Float32(exp(Float32(Float32(-x) / s)) + Float32(1.0)) ^ Float32(2.0)))) end
x = abs(x) function tmp = code(x, s) tmp = (exp(single(-1.0)) ^ (x / s)) / (s * ((exp((-x / s)) + single(1.0)) ^ single(2.0))); end
\begin{array}{l}
x = |x|\\
\\
\frac{{\left(e^{-1}\right)}^{\left(\frac{x}{s}\right)}}{s \cdot {\left(e^{\frac{-x}{s}} + 1\right)}^{2}}
\end{array}
Initial program 99.1%
/-rgt-identity99.1%
associate-/l/99.1%
*-commutative99.1%
associate-*l*99.1%
associate-*l*99.1%
*-rgt-identity99.1%
+-commutative99.1%
+-commutative99.1%
Simplified99.1%
Taylor expanded in x around 0 99.1%
+-commutative99.1%
associate-*r/99.1%
mul-1-neg99.1%
Simplified99.1%
distribute-frac-neg99.1%
exp-neg99.1%
add-sqr-sqrt99.1%
sqrt-unprod96.4%
sqr-neg96.4%
sqrt-unprod-0.0%
add-sqr-sqrt92.1%
add-sqr-sqrt-0.0%
add-sqr-sqrt92.1%
add-sqr-sqrt-0.0%
sqrt-unprod96.4%
sqr-neg96.4%
sqrt-unprod99.1%
add-sqr-sqrt99.1%
add-sqr-sqrt47.7%
fabs-sqr47.7%
add-sqr-sqrt95.1%
Applied egg-rr95.1%
rec-exp95.2%
Simplified95.2%
distribute-frac-neg99.1%
exp-neg99.1%
add-sqr-sqrt99.1%
sqrt-unprod96.4%
sqr-neg96.4%
sqrt-unprod-0.0%
add-sqr-sqrt92.1%
add-sqr-sqrt-0.0%
add-sqr-sqrt92.1%
add-sqr-sqrt-0.0%
sqrt-unprod96.4%
sqr-neg96.4%
sqrt-unprod99.1%
add-sqr-sqrt99.1%
add-sqr-sqrt47.7%
fabs-sqr47.7%
add-sqr-sqrt95.1%
Applied egg-rr63.9%
rec-exp95.2%
Simplified64.0%
neg-mul-164.0%
metadata-eval64.0%
exp-prod63.9%
metadata-eval63.9%
Applied egg-rr63.9%
Final simplification63.9%
NOTE: x should be positive before calling this function (FPCore (x s) :precision binary32 (if (<= (- (fabs x)) -200.0) (/ (exp (/ (- x) s)) (* s 4.0)) (/ (exp (+ (/ x s) (* (log1p (exp (/ x s))) -2.0))) s)))
x = abs(x);
float code(float x, float s) {
float tmp;
if (-fabsf(x) <= -200.0f) {
tmp = expf((-x / s)) / (s * 4.0f);
} else {
tmp = expf(((x / s) + (log1pf(expf((x / s))) * -2.0f))) / s;
}
return tmp;
}
x = abs(x) function code(x, s) tmp = Float32(0.0) if (Float32(-abs(x)) <= Float32(-200.0)) tmp = Float32(exp(Float32(Float32(-x) / s)) / Float32(s * Float32(4.0))); else tmp = Float32(exp(Float32(Float32(x / s) + Float32(log1p(exp(Float32(x / s))) * Float32(-2.0)))) / s); end return tmp end
\begin{array}{l}
x = |x|\\
\\
\begin{array}{l}
\mathbf{if}\;-\left|x\right| \leq -200:\\
\;\;\;\;\frac{e^{\frac{-x}{s}}}{s \cdot 4}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{\frac{x}{s} + \mathsf{log1p}\left(e^{\frac{x}{s}}\right) \cdot -2}}{s}\\
\end{array}
\end{array}
if (neg.f32 (fabs.f32 x)) < -200Initial program 100.0%
/-rgt-identity100.0%
associate-/l/100.0%
*-commutative100.0%
associate-*l*100.0%
associate-*l*100.0%
*-rgt-identity100.0%
+-commutative100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
+-commutative100.0%
associate-*r/100.0%
mul-1-neg100.0%
Simplified100.0%
distribute-frac-neg100.0%
exp-neg100.0%
add-sqr-sqrt100.0%
sqrt-unprod100.0%
sqr-neg100.0%
sqrt-unprod-0.0%
add-sqr-sqrt100.0%
add-sqr-sqrt-0.0%
add-sqr-sqrt100.0%
add-sqr-sqrt-0.0%
sqrt-unprod100.0%
sqr-neg100.0%
sqrt-unprod100.0%
add-sqr-sqrt100.0%
add-sqr-sqrt48.7%
fabs-sqr48.7%
add-sqr-sqrt100.0%
Applied egg-rr100.0%
rec-exp100.0%
Simplified100.0%
distribute-frac-neg100.0%
exp-neg100.0%
add-sqr-sqrt100.0%
sqrt-unprod100.0%
sqr-neg100.0%
sqrt-unprod-0.0%
add-sqr-sqrt100.0%
add-sqr-sqrt-0.0%
add-sqr-sqrt100.0%
add-sqr-sqrt-0.0%
sqrt-unprod100.0%
sqr-neg100.0%
sqrt-unprod100.0%
add-sqr-sqrt100.0%
add-sqr-sqrt48.7%
fabs-sqr48.7%
add-sqr-sqrt100.0%
Applied egg-rr48.7%
rec-exp100.0%
Simplified48.7%
Taylor expanded in s around inf 50.3%
*-commutative50.3%
Simplified50.3%
if -200 < (neg.f32 (fabs.f32 x)) Initial program 98.3%
/-rgt-identity98.3%
associate-/l/98.3%
*-commutative98.3%
associate-*l*98.3%
associate-*l*98.3%
*-rgt-identity98.3%
+-commutative98.3%
+-commutative98.3%
Simplified98.3%
associate-/r*98.4%
div-inv98.4%
add-sqr-sqrt-0.0%
sqrt-unprod48.0%
sqr-neg48.0%
sqrt-unprod47.6%
add-sqr-sqrt47.6%
add-sqr-sqrt23.7%
fabs-sqr23.7%
add-sqr-sqrt75.1%
pow275.1%
Applied egg-rr80.0%
associate-*l/80.0%
add-exp-log79.9%
prod-exp98.1%
pow-flip98.1%
log-pow98.2%
+-commutative98.2%
log1p-udef98.3%
metadata-eval98.3%
Applied egg-rr98.3%
*-commutative98.3%
Simplified98.3%
Final simplification76.4%
NOTE: x should be positive before calling this function (FPCore (x s) :precision binary32 (let* ((t_0 (exp (/ (- x) s)))) (/ t_0 (* s (pow (+ t_0 1.0) 2.0)))))
x = abs(x);
float code(float x, float s) {
float t_0 = expf((-x / s));
return t_0 / (s * powf((t_0 + 1.0f), 2.0f));
}
NOTE: x should be positive before calling this function
real(4) function code(x, s)
real(4), intent (in) :: x
real(4), intent (in) :: s
real(4) :: t_0
t_0 = exp((-x / s))
code = t_0 / (s * ((t_0 + 1.0e0) ** 2.0e0))
end function
x = abs(x) function code(x, s) t_0 = exp(Float32(Float32(-x) / s)) return Float32(t_0 / Float32(s * (Float32(t_0 + Float32(1.0)) ^ Float32(2.0)))) end
x = abs(x) function tmp = code(x, s) t_0 = exp((-x / s)); tmp = t_0 / (s * ((t_0 + single(1.0)) ^ single(2.0))); end
\begin{array}{l}
x = |x|\\
\\
\begin{array}{l}
t_0 := e^{\frac{-x}{s}}\\
\frac{t_0}{s \cdot {\left(t_0 + 1\right)}^{2}}
\end{array}
\end{array}
Initial program 99.1%
/-rgt-identity99.1%
associate-/l/99.1%
*-commutative99.1%
associate-*l*99.1%
associate-*l*99.1%
*-rgt-identity99.1%
+-commutative99.1%
+-commutative99.1%
Simplified99.1%
Taylor expanded in x around 0 99.1%
+-commutative99.1%
associate-*r/99.1%
mul-1-neg99.1%
Simplified99.1%
distribute-frac-neg99.1%
exp-neg99.1%
add-sqr-sqrt99.1%
sqrt-unprod96.4%
sqr-neg96.4%
sqrt-unprod-0.0%
add-sqr-sqrt92.1%
add-sqr-sqrt-0.0%
add-sqr-sqrt92.1%
add-sqr-sqrt-0.0%
sqrt-unprod96.4%
sqr-neg96.4%
sqrt-unprod99.1%
add-sqr-sqrt99.1%
add-sqr-sqrt47.7%
fabs-sqr47.7%
add-sqr-sqrt95.1%
Applied egg-rr95.1%
rec-exp95.2%
Simplified95.2%
distribute-frac-neg99.1%
exp-neg99.1%
add-sqr-sqrt99.1%
sqrt-unprod96.4%
sqr-neg96.4%
sqrt-unprod-0.0%
add-sqr-sqrt92.1%
add-sqr-sqrt-0.0%
add-sqr-sqrt92.1%
add-sqr-sqrt-0.0%
sqrt-unprod96.4%
sqr-neg96.4%
sqrt-unprod99.1%
add-sqr-sqrt99.1%
add-sqr-sqrt47.7%
fabs-sqr47.7%
add-sqr-sqrt95.1%
Applied egg-rr63.9%
rec-exp95.2%
Simplified64.0%
Final simplification64.0%
NOTE: x should be positive before calling this function (FPCore (x s) :precision binary32 (/ (exp (/ (- x) s)) (* s (pow (+ 1.0 (- 1.0 (/ x s))) 2.0))))
x = abs(x);
float code(float x, float s) {
return expf((-x / s)) / (s * powf((1.0f + (1.0f - (x / s))), 2.0f));
}
NOTE: x should be positive before calling this function
real(4) function code(x, s)
real(4), intent (in) :: x
real(4), intent (in) :: s
code = exp((-x / s)) / (s * ((1.0e0 + (1.0e0 - (x / s))) ** 2.0e0))
end function
x = abs(x) function code(x, s) return Float32(exp(Float32(Float32(-x) / s)) / Float32(s * (Float32(Float32(1.0) + Float32(Float32(1.0) - Float32(x / s))) ^ Float32(2.0)))) end
x = abs(x) function tmp = code(x, s) tmp = exp((-x / s)) / (s * ((single(1.0) + (single(1.0) - (x / s))) ^ single(2.0))); end
\begin{array}{l}
x = |x|\\
\\
\frac{e^{\frac{-x}{s}}}{s \cdot {\left(1 + \left(1 - \frac{x}{s}\right)\right)}^{2}}
\end{array}
Initial program 99.1%
/-rgt-identity99.1%
associate-/l/99.1%
*-commutative99.1%
associate-*l*99.1%
associate-*l*99.1%
*-rgt-identity99.1%
+-commutative99.1%
+-commutative99.1%
Simplified99.1%
Taylor expanded in x around 0 99.1%
+-commutative99.1%
associate-*r/99.1%
mul-1-neg99.1%
Simplified99.1%
distribute-frac-neg99.1%
exp-neg99.1%
add-sqr-sqrt99.1%
sqrt-unprod96.4%
sqr-neg96.4%
sqrt-unprod-0.0%
add-sqr-sqrt92.1%
add-sqr-sqrt-0.0%
add-sqr-sqrt92.1%
add-sqr-sqrt-0.0%
sqrt-unprod96.4%
sqr-neg96.4%
sqrt-unprod99.1%
add-sqr-sqrt99.1%
add-sqr-sqrt47.7%
fabs-sqr47.7%
add-sqr-sqrt95.1%
Applied egg-rr95.1%
rec-exp95.2%
Simplified95.2%
distribute-frac-neg99.1%
exp-neg99.1%
add-sqr-sqrt99.1%
sqrt-unprod96.4%
sqr-neg96.4%
sqrt-unprod-0.0%
add-sqr-sqrt92.1%
add-sqr-sqrt-0.0%
add-sqr-sqrt92.1%
add-sqr-sqrt-0.0%
sqrt-unprod96.4%
sqr-neg96.4%
sqrt-unprod99.1%
add-sqr-sqrt99.1%
add-sqr-sqrt47.7%
fabs-sqr47.7%
add-sqr-sqrt95.1%
Applied egg-rr63.9%
rec-exp95.2%
Simplified64.0%
Taylor expanded in x around 0 60.6%
mul-1-neg60.6%
neg-sub060.6%
metadata-eval60.6%
associate-+r-60.6%
metadata-eval60.6%
metadata-eval60.6%
Simplified60.6%
Final simplification60.6%
NOTE: x should be positive before calling this function (FPCore (x s) :precision binary32 (/ (/ 1.0 (exp (/ x s))) (* s 4.0)))
x = abs(x);
float code(float x, float s) {
return (1.0f / expf((x / s))) / (s * 4.0f);
}
NOTE: x should be positive before calling this function
real(4) function code(x, s)
real(4), intent (in) :: x
real(4), intent (in) :: s
code = (1.0e0 / exp((x / s))) / (s * 4.0e0)
end function
x = abs(x) function code(x, s) return Float32(Float32(Float32(1.0) / exp(Float32(x / s))) / Float32(s * Float32(4.0))) end
x = abs(x) function tmp = code(x, s) tmp = (single(1.0) / exp((x / s))) / (s * single(4.0)); end
\begin{array}{l}
x = |x|\\
\\
\frac{\frac{1}{e^{\frac{x}{s}}}}{s \cdot 4}
\end{array}
Initial program 99.1%
/-rgt-identity99.1%
associate-/l/99.1%
*-commutative99.1%
associate-*l*99.1%
associate-*l*99.1%
*-rgt-identity99.1%
+-commutative99.1%
+-commutative99.1%
Simplified99.1%
Taylor expanded in x around 0 99.1%
+-commutative99.1%
associate-*r/99.1%
mul-1-neg99.1%
Simplified99.1%
distribute-frac-neg99.1%
exp-neg99.1%
add-sqr-sqrt99.1%
sqrt-unprod96.4%
sqr-neg96.4%
sqrt-unprod-0.0%
add-sqr-sqrt92.1%
add-sqr-sqrt-0.0%
add-sqr-sqrt92.1%
add-sqr-sqrt-0.0%
sqrt-unprod96.4%
sqr-neg96.4%
sqrt-unprod99.1%
add-sqr-sqrt99.1%
add-sqr-sqrt47.7%
fabs-sqr47.7%
add-sqr-sqrt95.1%
Applied egg-rr61.5%
Taylor expanded in s around inf 58.8%
Final simplification58.8%
NOTE: x should be positive before calling this function (FPCore (x s) :precision binary32 (/ (exp (/ (- x) s)) (* s 4.0)))
x = abs(x);
float code(float x, float s) {
return expf((-x / s)) / (s * 4.0f);
}
NOTE: x should be positive before calling this function
real(4) function code(x, s)
real(4), intent (in) :: x
real(4), intent (in) :: s
code = exp((-x / s)) / (s * 4.0e0)
end function
x = abs(x) function code(x, s) return Float32(exp(Float32(Float32(-x) / s)) / Float32(s * Float32(4.0))) end
x = abs(x) function tmp = code(x, s) tmp = exp((-x / s)) / (s * single(4.0)); end
\begin{array}{l}
x = |x|\\
\\
\frac{e^{\frac{-x}{s}}}{s \cdot 4}
\end{array}
Initial program 99.1%
/-rgt-identity99.1%
associate-/l/99.1%
*-commutative99.1%
associate-*l*99.1%
associate-*l*99.1%
*-rgt-identity99.1%
+-commutative99.1%
+-commutative99.1%
Simplified99.1%
Taylor expanded in x around 0 99.1%
+-commutative99.1%
associate-*r/99.1%
mul-1-neg99.1%
Simplified99.1%
distribute-frac-neg99.1%
exp-neg99.1%
add-sqr-sqrt99.1%
sqrt-unprod96.4%
sqr-neg96.4%
sqrt-unprod-0.0%
add-sqr-sqrt92.1%
add-sqr-sqrt-0.0%
add-sqr-sqrt92.1%
add-sqr-sqrt-0.0%
sqrt-unprod96.4%
sqr-neg96.4%
sqrt-unprod99.1%
add-sqr-sqrt99.1%
add-sqr-sqrt47.7%
fabs-sqr47.7%
add-sqr-sqrt95.1%
Applied egg-rr95.1%
rec-exp95.2%
Simplified95.2%
distribute-frac-neg99.1%
exp-neg99.1%
add-sqr-sqrt99.1%
sqrt-unprod96.4%
sqr-neg96.4%
sqrt-unprod-0.0%
add-sqr-sqrt92.1%
add-sqr-sqrt-0.0%
add-sqr-sqrt92.1%
add-sqr-sqrt-0.0%
sqrt-unprod96.4%
sqr-neg96.4%
sqrt-unprod99.1%
add-sqr-sqrt99.1%
add-sqr-sqrt47.7%
fabs-sqr47.7%
add-sqr-sqrt95.1%
Applied egg-rr63.9%
rec-exp95.2%
Simplified64.0%
Taylor expanded in s around inf 58.8%
*-commutative58.8%
Simplified58.8%
Final simplification58.8%
NOTE: x should be positive before calling this function (FPCore (x s) :precision binary32 (+ (* -0.0625 (/ (/ x s) (/ s (/ x s)))) (* 0.25 (/ 1.0 s))))
x = abs(x);
float code(float x, float s) {
return (-0.0625f * ((x / s) / (s / (x / s)))) + (0.25f * (1.0f / s));
}
NOTE: x should be positive before calling this function
real(4) function code(x, s)
real(4), intent (in) :: x
real(4), intent (in) :: s
code = ((-0.0625e0) * ((x / s) / (s / (x / s)))) + (0.25e0 * (1.0e0 / s))
end function
x = abs(x) function code(x, s) return Float32(Float32(Float32(-0.0625) * Float32(Float32(x / s) / Float32(s / Float32(x / s)))) + Float32(Float32(0.25) * Float32(Float32(1.0) / s))) end
x = abs(x) function tmp = code(x, s) tmp = (single(-0.0625) * ((x / s) / (s / (x / s)))) + (single(0.25) * (single(1.0) / s)); end
\begin{array}{l}
x = |x|\\
\\
-0.0625 \cdot \frac{\frac{x}{s}}{\frac{s}{\frac{x}{s}}} + 0.25 \cdot \frac{1}{s}
\end{array}
Initial program 99.1%
/-rgt-identity99.1%
associate-/l/99.1%
*-commutative99.1%
associate-*l*99.1%
associate-*l*99.1%
*-rgt-identity99.1%
+-commutative99.1%
+-commutative99.1%
Simplified99.1%
associate-/r*99.1%
div-inv99.1%
add-sqr-sqrt-0.0%
sqrt-unprod27.5%
sqr-neg27.5%
sqrt-unprod27.3%
add-sqr-sqrt27.3%
add-sqr-sqrt13.5%
fabs-sqr13.5%
add-sqr-sqrt64.9%
pow264.9%
Applied egg-rr66.9%
Taylor expanded in x around 0 20.0%
*-un-lft-identity20.0%
cube-mult20.0%
times-frac26.1%
unpow226.1%
frac-times31.4%
pow231.4%
Applied egg-rr31.4%
associate-*l/31.4%
*-un-lft-identity31.4%
unpow231.4%
associate-/l*31.4%
Applied egg-rr31.4%
Final simplification31.4%
NOTE: x should be positive before calling this function (FPCore (x s) :precision binary32 (/ 0.25 s))
x = abs(x);
float code(float x, float s) {
return 0.25f / s;
}
NOTE: x should be positive before calling this function
real(4) function code(x, s)
real(4), intent (in) :: x
real(4), intent (in) :: s
code = 0.25e0 / s
end function
x = abs(x) function code(x, s) return Float32(Float32(0.25) / s) end
x = abs(x) function tmp = code(x, s) tmp = single(0.25) / s; end
\begin{array}{l}
x = |x|\\
\\
\frac{0.25}{s}
\end{array}
Initial program 99.1%
Simplified99.1%
Taylor expanded in s around inf 31.4%
Final simplification31.4%
NOTE: x should be positive before calling this function (FPCore (x s) :precision binary32 1.0)
x = abs(x);
float code(float x, float s) {
return 1.0f;
}
NOTE: x should be positive before calling this function
real(4) function code(x, s)
real(4), intent (in) :: x
real(4), intent (in) :: s
code = 1.0e0
end function
x = abs(x) function code(x, s) return Float32(1.0) end
x = abs(x) function tmp = code(x, s) tmp = single(1.0); end
\begin{array}{l}
x = |x|\\
\\
1
\end{array}
Initial program 99.1%
/-rgt-identity99.1%
associate-/l/99.1%
*-commutative99.1%
associate-*l*99.1%
associate-*l*99.1%
*-rgt-identity99.1%
+-commutative99.1%
+-commutative99.1%
Simplified99.1%
add-exp-log97.0%
log-div96.7%
add-log-exp97.2%
add-sqr-sqrt-0.0%
sqrt-unprod26.4%
sqr-neg26.4%
sqrt-unprod26.2%
add-sqr-sqrt26.2%
add-sqr-sqrt12.9%
fabs-sqr12.9%
add-sqr-sqrt63.1%
log-prod62.9%
Applied egg-rr84.0%
Taylor expanded in x around inf 40.5%
Taylor expanded in x around 0 7.1%
Taylor expanded in x around 0 9.1%
Final simplification9.1%
herbie shell --seed 2023301
(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))))))