
(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 21 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 (exp (- (log1p (exp (- (/ x s)))))))
float code(float x, float s) {
return expf(-log1pf(expf(-(x / s))));
}
function code(x, s) return exp(Float32(-log1p(exp(Float32(-Float32(x / s)))))) end
\begin{array}{l}
\\
e^{-\mathsf{log1p}\left(e^{-\frac{x}{s}}\right)}
\end{array}
Initial program 99.8%
div-inv99.8%
exp-prod83.2%
neg-mul-183.2%
exp-prod83.2%
pow-pow99.8%
div-inv99.8%
Applied egg-rr99.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (x s) :precision binary32 (/ 1.0 (+ 1.0 (/ 1.0 (pow E (/ x s))))))
float code(float x, float s) {
return 1.0f / (1.0f + (1.0f / powf(((float) M_E), (x / s))));
}
function code(x, s) return Float32(Float32(1.0) / Float32(Float32(1.0) + Float32(Float32(1.0) / (Float32(exp(1)) ^ Float32(x / s))))) end
function tmp = code(x, s) tmp = single(1.0) / (single(1.0) + (single(1.0) / (single(2.71828182845904523536) ^ (x / s)))); end
\begin{array}{l}
\\
\frac{1}{1 + \frac{1}{{e}^{\left(\frac{x}{s}\right)}}}
\end{array}
Initial program 99.8%
distribute-frac-neg99.8%
exp-neg99.8%
Applied egg-rr99.8%
*-un-lft-identity99.8%
exp-prod99.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (x s) :precision binary32 (/ 1.0 (+ 1.0 (pow E (- (/ x s))))))
float code(float x, float s) {
return 1.0f / (1.0f + powf(((float) M_E), -(x / s)));
}
function code(x, s) return Float32(Float32(1.0) / Float32(Float32(1.0) + (Float32(exp(1)) ^ Float32(-Float32(x / s))))) end
function tmp = code(x, s) tmp = single(1.0) / (single(1.0) + (single(2.71828182845904523536) ^ -(x / s))); end
\begin{array}{l}
\\
\frac{1}{1 + {e}^{\left(-\frac{x}{s}\right)}}
\end{array}
Initial program 99.8%
distribute-frac-neg99.8%
exp-neg99.8%
Applied egg-rr99.8%
*-un-lft-identity99.8%
exp-prod99.8%
Applied egg-rr99.8%
pow-flip99.8%
exp-1-e99.8%
distribute-neg-frac299.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (x s) :precision binary32 (/ 1.0 (+ 1.0 (/ 1.0 (exp (/ x s))))))
float code(float x, float s) {
return 1.0f / (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 + (1.0e0 / exp((x / s))))
end function
function code(x, s) return Float32(Float32(1.0) / Float32(Float32(1.0) + Float32(Float32(1.0) / exp(Float32(x / s))))) end
function tmp = code(x, s) tmp = single(1.0) / (single(1.0) + (single(1.0) / exp((x / s)))); end
\begin{array}{l}
\\
\frac{1}{1 + \frac{1}{e^{\frac{x}{s}}}}
\end{array}
Initial program 99.8%
distribute-frac-neg99.8%
exp-neg99.8%
Applied egg-rr99.8%
(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(x / Float32(-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.8%
Final simplification99.8%
(FPCore (x s)
:precision binary32
(let* ((t_0 (/ x (- s))))
(if (<= t_0 40.0)
(/ 1.0 (+ 1.0 (/ 1.0 (+ 1.0 (/ x s)))))
(if (<= t_0 19999999961012896000.0)
(/ 1.0 (* x (+ (/ 2.0 x) (+ (/ 1.0 s) (/ (+ s s) (* s s))))))
(if (<= t_0 9.999999680285692e+37)
(/ 1.0 (/ (- 4.0 (* (/ x s) (/ x s))) (+ (/ x s) 2.0)))
(/ 1.0 (/ x s)))))))
float code(float x, float s) {
float t_0 = x / -s;
float tmp;
if (t_0 <= 40.0f) {
tmp = 1.0f / (1.0f + (1.0f / (1.0f + (x / s))));
} else if (t_0 <= 19999999961012896000.0f) {
tmp = 1.0f / (x * ((2.0f / x) + ((1.0f / s) + ((s + s) / (s * s)))));
} else if (t_0 <= 9.999999680285692e+37f) {
tmp = 1.0f / ((4.0f - ((x / s) * (x / s))) / ((x / s) + 2.0f));
} else {
tmp = 1.0f / (x / 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 <= 40.0e0) then
tmp = 1.0e0 / (1.0e0 + (1.0e0 / (1.0e0 + (x / s))))
else if (t_0 <= 19999999961012896000.0e0) then
tmp = 1.0e0 / (x * ((2.0e0 / x) + ((1.0e0 / s) + ((s + s) / (s * s)))))
else if (t_0 <= 9.999999680285692e+37) then
tmp = 1.0e0 / ((4.0e0 - ((x / s) * (x / s))) / ((x / s) + 2.0e0))
else
tmp = 1.0e0 / (x / s)
end if
code = tmp
end function
function code(x, s) t_0 = Float32(x / Float32(-s)) tmp = Float32(0.0) if (t_0 <= Float32(40.0)) tmp = Float32(Float32(1.0) / Float32(Float32(1.0) + Float32(Float32(1.0) / Float32(Float32(1.0) + Float32(x / s))))); elseif (t_0 <= Float32(19999999961012896000.0)) tmp = Float32(Float32(1.0) / Float32(x * Float32(Float32(Float32(2.0) / x) + Float32(Float32(Float32(1.0) / s) + Float32(Float32(s + s) / Float32(s * s)))))); elseif (t_0 <= Float32(9.999999680285692e+37)) tmp = Float32(Float32(1.0) / Float32(Float32(Float32(4.0) - Float32(Float32(x / s) * Float32(x / s))) / Float32(Float32(x / s) + Float32(2.0)))); else tmp = Float32(Float32(1.0) / Float32(x / s)); end return tmp end
function tmp_2 = code(x, s) t_0 = x / -s; tmp = single(0.0); if (t_0 <= single(40.0)) tmp = single(1.0) / (single(1.0) + (single(1.0) / (single(1.0) + (x / s)))); elseif (t_0 <= single(19999999961012896000.0)) tmp = single(1.0) / (x * ((single(2.0) / x) + ((single(1.0) / s) + ((s + s) / (s * s))))); elseif (t_0 <= single(9.999999680285692e+37)) tmp = single(1.0) / ((single(4.0) - ((x / s) * (x / s))) / ((x / s) + single(2.0))); else tmp = single(1.0) / (x / s); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{-s}\\
\mathbf{if}\;t\_0 \leq 40:\\
\;\;\;\;\frac{1}{1 + \frac{1}{1 + \frac{x}{s}}}\\
\mathbf{elif}\;t\_0 \leq 19999999961012896000:\\
\;\;\;\;\frac{1}{x \cdot \left(\frac{2}{x} + \left(\frac{1}{s} + \frac{s + s}{s \cdot s}\right)\right)}\\
\mathbf{elif}\;t\_0 \leq 9.999999680285692 \cdot 10^{+37}:\\
\;\;\;\;\frac{1}{\frac{4 - \frac{x}{s} \cdot \frac{x}{s}}{\frac{x}{s} + 2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{x}{s}}\\
\end{array}
\end{array}
if (/.f32 (neg.f32 x) s) < 40Initial program 99.8%
distribute-frac-neg99.8%
exp-neg99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 93.8%
+-commutative93.8%
Simplified93.8%
if 40 < (/.f32 (neg.f32 x) s) < 2e19Initial program 99.5%
Taylor expanded in x around 0 7.8%
neg-mul-17.8%
unsub-neg7.8%
Simplified7.8%
Taylor expanded in x around inf 7.8%
associate-*r/7.8%
metadata-eval7.8%
Simplified7.8%
*-un-lft-identity7.8%
add-sqr-sqrt-0.0%
prod-diff-0.0%
associate-/r/-0.0%
clear-num-0.0%
distribute-frac-neg2-0.0%
add-sqr-sqrt-0.0%
sqrt-unprod-0.0%
sqr-neg-0.0%
sqrt-unprod-0.0%
add-sqr-sqrt-0.0%
fma-define-0.0%
add-sqr-sqrt7.6%
Applied egg-rr7.6%
associate-+l+7.6%
fma-undefine7.6%
*-rgt-identity7.6%
Simplified7.6%
frac-2neg7.6%
metadata-eval7.6%
frac-add52.0%
*-un-lft-identity52.0%
Applied egg-rr52.0%
if 2e19 < (/.f32 (neg.f32 x) s) < 9.99999968e37Initial program 100.0%
Taylor expanded in x around 0 14.7%
neg-mul-114.7%
unsub-neg14.7%
Simplified14.7%
*-un-lft-identity14.7%
cancel-sign-sub-inv14.7%
metadata-eval14.7%
add-log-exp100.0%
pow-exp100.0%
flip-+-0.0%
metadata-eval-0.0%
pow-exp-0.0%
add-log-exp-0.0%
neg-mul-1-0.0%
pow-exp-0.0%
add-log-exp-0.0%
neg-mul-1-0.0%
distribute-neg-frac2-0.0%
distribute-neg-frac2-0.0%
pow-exp-0.0%
Applied egg-rr100.0%
if 9.99999968e37 < (/.f32 (neg.f32 x) s) Initial program 100.0%
Taylor expanded in x around 0 100.0%
neg-mul-1100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in x around inf 94.1%
associate-*r/94.1%
neg-mul-194.1%
Simplified94.1%
clear-num100.0%
inv-pow100.0%
add-sqr-sqrt-0.0%
sqrt-unprod100.0%
sqr-neg100.0%
sqrt-unprod100.0%
add-sqr-sqrt100.0%
Applied egg-rr100.0%
unpow-1100.0%
Simplified100.0%
Final simplification91.7%
(FPCore (x s)
:precision binary32
(let* ((t_0 (/ x (- s))))
(if (<= t_0 40.0)
(/ 1.0 (+ 1.0 (/ 1.0 (+ 1.0 (/ x s)))))
(if (<= t_0 19999999961012896000.0)
(/ 1.0 (* x (* (- x (* s 2.0)) (/ -1.0 (* x s)))))
(if (<= t_0 9.999999680285692e+37)
(/ 1.0 (/ (- 4.0 (* (/ x s) (/ x s))) (+ (/ x s) 2.0)))
(/ 1.0 (/ x s)))))))
float code(float x, float s) {
float t_0 = x / -s;
float tmp;
if (t_0 <= 40.0f) {
tmp = 1.0f / (1.0f + (1.0f / (1.0f + (x / s))));
} else if (t_0 <= 19999999961012896000.0f) {
tmp = 1.0f / (x * ((x - (s * 2.0f)) * (-1.0f / (x * s))));
} else if (t_0 <= 9.999999680285692e+37f) {
tmp = 1.0f / ((4.0f - ((x / s) * (x / s))) / ((x / s) + 2.0f));
} else {
tmp = 1.0f / (x / 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 <= 40.0e0) then
tmp = 1.0e0 / (1.0e0 + (1.0e0 / (1.0e0 + (x / s))))
else if (t_0 <= 19999999961012896000.0e0) then
tmp = 1.0e0 / (x * ((x - (s * 2.0e0)) * ((-1.0e0) / (x * s))))
else if (t_0 <= 9.999999680285692e+37) then
tmp = 1.0e0 / ((4.0e0 - ((x / s) * (x / s))) / ((x / s) + 2.0e0))
else
tmp = 1.0e0 / (x / s)
end if
code = tmp
end function
function code(x, s) t_0 = Float32(x / Float32(-s)) tmp = Float32(0.0) if (t_0 <= Float32(40.0)) tmp = Float32(Float32(1.0) / Float32(Float32(1.0) + Float32(Float32(1.0) / Float32(Float32(1.0) + Float32(x / s))))); elseif (t_0 <= Float32(19999999961012896000.0)) tmp = Float32(Float32(1.0) / Float32(x * Float32(Float32(x - Float32(s * Float32(2.0))) * Float32(Float32(-1.0) / Float32(x * s))))); elseif (t_0 <= Float32(9.999999680285692e+37)) tmp = Float32(Float32(1.0) / Float32(Float32(Float32(4.0) - Float32(Float32(x / s) * Float32(x / s))) / Float32(Float32(x / s) + Float32(2.0)))); else tmp = Float32(Float32(1.0) / Float32(x / s)); end return tmp end
function tmp_2 = code(x, s) t_0 = x / -s; tmp = single(0.0); if (t_0 <= single(40.0)) tmp = single(1.0) / (single(1.0) + (single(1.0) / (single(1.0) + (x / s)))); elseif (t_0 <= single(19999999961012896000.0)) tmp = single(1.0) / (x * ((x - (s * single(2.0))) * (single(-1.0) / (x * s)))); elseif (t_0 <= single(9.999999680285692e+37)) tmp = single(1.0) / ((single(4.0) - ((x / s) * (x / s))) / ((x / s) + single(2.0))); else tmp = single(1.0) / (x / s); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{-s}\\
\mathbf{if}\;t\_0 \leq 40:\\
\;\;\;\;\frac{1}{1 + \frac{1}{1 + \frac{x}{s}}}\\
\mathbf{elif}\;t\_0 \leq 19999999961012896000:\\
\;\;\;\;\frac{1}{x \cdot \left(\left(x - s \cdot 2\right) \cdot \frac{-1}{x \cdot s}\right)}\\
\mathbf{elif}\;t\_0 \leq 9.999999680285692 \cdot 10^{+37}:\\
\;\;\;\;\frac{1}{\frac{4 - \frac{x}{s} \cdot \frac{x}{s}}{\frac{x}{s} + 2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{x}{s}}\\
\end{array}
\end{array}
if (/.f32 (neg.f32 x) s) < 40Initial program 99.8%
distribute-frac-neg99.8%
exp-neg99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 93.8%
+-commutative93.8%
Simplified93.8%
if 40 < (/.f32 (neg.f32 x) s) < 2e19Initial program 99.5%
Taylor expanded in x around 0 7.8%
neg-mul-17.8%
unsub-neg7.8%
Simplified7.8%
Taylor expanded in x around inf 7.8%
associate-*r/7.8%
metadata-eval7.8%
Simplified7.8%
frac-sub44.0%
div-inv47.9%
*-rgt-identity47.9%
*-commutative47.9%
Applied egg-rr47.9%
if 2e19 < (/.f32 (neg.f32 x) s) < 9.99999968e37Initial program 100.0%
Taylor expanded in x around 0 14.7%
neg-mul-114.7%
unsub-neg14.7%
Simplified14.7%
*-un-lft-identity14.7%
cancel-sign-sub-inv14.7%
metadata-eval14.7%
add-log-exp100.0%
pow-exp100.0%
flip-+-0.0%
metadata-eval-0.0%
pow-exp-0.0%
add-log-exp-0.0%
neg-mul-1-0.0%
pow-exp-0.0%
add-log-exp-0.0%
neg-mul-1-0.0%
distribute-neg-frac2-0.0%
distribute-neg-frac2-0.0%
pow-exp-0.0%
Applied egg-rr100.0%
if 9.99999968e37 < (/.f32 (neg.f32 x) s) Initial program 100.0%
Taylor expanded in x around 0 100.0%
neg-mul-1100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in x around inf 94.1%
associate-*r/94.1%
neg-mul-194.1%
Simplified94.1%
clear-num100.0%
inv-pow100.0%
add-sqr-sqrt-0.0%
sqrt-unprod100.0%
sqr-neg100.0%
sqrt-unprod100.0%
add-sqr-sqrt100.0%
Applied egg-rr100.0%
unpow-1100.0%
Simplified100.0%
Final simplification91.3%
(FPCore (x s)
:precision binary32
(let* ((t_0 (/ x (- s))))
(if (<= t_0 -10.0)
0.9583333333333334
(if (<= t_0 0.5) (+ 0.5 (/ (* x 0.25) s)) (/ -1.0 (/ x s))))))
float code(float x, float s) {
float t_0 = x / -s;
float tmp;
if (t_0 <= -10.0f) {
tmp = 0.9583333333333334f;
} else if (t_0 <= 0.5f) {
tmp = 0.5f + ((x * 0.25f) / s);
} else {
tmp = -1.0f / (x / 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 <= (-10.0e0)) then
tmp = 0.9583333333333334e0
else if (t_0 <= 0.5e0) then
tmp = 0.5e0 + ((x * 0.25e0) / s)
else
tmp = (-1.0e0) / (x / s)
end if
code = tmp
end function
function code(x, s) t_0 = Float32(x / Float32(-s)) tmp = Float32(0.0) if (t_0 <= Float32(-10.0)) tmp = Float32(0.9583333333333334); elseif (t_0 <= Float32(0.5)) tmp = Float32(Float32(0.5) + Float32(Float32(x * Float32(0.25)) / s)); else tmp = Float32(Float32(-1.0) / Float32(x / s)); end return tmp end
function tmp_2 = code(x, s) t_0 = x / -s; tmp = single(0.0); if (t_0 <= single(-10.0)) tmp = single(0.9583333333333334); elseif (t_0 <= single(0.5)) tmp = single(0.5) + ((x * single(0.25)) / s); else tmp = single(-1.0) / (x / s); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{-s}\\
\mathbf{if}\;t\_0 \leq -10:\\
\;\;\;\;0.9583333333333334\\
\mathbf{elif}\;t\_0 \leq 0.5:\\
\;\;\;\;0.5 + \frac{x \cdot 0.25}{s}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{\frac{x}{s}}\\
\end{array}
\end{array}
if (/.f32 (neg.f32 x) s) < -10Initial program 100.0%
distribute-frac-neg100.0%
exp-neg100.0%
Applied egg-rr100.0%
*-un-lft-identity100.0%
exp-prod100.0%
Applied egg-rr100.0%
Taylor expanded in s around inf 0.4%
Simplified39.3%
if -10 < (/.f32 (neg.f32 x) s) < 0.5Initial program 99.8%
Taylor expanded in x around 0 97.2%
associate-*r/97.2%
Simplified97.2%
if 0.5 < (/.f32 (neg.f32 x) s) Initial program 99.6%
Taylor expanded in x around 0 37.4%
neg-mul-137.4%
unsub-neg37.4%
Simplified37.4%
Taylor expanded in x around inf 37.4%
mul-1-neg37.4%
distribute-frac-neg237.4%
Simplified37.4%
Final simplification51.3%
(FPCore (x s)
:precision binary32
(let* ((t_0 (/ x (- s))))
(if (<= t_0 -10.0)
0.9583333333333334
(if (<= t_0 0.5) 0.5 (/ -1.0 (/ x s))))))
float code(float x, float s) {
float t_0 = x / -s;
float tmp;
if (t_0 <= -10.0f) {
tmp = 0.9583333333333334f;
} else if (t_0 <= 0.5f) {
tmp = 0.5f;
} else {
tmp = -1.0f / (x / 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 <= (-10.0e0)) then
tmp = 0.9583333333333334e0
else if (t_0 <= 0.5e0) then
tmp = 0.5e0
else
tmp = (-1.0e0) / (x / s)
end if
code = tmp
end function
function code(x, s) t_0 = Float32(x / Float32(-s)) tmp = Float32(0.0) if (t_0 <= Float32(-10.0)) tmp = Float32(0.9583333333333334); elseif (t_0 <= Float32(0.5)) tmp = Float32(0.5); else tmp = Float32(Float32(-1.0) / Float32(x / s)); end return tmp end
function tmp_2 = code(x, s) t_0 = x / -s; tmp = single(0.0); if (t_0 <= single(-10.0)) tmp = single(0.9583333333333334); elseif (t_0 <= single(0.5)) tmp = single(0.5); else tmp = single(-1.0) / (x / s); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{-s}\\
\mathbf{if}\;t\_0 \leq -10:\\
\;\;\;\;0.9583333333333334\\
\mathbf{elif}\;t\_0 \leq 0.5:\\
\;\;\;\;0.5\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{\frac{x}{s}}\\
\end{array}
\end{array}
if (/.f32 (neg.f32 x) s) < -10Initial program 100.0%
distribute-frac-neg100.0%
exp-neg100.0%
Applied egg-rr100.0%
*-un-lft-identity100.0%
exp-prod100.0%
Applied egg-rr100.0%
Taylor expanded in s around inf 0.4%
Simplified39.3%
if -10 < (/.f32 (neg.f32 x) s) < 0.5Initial program 99.8%
Taylor expanded in x around 0 90.5%
if 0.5 < (/.f32 (neg.f32 x) s) Initial program 99.6%
Taylor expanded in x around 0 37.4%
neg-mul-137.4%
unsub-neg37.4%
Simplified37.4%
Taylor expanded in x around inf 37.4%
mul-1-neg37.4%
distribute-frac-neg237.4%
Simplified37.4%
Final simplification49.8%
(FPCore (x s) :precision binary32 (if (<= (/ x (- s)) 50.0) (/ 1.0 (+ 1.0 (/ 1.0 (+ 1.0 (/ x s))))) (/ 1.0 (+ -4.0 (* x (* x -0.16666666666666666))))))
float code(float x, float s) {
float tmp;
if ((x / -s) <= 50.0f) {
tmp = 1.0f / (1.0f + (1.0f / (1.0f + (x / s))));
} else {
tmp = 1.0f / (-4.0f + (x * (x * -0.16666666666666666f)));
}
return tmp;
}
real(4) function code(x, s)
real(4), intent (in) :: x
real(4), intent (in) :: s
real(4) :: tmp
if ((x / -s) <= 50.0e0) then
tmp = 1.0e0 / (1.0e0 + (1.0e0 / (1.0e0 + (x / s))))
else
tmp = 1.0e0 / ((-4.0e0) + (x * (x * (-0.16666666666666666e0))))
end if
code = tmp
end function
function code(x, s) tmp = Float32(0.0) if (Float32(x / Float32(-s)) <= Float32(50.0)) tmp = Float32(Float32(1.0) / Float32(Float32(1.0) + Float32(Float32(1.0) / Float32(Float32(1.0) + Float32(x / s))))); else tmp = Float32(Float32(1.0) / Float32(Float32(-4.0) + Float32(x * Float32(x * Float32(-0.16666666666666666))))); end return tmp end
function tmp_2 = code(x, s) tmp = single(0.0); if ((x / -s) <= single(50.0)) tmp = single(1.0) / (single(1.0) + (single(1.0) / (single(1.0) + (x / s)))); else tmp = single(1.0) / (single(-4.0) + (x * (x * single(-0.16666666666666666)))); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{-s} \leq 50:\\
\;\;\;\;\frac{1}{1 + \frac{1}{1 + \frac{x}{s}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{-4 + x \cdot \left(x \cdot -0.16666666666666666\right)}\\
\end{array}
\end{array}
if (/.f32 (neg.f32 x) s) < 50Initial program 99.7%
distribute-frac-neg99.7%
exp-neg99.7%
Applied egg-rr99.7%
Taylor expanded in x around 0 93.3%
+-commutative93.3%
Simplified93.3%
if 50 < (/.f32 (neg.f32 x) s) Initial program 100.0%
distribute-frac-neg100.0%
exp-neg100.0%
Applied egg-rr100.0%
*-un-lft-identity100.0%
exp-prod100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0 95.1%
Simplified43.7%
Final simplification75.9%
(FPCore (x s) :precision binary32 (if (<= x -1.999999936531045e-21) (/ 1.0 (/ (* x (- (* s 2.0) x)) (* x s))) (/ 1.0 (+ 1.0 (/ 1.0 (+ 1.0 (/ x s)))))))
float code(float x, float s) {
float tmp;
if (x <= -1.999999936531045e-21f) {
tmp = 1.0f / ((x * ((s * 2.0f) - x)) / (x * s));
} else {
tmp = 1.0f / (1.0f + (1.0f / (1.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 <= (-1.999999936531045e-21)) then
tmp = 1.0e0 / ((x * ((s * 2.0e0) - x)) / (x * s))
else
tmp = 1.0e0 / (1.0e0 + (1.0e0 / (1.0e0 + (x / s))))
end if
code = tmp
end function
function code(x, s) tmp = Float32(0.0) if (x <= Float32(-1.999999936531045e-21)) tmp = Float32(Float32(1.0) / Float32(Float32(x * Float32(Float32(s * Float32(2.0)) - x)) / Float32(x * s))); else tmp = Float32(Float32(1.0) / Float32(Float32(1.0) + Float32(Float32(1.0) / Float32(Float32(1.0) + Float32(x / s))))); end return tmp end
function tmp_2 = code(x, s) tmp = single(0.0); if (x <= single(-1.999999936531045e-21)) tmp = single(1.0) / ((x * ((s * single(2.0)) - x)) / (x * s)); else tmp = single(1.0) / (single(1.0) + (single(1.0) / (single(1.0) + (x / s)))); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.999999936531045 \cdot 10^{-21}:\\
\;\;\;\;\frac{1}{\frac{x \cdot \left(s \cdot 2 - x\right)}{x \cdot s}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{1 + \frac{1}{1 + \frac{x}{s}}}\\
\end{array}
\end{array}
if x < -1.9999999e-21Initial program 99.9%
Taylor expanded in x around 0 41.8%
neg-mul-141.8%
unsub-neg41.8%
Simplified41.8%
Taylor expanded in x around inf 41.8%
associate-*r/41.8%
metadata-eval41.8%
Simplified41.8%
*-commutative41.8%
frac-sub45.9%
associate-*l/60.6%
*-rgt-identity60.6%
*-commutative60.6%
Applied egg-rr60.6%
if -1.9999999e-21 < x Initial program 99.8%
distribute-frac-neg99.8%
exp-neg99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 91.5%
+-commutative91.5%
Simplified91.5%
Final simplification80.7%
(FPCore (x s) :precision binary32 (if (<= x -5.000000229068525e-19) (* (* x s) (/ (/ -1.0 x) (- x (* s 2.0)))) (/ 1.0 (+ 1.0 (/ 1.0 (+ 1.0 (/ x s)))))))
float code(float x, float s) {
float tmp;
if (x <= -5.000000229068525e-19f) {
tmp = (x * s) * ((-1.0f / x) / (x - (s * 2.0f)));
} else {
tmp = 1.0f / (1.0f + (1.0f / (1.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 <= (-5.000000229068525e-19)) then
tmp = (x * s) * (((-1.0e0) / x) / (x - (s * 2.0e0)))
else
tmp = 1.0e0 / (1.0e0 + (1.0e0 / (1.0e0 + (x / s))))
end if
code = tmp
end function
function code(x, s) tmp = Float32(0.0) if (x <= Float32(-5.000000229068525e-19)) tmp = Float32(Float32(x * s) * Float32(Float32(Float32(-1.0) / x) / Float32(x - Float32(s * Float32(2.0))))); else tmp = Float32(Float32(1.0) / Float32(Float32(1.0) + Float32(Float32(1.0) / Float32(Float32(1.0) + Float32(x / s))))); end return tmp end
function tmp_2 = code(x, s) tmp = single(0.0); if (x <= single(-5.000000229068525e-19)) tmp = (x * s) * ((single(-1.0) / x) / (x - (s * single(2.0)))); else tmp = single(1.0) / (single(1.0) + (single(1.0) / (single(1.0) + (x / s)))); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.000000229068525 \cdot 10^{-19}:\\
\;\;\;\;\left(x \cdot s\right) \cdot \frac{\frac{-1}{x}}{x - s \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{1 + \frac{1}{1 + \frac{x}{s}}}\\
\end{array}
\end{array}
if x < -5.00000023e-19Initial program 99.9%
Taylor expanded in x around 0 41.7%
neg-mul-141.7%
unsub-neg41.7%
Simplified41.7%
Taylor expanded in x around inf 41.7%
associate-*r/41.7%
metadata-eval41.7%
Simplified41.7%
associate-/r*39.8%
frac-sub40.9%
associate-/r/53.5%
*-rgt-identity53.5%
*-commutative53.5%
Applied egg-rr53.5%
if -5.00000023e-19 < x Initial program 99.7%
distribute-frac-neg99.7%
exp-neg99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 90.1%
+-commutative90.1%
Simplified90.1%
Final simplification77.9%
(FPCore (x s) :precision binary32 (if (<= (/ x (- s)) -10.0) 0.9583333333333334 (/ 1.0 (+ -1.0 (- 3.0 (/ x s))))))
float code(float x, float s) {
float tmp;
if ((x / -s) <= -10.0f) {
tmp = 0.9583333333333334f;
} else {
tmp = 1.0f / (-1.0f + (3.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) <= (-10.0e0)) then
tmp = 0.9583333333333334e0
else
tmp = 1.0e0 / ((-1.0e0) + (3.0e0 - (x / s)))
end if
code = tmp
end function
function code(x, s) tmp = Float32(0.0) if (Float32(x / Float32(-s)) <= Float32(-10.0)) tmp = Float32(0.9583333333333334); else tmp = Float32(Float32(1.0) / Float32(Float32(-1.0) + Float32(Float32(3.0) - Float32(x / s)))); end return tmp end
function tmp_2 = code(x, s) tmp = single(0.0); if ((x / -s) <= single(-10.0)) tmp = single(0.9583333333333334); else tmp = single(1.0) / (single(-1.0) + (single(3.0) - (x / s))); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{-s} \leq -10:\\
\;\;\;\;0.9583333333333334\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{-1 + \left(3 - \frac{x}{s}\right)}\\
\end{array}
\end{array}
if (/.f32 (neg.f32 x) s) < -10Initial program 100.0%
distribute-frac-neg100.0%
exp-neg100.0%
Applied egg-rr100.0%
*-un-lft-identity100.0%
exp-prod100.0%
Applied egg-rr100.0%
Taylor expanded in s around inf 0.4%
Simplified39.3%
if -10 < (/.f32 (neg.f32 x) s) Initial program 99.7%
Taylor expanded in x around 0 58.8%
neg-mul-158.8%
unsub-neg58.8%
Simplified58.8%
expm1-log1p-u58.7%
Applied egg-rr58.7%
expm1-undefine58.7%
sub-neg58.7%
log1p-undefine58.7%
rem-exp-log58.8%
associate-+r-58.8%
metadata-eval58.8%
metadata-eval58.8%
Simplified58.8%
Final simplification50.8%
(FPCore (x s) :precision binary32 (if (<= (/ x (- s)) -10.0) 0.9583333333333334 (/ 1.0 (- 2.0 (/ x s)))))
float code(float x, float s) {
float tmp;
if ((x / -s) <= -10.0f) {
tmp = 0.9583333333333334f;
} 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) <= (-10.0e0)) then
tmp = 0.9583333333333334e0
else
tmp = 1.0e0 / (2.0e0 - (x / s))
end if
code = tmp
end function
function code(x, s) tmp = Float32(0.0) if (Float32(x / Float32(-s)) <= Float32(-10.0)) tmp = Float32(0.9583333333333334); 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(-10.0)) tmp = single(0.9583333333333334); 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 -10:\\
\;\;\;\;0.9583333333333334\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{2 - \frac{x}{s}}\\
\end{array}
\end{array}
if (/.f32 (neg.f32 x) s) < -10Initial program 100.0%
distribute-frac-neg100.0%
exp-neg100.0%
Applied egg-rr100.0%
*-un-lft-identity100.0%
exp-prod100.0%
Applied egg-rr100.0%
Taylor expanded in s around inf 0.4%
Simplified39.3%
if -10 < (/.f32 (neg.f32 x) s) Initial program 99.7%
Taylor expanded in x around 0 58.8%
neg-mul-158.8%
unsub-neg58.8%
Simplified58.8%
Final simplification50.8%
(FPCore (x s) :precision binary32 (if (<= x -4.999999969612645e-9) (/ 1.0 (/ x s)) (if (<= x 1.9999999920083944e-12) 0.5 0.9583333333333334)))
float code(float x, float s) {
float tmp;
if (x <= -4.999999969612645e-9f) {
tmp = 1.0f / (x / s);
} else if (x <= 1.9999999920083944e-12f) {
tmp = 0.5f;
} else {
tmp = 0.9583333333333334f;
}
return tmp;
}
real(4) function code(x, s)
real(4), intent (in) :: x
real(4), intent (in) :: s
real(4) :: tmp
if (x <= (-4.999999969612645e-9)) then
tmp = 1.0e0 / (x / s)
else if (x <= 1.9999999920083944e-12) then
tmp = 0.5e0
else
tmp = 0.9583333333333334e0
end if
code = tmp
end function
function code(x, s) tmp = Float32(0.0) if (x <= Float32(-4.999999969612645e-9)) tmp = Float32(Float32(1.0) / Float32(x / s)); elseif (x <= Float32(1.9999999920083944e-12)) tmp = Float32(0.5); else tmp = Float32(0.9583333333333334); end return tmp end
function tmp_2 = code(x, s) tmp = single(0.0); if (x <= single(-4.999999969612645e-9)) tmp = single(1.0) / (x / s); elseif (x <= single(1.9999999920083944e-12)) tmp = single(0.5); else tmp = single(0.9583333333333334); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.999999969612645 \cdot 10^{-9}:\\
\;\;\;\;\frac{1}{\frac{x}{s}}\\
\mathbf{elif}\;x \leq 1.9999999920083944 \cdot 10^{-12}:\\
\;\;\;\;0.5\\
\mathbf{else}:\\
\;\;\;\;0.9583333333333334\\
\end{array}
\end{array}
if x < -4.99999997e-9Initial program 100.0%
Taylor expanded in x around 0 45.7%
neg-mul-145.7%
unsub-neg45.7%
Simplified45.7%
Taylor expanded in x around inf 43.5%
associate-*r/43.5%
neg-mul-143.5%
Simplified43.5%
clear-num45.7%
inv-pow45.7%
add-sqr-sqrt-0.0%
sqrt-unprod59.6%
sqr-neg59.6%
sqrt-unprod45.7%
add-sqr-sqrt45.7%
Applied egg-rr45.7%
unpow-145.7%
Simplified45.7%
if -4.99999997e-9 < x < 1.99999999e-12Initial program 99.4%
Taylor expanded in x around 0 61.1%
if 1.99999999e-12 < x Initial program 100.0%
distribute-frac-neg100.0%
exp-neg100.0%
Applied egg-rr100.0%
*-un-lft-identity100.0%
exp-prod100.0%
Applied egg-rr100.0%
Taylor expanded in s around inf 1.5%
Simplified39.2%
(FPCore (x s) :precision binary32 (if (<= x -4.999999969612645e-9) (* 0.3333333333333333 (/ s x)) (if (<= x 1.9999999920083944e-12) 0.5 0.9583333333333334)))
float code(float x, float s) {
float tmp;
if (x <= -4.999999969612645e-9f) {
tmp = 0.3333333333333333f * (s / x);
} else if (x <= 1.9999999920083944e-12f) {
tmp = 0.5f;
} else {
tmp = 0.9583333333333334f;
}
return tmp;
}
real(4) function code(x, s)
real(4), intent (in) :: x
real(4), intent (in) :: s
real(4) :: tmp
if (x <= (-4.999999969612645e-9)) then
tmp = 0.3333333333333333e0 * (s / x)
else if (x <= 1.9999999920083944e-12) then
tmp = 0.5e0
else
tmp = 0.9583333333333334e0
end if
code = tmp
end function
function code(x, s) tmp = Float32(0.0) if (x <= Float32(-4.999999969612645e-9)) tmp = Float32(Float32(0.3333333333333333) * Float32(s / x)); elseif (x <= Float32(1.9999999920083944e-12)) tmp = Float32(0.5); else tmp = Float32(0.9583333333333334); end return tmp end
function tmp_2 = code(x, s) tmp = single(0.0); if (x <= single(-4.999999969612645e-9)) tmp = single(0.3333333333333333) * (s / x); elseif (x <= single(1.9999999920083944e-12)) tmp = single(0.5); else tmp = single(0.9583333333333334); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.999999969612645 \cdot 10^{-9}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{s}{x}\\
\mathbf{elif}\;x \leq 1.9999999920083944 \cdot 10^{-12}:\\
\;\;\;\;0.5\\
\mathbf{else}:\\
\;\;\;\;0.9583333333333334\\
\end{array}
\end{array}
if x < -4.99999997e-9Initial program 100.0%
Taylor expanded in x around 0 45.7%
neg-mul-145.7%
unsub-neg45.7%
Simplified45.7%
Taylor expanded in x around inf 45.7%
associate-*r/45.7%
metadata-eval45.7%
Simplified45.7%
*-un-lft-identity45.7%
add-sqr-sqrt-0.0%
prod-diff-0.0%
associate-/r/-0.0%
clear-num-0.0%
distribute-frac-neg2-0.0%
add-sqr-sqrt-0.0%
sqrt-unprod-0.0%
sqr-neg-0.0%
sqrt-unprod-0.0%
add-sqr-sqrt-0.0%
fma-define-0.0%
add-sqr-sqrt45.7%
Applied egg-rr46.1%
associate-+l+46.1%
fma-undefine46.1%
*-rgt-identity46.1%
Simplified46.1%
Taylor expanded in x around inf 44.2%
if -4.99999997e-9 < x < 1.99999999e-12Initial program 99.4%
Taylor expanded in x around 0 61.1%
if 1.99999999e-12 < x Initial program 100.0%
distribute-frac-neg100.0%
exp-neg100.0%
Applied egg-rr100.0%
*-un-lft-identity100.0%
exp-prod100.0%
Applied egg-rr100.0%
Taylor expanded in s around inf 1.5%
Simplified39.2%
(FPCore (x s) :precision binary32 (if (<= x -4.999999969612645e-9) (/ s x) (if (<= x 1.9999999920083944e-12) 0.5 0.9583333333333334)))
float code(float x, float s) {
float tmp;
if (x <= -4.999999969612645e-9f) {
tmp = s / x;
} else if (x <= 1.9999999920083944e-12f) {
tmp = 0.5f;
} else {
tmp = 0.9583333333333334f;
}
return tmp;
}
real(4) function code(x, s)
real(4), intent (in) :: x
real(4), intent (in) :: s
real(4) :: tmp
if (x <= (-4.999999969612645e-9)) then
tmp = s / x
else if (x <= 1.9999999920083944e-12) then
tmp = 0.5e0
else
tmp = 0.9583333333333334e0
end if
code = tmp
end function
function code(x, s) tmp = Float32(0.0) if (x <= Float32(-4.999999969612645e-9)) tmp = Float32(s / x); elseif (x <= Float32(1.9999999920083944e-12)) tmp = Float32(0.5); else tmp = Float32(0.9583333333333334); end return tmp end
function tmp_2 = code(x, s) tmp = single(0.0); if (x <= single(-4.999999969612645e-9)) tmp = s / x; elseif (x <= single(1.9999999920083944e-12)) tmp = single(0.5); else tmp = single(0.9583333333333334); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.999999969612645 \cdot 10^{-9}:\\
\;\;\;\;\frac{s}{x}\\
\mathbf{elif}\;x \leq 1.9999999920083944 \cdot 10^{-12}:\\
\;\;\;\;0.5\\
\mathbf{else}:\\
\;\;\;\;0.9583333333333334\\
\end{array}
\end{array}
if x < -4.99999997e-9Initial program 100.0%
Taylor expanded in x around 0 45.7%
neg-mul-145.7%
unsub-neg45.7%
Simplified45.7%
Taylor expanded in x around inf 43.5%
associate-*r/43.5%
neg-mul-143.5%
Simplified43.5%
div-inv43.5%
add-sqr-sqrt-0.0%
sqrt-unprod57.4%
sqr-neg57.4%
sqrt-unprod43.5%
add-sqr-sqrt43.5%
Applied egg-rr43.5%
associate-*r/43.5%
*-rgt-identity43.5%
Simplified43.5%
if -4.99999997e-9 < x < 1.99999999e-12Initial program 99.4%
Taylor expanded in x around 0 61.1%
if 1.99999999e-12 < x Initial program 100.0%
distribute-frac-neg100.0%
exp-neg100.0%
Applied egg-rr100.0%
*-un-lft-identity100.0%
exp-prod100.0%
Applied egg-rr100.0%
Taylor expanded in s around inf 1.5%
Simplified39.2%
(FPCore (x s) :precision binary32 (if (<= x 1.9999999920083944e-12) 0.5 0.9583333333333334))
float code(float x, float s) {
float tmp;
if (x <= 1.9999999920083944e-12f) {
tmp = 0.5f;
} else {
tmp = 0.9583333333333334f;
}
return tmp;
}
real(4) function code(x, s)
real(4), intent (in) :: x
real(4), intent (in) :: s
real(4) :: tmp
if (x <= 1.9999999920083944e-12) then
tmp = 0.5e0
else
tmp = 0.9583333333333334e0
end if
code = tmp
end function
function code(x, s) tmp = Float32(0.0) if (x <= Float32(1.9999999920083944e-12)) tmp = Float32(0.5); else tmp = Float32(0.9583333333333334); end return tmp end
function tmp_2 = code(x, s) tmp = single(0.0); if (x <= single(1.9999999920083944e-12)) tmp = single(0.5); else tmp = single(0.9583333333333334); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.9999999920083944 \cdot 10^{-12}:\\
\;\;\;\;0.5\\
\mathbf{else}:\\
\;\;\;\;0.9583333333333334\\
\end{array}
\end{array}
if x < 1.99999999e-12Initial program 99.7%
Taylor expanded in x around 0 36.7%
if 1.99999999e-12 < x Initial program 100.0%
distribute-frac-neg100.0%
exp-neg100.0%
Applied egg-rr100.0%
*-un-lft-identity100.0%
exp-prod100.0%
Applied egg-rr100.0%
Taylor expanded in s around inf 1.5%
Simplified39.2%
(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.8%
Taylor expanded in x around 0 33.8%
(FPCore (x s) :precision binary32 0.3333333333333333)
float code(float x, float s) {
return 0.3333333333333333f;
}
real(4) function code(x, s)
real(4), intent (in) :: x
real(4), intent (in) :: s
code = 0.3333333333333333e0
end function
function code(x, s) return Float32(0.3333333333333333) end
function tmp = code(x, s) tmp = single(0.3333333333333333); end
\begin{array}{l}
\\
0.3333333333333333
\end{array}
Initial program 99.8%
Taylor expanded in x around 0 36.7%
neg-mul-136.7%
unsub-neg36.7%
Simplified36.7%
Taylor expanded in x around inf 36.7%
associate-*r/36.7%
metadata-eval36.7%
Simplified36.7%
*-un-lft-identity36.7%
add-sqr-sqrt14.1%
prod-diff14.0%
associate-/r/14.0%
clear-num14.0%
distribute-frac-neg214.0%
add-sqr-sqrt-0.0%
sqrt-unprod12.5%
sqr-neg12.5%
sqrt-unprod14.9%
add-sqr-sqrt14.9%
fma-define14.9%
add-sqr-sqrt36.9%
Applied egg-rr36.7%
associate-+l+36.8%
fma-undefine36.8%
*-rgt-identity36.8%
Simplified36.8%
Taylor expanded in x around inf 18.9%
Simplified19.7%
(FPCore (x s) :precision binary32 0.1111111111111111)
float code(float x, float s) {
return 0.1111111111111111f;
}
real(4) function code(x, s)
real(4), intent (in) :: x
real(4), intent (in) :: s
code = 0.1111111111111111e0
end function
function code(x, s) return Float32(0.1111111111111111) end
function tmp = code(x, s) tmp = single(0.1111111111111111); end
\begin{array}{l}
\\
0.1111111111111111
\end{array}
Initial program 99.8%
Taylor expanded in x around 0 36.7%
neg-mul-136.7%
unsub-neg36.7%
Simplified36.7%
Taylor expanded in x around inf 36.7%
associate-*r/36.7%
metadata-eval36.7%
Simplified36.7%
*-un-lft-identity36.7%
add-sqr-sqrt14.1%
prod-diff14.0%
associate-/r/14.0%
clear-num14.0%
distribute-frac-neg214.0%
add-sqr-sqrt-0.0%
sqrt-unprod12.5%
sqr-neg12.5%
sqrt-unprod14.9%
add-sqr-sqrt14.9%
fma-define14.9%
add-sqr-sqrt36.9%
Applied egg-rr36.7%
associate-+l+36.8%
fma-undefine36.8%
*-rgt-identity36.8%
Simplified36.8%
Taylor expanded in s around 0 17.0%
Simplified17.3%
herbie shell --seed 2024137
(FPCore (x s)
:name "Logistic function"
:precision binary32
:pre (and (<= 0.0 s) (<= s 1.0651631))
(/ 1.0 (+ 1.0 (exp (/ (- x) s)))))