
(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 23 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 (- 0.0 (/ x s)))))))
float code(float x, float s) {
return expf(-log1pf(expf((0.0f - (x / s)))));
}
function code(x, s) return exp(Float32(-log1p(exp(Float32(Float32(0.0) - Float32(x / s)))))) end
\begin{array}{l}
\\
e^{-\mathsf{log1p}\left(e^{0 - \frac{x}{s}}\right)}
\end{array}
Initial program 99.9%
inv-powN/A
pow-to-expN/A
*-commutativeN/A
log-powN/A
inv-powN/A
exp-lowering-exp.f32N/A
log-recN/A
neg-lowering-neg.f32N/A
log1p-defineN/A
log1p-lowering-log1p.f32N/A
exp-lowering-exp.f32N/A
distribute-frac-negN/A
distribute-frac-neg2N/A
/-lowering-/.f32N/A
neg-lowering-neg.f3299.9%
Applied egg-rr99.9%
Final simplification99.9%
(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.9%
metadata-evalN/A
associate--r-N/A
unsub-negN/A
associate--r+N/A
metadata-evalN/A
--lowering--.f32N/A
distribute-frac-negN/A
exp-negN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f32N/A
exp-lowering-exp.f32N/A
/-lowering-/.f3299.9%
Applied egg-rr99.9%
(FPCore (x s) :precision binary32 (/ 1.0 (+ 1.0 (exp (- 0.0 (/ x s))))))
float code(float x, float s) {
return 1.0f / (1.0f + expf((0.0f - (x / s))));
}
real(4) function code(x, s)
real(4), intent (in) :: x
real(4), intent (in) :: s
code = 1.0e0 / (1.0e0 + exp((0.0e0 - (x / s))))
end function
function code(x, s) return Float32(Float32(1.0) / Float32(Float32(1.0) + exp(Float32(Float32(0.0) - Float32(x / s))))) end
function tmp = code(x, s) tmp = single(1.0) / (single(1.0) + exp((single(0.0) - (x / s)))); end
\begin{array}{l}
\\
\frac{1}{1 + e^{0 - \frac{x}{s}}}
\end{array}
Initial program 99.9%
Final simplification99.9%
(FPCore (x s)
:precision binary32
(if (<= x -1.0000000195414814e-25)
(/
1.0
(+
2.0
(*
x
(+
(* x (+ (* -0.16666666666666666 (/ (/ x s) (* s s))) (/ 0.5 (* s s))))
(/ -1.0 s)))))
(/
1.0
(+
1.0
(/
-1.0
(-
-1.0
(/
(+
x
(/ (+ (* 0.5 (* x x)) (* (* x (* x x)) (/ 0.16666666666666666 s))) s))
s)))))))
float code(float x, float s) {
float tmp;
if (x <= -1.0000000195414814e-25f) {
tmp = 1.0f / (2.0f + (x * ((x * ((-0.16666666666666666f * ((x / s) / (s * s))) + (0.5f / (s * s)))) + (-1.0f / s))));
} else {
tmp = 1.0f / (1.0f + (-1.0f / (-1.0f - ((x + (((0.5f * (x * x)) + ((x * (x * x)) * (0.16666666666666666f / s))) / 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 <= (-1.0000000195414814e-25)) then
tmp = 1.0e0 / (2.0e0 + (x * ((x * (((-0.16666666666666666e0) * ((x / s) / (s * s))) + (0.5e0 / (s * s)))) + ((-1.0e0) / s))))
else
tmp = 1.0e0 / (1.0e0 + ((-1.0e0) / ((-1.0e0) - ((x + (((0.5e0 * (x * x)) + ((x * (x * x)) * (0.16666666666666666e0 / s))) / s)) / s))))
end if
code = tmp
end function
function code(x, s) tmp = Float32(0.0) if (x <= Float32(-1.0000000195414814e-25)) tmp = Float32(Float32(1.0) / Float32(Float32(2.0) + Float32(x * Float32(Float32(x * Float32(Float32(Float32(-0.16666666666666666) * Float32(Float32(x / s) / Float32(s * s))) + Float32(Float32(0.5) / Float32(s * s)))) + Float32(Float32(-1.0) / s))))); else tmp = Float32(Float32(1.0) / Float32(Float32(1.0) + Float32(Float32(-1.0) / Float32(Float32(-1.0) - Float32(Float32(x + Float32(Float32(Float32(Float32(0.5) * Float32(x * x)) + Float32(Float32(x * Float32(x * x)) * Float32(Float32(0.16666666666666666) / s))) / s)) / s))))); end return tmp end
function tmp_2 = code(x, s) tmp = single(0.0); if (x <= single(-1.0000000195414814e-25)) tmp = single(1.0) / (single(2.0) + (x * ((x * ((single(-0.16666666666666666) * ((x / s) / (s * s))) + (single(0.5) / (s * s)))) + (single(-1.0) / s)))); else tmp = single(1.0) / (single(1.0) + (single(-1.0) / (single(-1.0) - ((x + (((single(0.5) * (x * x)) + ((x * (x * x)) * (single(0.16666666666666666) / s))) / s)) / s)))); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.0000000195414814 \cdot 10^{-25}:\\
\;\;\;\;\frac{1}{2 + x \cdot \left(x \cdot \left(-0.16666666666666666 \cdot \frac{\frac{x}{s}}{s \cdot s} + \frac{0.5}{s \cdot s}\right) + \frac{-1}{s}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{1 + \frac{-1}{-1 - \frac{x + \frac{0.5 \cdot \left(x \cdot x\right) + \left(x \cdot \left(x \cdot x\right)\right) \cdot \frac{0.16666666666666666}{s}}{s}}{s}}}\\
\end{array}
\end{array}
if x < -1.00000002e-25Initial program 99.8%
Taylor expanded in x around 0
Simplified86.6%
associate-/r*N/A
/-lowering-/.f32N/A
/-lowering-/.f32N/A
*-lowering-*.f3290.8%
Applied egg-rr90.8%
if -1.00000002e-25 < x Initial program 99.9%
metadata-evalN/A
associate--r-N/A
unsub-negN/A
associate--r+N/A
metadata-evalN/A
--lowering--.f32N/A
distribute-frac-negN/A
exp-negN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f32N/A
exp-lowering-exp.f32N/A
/-lowering-/.f3299.9%
Applied egg-rr99.9%
Taylor expanded in s around -inf
mul-1-negN/A
unsub-negN/A
--lowering--.f32N/A
/-lowering-/.f32N/A
Simplified96.2%
Final simplification94.0%
(FPCore (x s)
:precision binary32
(if (<= x -1.0000000195414814e-25)
(/
1.0
(+
2.0
(*
x
(+
(* x (+ (* -0.16666666666666666 (/ (/ x s) (* s s))) (/ 0.5 (* s s))))
(/ -1.0 s)))))
(/ 1.0 (+ 1.0 (/ -1.0 (+ -1.0 (/ (- (/ (* (* x x) -0.5) s) x) s)))))))
float code(float x, float s) {
float tmp;
if (x <= -1.0000000195414814e-25f) {
tmp = 1.0f / (2.0f + (x * ((x * ((-0.16666666666666666f * ((x / s) / (s * s))) + (0.5f / (s * s)))) + (-1.0f / s))));
} else {
tmp = 1.0f / (1.0f + (-1.0f / (-1.0f + (((((x * x) * -0.5f) / s) - 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.0000000195414814e-25)) then
tmp = 1.0e0 / (2.0e0 + (x * ((x * (((-0.16666666666666666e0) * ((x / s) / (s * s))) + (0.5e0 / (s * s)))) + ((-1.0e0) / s))))
else
tmp = 1.0e0 / (1.0e0 + ((-1.0e0) / ((-1.0e0) + (((((x * x) * (-0.5e0)) / s) - x) / s))))
end if
code = tmp
end function
function code(x, s) tmp = Float32(0.0) if (x <= Float32(-1.0000000195414814e-25)) tmp = Float32(Float32(1.0) / Float32(Float32(2.0) + Float32(x * Float32(Float32(x * Float32(Float32(Float32(-0.16666666666666666) * Float32(Float32(x / s) / Float32(s * s))) + Float32(Float32(0.5) / Float32(s * s)))) + Float32(Float32(-1.0) / s))))); else tmp = Float32(Float32(1.0) / Float32(Float32(1.0) + Float32(Float32(-1.0) / Float32(Float32(-1.0) + Float32(Float32(Float32(Float32(Float32(x * x) * Float32(-0.5)) / s) - x) / s))))); end return tmp end
function tmp_2 = code(x, s) tmp = single(0.0); if (x <= single(-1.0000000195414814e-25)) tmp = single(1.0) / (single(2.0) + (x * ((x * ((single(-0.16666666666666666) * ((x / s) / (s * s))) + (single(0.5) / (s * s)))) + (single(-1.0) / s)))); else tmp = single(1.0) / (single(1.0) + (single(-1.0) / (single(-1.0) + (((((x * x) * single(-0.5)) / s) - x) / s)))); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.0000000195414814 \cdot 10^{-25}:\\
\;\;\;\;\frac{1}{2 + x \cdot \left(x \cdot \left(-0.16666666666666666 \cdot \frac{\frac{x}{s}}{s \cdot s} + \frac{0.5}{s \cdot s}\right) + \frac{-1}{s}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{1 + \frac{-1}{-1 + \frac{\frac{\left(x \cdot x\right) \cdot -0.5}{s} - x}{s}}}\\
\end{array}
\end{array}
if x < -1.00000002e-25Initial program 99.8%
Taylor expanded in x around 0
Simplified86.6%
associate-/r*N/A
/-lowering-/.f32N/A
/-lowering-/.f32N/A
*-lowering-*.f3290.8%
Applied egg-rr90.8%
if -1.00000002e-25 < x Initial program 99.9%
metadata-evalN/A
associate--r-N/A
unsub-negN/A
associate--r+N/A
metadata-evalN/A
--lowering--.f32N/A
distribute-frac-negN/A
exp-negN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f32N/A
exp-lowering-exp.f32N/A
/-lowering-/.f3299.9%
Applied egg-rr99.9%
Taylor expanded in s around -inf
mul-1-negN/A
unsub-negN/A
--lowering--.f32N/A
/-lowering-/.f32N/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f32N/A
associate-*r/N/A
*-commutativeN/A
metadata-evalN/A
distribute-rgt-outN/A
/-lowering-/.f32N/A
distribute-rgt-outN/A
metadata-evalN/A
*-lowering-*.f32N/A
unpow2N/A
*-lowering-*.f3295.5%
Simplified95.5%
Final simplification93.5%
(FPCore (x s)
:precision binary32
(if (<= x -1.0000000195414814e-25)
(/
1.0
(+
2.0
(*
x
(+
(/ -1.0 s)
(* x (/ (- (/ 0.5 s) (/ (/ (* x 0.16666666666666666) s) s)) s))))))
(/ 1.0 (+ 1.0 (/ -1.0 (+ -1.0 (/ (- (/ (* (* x x) -0.5) s) x) s)))))))
float code(float x, float s) {
float tmp;
if (x <= -1.0000000195414814e-25f) {
tmp = 1.0f / (2.0f + (x * ((-1.0f / s) + (x * (((0.5f / s) - (((x * 0.16666666666666666f) / s) / s)) / s)))));
} else {
tmp = 1.0f / (1.0f + (-1.0f / (-1.0f + (((((x * x) * -0.5f) / s) - 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.0000000195414814e-25)) then
tmp = 1.0e0 / (2.0e0 + (x * (((-1.0e0) / s) + (x * (((0.5e0 / s) - (((x * 0.16666666666666666e0) / s) / s)) / s)))))
else
tmp = 1.0e0 / (1.0e0 + ((-1.0e0) / ((-1.0e0) + (((((x * x) * (-0.5e0)) / s) - x) / s))))
end if
code = tmp
end function
function code(x, s) tmp = Float32(0.0) if (x <= Float32(-1.0000000195414814e-25)) tmp = Float32(Float32(1.0) / Float32(Float32(2.0) + Float32(x * Float32(Float32(Float32(-1.0) / s) + Float32(x * Float32(Float32(Float32(Float32(0.5) / s) - Float32(Float32(Float32(x * Float32(0.16666666666666666)) / s) / s)) / s)))))); else tmp = Float32(Float32(1.0) / Float32(Float32(1.0) + Float32(Float32(-1.0) / Float32(Float32(-1.0) + Float32(Float32(Float32(Float32(Float32(x * x) * Float32(-0.5)) / s) - x) / s))))); end return tmp end
function tmp_2 = code(x, s) tmp = single(0.0); if (x <= single(-1.0000000195414814e-25)) tmp = single(1.0) / (single(2.0) + (x * ((single(-1.0) / s) + (x * (((single(0.5) / s) - (((x * single(0.16666666666666666)) / s) / s)) / s))))); else tmp = single(1.0) / (single(1.0) + (single(-1.0) / (single(-1.0) + (((((x * x) * single(-0.5)) / s) - x) / s)))); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.0000000195414814 \cdot 10^{-25}:\\
\;\;\;\;\frac{1}{2 + x \cdot \left(\frac{-1}{s} + x \cdot \frac{\frac{0.5}{s} - \frac{\frac{x \cdot 0.16666666666666666}{s}}{s}}{s}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{1 + \frac{-1}{-1 + \frac{\frac{\left(x \cdot x\right) \cdot -0.5}{s} - x}{s}}}\\
\end{array}
\end{array}
if x < -1.00000002e-25Initial program 99.8%
Taylor expanded in x around 0
Simplified86.6%
+-commutativeN/A
div-invN/A
fma-defineN/A
associate-*r/N/A
associate-/l/N/A
remove-double-negN/A
distribute-frac-neg2N/A
fmm-undefN/A
div-invN/A
--lowering--.f32N/A
/-lowering-/.f32N/A
*-lowering-*.f32N/A
/-lowering-/.f32N/A
/-lowering-/.f32N/A
*-commutativeN/A
*-lowering-*.f32N/A
*-lowering-*.f32N/A
neg-lowering-neg.f3290.0%
Applied egg-rr90.0%
associate-/r*N/A
distribute-frac-neg2N/A
distribute-frac-negN/A
sub-divN/A
/-lowering-/.f32N/A
--lowering--.f32N/A
/-lowering-/.f32N/A
associate-/r*N/A
distribute-frac-negN/A
distribute-frac-neg2N/A
/-lowering-/.f32N/A
frac-2negN/A
remove-double-negN/A
/-lowering-/.f32N/A
distribute-rgt-neg-inN/A
*-lowering-*.f32N/A
metadata-eval90.0%
Applied egg-rr90.0%
if -1.00000002e-25 < x Initial program 99.9%
metadata-evalN/A
associate--r-N/A
unsub-negN/A
associate--r+N/A
metadata-evalN/A
--lowering--.f32N/A
distribute-frac-negN/A
exp-negN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f32N/A
exp-lowering-exp.f32N/A
/-lowering-/.f3299.9%
Applied egg-rr99.9%
Taylor expanded in s around -inf
mul-1-negN/A
unsub-negN/A
--lowering--.f32N/A
/-lowering-/.f32N/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f32N/A
associate-*r/N/A
*-commutativeN/A
metadata-evalN/A
distribute-rgt-outN/A
/-lowering-/.f32N/A
distribute-rgt-outN/A
metadata-evalN/A
*-lowering-*.f32N/A
unpow2N/A
*-lowering-*.f3295.5%
Simplified95.5%
Final simplification93.2%
(FPCore (x s)
:precision binary32
(if (<= x -1.0000000195414814e-25)
(/
1.0
(+
2.0
(*
x
(+
(/ -1.0 s)
(* x (/ (+ 0.5 (/ (* x -0.16666666666666666) s)) (* s s)))))))
(/ 1.0 (+ 1.0 (/ -1.0 (+ -1.0 (/ (- (/ (* (* x x) -0.5) s) x) s)))))))
float code(float x, float s) {
float tmp;
if (x <= -1.0000000195414814e-25f) {
tmp = 1.0f / (2.0f + (x * ((-1.0f / s) + (x * ((0.5f + ((x * -0.16666666666666666f) / s)) / (s * s))))));
} else {
tmp = 1.0f / (1.0f + (-1.0f / (-1.0f + (((((x * x) * -0.5f) / s) - 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.0000000195414814e-25)) then
tmp = 1.0e0 / (2.0e0 + (x * (((-1.0e0) / s) + (x * ((0.5e0 + ((x * (-0.16666666666666666e0)) / s)) / (s * s))))))
else
tmp = 1.0e0 / (1.0e0 + ((-1.0e0) / ((-1.0e0) + (((((x * x) * (-0.5e0)) / s) - x) / s))))
end if
code = tmp
end function
function code(x, s) tmp = Float32(0.0) if (x <= Float32(-1.0000000195414814e-25)) tmp = Float32(Float32(1.0) / Float32(Float32(2.0) + Float32(x * Float32(Float32(Float32(-1.0) / s) + Float32(x * Float32(Float32(Float32(0.5) + Float32(Float32(x * Float32(-0.16666666666666666)) / s)) / Float32(s * s))))))); else tmp = Float32(Float32(1.0) / Float32(Float32(1.0) + Float32(Float32(-1.0) / Float32(Float32(-1.0) + Float32(Float32(Float32(Float32(Float32(x * x) * Float32(-0.5)) / s) - x) / s))))); end return tmp end
function tmp_2 = code(x, s) tmp = single(0.0); if (x <= single(-1.0000000195414814e-25)) tmp = single(1.0) / (single(2.0) + (x * ((single(-1.0) / s) + (x * ((single(0.5) + ((x * single(-0.16666666666666666)) / s)) / (s * s)))))); else tmp = single(1.0) / (single(1.0) + (single(-1.0) / (single(-1.0) + (((((x * x) * single(-0.5)) / s) - x) / s)))); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.0000000195414814 \cdot 10^{-25}:\\
\;\;\;\;\frac{1}{2 + x \cdot \left(\frac{-1}{s} + x \cdot \frac{0.5 + \frac{x \cdot -0.16666666666666666}{s}}{s \cdot s}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{1 + \frac{-1}{-1 + \frac{\frac{\left(x \cdot x\right) \cdot -0.5}{s} - x}{s}}}\\
\end{array}
\end{array}
if x < -1.00000002e-25Initial program 99.8%
Taylor expanded in x around 0
Simplified86.6%
Taylor expanded in s around inf
/-lowering-/.f32N/A
+-lowering-+.f32N/A
associate-*r/N/A
/-lowering-/.f32N/A
*-commutativeN/A
*-lowering-*.f32N/A
unpow2N/A
*-lowering-*.f3290.0%
Simplified90.0%
if -1.00000002e-25 < x Initial program 99.9%
metadata-evalN/A
associate--r-N/A
unsub-negN/A
associate--r+N/A
metadata-evalN/A
--lowering--.f32N/A
distribute-frac-negN/A
exp-negN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f32N/A
exp-lowering-exp.f32N/A
/-lowering-/.f3299.9%
Applied egg-rr99.9%
Taylor expanded in s around -inf
mul-1-negN/A
unsub-negN/A
--lowering--.f32N/A
/-lowering-/.f32N/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f32N/A
associate-*r/N/A
*-commutativeN/A
metadata-evalN/A
distribute-rgt-outN/A
/-lowering-/.f32N/A
distribute-rgt-outN/A
metadata-evalN/A
*-lowering-*.f32N/A
unpow2N/A
*-lowering-*.f3295.5%
Simplified95.5%
Final simplification93.2%
(FPCore (x s)
:precision binary32
(if (<= x -1.0000000195414814e-25)
(/
1.0
(+
2.0
(* x (+ (/ -1.0 s) (* x (* x (/ -0.16666666666666666 (* s (* s s)))))))))
(/ 1.0 (+ 1.0 (/ -1.0 (+ -1.0 (/ (- (/ (* (* x x) -0.5) s) x) s)))))))
float code(float x, float s) {
float tmp;
if (x <= -1.0000000195414814e-25f) {
tmp = 1.0f / (2.0f + (x * ((-1.0f / s) + (x * (x * (-0.16666666666666666f / (s * (s * s))))))));
} else {
tmp = 1.0f / (1.0f + (-1.0f / (-1.0f + (((((x * x) * -0.5f) / s) - 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.0000000195414814e-25)) then
tmp = 1.0e0 / (2.0e0 + (x * (((-1.0e0) / s) + (x * (x * ((-0.16666666666666666e0) / (s * (s * s))))))))
else
tmp = 1.0e0 / (1.0e0 + ((-1.0e0) / ((-1.0e0) + (((((x * x) * (-0.5e0)) / s) - x) / s))))
end if
code = tmp
end function
function code(x, s) tmp = Float32(0.0) if (x <= Float32(-1.0000000195414814e-25)) tmp = Float32(Float32(1.0) / Float32(Float32(2.0) + Float32(x * Float32(Float32(Float32(-1.0) / s) + Float32(x * Float32(x * Float32(Float32(-0.16666666666666666) / Float32(s * Float32(s * s))))))))); else tmp = Float32(Float32(1.0) / Float32(Float32(1.0) + Float32(Float32(-1.0) / Float32(Float32(-1.0) + Float32(Float32(Float32(Float32(Float32(x * x) * Float32(-0.5)) / s) - x) / s))))); end return tmp end
function tmp_2 = code(x, s) tmp = single(0.0); if (x <= single(-1.0000000195414814e-25)) tmp = single(1.0) / (single(2.0) + (x * ((single(-1.0) / s) + (x * (x * (single(-0.16666666666666666) / (s * (s * s)))))))); else tmp = single(1.0) / (single(1.0) + (single(-1.0) / (single(-1.0) + (((((x * x) * single(-0.5)) / s) - x) / s)))); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.0000000195414814 \cdot 10^{-25}:\\
\;\;\;\;\frac{1}{2 + x \cdot \left(\frac{-1}{s} + x \cdot \left(x \cdot \frac{-0.16666666666666666}{s \cdot \left(s \cdot s\right)}\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{1 + \frac{-1}{-1 + \frac{\frac{\left(x \cdot x\right) \cdot -0.5}{s} - x}{s}}}\\
\end{array}
\end{array}
if x < -1.00000002e-25Initial program 99.8%
Taylor expanded in x around 0
Simplified86.6%
Taylor expanded in x around inf
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
associate-*r/N/A
*-lowering-*.f32N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f32N/A
cube-multN/A
unpow2N/A
*-lowering-*.f32N/A
unpow2N/A
*-lowering-*.f3286.6%
Simplified86.6%
if -1.00000002e-25 < x Initial program 99.9%
metadata-evalN/A
associate--r-N/A
unsub-negN/A
associate--r+N/A
metadata-evalN/A
--lowering--.f32N/A
distribute-frac-negN/A
exp-negN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f32N/A
exp-lowering-exp.f32N/A
/-lowering-/.f3299.9%
Applied egg-rr99.9%
Taylor expanded in s around -inf
mul-1-negN/A
unsub-negN/A
--lowering--.f32N/A
/-lowering-/.f32N/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f32N/A
associate-*r/N/A
*-commutativeN/A
metadata-evalN/A
distribute-rgt-outN/A
/-lowering-/.f32N/A
distribute-rgt-outN/A
metadata-evalN/A
*-lowering-*.f32N/A
unpow2N/A
*-lowering-*.f3295.5%
Simplified95.5%
Final simplification91.8%
(FPCore (x s)
:precision binary32
(if (<= x -1.99999996490334e-14)
(/ 1.0 (/ (* x (* -0.16666666666666666 (* x x))) (* s (* s s))))
(if (<= x -1.0000000195414814e-25)
(/ 1.0 (+ 2.0 (* x (/ (- (* x 0.5) s) (* s s)))))
(/ 1.0 (+ 1.0 (/ -1.0 (- -1.0 (/ x s))))))))
float code(float x, float s) {
float tmp;
if (x <= -1.99999996490334e-14f) {
tmp = 1.0f / ((x * (-0.16666666666666666f * (x * x))) / (s * (s * s)));
} else if (x <= -1.0000000195414814e-25f) {
tmp = 1.0f / (2.0f + (x * (((x * 0.5f) - s) / (s * 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.99999996490334e-14)) then
tmp = 1.0e0 / ((x * ((-0.16666666666666666e0) * (x * x))) / (s * (s * s)))
else if (x <= (-1.0000000195414814e-25)) then
tmp = 1.0e0 / (2.0e0 + (x * (((x * 0.5e0) - s) / (s * 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.99999996490334e-14)) tmp = Float32(Float32(1.0) / Float32(Float32(x * Float32(Float32(-0.16666666666666666) * Float32(x * x))) / Float32(s * Float32(s * s)))); elseif (x <= Float32(-1.0000000195414814e-25)) tmp = Float32(Float32(1.0) / Float32(Float32(2.0) + Float32(x * Float32(Float32(Float32(x * Float32(0.5)) - s) / Float32(s * 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.99999996490334e-14)) tmp = single(1.0) / ((x * (single(-0.16666666666666666) * (x * x))) / (s * (s * s))); elseif (x <= single(-1.0000000195414814e-25)) tmp = single(1.0) / (single(2.0) + (x * (((x * single(0.5)) - s) / (s * 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.99999996490334 \cdot 10^{-14}:\\
\;\;\;\;\frac{1}{\frac{x \cdot \left(-0.16666666666666666 \cdot \left(x \cdot x\right)\right)}{s \cdot \left(s \cdot s\right)}}\\
\mathbf{elif}\;x \leq -1.0000000195414814 \cdot 10^{-25}:\\
\;\;\;\;\frac{1}{2 + x \cdot \frac{x \cdot 0.5 - s}{s \cdot s}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{1 + \frac{-1}{-1 - \frac{x}{s}}}\\
\end{array}
\end{array}
if x < -1.99999996e-14Initial program 100.0%
Taylor expanded in x around 0
Simplified88.2%
+-commutativeN/A
div-invN/A
fma-defineN/A
associate-*r/N/A
associate-/l/N/A
remove-double-negN/A
distribute-frac-neg2N/A
fmm-undefN/A
div-invN/A
--lowering--.f32N/A
/-lowering-/.f32N/A
*-lowering-*.f32N/A
/-lowering-/.f32N/A
/-lowering-/.f32N/A
*-commutativeN/A
*-lowering-*.f32N/A
*-lowering-*.f32N/A
neg-lowering-neg.f3287.2%
Applied egg-rr87.2%
distribute-lft-inN/A
frac-2negN/A
metadata-evalN/A
div-invN/A
associate-+r+N/A
distribute-frac-neg2N/A
unsub-negN/A
--lowering--.f32N/A
Applied egg-rr87.2%
Taylor expanded in x around inf
associate-*r/N/A
/-lowering-/.f32N/A
*-commutativeN/A
cube-multN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f32N/A
*-lowering-*.f32N/A
unpow2N/A
*-lowering-*.f32N/A
cube-multN/A
unpow2N/A
*-lowering-*.f32N/A
unpow2N/A
*-lowering-*.f3288.2%
Simplified88.2%
if -1.99999996e-14 < x < -1.00000002e-25Initial program 99.3%
Taylor expanded in x around 0
Simplified81.1%
Taylor expanded in x around 0
/-lowering-/.f32N/A
unpow2N/A
*-lowering-*.f3299.1%
Simplified99.1%
Taylor expanded in s around 0
/-lowering-/.f32N/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f32N/A
*-lowering-*.f32N/A
unpow2N/A
*-lowering-*.f3295.4%
Simplified95.4%
if -1.00000002e-25 < x Initial program 99.9%
metadata-evalN/A
associate--r-N/A
unsub-negN/A
associate--r+N/A
metadata-evalN/A
--lowering--.f32N/A
distribute-frac-negN/A
exp-negN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f32N/A
exp-lowering-exp.f32N/A
/-lowering-/.f3299.9%
Applied egg-rr99.9%
Taylor expanded in x around 0
+-commutativeN/A
+-lowering-+.f32N/A
/-lowering-/.f3293.8%
Simplified93.8%
Final simplification92.2%
(FPCore (x s)
:precision binary32
(if (<= x -1.99999996490334e-14)
(/ (* (* s (* s s)) -6.0) (* x (* x x)))
(if (<= x -1.0000000195414814e-25)
(/ 1.0 (+ 2.0 (* x (/ (- (* x 0.5) s) (* s s)))))
(/ 1.0 (+ 1.0 (/ -1.0 (- -1.0 (/ x s))))))))
float code(float x, float s) {
float tmp;
if (x <= -1.99999996490334e-14f) {
tmp = ((s * (s * s)) * -6.0f) / (x * (x * x));
} else if (x <= -1.0000000195414814e-25f) {
tmp = 1.0f / (2.0f + (x * (((x * 0.5f) - s) / (s * 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.99999996490334e-14)) then
tmp = ((s * (s * s)) * (-6.0e0)) / (x * (x * x))
else if (x <= (-1.0000000195414814e-25)) then
tmp = 1.0e0 / (2.0e0 + (x * (((x * 0.5e0) - s) / (s * 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.99999996490334e-14)) tmp = Float32(Float32(Float32(s * Float32(s * s)) * Float32(-6.0)) / Float32(x * Float32(x * x))); elseif (x <= Float32(-1.0000000195414814e-25)) tmp = Float32(Float32(1.0) / Float32(Float32(2.0) + Float32(x * Float32(Float32(Float32(x * Float32(0.5)) - s) / Float32(s * 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.99999996490334e-14)) tmp = ((s * (s * s)) * single(-6.0)) / (x * (x * x)); elseif (x <= single(-1.0000000195414814e-25)) tmp = single(1.0) / (single(2.0) + (x * (((x * single(0.5)) - s) / (s * 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.99999996490334 \cdot 10^{-14}:\\
\;\;\;\;\frac{\left(s \cdot \left(s \cdot s\right)\right) \cdot -6}{x \cdot \left(x \cdot x\right)}\\
\mathbf{elif}\;x \leq -1.0000000195414814 \cdot 10^{-25}:\\
\;\;\;\;\frac{1}{2 + x \cdot \frac{x \cdot 0.5 - s}{s \cdot s}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{1 + \frac{-1}{-1 - \frac{x}{s}}}\\
\end{array}
\end{array}
if x < -1.99999996e-14Initial program 100.0%
Taylor expanded in x around 0
Simplified88.2%
Taylor expanded in x around inf
associate-*r/N/A
/-lowering-/.f32N/A
*-commutativeN/A
*-lowering-*.f32N/A
cube-multN/A
unpow2N/A
*-lowering-*.f32N/A
unpow2N/A
*-lowering-*.f32N/A
cube-multN/A
unpow2N/A
*-lowering-*.f32N/A
unpow2N/A
*-lowering-*.f3288.2%
Simplified88.2%
if -1.99999996e-14 < x < -1.00000002e-25Initial program 99.3%
Taylor expanded in x around 0
Simplified81.1%
Taylor expanded in x around 0
/-lowering-/.f32N/A
unpow2N/A
*-lowering-*.f3299.1%
Simplified99.1%
Taylor expanded in s around 0
/-lowering-/.f32N/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f32N/A
*-lowering-*.f32N/A
unpow2N/A
*-lowering-*.f3295.4%
Simplified95.4%
if -1.00000002e-25 < x Initial program 99.9%
metadata-evalN/A
associate--r-N/A
unsub-negN/A
associate--r+N/A
metadata-evalN/A
--lowering--.f32N/A
distribute-frac-negN/A
exp-negN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f32N/A
exp-lowering-exp.f32N/A
/-lowering-/.f3299.9%
Applied egg-rr99.9%
Taylor expanded in x around 0
+-commutativeN/A
+-lowering-+.f32N/A
/-lowering-/.f3293.8%
Simplified93.8%
Final simplification92.2%
(FPCore (x s) :precision binary32 (if (<= x -1.0000000195414814e-25) (/ 1.0 (+ 2.0 (* x (+ (/ -1.0 s) (* x (/ 0.5 (* s s))))))) (/ 1.0 (+ 1.0 (/ -1.0 (+ -1.0 (/ (- (/ (* (* x x) -0.5) s) x) s)))))))
float code(float x, float s) {
float tmp;
if (x <= -1.0000000195414814e-25f) {
tmp = 1.0f / (2.0f + (x * ((-1.0f / s) + (x * (0.5f / (s * s))))));
} else {
tmp = 1.0f / (1.0f + (-1.0f / (-1.0f + (((((x * x) * -0.5f) / s) - 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.0000000195414814e-25)) then
tmp = 1.0e0 / (2.0e0 + (x * (((-1.0e0) / s) + (x * (0.5e0 / (s * s))))))
else
tmp = 1.0e0 / (1.0e0 + ((-1.0e0) / ((-1.0e0) + (((((x * x) * (-0.5e0)) / s) - x) / s))))
end if
code = tmp
end function
function code(x, s) tmp = Float32(0.0) if (x <= Float32(-1.0000000195414814e-25)) tmp = Float32(Float32(1.0) / Float32(Float32(2.0) + Float32(x * Float32(Float32(Float32(-1.0) / s) + Float32(x * Float32(Float32(0.5) / Float32(s * s))))))); else tmp = Float32(Float32(1.0) / Float32(Float32(1.0) + Float32(Float32(-1.0) / Float32(Float32(-1.0) + Float32(Float32(Float32(Float32(Float32(x * x) * Float32(-0.5)) / s) - x) / s))))); end return tmp end
function tmp_2 = code(x, s) tmp = single(0.0); if (x <= single(-1.0000000195414814e-25)) tmp = single(1.0) / (single(2.0) + (x * ((single(-1.0) / s) + (x * (single(0.5) / (s * s)))))); else tmp = single(1.0) / (single(1.0) + (single(-1.0) / (single(-1.0) + (((((x * x) * single(-0.5)) / s) - x) / s)))); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.0000000195414814 \cdot 10^{-25}:\\
\;\;\;\;\frac{1}{2 + x \cdot \left(\frac{-1}{s} + x \cdot \frac{0.5}{s \cdot s}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{1 + \frac{-1}{-1 + \frac{\frac{\left(x \cdot x\right) \cdot -0.5}{s} - x}{s}}}\\
\end{array}
\end{array}
if x < -1.00000002e-25Initial program 99.8%
Taylor expanded in x around 0
Simplified86.6%
Taylor expanded in x around 0
/-lowering-/.f32N/A
unpow2N/A
*-lowering-*.f3284.2%
Simplified84.2%
if -1.00000002e-25 < x Initial program 99.9%
metadata-evalN/A
associate--r-N/A
unsub-negN/A
associate--r+N/A
metadata-evalN/A
--lowering--.f32N/A
distribute-frac-negN/A
exp-negN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f32N/A
exp-lowering-exp.f32N/A
/-lowering-/.f3299.9%
Applied egg-rr99.9%
Taylor expanded in s around -inf
mul-1-negN/A
unsub-negN/A
--lowering--.f32N/A
/-lowering-/.f32N/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f32N/A
associate-*r/N/A
*-commutativeN/A
metadata-evalN/A
distribute-rgt-outN/A
/-lowering-/.f32N/A
distribute-rgt-outN/A
metadata-evalN/A
*-lowering-*.f32N/A
unpow2N/A
*-lowering-*.f3295.5%
Simplified95.5%
Final simplification90.8%
(FPCore (x s)
:precision binary32
(if (<= x -1.99999996490334e-14)
(/ (* (* s (* s s)) -6.0) (* x (* x x)))
(if (<= x -1.0000000195414814e-25)
(/ 1.0 (+ 2.0 (* x (/ (* x 0.5) (* s s)))))
(/ 1.0 (+ 1.0 (/ -1.0 (- -1.0 (/ x s))))))))
float code(float x, float s) {
float tmp;
if (x <= -1.99999996490334e-14f) {
tmp = ((s * (s * s)) * -6.0f) / (x * (x * x));
} else if (x <= -1.0000000195414814e-25f) {
tmp = 1.0f / (2.0f + (x * ((x * 0.5f) / (s * 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.99999996490334e-14)) then
tmp = ((s * (s * s)) * (-6.0e0)) / (x * (x * x))
else if (x <= (-1.0000000195414814e-25)) then
tmp = 1.0e0 / (2.0e0 + (x * ((x * 0.5e0) / (s * 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.99999996490334e-14)) tmp = Float32(Float32(Float32(s * Float32(s * s)) * Float32(-6.0)) / Float32(x * Float32(x * x))); elseif (x <= Float32(-1.0000000195414814e-25)) tmp = Float32(Float32(1.0) / Float32(Float32(2.0) + Float32(x * Float32(Float32(x * Float32(0.5)) / Float32(s * 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.99999996490334e-14)) tmp = ((s * (s * s)) * single(-6.0)) / (x * (x * x)); elseif (x <= single(-1.0000000195414814e-25)) tmp = single(1.0) / (single(2.0) + (x * ((x * single(0.5)) / (s * 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.99999996490334 \cdot 10^{-14}:\\
\;\;\;\;\frac{\left(s \cdot \left(s \cdot s\right)\right) \cdot -6}{x \cdot \left(x \cdot x\right)}\\
\mathbf{elif}\;x \leq -1.0000000195414814 \cdot 10^{-25}:\\
\;\;\;\;\frac{1}{2 + x \cdot \frac{x \cdot 0.5}{s \cdot s}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{1 + \frac{-1}{-1 - \frac{x}{s}}}\\
\end{array}
\end{array}
if x < -1.99999996e-14Initial program 100.0%
Taylor expanded in x around 0
Simplified88.2%
Taylor expanded in x around inf
associate-*r/N/A
/-lowering-/.f32N/A
*-commutativeN/A
*-lowering-*.f32N/A
cube-multN/A
unpow2N/A
*-lowering-*.f32N/A
unpow2N/A
*-lowering-*.f32N/A
cube-multN/A
unpow2N/A
*-lowering-*.f32N/A
unpow2N/A
*-lowering-*.f3288.2%
Simplified88.2%
if -1.99999996e-14 < x < -1.00000002e-25Initial program 99.3%
Taylor expanded in x around 0
Simplified81.1%
Taylor expanded in x around 0
/-lowering-/.f32N/A
unpow2N/A
*-lowering-*.f3299.1%
Simplified99.1%
Taylor expanded in x around inf
associate-*r/N/A
/-lowering-/.f32N/A
*-lowering-*.f32N/A
unpow2N/A
*-lowering-*.f3291.3%
Simplified91.3%
if -1.00000002e-25 < x Initial program 99.9%
metadata-evalN/A
associate--r-N/A
unsub-negN/A
associate--r+N/A
metadata-evalN/A
--lowering--.f32N/A
distribute-frac-negN/A
exp-negN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f32N/A
exp-lowering-exp.f32N/A
/-lowering-/.f3299.9%
Applied egg-rr99.9%
Taylor expanded in x around 0
+-commutativeN/A
+-lowering-+.f32N/A
/-lowering-/.f3293.8%
Simplified93.8%
Final simplification91.8%
(FPCore (x s)
:precision binary32
(if (<= x -1.99999996490334e-14)
(/ (* s (* (* s s) -6.0)) (* x (* x x)))
(if (<= x -1.0000000195414814e-25)
(/ 1.0 (+ 2.0 (* x (/ (* x 0.5) (* s s)))))
(/ 1.0 (+ 1.0 (/ -1.0 (- -1.0 (/ x s))))))))
float code(float x, float s) {
float tmp;
if (x <= -1.99999996490334e-14f) {
tmp = (s * ((s * s) * -6.0f)) / (x * (x * x));
} else if (x <= -1.0000000195414814e-25f) {
tmp = 1.0f / (2.0f + (x * ((x * 0.5f) / (s * 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.99999996490334e-14)) then
tmp = (s * ((s * s) * (-6.0e0))) / (x * (x * x))
else if (x <= (-1.0000000195414814e-25)) then
tmp = 1.0e0 / (2.0e0 + (x * ((x * 0.5e0) / (s * 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.99999996490334e-14)) tmp = Float32(Float32(s * Float32(Float32(s * s) * Float32(-6.0))) / Float32(x * Float32(x * x))); elseif (x <= Float32(-1.0000000195414814e-25)) tmp = Float32(Float32(1.0) / Float32(Float32(2.0) + Float32(x * Float32(Float32(x * Float32(0.5)) / Float32(s * 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.99999996490334e-14)) tmp = (s * ((s * s) * single(-6.0))) / (x * (x * x)); elseif (x <= single(-1.0000000195414814e-25)) tmp = single(1.0) / (single(2.0) + (x * ((x * single(0.5)) / (s * 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.99999996490334 \cdot 10^{-14}:\\
\;\;\;\;\frac{s \cdot \left(\left(s \cdot s\right) \cdot -6\right)}{x \cdot \left(x \cdot x\right)}\\
\mathbf{elif}\;x \leq -1.0000000195414814 \cdot 10^{-25}:\\
\;\;\;\;\frac{1}{2 + x \cdot \frac{x \cdot 0.5}{s \cdot s}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{1 + \frac{-1}{-1 - \frac{x}{s}}}\\
\end{array}
\end{array}
if x < -1.99999996e-14Initial program 100.0%
Taylor expanded in x around 0
Simplified88.2%
+-commutativeN/A
div-invN/A
fma-defineN/A
associate-*r/N/A
associate-/l/N/A
remove-double-negN/A
distribute-frac-neg2N/A
fmm-undefN/A
div-invN/A
--lowering--.f32N/A
/-lowering-/.f32N/A
*-lowering-*.f32N/A
/-lowering-/.f32N/A
/-lowering-/.f32N/A
*-commutativeN/A
*-lowering-*.f32N/A
*-lowering-*.f32N/A
neg-lowering-neg.f3287.2%
Applied egg-rr87.2%
Taylor expanded in x around inf
associate-*r/N/A
/-lowering-/.f32N/A
*-commutativeN/A
cube-multN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f32N/A
*-lowering-*.f32N/A
unpow2N/A
*-lowering-*.f32N/A
cube-multN/A
unpow2N/A
*-lowering-*.f32N/A
unpow2N/A
*-lowering-*.f3287.1%
Simplified87.1%
if -1.99999996e-14 < x < -1.00000002e-25Initial program 99.3%
Taylor expanded in x around 0
Simplified81.1%
Taylor expanded in x around 0
/-lowering-/.f32N/A
unpow2N/A
*-lowering-*.f3299.1%
Simplified99.1%
Taylor expanded in x around inf
associate-*r/N/A
/-lowering-/.f32N/A
*-lowering-*.f32N/A
unpow2N/A
*-lowering-*.f3291.3%
Simplified91.3%
if -1.00000002e-25 < x Initial program 99.9%
metadata-evalN/A
associate--r-N/A
unsub-negN/A
associate--r+N/A
metadata-evalN/A
--lowering--.f32N/A
distribute-frac-negN/A
exp-negN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f32N/A
exp-lowering-exp.f32N/A
/-lowering-/.f3299.9%
Applied egg-rr99.9%
Taylor expanded in x around 0
+-commutativeN/A
+-lowering-+.f32N/A
/-lowering-/.f3293.8%
Simplified93.8%
Final simplification91.4%
(FPCore (x s) :precision binary32 (if (<= x -1.0000000195414814e-25) (/ 1.0 (+ 2.0 (* x (+ (/ -1.0 s) (* x (/ 0.5 (* s s))))))) (/ 1.0 (+ 1.0 (/ -1.0 (- -1.0 (/ x s)))))))
float code(float x, float s) {
float tmp;
if (x <= -1.0000000195414814e-25f) {
tmp = 1.0f / (2.0f + (x * ((-1.0f / s) + (x * (0.5f / (s * 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.0000000195414814e-25)) then
tmp = 1.0e0 / (2.0e0 + (x * (((-1.0e0) / s) + (x * (0.5e0 / (s * 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.0000000195414814e-25)) tmp = Float32(Float32(1.0) / Float32(Float32(2.0) + Float32(x * Float32(Float32(Float32(-1.0) / s) + Float32(x * Float32(Float32(0.5) / Float32(s * 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.0000000195414814e-25)) tmp = single(1.0) / (single(2.0) + (x * ((single(-1.0) / s) + (x * (single(0.5) / (s * 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.0000000195414814 \cdot 10^{-25}:\\
\;\;\;\;\frac{1}{2 + x \cdot \left(\frac{-1}{s} + x \cdot \frac{0.5}{s \cdot s}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{1 + \frac{-1}{-1 - \frac{x}{s}}}\\
\end{array}
\end{array}
if x < -1.00000002e-25Initial program 99.8%
Taylor expanded in x around 0
Simplified86.6%
Taylor expanded in x around 0
/-lowering-/.f32N/A
unpow2N/A
*-lowering-*.f3284.2%
Simplified84.2%
if -1.00000002e-25 < x Initial program 99.9%
metadata-evalN/A
associate--r-N/A
unsub-negN/A
associate--r+N/A
metadata-evalN/A
--lowering--.f32N/A
distribute-frac-negN/A
exp-negN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f32N/A
exp-lowering-exp.f32N/A
/-lowering-/.f3299.9%
Applied egg-rr99.9%
Taylor expanded in x around 0
+-commutativeN/A
+-lowering-+.f32N/A
/-lowering-/.f3293.8%
Simplified93.8%
Final simplification89.8%
(FPCore (x s) :precision binary32 (if (<= x -1.0000000195414814e-25) (/ 1.0 (+ 2.0 (* x (/ (* x 0.5) (* s s))))) (/ 1.0 (+ 1.0 (/ -1.0 (- -1.0 (/ x s)))))))
float code(float x, float s) {
float tmp;
if (x <= -1.0000000195414814e-25f) {
tmp = 1.0f / (2.0f + (x * ((x * 0.5f) / (s * 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.0000000195414814e-25)) then
tmp = 1.0e0 / (2.0e0 + (x * ((x * 0.5e0) / (s * 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.0000000195414814e-25)) tmp = Float32(Float32(1.0) / Float32(Float32(2.0) + Float32(x * Float32(Float32(x * Float32(0.5)) / Float32(s * 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.0000000195414814e-25)) tmp = single(1.0) / (single(2.0) + (x * ((x * single(0.5)) / (s * 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.0000000195414814 \cdot 10^{-25}:\\
\;\;\;\;\frac{1}{2 + x \cdot \frac{x \cdot 0.5}{s \cdot s}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{1 + \frac{-1}{-1 - \frac{x}{s}}}\\
\end{array}
\end{array}
if x < -1.00000002e-25Initial program 99.8%
Taylor expanded in x around 0
Simplified86.6%
Taylor expanded in x around 0
/-lowering-/.f32N/A
unpow2N/A
*-lowering-*.f3284.2%
Simplified84.2%
Taylor expanded in x around inf
associate-*r/N/A
/-lowering-/.f32N/A
*-lowering-*.f32N/A
unpow2N/A
*-lowering-*.f3280.6%
Simplified80.6%
if -1.00000002e-25 < x Initial program 99.9%
metadata-evalN/A
associate--r-N/A
unsub-negN/A
associate--r+N/A
metadata-evalN/A
--lowering--.f32N/A
distribute-frac-negN/A
exp-negN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f32N/A
exp-lowering-exp.f32N/A
/-lowering-/.f3299.9%
Applied egg-rr99.9%
Taylor expanded in x around 0
+-commutativeN/A
+-lowering-+.f32N/A
/-lowering-/.f3293.8%
Simplified93.8%
Final simplification88.3%
(FPCore (x s) :precision binary32 (if (<= x -1.000000031374395e-22) (/ (/ (* 2.0 (* s s)) x) x) (/ 1.0 (+ 1.0 (/ -1.0 (- -1.0 (/ x s)))))))
float code(float x, float s) {
float tmp;
if (x <= -1.000000031374395e-22f) {
tmp = ((2.0f * (s * s)) / x) / x;
} 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.000000031374395e-22)) then
tmp = ((2.0e0 * (s * s)) / x) / x
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.000000031374395e-22)) tmp = Float32(Float32(Float32(Float32(2.0) * Float32(s * s)) / x) / x); 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.000000031374395e-22)) tmp = ((single(2.0) * (s * s)) / x) / x; 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.000000031374395 \cdot 10^{-22}:\\
\;\;\;\;\frac{\frac{2 \cdot \left(s \cdot s\right)}{x}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{1 + \frac{-1}{-1 - \frac{x}{s}}}\\
\end{array}
\end{array}
if x < -1.00000003e-22Initial program 99.9%
Taylor expanded in x around 0
Simplified88.3%
Taylor expanded in x around 0
/-lowering-/.f32N/A
unpow2N/A
*-lowering-*.f3283.0%
Simplified83.0%
Taylor expanded in x around inf
associate-*r/N/A
unpow2N/A
associate-/r*N/A
*-commutativeN/A
associate-*r/N/A
metadata-evalN/A
associate-*r/N/A
/-lowering-/.f32N/A
associate-*r/N/A
metadata-evalN/A
associate-*r/N/A
*-commutativeN/A
/-lowering-/.f32N/A
*-lowering-*.f32N/A
unpow2N/A
*-lowering-*.f3273.5%
Simplified73.5%
if -1.00000003e-22 < x Initial program 99.9%
metadata-evalN/A
associate--r-N/A
unsub-negN/A
associate--r+N/A
metadata-evalN/A
--lowering--.f32N/A
distribute-frac-negN/A
exp-negN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f32N/A
exp-lowering-exp.f32N/A
/-lowering-/.f3299.9%
Applied egg-rr99.9%
Taylor expanded in x around 0
+-commutativeN/A
+-lowering-+.f32N/A
/-lowering-/.f3292.3%
Simplified92.3%
Final simplification85.0%
(FPCore (x s) :precision binary32 (if (<= x -1.000000031374395e-22) (/ (/ (* 2.0 (* s s)) x) x) 0.5))
float code(float x, float s) {
float tmp;
if (x <= -1.000000031374395e-22f) {
tmp = ((2.0f * (s * s)) / x) / 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.000000031374395e-22)) then
tmp = ((2.0e0 * (s * s)) / x) / x
else
tmp = 0.5e0
end if
code = tmp
end function
function code(x, s) tmp = Float32(0.0) if (x <= Float32(-1.000000031374395e-22)) tmp = Float32(Float32(Float32(Float32(2.0) * Float32(s * s)) / x) / x); else tmp = Float32(0.5); end return tmp end
function tmp_2 = code(x, s) tmp = single(0.0); if (x <= single(-1.000000031374395e-22)) tmp = ((single(2.0) * (s * s)) / x) / x; else tmp = single(0.5); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.000000031374395 \cdot 10^{-22}:\\
\;\;\;\;\frac{\frac{2 \cdot \left(s \cdot s\right)}{x}}{x}\\
\mathbf{else}:\\
\;\;\;\;0.5\\
\end{array}
\end{array}
if x < -1.00000003e-22Initial program 99.9%
Taylor expanded in x around 0
Simplified88.3%
Taylor expanded in x around 0
/-lowering-/.f32N/A
unpow2N/A
*-lowering-*.f3283.0%
Simplified83.0%
Taylor expanded in x around inf
associate-*r/N/A
unpow2N/A
associate-/r*N/A
*-commutativeN/A
associate-*r/N/A
metadata-evalN/A
associate-*r/N/A
/-lowering-/.f32N/A
associate-*r/N/A
metadata-evalN/A
associate-*r/N/A
*-commutativeN/A
/-lowering-/.f32N/A
*-lowering-*.f32N/A
unpow2N/A
*-lowering-*.f3273.5%
Simplified73.5%
if -1.00000003e-22 < x Initial program 99.9%
Taylor expanded in x around 0
Simplified49.3%
(FPCore (x s) :precision binary32 (if (<= x -1.000000031374395e-22) (/ (* s (* s -2.0)) (* x x)) 0.5))
float code(float x, float s) {
float tmp;
if (x <= -1.000000031374395e-22f) {
tmp = (s * (s * -2.0f)) / (x * 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.000000031374395e-22)) then
tmp = (s * (s * (-2.0e0))) / (x * x)
else
tmp = 0.5e0
end if
code = tmp
end function
function code(x, s) tmp = Float32(0.0) if (x <= Float32(-1.000000031374395e-22)) tmp = Float32(Float32(s * Float32(s * Float32(-2.0))) / Float32(x * x)); else tmp = Float32(0.5); end return tmp end
function tmp_2 = code(x, s) tmp = single(0.0); if (x <= single(-1.000000031374395e-22)) tmp = (s * (s * single(-2.0))) / (x * x); else tmp = single(0.5); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.000000031374395 \cdot 10^{-22}:\\
\;\;\;\;\frac{s \cdot \left(s \cdot -2\right)}{x \cdot x}\\
\mathbf{else}:\\
\;\;\;\;0.5\\
\end{array}
\end{array}
if x < -1.00000003e-22Initial program 99.9%
Taylor expanded in x around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f32N/A
/-lowering-/.f3242.3%
Simplified42.3%
Taylor expanded in x around inf
+-commutativeN/A
metadata-evalN/A
cancel-sign-sub-invN/A
/-lowering-/.f32N/A
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f32N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f32N/A
metadata-evalN/A
*-commutativeN/A
*-lowering-*.f32N/A
unpow2N/A
*-lowering-*.f3232.0%
Simplified32.0%
Taylor expanded in s around inf
associate-*r/N/A
/-lowering-/.f32N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f32N/A
*-commutativeN/A
*-lowering-*.f32N/A
unpow2N/A
*-lowering-*.f3272.8%
Simplified72.8%
if -1.00000003e-22 < x Initial program 99.9%
Taylor expanded in x around 0
Simplified49.3%
(FPCore (x s) :precision binary32 (if (<= x -1.000000031374395e-22) (* -2.0 (/ (/ (* s s) x) x)) 0.5))
float code(float x, float s) {
float tmp;
if (x <= -1.000000031374395e-22f) {
tmp = -2.0f * (((s * s) / x) / 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.000000031374395e-22)) then
tmp = (-2.0e0) * (((s * s) / x) / x)
else
tmp = 0.5e0
end if
code = tmp
end function
function code(x, s) tmp = Float32(0.0) if (x <= Float32(-1.000000031374395e-22)) tmp = Float32(Float32(-2.0) * Float32(Float32(Float32(s * s) / x) / x)); else tmp = Float32(0.5); end return tmp end
function tmp_2 = code(x, s) tmp = single(0.0); if (x <= single(-1.000000031374395e-22)) tmp = single(-2.0) * (((s * s) / x) / x); else tmp = single(0.5); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.000000031374395 \cdot 10^{-22}:\\
\;\;\;\;-2 \cdot \frac{\frac{s \cdot s}{x}}{x}\\
\mathbf{else}:\\
\;\;\;\;0.5\\
\end{array}
\end{array}
if x < -1.00000003e-22Initial program 99.9%
Taylor expanded in x around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f32N/A
/-lowering-/.f3242.3%
Simplified42.3%
Taylor expanded in x around inf
+-commutativeN/A
metadata-evalN/A
cancel-sign-sub-invN/A
/-lowering-/.f32N/A
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f32N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f32N/A
metadata-evalN/A
*-commutativeN/A
*-lowering-*.f32N/A
unpow2N/A
*-lowering-*.f3232.0%
Simplified32.0%
sub-negN/A
associate-*l*N/A
associate-/l*N/A
neg-mul-1N/A
*-commutativeN/A
distribute-lft-outN/A
*-lowering-*.f32N/A
+-lowering-+.f32N/A
div-invN/A
associate-*r*N/A
div-invN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f32N/A
/-lowering-/.f3232.0%
Applied egg-rr32.0%
Taylor expanded in s around inf
*-lowering-*.f32N/A
unpow2N/A
associate-/r*N/A
/-lowering-/.f32N/A
/-lowering-/.f32N/A
unpow2N/A
*-lowering-*.f3272.7%
Simplified72.7%
if -1.00000003e-22 < x Initial program 99.9%
Taylor expanded in x around 0
Simplified49.3%
(FPCore (x s) :precision binary32 (if (<= x 1.9999999593223797e-31) (/ 1.0 (- 2.0 (/ x s))) 0.5))
float code(float x, float s) {
float tmp;
if (x <= 1.9999999593223797e-31f) {
tmp = 1.0f / (2.0f - (x / s));
} 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.9999999593223797e-31) then
tmp = 1.0e0 / (2.0e0 - (x / s))
else
tmp = 0.5e0
end if
code = tmp
end function
function code(x, s) tmp = Float32(0.0) if (x <= Float32(1.9999999593223797e-31)) tmp = Float32(Float32(1.0) / Float32(Float32(2.0) - Float32(x / s))); else tmp = Float32(0.5); end return tmp end
function tmp_2 = code(x, s) tmp = single(0.0); if (x <= single(1.9999999593223797e-31)) tmp = single(1.0) / (single(2.0) - (x / s)); else tmp = single(0.5); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.9999999593223797 \cdot 10^{-31}:\\
\;\;\;\;\frac{1}{2 - \frac{x}{s}}\\
\mathbf{else}:\\
\;\;\;\;0.5\\
\end{array}
\end{array}
if x < 1.99999996e-31Initial program 99.8%
Taylor expanded in x around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f32N/A
/-lowering-/.f3254.2%
Simplified54.2%
if 1.99999996e-31 < x Initial program 100.0%
Taylor expanded in x around 0
Simplified38.5%
(FPCore (x s) :precision binary32 (if (<= x -1.99999996490334e-14) (/ -1.0 (/ x s)) 0.5))
float code(float x, float s) {
float tmp;
if (x <= -1.99999996490334e-14f) {
tmp = -1.0f / (x / s);
} 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.99999996490334e-14)) then
tmp = (-1.0e0) / (x / s)
else
tmp = 0.5e0
end if
code = tmp
end function
function code(x, s) tmp = Float32(0.0) if (x <= Float32(-1.99999996490334e-14)) tmp = Float32(Float32(-1.0) / Float32(x / s)); else tmp = Float32(0.5); end return tmp end
function tmp_2 = code(x, s) tmp = single(0.0); if (x <= single(-1.99999996490334e-14)) tmp = single(-1.0) / (x / s); else tmp = single(0.5); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.99999996490334 \cdot 10^{-14}:\\
\;\;\;\;\frac{-1}{\frac{x}{s}}\\
\mathbf{else}:\\
\;\;\;\;0.5\\
\end{array}
\end{array}
if x < -1.99999996e-14Initial program 100.0%
Taylor expanded in x around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f32N/A
/-lowering-/.f3241.9%
Simplified41.9%
Taylor expanded in x around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f32N/A
/-lowering-/.f3237.4%
Simplified37.4%
sub0-negN/A
clear-numN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f32N/A
/-lowering-/.f3241.9%
Applied egg-rr41.9%
if -1.99999996e-14 < x Initial program 99.8%
Taylor expanded in x around 0
Simplified48.4%
(FPCore (x s) :precision binary32 (if (<= x -1.99999996490334e-14) (/ s (- x)) 0.5))
float code(float x, float s) {
float tmp;
if (x <= -1.99999996490334e-14f) {
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.99999996490334e-14)) 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.99999996490334e-14)) tmp = Float32(s / Float32(-x)); else tmp = Float32(0.5); end return tmp end
function tmp_2 = code(x, s) tmp = single(0.0); if (x <= single(-1.99999996490334e-14)) tmp = s / -x; else tmp = single(0.5); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.99999996490334 \cdot 10^{-14}:\\
\;\;\;\;\frac{s}{-x}\\
\mathbf{else}:\\
\;\;\;\;0.5\\
\end{array}
\end{array}
if x < -1.99999996e-14Initial program 100.0%
Taylor expanded in x around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f32N/A
/-lowering-/.f3241.9%
Simplified41.9%
Taylor expanded in x around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f32N/A
/-lowering-/.f3237.4%
Simplified37.4%
sub0-negN/A
distribute-frac-negN/A
/-lowering-/.f32N/A
neg-lowering-neg.f3237.4%
Applied egg-rr37.4%
if -1.99999996e-14 < x Initial program 99.8%
Taylor expanded in x around 0
Simplified48.4%
Final simplification44.9%
(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
Simplified35.0%
herbie shell --seed 2024164
(FPCore (x s)
:name "Logistic function"
:precision binary32
:pre (and (<= 0.0 s) (<= s 1.0651631))
(/ 1.0 (+ 1.0 (exp (/ (- x) s)))))