
(FPCore (x eps) :precision binary64 (/ (- (* (+ 1.0 (/ 1.0 eps)) (exp (- (* (- 1.0 eps) x)))) (* (- (/ 1.0 eps) 1.0) (exp (- (* (+ 1.0 eps) x))))) 2.0))
double code(double x, double eps) {
return (((1.0 + (1.0 / eps)) * exp(-((1.0 - eps) * x))) - (((1.0 / eps) - 1.0) * exp(-((1.0 + eps) * x)))) / 2.0;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
code = (((1.0d0 + (1.0d0 / eps)) * exp(-((1.0d0 - eps) * x))) - (((1.0d0 / eps) - 1.0d0) * exp(-((1.0d0 + eps) * x)))) / 2.0d0
end function
public static double code(double x, double eps) {
return (((1.0 + (1.0 / eps)) * Math.exp(-((1.0 - eps) * x))) - (((1.0 / eps) - 1.0) * Math.exp(-((1.0 + eps) * x)))) / 2.0;
}
def code(x, eps): return (((1.0 + (1.0 / eps)) * math.exp(-((1.0 - eps) * x))) - (((1.0 / eps) - 1.0) * math.exp(-((1.0 + eps) * x)))) / 2.0
function code(x, eps) return Float64(Float64(Float64(Float64(1.0 + Float64(1.0 / eps)) * exp(Float64(-Float64(Float64(1.0 - eps) * x)))) - Float64(Float64(Float64(1.0 / eps) - 1.0) * exp(Float64(-Float64(Float64(1.0 + eps) * x))))) / 2.0) end
function tmp = code(x, eps) tmp = (((1.0 + (1.0 / eps)) * exp(-((1.0 - eps) * x))) - (((1.0 / eps) - 1.0) * exp(-((1.0 + eps) * x)))) / 2.0; end
code[x_, eps_] := N[(N[(N[(N[(1.0 + N[(1.0 / eps), $MachinePrecision]), $MachinePrecision] * N[Exp[(-N[(N[(1.0 - eps), $MachinePrecision] * x), $MachinePrecision])], $MachinePrecision]), $MachinePrecision] - N[(N[(N[(1.0 / eps), $MachinePrecision] - 1.0), $MachinePrecision] * N[Exp[(-N[(N[(1.0 + eps), $MachinePrecision] * x), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot e^{-\left(1 - \varepsilon\right) \cdot x} - \left(\frac{1}{\varepsilon} - 1\right) \cdot e^{-\left(1 + \varepsilon\right) \cdot x}}{2}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x eps) :precision binary64 (/ (- (* (+ 1.0 (/ 1.0 eps)) (exp (- (* (- 1.0 eps) x)))) (* (- (/ 1.0 eps) 1.0) (exp (- (* (+ 1.0 eps) x))))) 2.0))
double code(double x, double eps) {
return (((1.0 + (1.0 / eps)) * exp(-((1.0 - eps) * x))) - (((1.0 / eps) - 1.0) * exp(-((1.0 + eps) * x)))) / 2.0;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
code = (((1.0d0 + (1.0d0 / eps)) * exp(-((1.0d0 - eps) * x))) - (((1.0d0 / eps) - 1.0d0) * exp(-((1.0d0 + eps) * x)))) / 2.0d0
end function
public static double code(double x, double eps) {
return (((1.0 + (1.0 / eps)) * Math.exp(-((1.0 - eps) * x))) - (((1.0 / eps) - 1.0) * Math.exp(-((1.0 + eps) * x)))) / 2.0;
}
def code(x, eps): return (((1.0 + (1.0 / eps)) * math.exp(-((1.0 - eps) * x))) - (((1.0 / eps) - 1.0) * math.exp(-((1.0 + eps) * x)))) / 2.0
function code(x, eps) return Float64(Float64(Float64(Float64(1.0 + Float64(1.0 / eps)) * exp(Float64(-Float64(Float64(1.0 - eps) * x)))) - Float64(Float64(Float64(1.0 / eps) - 1.0) * exp(Float64(-Float64(Float64(1.0 + eps) * x))))) / 2.0) end
function tmp = code(x, eps) tmp = (((1.0 + (1.0 / eps)) * exp(-((1.0 - eps) * x))) - (((1.0 / eps) - 1.0) * exp(-((1.0 + eps) * x)))) / 2.0; end
code[x_, eps_] := N[(N[(N[(N[(1.0 + N[(1.0 / eps), $MachinePrecision]), $MachinePrecision] * N[Exp[(-N[(N[(1.0 - eps), $MachinePrecision] * x), $MachinePrecision])], $MachinePrecision]), $MachinePrecision] - N[(N[(N[(1.0 / eps), $MachinePrecision] - 1.0), $MachinePrecision] * N[Exp[(-N[(N[(1.0 + eps), $MachinePrecision] * x), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot e^{-\left(1 - \varepsilon\right) \cdot x} - \left(\frac{1}{\varepsilon} - 1\right) \cdot e^{-\left(1 + \varepsilon\right) \cdot x}}{2}
\end{array}
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= eps_m 2e-14) (/ (+ (/ (+ x 1.0) (exp x)) (* (+ x 1.0) (exp (- x)))) 2.0) (/ (+ (exp (* x (+ eps_m -1.0))) (exp (* x (- eps_m)))) 2.0)))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (eps_m <= 2e-14) {
tmp = (((x + 1.0) / exp(x)) + ((x + 1.0) * exp(-x))) / 2.0;
} else {
tmp = (exp((x * (eps_m + -1.0))) + exp((x * -eps_m))) / 2.0;
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: tmp
if (eps_m <= 2d-14) then
tmp = (((x + 1.0d0) / exp(x)) + ((x + 1.0d0) * exp(-x))) / 2.0d0
else
tmp = (exp((x * (eps_m + (-1.0d0)))) + exp((x * -eps_m))) / 2.0d0
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (eps_m <= 2e-14) {
tmp = (((x + 1.0) / Math.exp(x)) + ((x + 1.0) * Math.exp(-x))) / 2.0;
} else {
tmp = (Math.exp((x * (eps_m + -1.0))) + Math.exp((x * -eps_m))) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if eps_m <= 2e-14: tmp = (((x + 1.0) / math.exp(x)) + ((x + 1.0) * math.exp(-x))) / 2.0 else: tmp = (math.exp((x * (eps_m + -1.0))) + math.exp((x * -eps_m))) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (eps_m <= 2e-14) tmp = Float64(Float64(Float64(Float64(x + 1.0) / exp(x)) + Float64(Float64(x + 1.0) * exp(Float64(-x)))) / 2.0); else tmp = Float64(Float64(exp(Float64(x * Float64(eps_m + -1.0))) + exp(Float64(x * Float64(-eps_m)))) / 2.0); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (eps_m <= 2e-14) tmp = (((x + 1.0) / exp(x)) + ((x + 1.0) * exp(-x))) / 2.0; else tmp = (exp((x * (eps_m + -1.0))) + exp((x * -eps_m))) / 2.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[eps$95$m, 2e-14], N[(N[(N[(N[(x + 1.0), $MachinePrecision] / N[Exp[x], $MachinePrecision]), $MachinePrecision] + N[(N[(x + 1.0), $MachinePrecision] * N[Exp[(-x)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(N[Exp[N[(x * N[(eps$95$m + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[Exp[N[(x * (-eps$95$m)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;eps\_m \leq 2 \cdot 10^{-14}:\\
\;\;\;\;\frac{\frac{x + 1}{e^{x}} + \left(x + 1\right) \cdot e^{-x}}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{x \cdot \left(eps\_m + -1\right)} + e^{x \cdot \left(-eps\_m\right)}}{2}\\
\end{array}
\end{array}
if eps < 2e-14Initial program 60.3%
fma-neg60.2%
/-rgt-identity60.2%
fma-neg60.3%
/-rgt-identity60.3%
distribute-rgt-neg-in60.3%
sub-neg60.3%
metadata-eval60.3%
distribute-rgt-neg-in60.3%
Simplified60.3%
Taylor expanded in eps around 0 68.8%
Simplified69.3%
rec-exp69.4%
un-div-inv69.4%
Applied egg-rr69.4%
if 2e-14 < eps Initial program 100.0%
fma-neg100.0%
/-rgt-identity100.0%
fma-neg100.0%
/-rgt-identity100.0%
distribute-rgt-neg-in100.0%
sub-neg100.0%
metadata-eval100.0%
distribute-rgt-neg-in100.0%
Simplified100.0%
Taylor expanded in eps around inf 100.0%
Taylor expanded in eps around -inf 100.0%
associate-*r*100.0%
neg-mul-1100.0%
mul-1-neg100.0%
sub-neg100.0%
mul-1-neg100.0%
associate-*r*100.0%
neg-mul-1100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in eps around inf 100.0%
associate-*r*100.0%
neg-mul-1100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
mul-1-neg100.0%
distribute-rgt-neg-in100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
+-commutative100.0%
+-commutative100.0%
Simplified100.0%
Final simplification79.1%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(let* ((t_0 (exp (- x))))
(if (<= x -3.5e-259)
(/ (+ 1.0 (exp (* x (- eps_m)))) 2.0)
(if (<= x 410.0)
(/ (+ (exp (* x (+ eps_m -1.0))) (+ 1.0 (* x (- -1.0 eps_m)))) 2.0)
(if (<= x 6.8e+93)
(/ (+ t_0 (* 2.0 (/ x (exp x)))) 2.0)
(if (<= x 4.2e+162)
(/ (* x eps_m) 2.0)
(if (<= x 6e+179)
(/ (* 2.0 t_0) 2.0)
(/ (* 0.25 (pow x 2.0)) eps_m))))))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double t_0 = exp(-x);
double tmp;
if (x <= -3.5e-259) {
tmp = (1.0 + exp((x * -eps_m))) / 2.0;
} else if (x <= 410.0) {
tmp = (exp((x * (eps_m + -1.0))) + (1.0 + (x * (-1.0 - eps_m)))) / 2.0;
} else if (x <= 6.8e+93) {
tmp = (t_0 + (2.0 * (x / exp(x)))) / 2.0;
} else if (x <= 4.2e+162) {
tmp = (x * eps_m) / 2.0;
} else if (x <= 6e+179) {
tmp = (2.0 * t_0) / 2.0;
} else {
tmp = (0.25 * pow(x, 2.0)) / eps_m;
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: t_0
real(8) :: tmp
t_0 = exp(-x)
if (x <= (-3.5d-259)) then
tmp = (1.0d0 + exp((x * -eps_m))) / 2.0d0
else if (x <= 410.0d0) then
tmp = (exp((x * (eps_m + (-1.0d0)))) + (1.0d0 + (x * ((-1.0d0) - eps_m)))) / 2.0d0
else if (x <= 6.8d+93) then
tmp = (t_0 + (2.0d0 * (x / exp(x)))) / 2.0d0
else if (x <= 4.2d+162) then
tmp = (x * eps_m) / 2.0d0
else if (x <= 6d+179) then
tmp = (2.0d0 * t_0) / 2.0d0
else
tmp = (0.25d0 * (x ** 2.0d0)) / eps_m
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double t_0 = Math.exp(-x);
double tmp;
if (x <= -3.5e-259) {
tmp = (1.0 + Math.exp((x * -eps_m))) / 2.0;
} else if (x <= 410.0) {
tmp = (Math.exp((x * (eps_m + -1.0))) + (1.0 + (x * (-1.0 - eps_m)))) / 2.0;
} else if (x <= 6.8e+93) {
tmp = (t_0 + (2.0 * (x / Math.exp(x)))) / 2.0;
} else if (x <= 4.2e+162) {
tmp = (x * eps_m) / 2.0;
} else if (x <= 6e+179) {
tmp = (2.0 * t_0) / 2.0;
} else {
tmp = (0.25 * Math.pow(x, 2.0)) / eps_m;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): t_0 = math.exp(-x) tmp = 0 if x <= -3.5e-259: tmp = (1.0 + math.exp((x * -eps_m))) / 2.0 elif x <= 410.0: tmp = (math.exp((x * (eps_m + -1.0))) + (1.0 + (x * (-1.0 - eps_m)))) / 2.0 elif x <= 6.8e+93: tmp = (t_0 + (2.0 * (x / math.exp(x)))) / 2.0 elif x <= 4.2e+162: tmp = (x * eps_m) / 2.0 elif x <= 6e+179: tmp = (2.0 * t_0) / 2.0 else: tmp = (0.25 * math.pow(x, 2.0)) / eps_m return tmp
eps_m = abs(eps) function code(x, eps_m) t_0 = exp(Float64(-x)) tmp = 0.0 if (x <= -3.5e-259) tmp = Float64(Float64(1.0 + exp(Float64(x * Float64(-eps_m)))) / 2.0); elseif (x <= 410.0) tmp = Float64(Float64(exp(Float64(x * Float64(eps_m + -1.0))) + Float64(1.0 + Float64(x * Float64(-1.0 - eps_m)))) / 2.0); elseif (x <= 6.8e+93) tmp = Float64(Float64(t_0 + Float64(2.0 * Float64(x / exp(x)))) / 2.0); elseif (x <= 4.2e+162) tmp = Float64(Float64(x * eps_m) / 2.0); elseif (x <= 6e+179) tmp = Float64(Float64(2.0 * t_0) / 2.0); else tmp = Float64(Float64(0.25 * (x ^ 2.0)) / eps_m); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) t_0 = exp(-x); tmp = 0.0; if (x <= -3.5e-259) tmp = (1.0 + exp((x * -eps_m))) / 2.0; elseif (x <= 410.0) tmp = (exp((x * (eps_m + -1.0))) + (1.0 + (x * (-1.0 - eps_m)))) / 2.0; elseif (x <= 6.8e+93) tmp = (t_0 + (2.0 * (x / exp(x)))) / 2.0; elseif (x <= 4.2e+162) tmp = (x * eps_m) / 2.0; elseif (x <= 6e+179) tmp = (2.0 * t_0) / 2.0; else tmp = (0.25 * (x ^ 2.0)) / eps_m; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision]
code[x_, eps$95$m_] := Block[{t$95$0 = N[Exp[(-x)], $MachinePrecision]}, If[LessEqual[x, -3.5e-259], N[(N[(1.0 + N[Exp[N[(x * (-eps$95$m)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 410.0], N[(N[(N[Exp[N[(x * N[(eps$95$m + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(1.0 + N[(x * N[(-1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 6.8e+93], N[(N[(t$95$0 + N[(2.0 * N[(x / N[Exp[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 4.2e+162], N[(N[(x * eps$95$m), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 6e+179], N[(N[(2.0 * t$95$0), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(0.25 * N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision] / eps$95$m), $MachinePrecision]]]]]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
t_0 := e^{-x}\\
\mathbf{if}\;x \leq -3.5 \cdot 10^{-259}:\\
\;\;\;\;\frac{1 + e^{x \cdot \left(-eps\_m\right)}}{2}\\
\mathbf{elif}\;x \leq 410:\\
\;\;\;\;\frac{e^{x \cdot \left(eps\_m + -1\right)} + \left(1 + x \cdot \left(-1 - eps\_m\right)\right)}{2}\\
\mathbf{elif}\;x \leq 6.8 \cdot 10^{+93}:\\
\;\;\;\;\frac{t\_0 + 2 \cdot \frac{x}{e^{x}}}{2}\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{+162}:\\
\;\;\;\;\frac{x \cdot eps\_m}{2}\\
\mathbf{elif}\;x \leq 6 \cdot 10^{+179}:\\
\;\;\;\;\frac{2 \cdot t\_0}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.25 \cdot {x}^{2}}{eps\_m}\\
\end{array}
\end{array}
if x < -3.5000000000000002e-259Initial program 69.8%
fma-neg69.7%
/-rgt-identity69.7%
fma-neg69.8%
/-rgt-identity69.8%
distribute-rgt-neg-in69.8%
sub-neg69.8%
metadata-eval69.8%
distribute-rgt-neg-in69.8%
Simplified69.8%
Taylor expanded in eps around inf 98.0%
Taylor expanded in eps around -inf 98.0%
associate-*r*98.0%
neg-mul-198.0%
mul-1-neg98.0%
sub-neg98.0%
mul-1-neg98.0%
associate-*r*98.0%
neg-mul-198.0%
mul-1-neg98.0%
Simplified98.0%
Taylor expanded in eps around inf 98.0%
associate-*r*98.0%
neg-mul-198.0%
Simplified98.0%
Taylor expanded in x around 0 76.4%
if -3.5000000000000002e-259 < x < 410Initial program 56.2%
fma-neg56.2%
/-rgt-identity56.2%
fma-neg56.2%
/-rgt-identity56.2%
distribute-rgt-neg-in56.2%
sub-neg56.2%
metadata-eval56.2%
distribute-rgt-neg-in56.2%
Simplified56.2%
Taylor expanded in eps around inf 99.8%
Taylor expanded in eps around -inf 99.8%
associate-*r*99.8%
neg-mul-199.8%
mul-1-neg99.8%
sub-neg99.8%
mul-1-neg99.8%
associate-*r*99.8%
neg-mul-199.8%
mul-1-neg99.8%
Simplified99.8%
Taylor expanded in x around 0 89.0%
mul-1-neg89.0%
distribute-rgt-neg-in89.0%
distribute-neg-in89.0%
metadata-eval89.0%
Simplified89.0%
if 410 < x < 6.8000000000000001e93Initial program 95.9%
fma-neg95.9%
/-rgt-identity95.9%
fma-neg95.9%
/-rgt-identity95.9%
distribute-rgt-neg-in95.9%
sub-neg95.9%
metadata-eval95.9%
distribute-rgt-neg-in95.9%
Simplified95.9%
Taylor expanded in eps around 0 76.8%
Simplified76.8%
Taylor expanded in x around inf 72.9%
exp-neg72.9%
associate-*r/72.9%
*-rgt-identity72.9%
Simplified72.9%
Taylor expanded in x around inf 72.9%
rec-exp72.9%
cancel-sign-sub-inv72.9%
metadata-eval72.9%
*-lft-identity72.9%
neg-mul-172.9%
rec-exp72.9%
rec-exp72.9%
distribute-lft-in72.9%
neg-mul-172.9%
count-272.9%
rem-exp-log72.9%
neg-mul-172.9%
exp-sum72.9%
sub-neg72.9%
exp-diff72.9%
Simplified72.9%
if 6.8000000000000001e93 < x < 4.2000000000000001e162Initial program 100.0%
fma-neg100.0%
/-rgt-identity100.0%
fma-neg100.0%
/-rgt-identity100.0%
distribute-rgt-neg-in100.0%
sub-neg100.0%
metadata-eval100.0%
distribute-rgt-neg-in100.0%
Simplified100.0%
Taylor expanded in eps around inf 100.0%
Taylor expanded in x around 0 46.1%
mul-1-neg46.1%
distribute-rgt-neg-in46.1%
sub-neg46.1%
mul-1-neg46.1%
distribute-neg-in46.1%
metadata-eval46.1%
mul-1-neg46.1%
remove-double-neg46.1%
Simplified46.1%
Taylor expanded in eps around inf 37.1%
*-commutative37.1%
Simplified37.1%
if 4.2000000000000001e162 < x < 5.9999999999999996e179Initial program 100.0%
fma-neg100.0%
/-rgt-identity100.0%
fma-neg100.0%
/-rgt-identity100.0%
distribute-rgt-neg-in100.0%
sub-neg100.0%
metadata-eval100.0%
distribute-rgt-neg-in100.0%
Simplified100.0%
Taylor expanded in eps around inf 100.0%
Taylor expanded in eps around 0 80.3%
cancel-sign-sub-inv80.3%
metadata-eval80.3%
distribute-rgt1-in80.3%
metadata-eval80.3%
neg-mul-180.3%
Simplified80.3%
if 5.9999999999999996e179 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 36.1%
Taylor expanded in x around 0 1.6%
neg-mul-11.6%
unsub-neg1.6%
Simplified1.6%
Taylor expanded in x around 0 22.2%
associate-*r/22.2%
Simplified22.2%
Final simplification71.3%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<= x -5e-254)
(/ (+ 1.0 (exp (* x (- eps_m)))) 2.0)
(if (<= x 410.0)
(/ (+ (exp (* x (+ eps_m -1.0))) (+ 1.0 (* x (- -1.0 eps_m)))) 2.0)
(if (<= x 5.2e+93)
(/ (* 2.0 (exp (- (log x) x))) 2.0)
(if (<= x 4.6e+156)
(/ (* x eps_m) 2.0)
(if (<= x 5e+179)
(/ (* 2.0 (exp (- x))) 2.0)
(/ (* 0.25 (pow x 2.0)) eps_m)))))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= -5e-254) {
tmp = (1.0 + exp((x * -eps_m))) / 2.0;
} else if (x <= 410.0) {
tmp = (exp((x * (eps_m + -1.0))) + (1.0 + (x * (-1.0 - eps_m)))) / 2.0;
} else if (x <= 5.2e+93) {
tmp = (2.0 * exp((log(x) - x))) / 2.0;
} else if (x <= 4.6e+156) {
tmp = (x * eps_m) / 2.0;
} else if (x <= 5e+179) {
tmp = (2.0 * exp(-x)) / 2.0;
} else {
tmp = (0.25 * pow(x, 2.0)) / eps_m;
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: tmp
if (x <= (-5d-254)) then
tmp = (1.0d0 + exp((x * -eps_m))) / 2.0d0
else if (x <= 410.0d0) then
tmp = (exp((x * (eps_m + (-1.0d0)))) + (1.0d0 + (x * ((-1.0d0) - eps_m)))) / 2.0d0
else if (x <= 5.2d+93) then
tmp = (2.0d0 * exp((log(x) - x))) / 2.0d0
else if (x <= 4.6d+156) then
tmp = (x * eps_m) / 2.0d0
else if (x <= 5d+179) then
tmp = (2.0d0 * exp(-x)) / 2.0d0
else
tmp = (0.25d0 * (x ** 2.0d0)) / eps_m
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (x <= -5e-254) {
tmp = (1.0 + Math.exp((x * -eps_m))) / 2.0;
} else if (x <= 410.0) {
tmp = (Math.exp((x * (eps_m + -1.0))) + (1.0 + (x * (-1.0 - eps_m)))) / 2.0;
} else if (x <= 5.2e+93) {
tmp = (2.0 * Math.exp((Math.log(x) - x))) / 2.0;
} else if (x <= 4.6e+156) {
tmp = (x * eps_m) / 2.0;
} else if (x <= 5e+179) {
tmp = (2.0 * Math.exp(-x)) / 2.0;
} else {
tmp = (0.25 * Math.pow(x, 2.0)) / eps_m;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= -5e-254: tmp = (1.0 + math.exp((x * -eps_m))) / 2.0 elif x <= 410.0: tmp = (math.exp((x * (eps_m + -1.0))) + (1.0 + (x * (-1.0 - eps_m)))) / 2.0 elif x <= 5.2e+93: tmp = (2.0 * math.exp((math.log(x) - x))) / 2.0 elif x <= 4.6e+156: tmp = (x * eps_m) / 2.0 elif x <= 5e+179: tmp = (2.0 * math.exp(-x)) / 2.0 else: tmp = (0.25 * math.pow(x, 2.0)) / eps_m return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= -5e-254) tmp = Float64(Float64(1.0 + exp(Float64(x * Float64(-eps_m)))) / 2.0); elseif (x <= 410.0) tmp = Float64(Float64(exp(Float64(x * Float64(eps_m + -1.0))) + Float64(1.0 + Float64(x * Float64(-1.0 - eps_m)))) / 2.0); elseif (x <= 5.2e+93) tmp = Float64(Float64(2.0 * exp(Float64(log(x) - x))) / 2.0); elseif (x <= 4.6e+156) tmp = Float64(Float64(x * eps_m) / 2.0); elseif (x <= 5e+179) tmp = Float64(Float64(2.0 * exp(Float64(-x))) / 2.0); else tmp = Float64(Float64(0.25 * (x ^ 2.0)) / eps_m); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (x <= -5e-254) tmp = (1.0 + exp((x * -eps_m))) / 2.0; elseif (x <= 410.0) tmp = (exp((x * (eps_m + -1.0))) + (1.0 + (x * (-1.0 - eps_m)))) / 2.0; elseif (x <= 5.2e+93) tmp = (2.0 * exp((log(x) - x))) / 2.0; elseif (x <= 4.6e+156) tmp = (x * eps_m) / 2.0; elseif (x <= 5e+179) tmp = (2.0 * exp(-x)) / 2.0; else tmp = (0.25 * (x ^ 2.0)) / eps_m; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, -5e-254], N[(N[(1.0 + N[Exp[N[(x * (-eps$95$m)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 410.0], N[(N[(N[Exp[N[(x * N[(eps$95$m + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(1.0 + N[(x * N[(-1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 5.2e+93], N[(N[(2.0 * N[Exp[N[(N[Log[x], $MachinePrecision] - x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 4.6e+156], N[(N[(x * eps$95$m), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 5e+179], N[(N[(2.0 * N[Exp[(-x)], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(0.25 * N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision] / eps$95$m), $MachinePrecision]]]]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5 \cdot 10^{-254}:\\
\;\;\;\;\frac{1 + e^{x \cdot \left(-eps\_m\right)}}{2}\\
\mathbf{elif}\;x \leq 410:\\
\;\;\;\;\frac{e^{x \cdot \left(eps\_m + -1\right)} + \left(1 + x \cdot \left(-1 - eps\_m\right)\right)}{2}\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{+93}:\\
\;\;\;\;\frac{2 \cdot e^{\log x - x}}{2}\\
\mathbf{elif}\;x \leq 4.6 \cdot 10^{+156}:\\
\;\;\;\;\frac{x \cdot eps\_m}{2}\\
\mathbf{elif}\;x \leq 5 \cdot 10^{+179}:\\
\;\;\;\;\frac{2 \cdot e^{-x}}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.25 \cdot {x}^{2}}{eps\_m}\\
\end{array}
\end{array}
if x < -5.0000000000000003e-254Initial program 69.8%
fma-neg69.7%
/-rgt-identity69.7%
fma-neg69.8%
/-rgt-identity69.8%
distribute-rgt-neg-in69.8%
sub-neg69.8%
metadata-eval69.8%
distribute-rgt-neg-in69.8%
Simplified69.8%
Taylor expanded in eps around inf 98.0%
Taylor expanded in eps around -inf 98.0%
associate-*r*98.0%
neg-mul-198.0%
mul-1-neg98.0%
sub-neg98.0%
mul-1-neg98.0%
associate-*r*98.0%
neg-mul-198.0%
mul-1-neg98.0%
Simplified98.0%
Taylor expanded in eps around inf 98.0%
associate-*r*98.0%
neg-mul-198.0%
Simplified98.0%
Taylor expanded in x around 0 76.4%
if -5.0000000000000003e-254 < x < 410Initial program 56.2%
fma-neg56.2%
/-rgt-identity56.2%
fma-neg56.2%
/-rgt-identity56.2%
distribute-rgt-neg-in56.2%
sub-neg56.2%
metadata-eval56.2%
distribute-rgt-neg-in56.2%
Simplified56.2%
Taylor expanded in eps around inf 99.8%
Taylor expanded in eps around -inf 99.8%
associate-*r*99.8%
neg-mul-199.8%
mul-1-neg99.8%
sub-neg99.8%
mul-1-neg99.8%
associate-*r*99.8%
neg-mul-199.8%
mul-1-neg99.8%
Simplified99.8%
Taylor expanded in x around 0 89.0%
mul-1-neg89.0%
distribute-rgt-neg-in89.0%
distribute-neg-in89.0%
metadata-eval89.0%
Simplified89.0%
if 410 < x < 5.19999999999999999e93Initial program 95.9%
fma-neg95.9%
/-rgt-identity95.9%
fma-neg95.9%
/-rgt-identity95.9%
distribute-rgt-neg-in95.9%
sub-neg95.9%
metadata-eval95.9%
distribute-rgt-neg-in95.9%
Simplified95.9%
Taylor expanded in eps around 0 76.8%
Simplified76.8%
Taylor expanded in x around inf 72.9%
exp-neg72.9%
associate-*r/72.9%
*-rgt-identity72.9%
Simplified72.9%
Taylor expanded in x around inf 72.8%
rec-exp72.8%
cancel-sign-sub-inv72.8%
metadata-eval72.8%
*-lft-identity72.8%
neg-mul-172.8%
rec-exp72.8%
rec-exp72.8%
distribute-lft-in72.8%
neg-mul-172.8%
count-272.8%
rem-exp-log72.8%
neg-mul-172.8%
exp-sum72.8%
sub-neg72.8%
exp-diff72.8%
rem-exp-log72.8%
Simplified72.8%
add-exp-log72.8%
div-exp72.8%
Applied egg-rr72.8%
if 5.19999999999999999e93 < x < 4.5999999999999998e156Initial program 100.0%
fma-neg100.0%
/-rgt-identity100.0%
fma-neg100.0%
/-rgt-identity100.0%
distribute-rgt-neg-in100.0%
sub-neg100.0%
metadata-eval100.0%
distribute-rgt-neg-in100.0%
Simplified100.0%
Taylor expanded in eps around inf 100.0%
Taylor expanded in x around 0 46.1%
mul-1-neg46.1%
distribute-rgt-neg-in46.1%
sub-neg46.1%
mul-1-neg46.1%
distribute-neg-in46.1%
metadata-eval46.1%
mul-1-neg46.1%
remove-double-neg46.1%
Simplified46.1%
Taylor expanded in eps around inf 37.1%
*-commutative37.1%
Simplified37.1%
if 4.5999999999999998e156 < x < 5e179Initial program 100.0%
fma-neg100.0%
/-rgt-identity100.0%
fma-neg100.0%
/-rgt-identity100.0%
distribute-rgt-neg-in100.0%
sub-neg100.0%
metadata-eval100.0%
distribute-rgt-neg-in100.0%
Simplified100.0%
Taylor expanded in eps around inf 100.0%
Taylor expanded in eps around 0 80.3%
cancel-sign-sub-inv80.3%
metadata-eval80.3%
distribute-rgt1-in80.3%
metadata-eval80.3%
neg-mul-180.3%
Simplified80.3%
if 5e179 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 36.1%
Taylor expanded in x around 0 1.6%
neg-mul-11.6%
unsub-neg1.6%
Simplified1.6%
Taylor expanded in x around 0 22.2%
associate-*r/22.2%
Simplified22.2%
Final simplification71.3%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= eps_m 2.25e-14) (/ (* 2.0 (exp (- x))) 2.0) (/ (+ (exp (* x (+ eps_m -1.0))) (exp (* x (- eps_m)))) 2.0)))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (eps_m <= 2.25e-14) {
tmp = (2.0 * exp(-x)) / 2.0;
} else {
tmp = (exp((x * (eps_m + -1.0))) + exp((x * -eps_m))) / 2.0;
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: tmp
if (eps_m <= 2.25d-14) then
tmp = (2.0d0 * exp(-x)) / 2.0d0
else
tmp = (exp((x * (eps_m + (-1.0d0)))) + exp((x * -eps_m))) / 2.0d0
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (eps_m <= 2.25e-14) {
tmp = (2.0 * Math.exp(-x)) / 2.0;
} else {
tmp = (Math.exp((x * (eps_m + -1.0))) + Math.exp((x * -eps_m))) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if eps_m <= 2.25e-14: tmp = (2.0 * math.exp(-x)) / 2.0 else: tmp = (math.exp((x * (eps_m + -1.0))) + math.exp((x * -eps_m))) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (eps_m <= 2.25e-14) tmp = Float64(Float64(2.0 * exp(Float64(-x))) / 2.0); else tmp = Float64(Float64(exp(Float64(x * Float64(eps_m + -1.0))) + exp(Float64(x * Float64(-eps_m)))) / 2.0); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (eps_m <= 2.25e-14) tmp = (2.0 * exp(-x)) / 2.0; else tmp = (exp((x * (eps_m + -1.0))) + exp((x * -eps_m))) / 2.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[eps$95$m, 2.25e-14], N[(N[(2.0 * N[Exp[(-x)], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(N[Exp[N[(x * N[(eps$95$m + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[Exp[N[(x * (-eps$95$m)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;eps\_m \leq 2.25 \cdot 10^{-14}:\\
\;\;\;\;\frac{2 \cdot e^{-x}}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{x \cdot \left(eps\_m + -1\right)} + e^{x \cdot \left(-eps\_m\right)}}{2}\\
\end{array}
\end{array}
if eps < 2.2499999999999999e-14Initial program 60.3%
fma-neg60.2%
/-rgt-identity60.2%
fma-neg60.3%
/-rgt-identity60.3%
distribute-rgt-neg-in60.3%
sub-neg60.3%
metadata-eval60.3%
distribute-rgt-neg-in60.3%
Simplified60.3%
Taylor expanded in eps around inf 98.4%
Taylor expanded in eps around 0 75.1%
cancel-sign-sub-inv75.1%
metadata-eval75.1%
distribute-rgt1-in75.1%
metadata-eval75.1%
neg-mul-175.1%
Simplified75.1%
if 2.2499999999999999e-14 < eps Initial program 100.0%
fma-neg100.0%
/-rgt-identity100.0%
fma-neg100.0%
/-rgt-identity100.0%
distribute-rgt-neg-in100.0%
sub-neg100.0%
metadata-eval100.0%
distribute-rgt-neg-in100.0%
Simplified100.0%
Taylor expanded in eps around inf 100.0%
Taylor expanded in eps around -inf 100.0%
associate-*r*100.0%
neg-mul-1100.0%
mul-1-neg100.0%
sub-neg100.0%
mul-1-neg100.0%
associate-*r*100.0%
neg-mul-1100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in eps around inf 100.0%
associate-*r*100.0%
neg-mul-1100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
mul-1-neg100.0%
distribute-rgt-neg-in100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
+-commutative100.0%
+-commutative100.0%
Simplified100.0%
Final simplification83.0%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (/ (+ (exp (* x (+ eps_m -1.0))) (exp (* x (- -1.0 eps_m)))) 2.0))
eps_m = fabs(eps);
double code(double x, double eps_m) {
return (exp((x * (eps_m + -1.0))) + exp((x * (-1.0 - eps_m)))) / 2.0;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
code = (exp((x * (eps_m + (-1.0d0)))) + exp((x * ((-1.0d0) - eps_m)))) / 2.0d0
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
return (Math.exp((x * (eps_m + -1.0))) + Math.exp((x * (-1.0 - eps_m)))) / 2.0;
}
eps_m = math.fabs(eps) def code(x, eps_m): return (math.exp((x * (eps_m + -1.0))) + math.exp((x * (-1.0 - eps_m)))) / 2.0
eps_m = abs(eps) function code(x, eps_m) return Float64(Float64(exp(Float64(x * Float64(eps_m + -1.0))) + exp(Float64(x * Float64(-1.0 - eps_m)))) / 2.0) end
eps_m = abs(eps); function tmp = code(x, eps_m) tmp = (exp((x * (eps_m + -1.0))) + exp((x * (-1.0 - eps_m)))) / 2.0; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := N[(N[(N[Exp[N[(x * N[(eps$95$m + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[Exp[N[(x * N[(-1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\frac{e^{x \cdot \left(eps\_m + -1\right)} + e^{x \cdot \left(-1 - eps\_m\right)}}{2}
\end{array}
Initial program 72.8%
fma-neg72.8%
/-rgt-identity72.8%
fma-neg72.8%
/-rgt-identity72.8%
distribute-rgt-neg-in72.8%
sub-neg72.8%
metadata-eval72.8%
distribute-rgt-neg-in72.8%
Simplified72.8%
Taylor expanded in eps around inf 98.9%
Taylor expanded in eps around -inf 98.9%
associate-*r*98.9%
neg-mul-198.9%
mul-1-neg98.9%
sub-neg98.9%
mul-1-neg98.9%
associate-*r*98.9%
neg-mul-198.9%
mul-1-neg98.9%
Simplified98.9%
Final simplification98.9%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<= x -1.0)
(* (* x eps_m) -0.5)
(if (<= x 410.0)
1.0
(if (<= x 2.1e+93)
0.0
(if (<= x 1.45e+156)
(/ (* x eps_m) 2.0)
(if (<= x 4.9e+179) 0.0 (/ (* 0.25 (pow x 2.0)) eps_m)))))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= -1.0) {
tmp = (x * eps_m) * -0.5;
} else if (x <= 410.0) {
tmp = 1.0;
} else if (x <= 2.1e+93) {
tmp = 0.0;
} else if (x <= 1.45e+156) {
tmp = (x * eps_m) / 2.0;
} else if (x <= 4.9e+179) {
tmp = 0.0;
} else {
tmp = (0.25 * pow(x, 2.0)) / eps_m;
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: tmp
if (x <= (-1.0d0)) then
tmp = (x * eps_m) * (-0.5d0)
else if (x <= 410.0d0) then
tmp = 1.0d0
else if (x <= 2.1d+93) then
tmp = 0.0d0
else if (x <= 1.45d+156) then
tmp = (x * eps_m) / 2.0d0
else if (x <= 4.9d+179) then
tmp = 0.0d0
else
tmp = (0.25d0 * (x ** 2.0d0)) / eps_m
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (x <= -1.0) {
tmp = (x * eps_m) * -0.5;
} else if (x <= 410.0) {
tmp = 1.0;
} else if (x <= 2.1e+93) {
tmp = 0.0;
} else if (x <= 1.45e+156) {
tmp = (x * eps_m) / 2.0;
} else if (x <= 4.9e+179) {
tmp = 0.0;
} else {
tmp = (0.25 * Math.pow(x, 2.0)) / eps_m;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= -1.0: tmp = (x * eps_m) * -0.5 elif x <= 410.0: tmp = 1.0 elif x <= 2.1e+93: tmp = 0.0 elif x <= 1.45e+156: tmp = (x * eps_m) / 2.0 elif x <= 4.9e+179: tmp = 0.0 else: tmp = (0.25 * math.pow(x, 2.0)) / eps_m return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= -1.0) tmp = Float64(Float64(x * eps_m) * -0.5); elseif (x <= 410.0) tmp = 1.0; elseif (x <= 2.1e+93) tmp = 0.0; elseif (x <= 1.45e+156) tmp = Float64(Float64(x * eps_m) / 2.0); elseif (x <= 4.9e+179) tmp = 0.0; else tmp = Float64(Float64(0.25 * (x ^ 2.0)) / eps_m); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (x <= -1.0) tmp = (x * eps_m) * -0.5; elseif (x <= 410.0) tmp = 1.0; elseif (x <= 2.1e+93) tmp = 0.0; elseif (x <= 1.45e+156) tmp = (x * eps_m) / 2.0; elseif (x <= 4.9e+179) tmp = 0.0; else tmp = (0.25 * (x ^ 2.0)) / eps_m; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, -1.0], N[(N[(x * eps$95$m), $MachinePrecision] * -0.5), $MachinePrecision], If[LessEqual[x, 410.0], 1.0, If[LessEqual[x, 2.1e+93], 0.0, If[LessEqual[x, 1.45e+156], N[(N[(x * eps$95$m), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 4.9e+179], 0.0, N[(N[(0.25 * N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision] / eps$95$m), $MachinePrecision]]]]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\left(x \cdot eps\_m\right) \cdot -0.5\\
\mathbf{elif}\;x \leq 410:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 2.1 \cdot 10^{+93}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 1.45 \cdot 10^{+156}:\\
\;\;\;\;\frac{x \cdot eps\_m}{2}\\
\mathbf{elif}\;x \leq 4.9 \cdot 10^{+179}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;\frac{0.25 \cdot {x}^{2}}{eps\_m}\\
\end{array}
\end{array}
if x < -1Initial program 97.3%
fma-neg97.3%
/-rgt-identity97.3%
fma-neg97.3%
/-rgt-identity97.3%
distribute-rgt-neg-in97.3%
sub-neg97.3%
metadata-eval97.3%
distribute-rgt-neg-in97.3%
Simplified97.3%
Taylor expanded in eps around inf 97.3%
Taylor expanded in x around 0 28.4%
mul-1-neg28.4%
distribute-rgt-neg-in28.4%
sub-neg28.4%
mul-1-neg28.4%
distribute-neg-in28.4%
metadata-eval28.4%
mul-1-neg28.4%
remove-double-neg28.4%
Simplified28.4%
Taylor expanded in eps around inf 15.0%
*-commutative15.0%
Simplified15.0%
frac-2neg15.0%
mul-1-neg15.0%
div-inv15.0%
associate-*r*15.0%
neg-mul-115.0%
add-sqr-sqrt15.0%
sqrt-unprod20.0%
sqr-neg20.0%
sqrt-unprod0.0%
add-sqr-sqrt49.6%
metadata-eval49.6%
metadata-eval49.6%
Applied egg-rr49.6%
if -1 < x < 410Initial program 54.5%
fma-neg54.4%
/-rgt-identity54.4%
fma-neg54.5%
/-rgt-identity54.5%
distribute-rgt-neg-in54.5%
sub-neg54.5%
metadata-eval54.5%
distribute-rgt-neg-in54.5%
Simplified54.5%
Taylor expanded in x around 0 72.0%
if 410 < x < 2.0999999999999998e93 or 1.45000000000000005e156 < x < 4.8999999999999999e179Initial program 96.8%
fma-neg96.8%
/-rgt-identity96.8%
fma-neg96.8%
/-rgt-identity96.8%
distribute-rgt-neg-in96.8%
sub-neg96.8%
metadata-eval96.8%
distribute-rgt-neg-in96.8%
Simplified96.8%
Taylor expanded in eps around inf 96.1%
Taylor expanded in x around 0 16.1%
mul-1-neg16.1%
distribute-rgt-neg-in16.1%
sub-neg16.1%
mul-1-neg16.1%
distribute-neg-in16.1%
metadata-eval16.1%
mul-1-neg16.1%
remove-double-neg16.1%
Simplified16.1%
Taylor expanded in x around 0 2.4%
+-commutative2.4%
associate--l+2.4%
+-commutative2.4%
add-sqr-sqrt2.2%
sqrt-unprod2.1%
mul-1-neg2.1%
mul-1-neg2.1%
sqr-neg2.1%
sqrt-unprod0.0%
add-sqr-sqrt73.3%
+-commutative73.3%
Applied egg-rr73.3%
associate-+r-73.3%
fma-udef73.3%
+-inverses73.3%
Simplified73.3%
if 2.0999999999999998e93 < x < 1.45000000000000005e156Initial program 100.0%
fma-neg100.0%
/-rgt-identity100.0%
fma-neg100.0%
/-rgt-identity100.0%
distribute-rgt-neg-in100.0%
sub-neg100.0%
metadata-eval100.0%
distribute-rgt-neg-in100.0%
Simplified100.0%
Taylor expanded in eps around inf 100.0%
Taylor expanded in x around 0 46.1%
mul-1-neg46.1%
distribute-rgt-neg-in46.1%
sub-neg46.1%
mul-1-neg46.1%
distribute-neg-in46.1%
metadata-eval46.1%
mul-1-neg46.1%
remove-double-neg46.1%
Simplified46.1%
Taylor expanded in eps around inf 37.1%
*-commutative37.1%
Simplified37.1%
if 4.8999999999999999e179 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 36.1%
Taylor expanded in x around 0 1.6%
neg-mul-11.6%
unsub-neg1.6%
Simplified1.6%
Taylor expanded in x around 0 22.2%
associate-*r/22.2%
Simplified22.2%
Final simplification60.2%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<= x -1e-258)
(/ (+ 1.0 (exp (* x (- eps_m)))) 2.0)
(if (<= x 410.0)
(/ (+ (exp (* x (+ eps_m -1.0))) (+ 1.0 (* x (- -1.0 eps_m)))) 2.0)
(if (<= x 7.5e+89)
(/ (* 2.0 (/ x (exp x))) 2.0)
(if (<= x 1.6e+161)
(/ (* x eps_m) 2.0)
(if (<= x 4.8e+179)
(/ (* 2.0 (exp (- x))) 2.0)
(/ (* 0.25 (pow x 2.0)) eps_m)))))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= -1e-258) {
tmp = (1.0 + exp((x * -eps_m))) / 2.0;
} else if (x <= 410.0) {
tmp = (exp((x * (eps_m + -1.0))) + (1.0 + (x * (-1.0 - eps_m)))) / 2.0;
} else if (x <= 7.5e+89) {
tmp = (2.0 * (x / exp(x))) / 2.0;
} else if (x <= 1.6e+161) {
tmp = (x * eps_m) / 2.0;
} else if (x <= 4.8e+179) {
tmp = (2.0 * exp(-x)) / 2.0;
} else {
tmp = (0.25 * pow(x, 2.0)) / eps_m;
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: tmp
if (x <= (-1d-258)) then
tmp = (1.0d0 + exp((x * -eps_m))) / 2.0d0
else if (x <= 410.0d0) then
tmp = (exp((x * (eps_m + (-1.0d0)))) + (1.0d0 + (x * ((-1.0d0) - eps_m)))) / 2.0d0
else if (x <= 7.5d+89) then
tmp = (2.0d0 * (x / exp(x))) / 2.0d0
else if (x <= 1.6d+161) then
tmp = (x * eps_m) / 2.0d0
else if (x <= 4.8d+179) then
tmp = (2.0d0 * exp(-x)) / 2.0d0
else
tmp = (0.25d0 * (x ** 2.0d0)) / eps_m
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (x <= -1e-258) {
tmp = (1.0 + Math.exp((x * -eps_m))) / 2.0;
} else if (x <= 410.0) {
tmp = (Math.exp((x * (eps_m + -1.0))) + (1.0 + (x * (-1.0 - eps_m)))) / 2.0;
} else if (x <= 7.5e+89) {
tmp = (2.0 * (x / Math.exp(x))) / 2.0;
} else if (x <= 1.6e+161) {
tmp = (x * eps_m) / 2.0;
} else if (x <= 4.8e+179) {
tmp = (2.0 * Math.exp(-x)) / 2.0;
} else {
tmp = (0.25 * Math.pow(x, 2.0)) / eps_m;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= -1e-258: tmp = (1.0 + math.exp((x * -eps_m))) / 2.0 elif x <= 410.0: tmp = (math.exp((x * (eps_m + -1.0))) + (1.0 + (x * (-1.0 - eps_m)))) / 2.0 elif x <= 7.5e+89: tmp = (2.0 * (x / math.exp(x))) / 2.0 elif x <= 1.6e+161: tmp = (x * eps_m) / 2.0 elif x <= 4.8e+179: tmp = (2.0 * math.exp(-x)) / 2.0 else: tmp = (0.25 * math.pow(x, 2.0)) / eps_m return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= -1e-258) tmp = Float64(Float64(1.0 + exp(Float64(x * Float64(-eps_m)))) / 2.0); elseif (x <= 410.0) tmp = Float64(Float64(exp(Float64(x * Float64(eps_m + -1.0))) + Float64(1.0 + Float64(x * Float64(-1.0 - eps_m)))) / 2.0); elseif (x <= 7.5e+89) tmp = Float64(Float64(2.0 * Float64(x / exp(x))) / 2.0); elseif (x <= 1.6e+161) tmp = Float64(Float64(x * eps_m) / 2.0); elseif (x <= 4.8e+179) tmp = Float64(Float64(2.0 * exp(Float64(-x))) / 2.0); else tmp = Float64(Float64(0.25 * (x ^ 2.0)) / eps_m); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (x <= -1e-258) tmp = (1.0 + exp((x * -eps_m))) / 2.0; elseif (x <= 410.0) tmp = (exp((x * (eps_m + -1.0))) + (1.0 + (x * (-1.0 - eps_m)))) / 2.0; elseif (x <= 7.5e+89) tmp = (2.0 * (x / exp(x))) / 2.0; elseif (x <= 1.6e+161) tmp = (x * eps_m) / 2.0; elseif (x <= 4.8e+179) tmp = (2.0 * exp(-x)) / 2.0; else tmp = (0.25 * (x ^ 2.0)) / eps_m; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, -1e-258], N[(N[(1.0 + N[Exp[N[(x * (-eps$95$m)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 410.0], N[(N[(N[Exp[N[(x * N[(eps$95$m + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(1.0 + N[(x * N[(-1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 7.5e+89], N[(N[(2.0 * N[(x / N[Exp[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 1.6e+161], N[(N[(x * eps$95$m), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 4.8e+179], N[(N[(2.0 * N[Exp[(-x)], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(0.25 * N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision] / eps$95$m), $MachinePrecision]]]]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1 \cdot 10^{-258}:\\
\;\;\;\;\frac{1 + e^{x \cdot \left(-eps\_m\right)}}{2}\\
\mathbf{elif}\;x \leq 410:\\
\;\;\;\;\frac{e^{x \cdot \left(eps\_m + -1\right)} + \left(1 + x \cdot \left(-1 - eps\_m\right)\right)}{2}\\
\mathbf{elif}\;x \leq 7.5 \cdot 10^{+89}:\\
\;\;\;\;\frac{2 \cdot \frac{x}{e^{x}}}{2}\\
\mathbf{elif}\;x \leq 1.6 \cdot 10^{+161}:\\
\;\;\;\;\frac{x \cdot eps\_m}{2}\\
\mathbf{elif}\;x \leq 4.8 \cdot 10^{+179}:\\
\;\;\;\;\frac{2 \cdot e^{-x}}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.25 \cdot {x}^{2}}{eps\_m}\\
\end{array}
\end{array}
if x < -9.99999999999999954e-259Initial program 69.8%
fma-neg69.7%
/-rgt-identity69.7%
fma-neg69.8%
/-rgt-identity69.8%
distribute-rgt-neg-in69.8%
sub-neg69.8%
metadata-eval69.8%
distribute-rgt-neg-in69.8%
Simplified69.8%
Taylor expanded in eps around inf 98.0%
Taylor expanded in eps around -inf 98.0%
associate-*r*98.0%
neg-mul-198.0%
mul-1-neg98.0%
sub-neg98.0%
mul-1-neg98.0%
associate-*r*98.0%
neg-mul-198.0%
mul-1-neg98.0%
Simplified98.0%
Taylor expanded in eps around inf 98.0%
associate-*r*98.0%
neg-mul-198.0%
Simplified98.0%
Taylor expanded in x around 0 76.4%
if -9.99999999999999954e-259 < x < 410Initial program 56.2%
fma-neg56.2%
/-rgt-identity56.2%
fma-neg56.2%
/-rgt-identity56.2%
distribute-rgt-neg-in56.2%
sub-neg56.2%
metadata-eval56.2%
distribute-rgt-neg-in56.2%
Simplified56.2%
Taylor expanded in eps around inf 99.8%
Taylor expanded in eps around -inf 99.8%
associate-*r*99.8%
neg-mul-199.8%
mul-1-neg99.8%
sub-neg99.8%
mul-1-neg99.8%
associate-*r*99.8%
neg-mul-199.8%
mul-1-neg99.8%
Simplified99.8%
Taylor expanded in x around 0 89.0%
mul-1-neg89.0%
distribute-rgt-neg-in89.0%
distribute-neg-in89.0%
metadata-eval89.0%
Simplified89.0%
if 410 < x < 7.49999999999999947e89Initial program 95.9%
fma-neg95.9%
/-rgt-identity95.9%
fma-neg95.9%
/-rgt-identity95.9%
distribute-rgt-neg-in95.9%
sub-neg95.9%
metadata-eval95.9%
distribute-rgt-neg-in95.9%
Simplified95.9%
Taylor expanded in eps around 0 76.8%
Simplified76.8%
Taylor expanded in x around inf 72.9%
exp-neg72.9%
associate-*r/72.9%
*-rgt-identity72.9%
Simplified72.9%
Taylor expanded in x around inf 72.8%
rec-exp72.8%
cancel-sign-sub-inv72.8%
metadata-eval72.8%
*-lft-identity72.8%
neg-mul-172.8%
rec-exp72.8%
rec-exp72.8%
distribute-lft-in72.8%
neg-mul-172.8%
count-272.8%
rem-exp-log72.8%
neg-mul-172.8%
exp-sum72.8%
sub-neg72.8%
exp-diff72.8%
rem-exp-log72.8%
Simplified72.8%
if 7.49999999999999947e89 < x < 1.60000000000000001e161Initial program 100.0%
fma-neg100.0%
/-rgt-identity100.0%
fma-neg100.0%
/-rgt-identity100.0%
distribute-rgt-neg-in100.0%
sub-neg100.0%
metadata-eval100.0%
distribute-rgt-neg-in100.0%
Simplified100.0%
Taylor expanded in eps around inf 100.0%
Taylor expanded in x around 0 46.1%
mul-1-neg46.1%
distribute-rgt-neg-in46.1%
sub-neg46.1%
mul-1-neg46.1%
distribute-neg-in46.1%
metadata-eval46.1%
mul-1-neg46.1%
remove-double-neg46.1%
Simplified46.1%
Taylor expanded in eps around inf 37.1%
*-commutative37.1%
Simplified37.1%
if 1.60000000000000001e161 < x < 4.80000000000000025e179Initial program 100.0%
fma-neg100.0%
/-rgt-identity100.0%
fma-neg100.0%
/-rgt-identity100.0%
distribute-rgt-neg-in100.0%
sub-neg100.0%
metadata-eval100.0%
distribute-rgt-neg-in100.0%
Simplified100.0%
Taylor expanded in eps around inf 100.0%
Taylor expanded in eps around 0 80.3%
cancel-sign-sub-inv80.3%
metadata-eval80.3%
distribute-rgt1-in80.3%
metadata-eval80.3%
neg-mul-180.3%
Simplified80.3%
if 4.80000000000000025e179 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 36.1%
Taylor expanded in x around 0 1.6%
neg-mul-11.6%
unsub-neg1.6%
Simplified1.6%
Taylor expanded in x around 0 22.2%
associate-*r/22.2%
Simplified22.2%
Final simplification71.3%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<= x 1.4)
(/ (+ 1.0 (exp (* x (- eps_m)))) 2.0)
(if (<= x 6.8e+93)
(/ (* 2.0 (/ x (exp x))) 2.0)
(if (<= x 2.8e+155)
(/ (* x eps_m) 2.0)
(if (<= x 5e+179)
(/ (* 2.0 (exp (- x))) 2.0)
(/ (* 0.25 (pow x 2.0)) eps_m))))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= 1.4) {
tmp = (1.0 + exp((x * -eps_m))) / 2.0;
} else if (x <= 6.8e+93) {
tmp = (2.0 * (x / exp(x))) / 2.0;
} else if (x <= 2.8e+155) {
tmp = (x * eps_m) / 2.0;
} else if (x <= 5e+179) {
tmp = (2.0 * exp(-x)) / 2.0;
} else {
tmp = (0.25 * pow(x, 2.0)) / eps_m;
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: tmp
if (x <= 1.4d0) then
tmp = (1.0d0 + exp((x * -eps_m))) / 2.0d0
else if (x <= 6.8d+93) then
tmp = (2.0d0 * (x / exp(x))) / 2.0d0
else if (x <= 2.8d+155) then
tmp = (x * eps_m) / 2.0d0
else if (x <= 5d+179) then
tmp = (2.0d0 * exp(-x)) / 2.0d0
else
tmp = (0.25d0 * (x ** 2.0d0)) / eps_m
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (x <= 1.4) {
tmp = (1.0 + Math.exp((x * -eps_m))) / 2.0;
} else if (x <= 6.8e+93) {
tmp = (2.0 * (x / Math.exp(x))) / 2.0;
} else if (x <= 2.8e+155) {
tmp = (x * eps_m) / 2.0;
} else if (x <= 5e+179) {
tmp = (2.0 * Math.exp(-x)) / 2.0;
} else {
tmp = (0.25 * Math.pow(x, 2.0)) / eps_m;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= 1.4: tmp = (1.0 + math.exp((x * -eps_m))) / 2.0 elif x <= 6.8e+93: tmp = (2.0 * (x / math.exp(x))) / 2.0 elif x <= 2.8e+155: tmp = (x * eps_m) / 2.0 elif x <= 5e+179: tmp = (2.0 * math.exp(-x)) / 2.0 else: tmp = (0.25 * math.pow(x, 2.0)) / eps_m return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= 1.4) tmp = Float64(Float64(1.0 + exp(Float64(x * Float64(-eps_m)))) / 2.0); elseif (x <= 6.8e+93) tmp = Float64(Float64(2.0 * Float64(x / exp(x))) / 2.0); elseif (x <= 2.8e+155) tmp = Float64(Float64(x * eps_m) / 2.0); elseif (x <= 5e+179) tmp = Float64(Float64(2.0 * exp(Float64(-x))) / 2.0); else tmp = Float64(Float64(0.25 * (x ^ 2.0)) / eps_m); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (x <= 1.4) tmp = (1.0 + exp((x * -eps_m))) / 2.0; elseif (x <= 6.8e+93) tmp = (2.0 * (x / exp(x))) / 2.0; elseif (x <= 2.8e+155) tmp = (x * eps_m) / 2.0; elseif (x <= 5e+179) tmp = (2.0 * exp(-x)) / 2.0; else tmp = (0.25 * (x ^ 2.0)) / eps_m; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, 1.4], N[(N[(1.0 + N[Exp[N[(x * (-eps$95$m)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 6.8e+93], N[(N[(2.0 * N[(x / N[Exp[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 2.8e+155], N[(N[(x * eps$95$m), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 5e+179], N[(N[(2.0 * N[Exp[(-x)], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(0.25 * N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision] / eps$95$m), $MachinePrecision]]]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.4:\\
\;\;\;\;\frac{1 + e^{x \cdot \left(-eps\_m\right)}}{2}\\
\mathbf{elif}\;x \leq 6.8 \cdot 10^{+93}:\\
\;\;\;\;\frac{2 \cdot \frac{x}{e^{x}}}{2}\\
\mathbf{elif}\;x \leq 2.8 \cdot 10^{+155}:\\
\;\;\;\;\frac{x \cdot eps\_m}{2}\\
\mathbf{elif}\;x \leq 5 \cdot 10^{+179}:\\
\;\;\;\;\frac{2 \cdot e^{-x}}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.25 \cdot {x}^{2}}{eps\_m}\\
\end{array}
\end{array}
if x < 1.3999999999999999Initial program 63.0%
fma-neg63.0%
/-rgt-identity63.0%
fma-neg63.0%
/-rgt-identity63.0%
distribute-rgt-neg-in63.0%
sub-neg63.0%
metadata-eval63.0%
distribute-rgt-neg-in63.0%
Simplified63.0%
Taylor expanded in eps around inf 98.9%
Taylor expanded in eps around -inf 98.9%
associate-*r*98.9%
neg-mul-198.9%
mul-1-neg98.9%
sub-neg98.9%
mul-1-neg98.9%
associate-*r*98.9%
neg-mul-198.9%
mul-1-neg98.9%
Simplified98.9%
Taylor expanded in eps around inf 98.9%
associate-*r*98.9%
neg-mul-198.9%
Simplified98.9%
Taylor expanded in x around 0 81.0%
if 1.3999999999999999 < x < 6.8000000000000001e93Initial program 95.9%
fma-neg95.9%
/-rgt-identity95.9%
fma-neg95.9%
/-rgt-identity95.9%
distribute-rgt-neg-in95.9%
sub-neg95.9%
metadata-eval95.9%
distribute-rgt-neg-in95.9%
Simplified95.9%
Taylor expanded in eps around 0 76.8%
Simplified76.8%
Taylor expanded in x around inf 72.9%
exp-neg72.9%
associate-*r/72.9%
*-rgt-identity72.9%
Simplified72.9%
Taylor expanded in x around inf 72.8%
rec-exp72.8%
cancel-sign-sub-inv72.8%
metadata-eval72.8%
*-lft-identity72.8%
neg-mul-172.8%
rec-exp72.8%
rec-exp72.8%
distribute-lft-in72.8%
neg-mul-172.8%
count-272.8%
rem-exp-log72.8%
neg-mul-172.8%
exp-sum72.8%
sub-neg72.8%
exp-diff72.8%
rem-exp-log72.8%
Simplified72.8%
if 6.8000000000000001e93 < x < 2.80000000000000016e155Initial program 100.0%
fma-neg100.0%
/-rgt-identity100.0%
fma-neg100.0%
/-rgt-identity100.0%
distribute-rgt-neg-in100.0%
sub-neg100.0%
metadata-eval100.0%
distribute-rgt-neg-in100.0%
Simplified100.0%
Taylor expanded in eps around inf 100.0%
Taylor expanded in x around 0 46.1%
mul-1-neg46.1%
distribute-rgt-neg-in46.1%
sub-neg46.1%
mul-1-neg46.1%
distribute-neg-in46.1%
metadata-eval46.1%
mul-1-neg46.1%
remove-double-neg46.1%
Simplified46.1%
Taylor expanded in eps around inf 37.1%
*-commutative37.1%
Simplified37.1%
if 2.80000000000000016e155 < x < 5e179Initial program 100.0%
fma-neg100.0%
/-rgt-identity100.0%
fma-neg100.0%
/-rgt-identity100.0%
distribute-rgt-neg-in100.0%
sub-neg100.0%
metadata-eval100.0%
distribute-rgt-neg-in100.0%
Simplified100.0%
Taylor expanded in eps around inf 100.0%
Taylor expanded in eps around 0 80.3%
cancel-sign-sub-inv80.3%
metadata-eval80.3%
distribute-rgt1-in80.3%
metadata-eval80.3%
neg-mul-180.3%
Simplified80.3%
if 5e179 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 36.1%
Taylor expanded in x around 0 1.6%
neg-mul-11.6%
unsub-neg1.6%
Simplified1.6%
Taylor expanded in x around 0 22.2%
associate-*r/22.2%
Simplified22.2%
Final simplification70.0%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(let* ((t_0 (exp (* x (- eps_m)))))
(if (<= eps_m 0.26)
(/ (* 2.0 (exp (- x))) 2.0)
(if (<= eps_m 5.4e+287)
(/ (+ (+ 1.0 (* x (+ eps_m -1.0))) t_0) 2.0)
(/ (+ 1.0 t_0) 2.0)))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double t_0 = exp((x * -eps_m));
double tmp;
if (eps_m <= 0.26) {
tmp = (2.0 * exp(-x)) / 2.0;
} else if (eps_m <= 5.4e+287) {
tmp = ((1.0 + (x * (eps_m + -1.0))) + t_0) / 2.0;
} else {
tmp = (1.0 + t_0) / 2.0;
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: t_0
real(8) :: tmp
t_0 = exp((x * -eps_m))
if (eps_m <= 0.26d0) then
tmp = (2.0d0 * exp(-x)) / 2.0d0
else if (eps_m <= 5.4d+287) then
tmp = ((1.0d0 + (x * (eps_m + (-1.0d0)))) + t_0) / 2.0d0
else
tmp = (1.0d0 + t_0) / 2.0d0
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double t_0 = Math.exp((x * -eps_m));
double tmp;
if (eps_m <= 0.26) {
tmp = (2.0 * Math.exp(-x)) / 2.0;
} else if (eps_m <= 5.4e+287) {
tmp = ((1.0 + (x * (eps_m + -1.0))) + t_0) / 2.0;
} else {
tmp = (1.0 + t_0) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): t_0 = math.exp((x * -eps_m)) tmp = 0 if eps_m <= 0.26: tmp = (2.0 * math.exp(-x)) / 2.0 elif eps_m <= 5.4e+287: tmp = ((1.0 + (x * (eps_m + -1.0))) + t_0) / 2.0 else: tmp = (1.0 + t_0) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) t_0 = exp(Float64(x * Float64(-eps_m))) tmp = 0.0 if (eps_m <= 0.26) tmp = Float64(Float64(2.0 * exp(Float64(-x))) / 2.0); elseif (eps_m <= 5.4e+287) tmp = Float64(Float64(Float64(1.0 + Float64(x * Float64(eps_m + -1.0))) + t_0) / 2.0); else tmp = Float64(Float64(1.0 + t_0) / 2.0); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) t_0 = exp((x * -eps_m)); tmp = 0.0; if (eps_m <= 0.26) tmp = (2.0 * exp(-x)) / 2.0; elseif (eps_m <= 5.4e+287) tmp = ((1.0 + (x * (eps_m + -1.0))) + t_0) / 2.0; else tmp = (1.0 + t_0) / 2.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision]
code[x_, eps$95$m_] := Block[{t$95$0 = N[Exp[N[(x * (-eps$95$m)), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[eps$95$m, 0.26], N[(N[(2.0 * N[Exp[(-x)], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[eps$95$m, 5.4e+287], N[(N[(N[(1.0 + N[(x * N[(eps$95$m + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(1.0 + t$95$0), $MachinePrecision] / 2.0), $MachinePrecision]]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
t_0 := e^{x \cdot \left(-eps\_m\right)}\\
\mathbf{if}\;eps\_m \leq 0.26:\\
\;\;\;\;\frac{2 \cdot e^{-x}}{2}\\
\mathbf{elif}\;eps\_m \leq 5.4 \cdot 10^{+287}:\\
\;\;\;\;\frac{\left(1 + x \cdot \left(eps\_m + -1\right)\right) + t\_0}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + t\_0}{2}\\
\end{array}
\end{array}
if eps < 0.26000000000000001Initial program 60.5%
fma-neg60.5%
/-rgt-identity60.5%
fma-neg60.5%
/-rgt-identity60.5%
distribute-rgt-neg-in60.5%
sub-neg60.5%
metadata-eval60.5%
distribute-rgt-neg-in60.5%
Simplified60.5%
Taylor expanded in eps around inf 98.4%
Taylor expanded in eps around 0 75.3%
cancel-sign-sub-inv75.3%
metadata-eval75.3%
distribute-rgt1-in75.3%
metadata-eval75.3%
neg-mul-175.3%
Simplified75.3%
if 0.26000000000000001 < eps < 5.3999999999999998e287Initial program 100.0%
fma-neg100.0%
/-rgt-identity100.0%
fma-neg100.0%
/-rgt-identity100.0%
distribute-rgt-neg-in100.0%
sub-neg100.0%
metadata-eval100.0%
distribute-rgt-neg-in100.0%
Simplified100.0%
Taylor expanded in eps around inf 100.0%
Taylor expanded in eps around -inf 100.0%
associate-*r*100.0%
neg-mul-1100.0%
mul-1-neg100.0%
sub-neg100.0%
mul-1-neg100.0%
associate-*r*100.0%
neg-mul-1100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in eps around inf 100.0%
associate-*r*100.0%
neg-mul-1100.0%
Simplified100.0%
Taylor expanded in x around 0 61.3%
mul-1-neg61.3%
distribute-lft-neg-out61.3%
*-commutative61.3%
Simplified61.3%
if 5.3999999999999998e287 < eps Initial program 100.0%
fma-neg100.0%
/-rgt-identity100.0%
fma-neg100.0%
/-rgt-identity100.0%
distribute-rgt-neg-in100.0%
sub-neg100.0%
metadata-eval100.0%
distribute-rgt-neg-in100.0%
Simplified100.0%
Taylor expanded in eps around inf 100.0%
Taylor expanded in eps around -inf 100.0%
associate-*r*100.0%
neg-mul-1100.0%
mul-1-neg100.0%
sub-neg100.0%
mul-1-neg100.0%
associate-*r*100.0%
neg-mul-1100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in eps around inf 100.0%
associate-*r*100.0%
neg-mul-1100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
Final simplification72.0%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(let* ((t_0 (/ (* 2.0 (exp (- x))) 2.0)))
(if (<= x 6.8e+93)
t_0
(if (<= x 1.8e+160)
(/ (* x eps_m) 2.0)
(if (<= x 4.9e+179) t_0 (/ (* 0.25 (pow x 2.0)) eps_m))))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double t_0 = (2.0 * exp(-x)) / 2.0;
double tmp;
if (x <= 6.8e+93) {
tmp = t_0;
} else if (x <= 1.8e+160) {
tmp = (x * eps_m) / 2.0;
} else if (x <= 4.9e+179) {
tmp = t_0;
} else {
tmp = (0.25 * pow(x, 2.0)) / eps_m;
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: t_0
real(8) :: tmp
t_0 = (2.0d0 * exp(-x)) / 2.0d0
if (x <= 6.8d+93) then
tmp = t_0
else if (x <= 1.8d+160) then
tmp = (x * eps_m) / 2.0d0
else if (x <= 4.9d+179) then
tmp = t_0
else
tmp = (0.25d0 * (x ** 2.0d0)) / eps_m
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double t_0 = (2.0 * Math.exp(-x)) / 2.0;
double tmp;
if (x <= 6.8e+93) {
tmp = t_0;
} else if (x <= 1.8e+160) {
tmp = (x * eps_m) / 2.0;
} else if (x <= 4.9e+179) {
tmp = t_0;
} else {
tmp = (0.25 * Math.pow(x, 2.0)) / eps_m;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): t_0 = (2.0 * math.exp(-x)) / 2.0 tmp = 0 if x <= 6.8e+93: tmp = t_0 elif x <= 1.8e+160: tmp = (x * eps_m) / 2.0 elif x <= 4.9e+179: tmp = t_0 else: tmp = (0.25 * math.pow(x, 2.0)) / eps_m return tmp
eps_m = abs(eps) function code(x, eps_m) t_0 = Float64(Float64(2.0 * exp(Float64(-x))) / 2.0) tmp = 0.0 if (x <= 6.8e+93) tmp = t_0; elseif (x <= 1.8e+160) tmp = Float64(Float64(x * eps_m) / 2.0); elseif (x <= 4.9e+179) tmp = t_0; else tmp = Float64(Float64(0.25 * (x ^ 2.0)) / eps_m); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) t_0 = (2.0 * exp(-x)) / 2.0; tmp = 0.0; if (x <= 6.8e+93) tmp = t_0; elseif (x <= 1.8e+160) tmp = (x * eps_m) / 2.0; elseif (x <= 4.9e+179) tmp = t_0; else tmp = (0.25 * (x ^ 2.0)) / eps_m; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision]
code[x_, eps$95$m_] := Block[{t$95$0 = N[(N[(2.0 * N[Exp[(-x)], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]}, If[LessEqual[x, 6.8e+93], t$95$0, If[LessEqual[x, 1.8e+160], N[(N[(x * eps$95$m), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 4.9e+179], t$95$0, N[(N[(0.25 * N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision] / eps$95$m), $MachinePrecision]]]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
t_0 := \frac{2 \cdot e^{-x}}{2}\\
\mathbf{if}\;x \leq 6.8 \cdot 10^{+93}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.8 \cdot 10^{+160}:\\
\;\;\;\;\frac{x \cdot eps\_m}{2}\\
\mathbf{elif}\;x \leq 4.9 \cdot 10^{+179}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{0.25 \cdot {x}^{2}}{eps\_m}\\
\end{array}
\end{array}
if x < 6.8000000000000001e93 or 1.80000000000000011e160 < x < 4.8999999999999999e179Initial program 66.6%
fma-neg66.5%
/-rgt-identity66.5%
fma-neg66.6%
/-rgt-identity66.6%
distribute-rgt-neg-in66.6%
sub-neg66.6%
metadata-eval66.6%
distribute-rgt-neg-in66.6%
Simplified66.6%
Taylor expanded in eps around inf 98.6%
Taylor expanded in eps around 0 76.4%
cancel-sign-sub-inv76.4%
metadata-eval76.4%
distribute-rgt1-in76.4%
metadata-eval76.4%
neg-mul-176.4%
Simplified76.4%
if 6.8000000000000001e93 < x < 1.80000000000000011e160Initial program 100.0%
fma-neg100.0%
/-rgt-identity100.0%
fma-neg100.0%
/-rgt-identity100.0%
distribute-rgt-neg-in100.0%
sub-neg100.0%
metadata-eval100.0%
distribute-rgt-neg-in100.0%
Simplified100.0%
Taylor expanded in eps around inf 100.0%
Taylor expanded in x around 0 46.1%
mul-1-neg46.1%
distribute-rgt-neg-in46.1%
sub-neg46.1%
mul-1-neg46.1%
distribute-neg-in46.1%
metadata-eval46.1%
mul-1-neg46.1%
remove-double-neg46.1%
Simplified46.1%
Taylor expanded in eps around inf 37.1%
*-commutative37.1%
Simplified37.1%
if 4.8999999999999999e179 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 36.1%
Taylor expanded in x around 0 1.6%
neg-mul-11.6%
unsub-neg1.6%
Simplified1.6%
Taylor expanded in x around 0 22.2%
associate-*r/22.2%
Simplified22.2%
Final simplification66.9%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= x -0.95) (* (* x eps_m) -0.5) (if (<= x 410.0) 1.0 (if (<= x 3.8e+93) 0.0 (/ (* x eps_m) 2.0)))))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= -0.95) {
tmp = (x * eps_m) * -0.5;
} else if (x <= 410.0) {
tmp = 1.0;
} else if (x <= 3.8e+93) {
tmp = 0.0;
} else {
tmp = (x * eps_m) / 2.0;
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: tmp
if (x <= (-0.95d0)) then
tmp = (x * eps_m) * (-0.5d0)
else if (x <= 410.0d0) then
tmp = 1.0d0
else if (x <= 3.8d+93) then
tmp = 0.0d0
else
tmp = (x * eps_m) / 2.0d0
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (x <= -0.95) {
tmp = (x * eps_m) * -0.5;
} else if (x <= 410.0) {
tmp = 1.0;
} else if (x <= 3.8e+93) {
tmp = 0.0;
} else {
tmp = (x * eps_m) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= -0.95: tmp = (x * eps_m) * -0.5 elif x <= 410.0: tmp = 1.0 elif x <= 3.8e+93: tmp = 0.0 else: tmp = (x * eps_m) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= -0.95) tmp = Float64(Float64(x * eps_m) * -0.5); elseif (x <= 410.0) tmp = 1.0; elseif (x <= 3.8e+93) tmp = 0.0; else tmp = Float64(Float64(x * eps_m) / 2.0); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (x <= -0.95) tmp = (x * eps_m) * -0.5; elseif (x <= 410.0) tmp = 1.0; elseif (x <= 3.8e+93) tmp = 0.0; else tmp = (x * eps_m) / 2.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, -0.95], N[(N[(x * eps$95$m), $MachinePrecision] * -0.5), $MachinePrecision], If[LessEqual[x, 410.0], 1.0, If[LessEqual[x, 3.8e+93], 0.0, N[(N[(x * eps$95$m), $MachinePrecision] / 2.0), $MachinePrecision]]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.95:\\
\;\;\;\;\left(x \cdot eps\_m\right) \cdot -0.5\\
\mathbf{elif}\;x \leq 410:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{+93}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot eps\_m}{2}\\
\end{array}
\end{array}
if x < -0.94999999999999996Initial program 97.3%
fma-neg97.3%
/-rgt-identity97.3%
fma-neg97.3%
/-rgt-identity97.3%
distribute-rgt-neg-in97.3%
sub-neg97.3%
metadata-eval97.3%
distribute-rgt-neg-in97.3%
Simplified97.3%
Taylor expanded in eps around inf 97.3%
Taylor expanded in x around 0 28.4%
mul-1-neg28.4%
distribute-rgt-neg-in28.4%
sub-neg28.4%
mul-1-neg28.4%
distribute-neg-in28.4%
metadata-eval28.4%
mul-1-neg28.4%
remove-double-neg28.4%
Simplified28.4%
Taylor expanded in eps around inf 15.0%
*-commutative15.0%
Simplified15.0%
frac-2neg15.0%
mul-1-neg15.0%
div-inv15.0%
associate-*r*15.0%
neg-mul-115.0%
add-sqr-sqrt15.0%
sqrt-unprod20.0%
sqr-neg20.0%
sqrt-unprod0.0%
add-sqr-sqrt49.6%
metadata-eval49.6%
metadata-eval49.6%
Applied egg-rr49.6%
if -0.94999999999999996 < x < 410Initial program 54.5%
fma-neg54.4%
/-rgt-identity54.4%
fma-neg54.5%
/-rgt-identity54.5%
distribute-rgt-neg-in54.5%
sub-neg54.5%
metadata-eval54.5%
distribute-rgt-neg-in54.5%
Simplified54.5%
Taylor expanded in x around 0 72.0%
if 410 < x < 3.7999999999999998e93Initial program 95.9%
fma-neg95.9%
/-rgt-identity95.9%
fma-neg95.9%
/-rgt-identity95.9%
distribute-rgt-neg-in95.9%
sub-neg95.9%
metadata-eval95.9%
distribute-rgt-neg-in95.9%
Simplified95.9%
Taylor expanded in eps around inf 94.9%
Taylor expanded in x around 0 14.4%
mul-1-neg14.4%
distribute-rgt-neg-in14.4%
sub-neg14.4%
mul-1-neg14.4%
distribute-neg-in14.4%
metadata-eval14.4%
mul-1-neg14.4%
remove-double-neg14.4%
Simplified14.4%
Taylor expanded in x around 0 2.5%
+-commutative2.5%
associate--l+2.5%
+-commutative2.5%
add-sqr-sqrt2.4%
sqrt-unprod2.3%
mul-1-neg2.3%
mul-1-neg2.3%
sqr-neg2.3%
sqrt-unprod0.0%
add-sqr-sqrt71.4%
+-commutative71.4%
Applied egg-rr71.3%
associate-+r-71.3%
fma-udef71.3%
+-inverses71.3%
Simplified71.3%
if 3.7999999999999998e93 < x Initial program 100.0%
fma-neg100.0%
/-rgt-identity100.0%
fma-neg100.0%
/-rgt-identity100.0%
distribute-rgt-neg-in100.0%
sub-neg100.0%
metadata-eval100.0%
distribute-rgt-neg-in100.0%
Simplified100.0%
Taylor expanded in eps around inf 100.0%
Taylor expanded in x around 0 23.6%
mul-1-neg23.6%
distribute-rgt-neg-in23.6%
sub-neg23.6%
mul-1-neg23.6%
distribute-neg-in23.6%
metadata-eval23.6%
mul-1-neg23.6%
remove-double-neg23.6%
Simplified23.6%
Taylor expanded in eps around inf 20.2%
*-commutative20.2%
Simplified20.2%
Final simplification58.0%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= x -1.0) (* (* x eps_m) -0.5) (if (<= x 410.0) 1.0 0.0)))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= -1.0) {
tmp = (x * eps_m) * -0.5;
} else if (x <= 410.0) {
tmp = 1.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: tmp
if (x <= (-1.0d0)) then
tmp = (x * eps_m) * (-0.5d0)
else if (x <= 410.0d0) then
tmp = 1.0d0
else
tmp = 0.0d0
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (x <= -1.0) {
tmp = (x * eps_m) * -0.5;
} else if (x <= 410.0) {
tmp = 1.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= -1.0: tmp = (x * eps_m) * -0.5 elif x <= 410.0: tmp = 1.0 else: tmp = 0.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= -1.0) tmp = Float64(Float64(x * eps_m) * -0.5); elseif (x <= 410.0) tmp = 1.0; else tmp = 0.0; end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (x <= -1.0) tmp = (x * eps_m) * -0.5; elseif (x <= 410.0) tmp = 1.0; else tmp = 0.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, -1.0], N[(N[(x * eps$95$m), $MachinePrecision] * -0.5), $MachinePrecision], If[LessEqual[x, 410.0], 1.0, 0.0]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\left(x \cdot eps\_m\right) \cdot -0.5\\
\mathbf{elif}\;x \leq 410:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < -1Initial program 97.3%
fma-neg97.3%
/-rgt-identity97.3%
fma-neg97.3%
/-rgt-identity97.3%
distribute-rgt-neg-in97.3%
sub-neg97.3%
metadata-eval97.3%
distribute-rgt-neg-in97.3%
Simplified97.3%
Taylor expanded in eps around inf 97.3%
Taylor expanded in x around 0 28.4%
mul-1-neg28.4%
distribute-rgt-neg-in28.4%
sub-neg28.4%
mul-1-neg28.4%
distribute-neg-in28.4%
metadata-eval28.4%
mul-1-neg28.4%
remove-double-neg28.4%
Simplified28.4%
Taylor expanded in eps around inf 15.0%
*-commutative15.0%
Simplified15.0%
frac-2neg15.0%
mul-1-neg15.0%
div-inv15.0%
associate-*r*15.0%
neg-mul-115.0%
add-sqr-sqrt15.0%
sqrt-unprod20.0%
sqr-neg20.0%
sqrt-unprod0.0%
add-sqr-sqrt49.6%
metadata-eval49.6%
metadata-eval49.6%
Applied egg-rr49.6%
if -1 < x < 410Initial program 54.5%
fma-neg54.4%
/-rgt-identity54.4%
fma-neg54.5%
/-rgt-identity54.5%
distribute-rgt-neg-in54.5%
sub-neg54.5%
metadata-eval54.5%
distribute-rgt-neg-in54.5%
Simplified54.5%
Taylor expanded in x around 0 72.0%
if 410 < x Initial program 99.0%
fma-neg99.0%
/-rgt-identity99.0%
fma-neg99.0%
/-rgt-identity99.0%
distribute-rgt-neg-in99.0%
sub-neg99.0%
metadata-eval99.0%
distribute-rgt-neg-in99.0%
Simplified99.0%
Taylor expanded in eps around inf 98.8%
Taylor expanded in x around 0 21.4%
mul-1-neg21.4%
distribute-rgt-neg-in21.4%
sub-neg21.4%
mul-1-neg21.4%
distribute-neg-in21.4%
metadata-eval21.4%
mul-1-neg21.4%
remove-double-neg21.4%
Simplified21.4%
Taylor expanded in x around 0 1.3%
+-commutative1.3%
associate--l+1.3%
+-commutative1.3%
add-sqr-sqrt1.2%
sqrt-unprod1.0%
mul-1-neg1.0%
mul-1-neg1.0%
sqr-neg1.0%
sqrt-unprod0.0%
add-sqr-sqrt59.0%
+-commutative59.0%
Applied egg-rr46.0%
associate-+r-46.0%
fma-udef46.0%
+-inverses46.6%
Simplified46.6%
Final simplification61.8%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= x 410.0) 1.0 0.0))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= 410.0) {
tmp = 1.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: tmp
if (x <= 410.0d0) then
tmp = 1.0d0
else
tmp = 0.0d0
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (x <= 410.0) {
tmp = 1.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= 410.0: tmp = 1.0 else: tmp = 0.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= 410.0) tmp = 1.0; else tmp = 0.0; end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (x <= 410.0) tmp = 1.0; else tmp = 0.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, 410.0], 1.0, 0.0]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq 410:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 410Initial program 63.0%
fma-neg63.0%
/-rgt-identity63.0%
fma-neg63.0%
/-rgt-identity63.0%
distribute-rgt-neg-in63.0%
sub-neg63.0%
metadata-eval63.0%
distribute-rgt-neg-in63.0%
Simplified63.0%
Taylor expanded in x around 0 58.3%
if 410 < x Initial program 99.0%
fma-neg99.0%
/-rgt-identity99.0%
fma-neg99.0%
/-rgt-identity99.0%
distribute-rgt-neg-in99.0%
sub-neg99.0%
metadata-eval99.0%
distribute-rgt-neg-in99.0%
Simplified99.0%
Taylor expanded in eps around inf 98.8%
Taylor expanded in x around 0 21.4%
mul-1-neg21.4%
distribute-rgt-neg-in21.4%
sub-neg21.4%
mul-1-neg21.4%
distribute-neg-in21.4%
metadata-eval21.4%
mul-1-neg21.4%
remove-double-neg21.4%
Simplified21.4%
Taylor expanded in x around 0 1.3%
+-commutative1.3%
associate--l+1.3%
+-commutative1.3%
add-sqr-sqrt1.2%
sqrt-unprod1.0%
mul-1-neg1.0%
mul-1-neg1.0%
sqr-neg1.0%
sqrt-unprod0.0%
add-sqr-sqrt59.0%
+-commutative59.0%
Applied egg-rr46.0%
associate-+r-46.0%
fma-udef46.0%
+-inverses46.6%
Simplified46.6%
Final simplification55.1%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 0.0)
eps_m = fabs(eps);
double code(double x, double eps_m) {
return 0.0;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
code = 0.0d0
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
return 0.0;
}
eps_m = math.fabs(eps) def code(x, eps_m): return 0.0
eps_m = abs(eps) function code(x, eps_m) return 0.0 end
eps_m = abs(eps); function tmp = code(x, eps_m) tmp = 0.0; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := 0.0
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
0
\end{array}
Initial program 72.8%
fma-neg72.8%
/-rgt-identity72.8%
fma-neg72.8%
/-rgt-identity72.8%
distribute-rgt-neg-in72.8%
sub-neg72.8%
metadata-eval72.8%
distribute-rgt-neg-in72.8%
Simplified72.8%
Taylor expanded in eps around inf 98.9%
Taylor expanded in x around 0 59.7%
mul-1-neg59.7%
distribute-rgt-neg-in59.7%
sub-neg59.7%
mul-1-neg59.7%
distribute-neg-in59.7%
metadata-eval59.7%
mul-1-neg59.7%
remove-double-neg59.7%
Simplified59.7%
Taylor expanded in x around 0 41.9%
+-commutative41.9%
associate--l+41.9%
+-commutative41.9%
add-sqr-sqrt0.6%
sqrt-unprod2.0%
mul-1-neg2.0%
mul-1-neg2.0%
sqr-neg2.0%
sqrt-unprod1.7%
add-sqr-sqrt20.2%
+-commutative20.2%
Applied egg-rr14.4%
associate-+r-14.2%
fma-udef14.2%
+-inverses14.5%
Simplified14.5%
Final simplification14.5%
herbie shell --seed 2024031
(FPCore (x eps)
:name "NMSE Section 6.1 mentioned, A"
:precision binary64
(/ (- (* (+ 1.0 (/ 1.0 eps)) (exp (- (* (- 1.0 eps) x)))) (* (- (/ 1.0 eps) 1.0) (exp (- (* (+ 1.0 eps) x))))) 2.0))