
(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 18 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
(let* ((t_0 (* x (+ -1.0 eps_m))))
(if (<= x 1.65e-9)
(/ (+ (pow E t_0) (exp (* x (- eps_m)))) 2.0)
(/ (+ (exp t_0) (exp (- x))) 2.0))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double t_0 = x * (-1.0 + eps_m);
double tmp;
if (x <= 1.65e-9) {
tmp = (pow(((double) M_E), t_0) + exp((x * -eps_m))) / 2.0;
} else {
tmp = (exp(t_0) + exp(-x)) / 2.0;
}
return tmp;
}
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double t_0 = x * (-1.0 + eps_m);
double tmp;
if (x <= 1.65e-9) {
tmp = (Math.pow(Math.E, t_0) + Math.exp((x * -eps_m))) / 2.0;
} else {
tmp = (Math.exp(t_0) + Math.exp(-x)) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): t_0 = x * (-1.0 + eps_m) tmp = 0 if x <= 1.65e-9: tmp = (math.pow(math.e, t_0) + math.exp((x * -eps_m))) / 2.0 else: tmp = (math.exp(t_0) + math.exp(-x)) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) t_0 = Float64(x * Float64(-1.0 + eps_m)) tmp = 0.0 if (x <= 1.65e-9) tmp = Float64(Float64((exp(1) ^ t_0) + exp(Float64(x * Float64(-eps_m)))) / 2.0); else tmp = Float64(Float64(exp(t_0) + exp(Float64(-x))) / 2.0); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) t_0 = x * (-1.0 + eps_m); tmp = 0.0; if (x <= 1.65e-9) tmp = ((2.71828182845904523536 ^ t_0) + exp((x * -eps_m))) / 2.0; else tmp = (exp(t_0) + exp(-x)) / 2.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision]
code[x_, eps$95$m_] := Block[{t$95$0 = N[(x * N[(-1.0 + eps$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 1.65e-9], N[(N[(N[Power[E, t$95$0], $MachinePrecision] + N[Exp[N[(x * (-eps$95$m)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(N[Exp[t$95$0], $MachinePrecision] + N[Exp[(-x)], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
t_0 := x \cdot \left(-1 + eps\_m\right)\\
\mathbf{if}\;x \leq 1.65 \cdot 10^{-9}:\\
\;\;\;\;\frac{{e}^{t\_0} + e^{x \cdot \left(-eps\_m\right)}}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{t\_0} + e^{-x}}{2}\\
\end{array}
\end{array}
if x < 1.65000000000000009e-9Initial program 64.5%
Simplified45.1%
Taylor expanded in eps around inf 99.3%
*-un-lft-identity99.3%
exp-prod99.3%
sub-neg99.3%
metadata-eval99.3%
Applied egg-rr99.3%
exp-1-e99.3%
Simplified99.3%
Taylor expanded in eps around inf 99.3%
*-commutative99.3%
Simplified99.3%
if 1.65000000000000009e-9 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around inf 100.0%
Taylor expanded in eps around 0 83.8%
Final simplification94.9%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(let* ((t_0 (exp (* x (- eps_m)))))
(if (<= x -1e-227)
(/ (+ 1.0 t_0) 2.0)
(if (<= x 9e+54)
(/ (+ (exp (* x (+ -1.0 eps_m))) (- 1.0 (* x eps_m))) 2.0)
(if (<= x 3.1e+197)
(/ (+ (+ 1.0 (/ 1.0 eps_m)) (- 1.0 (/ 1.0 eps_m))) 2.0)
(if (or (<= x 6e+262) (not (<= x 1.05e+300)))
(/ (* x eps_m) 2.0)
(/ (+ t_0 (exp (- x))) 2.0)))))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double t_0 = exp((x * -eps_m));
double tmp;
if (x <= -1e-227) {
tmp = (1.0 + t_0) / 2.0;
} else if (x <= 9e+54) {
tmp = (exp((x * (-1.0 + eps_m))) + (1.0 - (x * eps_m))) / 2.0;
} else if (x <= 3.1e+197) {
tmp = ((1.0 + (1.0 / eps_m)) + (1.0 - (1.0 / eps_m))) / 2.0;
} else if ((x <= 6e+262) || !(x <= 1.05e+300)) {
tmp = (x * eps_m) / 2.0;
} else {
tmp = (t_0 + exp(-x)) / 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 (x <= (-1d-227)) then
tmp = (1.0d0 + t_0) / 2.0d0
else if (x <= 9d+54) then
tmp = (exp((x * ((-1.0d0) + eps_m))) + (1.0d0 - (x * eps_m))) / 2.0d0
else if (x <= 3.1d+197) then
tmp = ((1.0d0 + (1.0d0 / eps_m)) + (1.0d0 - (1.0d0 / eps_m))) / 2.0d0
else if ((x <= 6d+262) .or. (.not. (x <= 1.05d+300))) then
tmp = (x * eps_m) / 2.0d0
else
tmp = (t_0 + exp(-x)) / 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 (x <= -1e-227) {
tmp = (1.0 + t_0) / 2.0;
} else if (x <= 9e+54) {
tmp = (Math.exp((x * (-1.0 + eps_m))) + (1.0 - (x * eps_m))) / 2.0;
} else if (x <= 3.1e+197) {
tmp = ((1.0 + (1.0 / eps_m)) + (1.0 - (1.0 / eps_m))) / 2.0;
} else if ((x <= 6e+262) || !(x <= 1.05e+300)) {
tmp = (x * eps_m) / 2.0;
} else {
tmp = (t_0 + Math.exp(-x)) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): t_0 = math.exp((x * -eps_m)) tmp = 0 if x <= -1e-227: tmp = (1.0 + t_0) / 2.0 elif x <= 9e+54: tmp = (math.exp((x * (-1.0 + eps_m))) + (1.0 - (x * eps_m))) / 2.0 elif x <= 3.1e+197: tmp = ((1.0 + (1.0 / eps_m)) + (1.0 - (1.0 / eps_m))) / 2.0 elif (x <= 6e+262) or not (x <= 1.05e+300): tmp = (x * eps_m) / 2.0 else: tmp = (t_0 + math.exp(-x)) / 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 (x <= -1e-227) tmp = Float64(Float64(1.0 + t_0) / 2.0); elseif (x <= 9e+54) tmp = Float64(Float64(exp(Float64(x * Float64(-1.0 + eps_m))) + Float64(1.0 - Float64(x * eps_m))) / 2.0); elseif (x <= 3.1e+197) tmp = Float64(Float64(Float64(1.0 + Float64(1.0 / eps_m)) + Float64(1.0 - Float64(1.0 / eps_m))) / 2.0); elseif ((x <= 6e+262) || !(x <= 1.05e+300)) tmp = Float64(Float64(x * eps_m) / 2.0); else tmp = Float64(Float64(t_0 + exp(Float64(-x))) / 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 (x <= -1e-227) tmp = (1.0 + t_0) / 2.0; elseif (x <= 9e+54) tmp = (exp((x * (-1.0 + eps_m))) + (1.0 - (x * eps_m))) / 2.0; elseif (x <= 3.1e+197) tmp = ((1.0 + (1.0 / eps_m)) + (1.0 - (1.0 / eps_m))) / 2.0; elseif ((x <= 6e+262) || ~((x <= 1.05e+300))) tmp = (x * eps_m) / 2.0; else tmp = (t_0 + exp(-x)) / 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[x, -1e-227], N[(N[(1.0 + t$95$0), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 9e+54], N[(N[(N[Exp[N[(x * N[(-1.0 + eps$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(1.0 - N[(x * eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 3.1e+197], N[(N[(N[(1.0 + N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[Or[LessEqual[x, 6e+262], N[Not[LessEqual[x, 1.05e+300]], $MachinePrecision]], N[(N[(x * eps$95$m), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(t$95$0 + N[Exp[(-x)], $MachinePrecision]), $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}\;x \leq -1 \cdot 10^{-227}:\\
\;\;\;\;\frac{1 + t\_0}{2}\\
\mathbf{elif}\;x \leq 9 \cdot 10^{+54}:\\
\;\;\;\;\frac{e^{x \cdot \left(-1 + eps\_m\right)} + \left(1 - x \cdot eps\_m\right)}{2}\\
\mathbf{elif}\;x \leq 3.1 \cdot 10^{+197}:\\
\;\;\;\;\frac{\left(1 + \frac{1}{eps\_m}\right) + \left(1 - \frac{1}{eps\_m}\right)}{2}\\
\mathbf{elif}\;x \leq 6 \cdot 10^{+262} \lor \neg \left(x \leq 1.05 \cdot 10^{+300}\right):\\
\;\;\;\;\frac{x \cdot eps\_m}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_0 + e^{-x}}{2}\\
\end{array}
\end{array}
if x < -9.99999999999999945e-228Initial program 74.4%
Simplified63.4%
Taylor expanded in eps around inf 98.9%
Taylor expanded in eps around inf 98.9%
*-commutative98.9%
Simplified98.9%
Taylor expanded in x around 0 63.8%
if -9.99999999999999945e-228 < x < 8.99999999999999968e54Initial program 63.2%
Simplified40.9%
Taylor expanded in eps around inf 99.7%
Taylor expanded in eps around inf 95.6%
*-commutative95.6%
Simplified95.6%
Taylor expanded in x around 0 83.8%
mul-1-neg83.8%
*-commutative83.8%
unsub-neg83.8%
Simplified83.8%
if 8.99999999999999968e54 < x < 3.1e197Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 18.3%
Taylor expanded in x around 0 63.3%
if 3.1e197 < x < 6.0000000000000001e262 or 1.05000000000000006e300 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 63.8%
Taylor expanded in x around inf 63.8%
associate-*r*63.8%
*-commutative63.8%
associate-*r*63.8%
sub-neg63.8%
neg-mul-163.8%
associate-*r*63.8%
mul-1-neg63.8%
neg-sub063.8%
distribute-rgt-in63.8%
*-lft-identity63.8%
neg-mul-163.8%
cancel-sign-sub-inv63.8%
associate-+l-63.8%
neg-sub063.8%
neg-mul-163.8%
+-commutative63.8%
distribute-rgt-in63.8%
Simplified63.8%
Taylor expanded in eps around inf 63.9%
*-commutative63.9%
Simplified63.9%
if 6.0000000000000001e262 < x < 1.05000000000000006e300Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around inf 100.0%
Taylor expanded in eps around inf 40.9%
*-commutative40.9%
Simplified40.9%
Taylor expanded in eps around 0 40.9%
neg-mul-140.9%
Simplified40.9%
Final simplification72.3%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(let* ((t_0 (exp (* x (+ -1.0 eps_m)))))
(if (<= x 1.65e-9)
(/ (+ t_0 (exp (* x (- eps_m)))) 2.0)
(/ (+ t_0 (exp (- x))) 2.0))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double t_0 = exp((x * (-1.0 + eps_m)));
double tmp;
if (x <= 1.65e-9) {
tmp = (t_0 + exp((x * -eps_m))) / 2.0;
} else {
tmp = (t_0 + exp(-x)) / 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 * ((-1.0d0) + eps_m)))
if (x <= 1.65d-9) then
tmp = (t_0 + exp((x * -eps_m))) / 2.0d0
else
tmp = (t_0 + exp(-x)) / 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 * (-1.0 + eps_m)));
double tmp;
if (x <= 1.65e-9) {
tmp = (t_0 + Math.exp((x * -eps_m))) / 2.0;
} else {
tmp = (t_0 + Math.exp(-x)) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): t_0 = math.exp((x * (-1.0 + eps_m))) tmp = 0 if x <= 1.65e-9: tmp = (t_0 + math.exp((x * -eps_m))) / 2.0 else: tmp = (t_0 + math.exp(-x)) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) t_0 = exp(Float64(x * Float64(-1.0 + eps_m))) tmp = 0.0 if (x <= 1.65e-9) tmp = Float64(Float64(t_0 + exp(Float64(x * Float64(-eps_m)))) / 2.0); else tmp = Float64(Float64(t_0 + exp(Float64(-x))) / 2.0); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) t_0 = exp((x * (-1.0 + eps_m))); tmp = 0.0; if (x <= 1.65e-9) tmp = (t_0 + exp((x * -eps_m))) / 2.0; else tmp = (t_0 + exp(-x)) / 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 * N[(-1.0 + eps$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, 1.65e-9], N[(N[(t$95$0 + N[Exp[N[(x * (-eps$95$m)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(t$95$0 + N[Exp[(-x)], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
t_0 := e^{x \cdot \left(-1 + eps\_m\right)}\\
\mathbf{if}\;x \leq 1.65 \cdot 10^{-9}:\\
\;\;\;\;\frac{t\_0 + e^{x \cdot \left(-eps\_m\right)}}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_0 + e^{-x}}{2}\\
\end{array}
\end{array}
if x < 1.65000000000000009e-9Initial program 64.5%
Simplified45.1%
Taylor expanded in eps around inf 99.3%
Taylor expanded in eps around inf 99.3%
*-commutative99.3%
Simplified99.3%
Taylor expanded in x around inf 99.3%
associate-*r*99.3%
neg-mul-199.3%
Simplified99.3%
if 1.65000000000000009e-9 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around inf 100.0%
Taylor expanded in eps around 0 83.8%
Final simplification94.9%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= x -9.8e-228) (/ (+ 1.0 (exp (* x (- eps_m)))) 2.0) (/ (+ (pow E (* x (+ -1.0 eps_m))) (exp (- x))) 2.0)))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= -9.8e-228) {
tmp = (1.0 + exp((x * -eps_m))) / 2.0;
} else {
tmp = (pow(((double) M_E), (x * (-1.0 + eps_m))) + exp(-x)) / 2.0;
}
return tmp;
}
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (x <= -9.8e-228) {
tmp = (1.0 + Math.exp((x * -eps_m))) / 2.0;
} else {
tmp = (Math.pow(Math.E, (x * (-1.0 + eps_m))) + Math.exp(-x)) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= -9.8e-228: tmp = (1.0 + math.exp((x * -eps_m))) / 2.0 else: tmp = (math.pow(math.e, (x * (-1.0 + eps_m))) + math.exp(-x)) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= -9.8e-228) tmp = Float64(Float64(1.0 + exp(Float64(x * Float64(-eps_m)))) / 2.0); else tmp = Float64(Float64((exp(1) ^ Float64(x * Float64(-1.0 + eps_m))) + exp(Float64(-x))) / 2.0); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (x <= -9.8e-228) tmp = (1.0 + exp((x * -eps_m))) / 2.0; else tmp = ((2.71828182845904523536 ^ (x * (-1.0 + eps_m))) + exp(-x)) / 2.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, -9.8e-228], N[(N[(1.0 + N[Exp[N[(x * (-eps$95$m)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(N[Power[E, N[(x * N[(-1.0 + eps$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[Exp[(-x)], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.8 \cdot 10^{-228}:\\
\;\;\;\;\frac{1 + e^{x \cdot \left(-eps\_m\right)}}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{{e}^{\left(x \cdot \left(-1 + eps\_m\right)\right)} + e^{-x}}{2}\\
\end{array}
\end{array}
if x < -9.79999999999999976e-228Initial program 74.4%
Simplified63.4%
Taylor expanded in eps around inf 98.9%
Taylor expanded in eps around inf 98.9%
*-commutative98.9%
Simplified98.9%
Taylor expanded in x around 0 63.8%
if -9.79999999999999976e-228 < x Initial program 74.7%
Simplified59.4%
Taylor expanded in eps around inf 99.8%
*-un-lft-identity99.8%
exp-prod99.8%
sub-neg99.8%
metadata-eval99.8%
Applied egg-rr99.8%
exp-1-e99.8%
Simplified99.8%
Taylor expanded in eps around 0 86.2%
Final simplification78.6%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= x -1e-221) (/ (+ 1.0 (exp (* x (- eps_m)))) 2.0) (/ (+ (exp (* x (+ -1.0 eps_m))) (exp (- x))) 2.0)))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= -1e-221) {
tmp = (1.0 + exp((x * -eps_m))) / 2.0;
} else {
tmp = (exp((x * (-1.0 + eps_m))) + exp(-x)) / 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 <= (-1d-221)) then
tmp = (1.0d0 + exp((x * -eps_m))) / 2.0d0
else
tmp = (exp((x * ((-1.0d0) + eps_m))) + exp(-x)) / 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 <= -1e-221) {
tmp = (1.0 + Math.exp((x * -eps_m))) / 2.0;
} else {
tmp = (Math.exp((x * (-1.0 + eps_m))) + Math.exp(-x)) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= -1e-221: tmp = (1.0 + math.exp((x * -eps_m))) / 2.0 else: tmp = (math.exp((x * (-1.0 + eps_m))) + math.exp(-x)) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= -1e-221) tmp = Float64(Float64(1.0 + exp(Float64(x * Float64(-eps_m)))) / 2.0); else tmp = Float64(Float64(exp(Float64(x * Float64(-1.0 + eps_m))) + exp(Float64(-x))) / 2.0); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (x <= -1e-221) tmp = (1.0 + exp((x * -eps_m))) / 2.0; else tmp = (exp((x * (-1.0 + eps_m))) + exp(-x)) / 2.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, -1e-221], N[(N[(1.0 + N[Exp[N[(x * (-eps$95$m)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(N[Exp[N[(x * N[(-1.0 + eps$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[Exp[(-x)], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1 \cdot 10^{-221}:\\
\;\;\;\;\frac{1 + e^{x \cdot \left(-eps\_m\right)}}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{x \cdot \left(-1 + eps\_m\right)} + e^{-x}}{2}\\
\end{array}
\end{array}
if x < -1.00000000000000002e-221Initial program 74.4%
Simplified63.4%
Taylor expanded in eps around inf 98.9%
Taylor expanded in eps around inf 98.9%
*-commutative98.9%
Simplified98.9%
Taylor expanded in x around 0 63.8%
if -1.00000000000000002e-221 < x Initial program 74.7%
Simplified59.4%
Taylor expanded in eps around inf 99.8%
Taylor expanded in eps around 0 86.2%
Final simplification78.6%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (/ (+ (exp (* x (- -1.0 eps_m))) (pow E (* x (+ -1.0 eps_m)))) 2.0))
eps_m = fabs(eps);
double code(double x, double eps_m) {
return (exp((x * (-1.0 - eps_m))) + pow(((double) M_E), (x * (-1.0 + eps_m)))) / 2.0;
}
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
return (Math.exp((x * (-1.0 - eps_m))) + Math.pow(Math.E, (x * (-1.0 + eps_m)))) / 2.0;
}
eps_m = math.fabs(eps) def code(x, eps_m): return (math.exp((x * (-1.0 - eps_m))) + math.pow(math.e, (x * (-1.0 + eps_m)))) / 2.0
eps_m = abs(eps) function code(x, eps_m) return Float64(Float64(exp(Float64(x * Float64(-1.0 - eps_m))) + (exp(1) ^ Float64(x * Float64(-1.0 + eps_m)))) / 2.0) end
eps_m = abs(eps); function tmp = code(x, eps_m) tmp = (exp((x * (-1.0 - eps_m))) + (2.71828182845904523536 ^ (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[(-1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[Power[E, 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(-1 - eps\_m\right)} + {e}^{\left(x \cdot \left(-1 + eps\_m\right)\right)}}{2}
\end{array}
Initial program 74.6%
Simplified60.8%
Taylor expanded in eps around inf 99.5%
*-un-lft-identity99.5%
exp-prod99.5%
sub-neg99.5%
metadata-eval99.5%
Applied egg-rr99.5%
exp-1-e99.5%
Simplified99.5%
Final simplification99.5%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (/ (+ (exp (* x (- -1.0 eps_m))) (exp (* x (+ -1.0 eps_m)))) 2.0))
eps_m = fabs(eps);
double code(double x, double eps_m) {
return (exp((x * (-1.0 - eps_m))) + 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 * ((-1.0d0) - eps_m))) + 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 * (-1.0 - eps_m))) + Math.exp((x * (-1.0 + eps_m)))) / 2.0;
}
eps_m = math.fabs(eps) def code(x, eps_m): return (math.exp((x * (-1.0 - eps_m))) + 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(-1.0 - eps_m))) + exp(Float64(x * Float64(-1.0 + eps_m)))) / 2.0) end
eps_m = abs(eps); function tmp = code(x, eps_m) tmp = (exp((x * (-1.0 - eps_m))) + 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[(-1.0 - eps$95$m), $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(-1 - eps\_m\right)} + e^{x \cdot \left(-1 + eps\_m\right)}}{2}
\end{array}
Initial program 74.6%
Simplified60.8%
Taylor expanded in eps around inf 99.5%
Final simplification99.5%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(let* ((t_0 (- 1.0 (/ 1.0 eps_m))) (t_1 (+ 1.0 (/ 1.0 eps_m))))
(if (<= x -9.8e-228)
(/ (+ 1.0 (exp (* x (- eps_m)))) 2.0)
(if (<= x 9.5e+54)
(/ (+ (exp (* x (+ -1.0 eps_m))) (- 1.0 (* x eps_m))) 2.0)
(if (<= x 7e+196)
(/ (+ t_1 t_0) 2.0)
(/ (+ t_1 (* (exp (- (* x eps_m) x)) t_0)) 2.0))))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double t_0 = 1.0 - (1.0 / eps_m);
double t_1 = 1.0 + (1.0 / eps_m);
double tmp;
if (x <= -9.8e-228) {
tmp = (1.0 + exp((x * -eps_m))) / 2.0;
} else if (x <= 9.5e+54) {
tmp = (exp((x * (-1.0 + eps_m))) + (1.0 - (x * eps_m))) / 2.0;
} else if (x <= 7e+196) {
tmp = (t_1 + t_0) / 2.0;
} else {
tmp = (t_1 + (exp(((x * eps_m) - x)) * 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) :: t_1
real(8) :: tmp
t_0 = 1.0d0 - (1.0d0 / eps_m)
t_1 = 1.0d0 + (1.0d0 / eps_m)
if (x <= (-9.8d-228)) then
tmp = (1.0d0 + exp((x * -eps_m))) / 2.0d0
else if (x <= 9.5d+54) then
tmp = (exp((x * ((-1.0d0) + eps_m))) + (1.0d0 - (x * eps_m))) / 2.0d0
else if (x <= 7d+196) then
tmp = (t_1 + t_0) / 2.0d0
else
tmp = (t_1 + (exp(((x * eps_m) - x)) * 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 = 1.0 - (1.0 / eps_m);
double t_1 = 1.0 + (1.0 / eps_m);
double tmp;
if (x <= -9.8e-228) {
tmp = (1.0 + Math.exp((x * -eps_m))) / 2.0;
} else if (x <= 9.5e+54) {
tmp = (Math.exp((x * (-1.0 + eps_m))) + (1.0 - (x * eps_m))) / 2.0;
} else if (x <= 7e+196) {
tmp = (t_1 + t_0) / 2.0;
} else {
tmp = (t_1 + (Math.exp(((x * eps_m) - x)) * t_0)) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): t_0 = 1.0 - (1.0 / eps_m) t_1 = 1.0 + (1.0 / eps_m) tmp = 0 if x <= -9.8e-228: tmp = (1.0 + math.exp((x * -eps_m))) / 2.0 elif x <= 9.5e+54: tmp = (math.exp((x * (-1.0 + eps_m))) + (1.0 - (x * eps_m))) / 2.0 elif x <= 7e+196: tmp = (t_1 + t_0) / 2.0 else: tmp = (t_1 + (math.exp(((x * eps_m) - x)) * t_0)) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) t_0 = Float64(1.0 - Float64(1.0 / eps_m)) t_1 = Float64(1.0 + Float64(1.0 / eps_m)) tmp = 0.0 if (x <= -9.8e-228) tmp = Float64(Float64(1.0 + exp(Float64(x * Float64(-eps_m)))) / 2.0); elseif (x <= 9.5e+54) tmp = Float64(Float64(exp(Float64(x * Float64(-1.0 + eps_m))) + Float64(1.0 - Float64(x * eps_m))) / 2.0); elseif (x <= 7e+196) tmp = Float64(Float64(t_1 + t_0) / 2.0); else tmp = Float64(Float64(t_1 + Float64(exp(Float64(Float64(x * eps_m) - x)) * t_0)) / 2.0); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) t_0 = 1.0 - (1.0 / eps_m); t_1 = 1.0 + (1.0 / eps_m); tmp = 0.0; if (x <= -9.8e-228) tmp = (1.0 + exp((x * -eps_m))) / 2.0; elseif (x <= 9.5e+54) tmp = (exp((x * (-1.0 + eps_m))) + (1.0 - (x * eps_m))) / 2.0; elseif (x <= 7e+196) tmp = (t_1 + t_0) / 2.0; else tmp = (t_1 + (exp(((x * eps_m) - x)) * 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[(1.0 - N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 + N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -9.8e-228], N[(N[(1.0 + N[Exp[N[(x * (-eps$95$m)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 9.5e+54], N[(N[(N[Exp[N[(x * N[(-1.0 + eps$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(1.0 - N[(x * eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 7e+196], N[(N[(t$95$1 + t$95$0), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(t$95$1 + N[(N[Exp[N[(N[(x * eps$95$m), $MachinePrecision] - x), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]]]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
t_0 := 1 - \frac{1}{eps\_m}\\
t_1 := 1 + \frac{1}{eps\_m}\\
\mathbf{if}\;x \leq -9.8 \cdot 10^{-228}:\\
\;\;\;\;\frac{1 + e^{x \cdot \left(-eps\_m\right)}}{2}\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{+54}:\\
\;\;\;\;\frac{e^{x \cdot \left(-1 + eps\_m\right)} + \left(1 - x \cdot eps\_m\right)}{2}\\
\mathbf{elif}\;x \leq 7 \cdot 10^{+196}:\\
\;\;\;\;\frac{t\_1 + t\_0}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_1 + e^{x \cdot eps\_m - x} \cdot t\_0}{2}\\
\end{array}
\end{array}
if x < -9.79999999999999976e-228Initial program 74.4%
Simplified63.4%
Taylor expanded in eps around inf 98.9%
Taylor expanded in eps around inf 98.9%
*-commutative98.9%
Simplified98.9%
Taylor expanded in x around 0 63.8%
if -9.79999999999999976e-228 < x < 9.4999999999999999e54Initial program 63.2%
Simplified40.9%
Taylor expanded in eps around inf 99.7%
Taylor expanded in eps around inf 95.6%
*-commutative95.6%
Simplified95.6%
Taylor expanded in x around 0 83.8%
mul-1-neg83.8%
*-commutative83.8%
unsub-neg83.8%
Simplified83.8%
if 9.4999999999999999e54 < x < 6.9999999999999997e196Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 18.3%
Taylor expanded in x around 0 63.3%
if 6.9999999999999997e196 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 21.0%
*-commutative21.0%
+-commutative21.0%
distribute-rgt-in21.0%
add-sqr-sqrt0.0%
sqrt-unprod45.1%
sqr-neg45.1%
sqrt-unprod45.2%
add-sqr-sqrt45.2%
*-un-lft-identity45.2%
unsub-neg45.2%
Applied egg-rr45.2%
Final simplification71.6%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<= x -2e-215)
(/ (+ 1.0 (exp (* x (- eps_m)))) 2.0)
(if (<= x 6.2e+54)
(/ (+ (exp (* x (+ -1.0 eps_m))) (- 1.0 (* x eps_m))) 2.0)
(if (<= x 7e+196)
(/ (+ (+ 1.0 (/ 1.0 eps_m)) (- 1.0 (/ 1.0 eps_m))) 2.0)
(/ (* x eps_m) 2.0)))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= -2e-215) {
tmp = (1.0 + exp((x * -eps_m))) / 2.0;
} else if (x <= 6.2e+54) {
tmp = (exp((x * (-1.0 + eps_m))) + (1.0 - (x * eps_m))) / 2.0;
} else if (x <= 7e+196) {
tmp = ((1.0 + (1.0 / eps_m)) + (1.0 - (1.0 / eps_m))) / 2.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 <= (-2d-215)) then
tmp = (1.0d0 + exp((x * -eps_m))) / 2.0d0
else if (x <= 6.2d+54) then
tmp = (exp((x * ((-1.0d0) + eps_m))) + (1.0d0 - (x * eps_m))) / 2.0d0
else if (x <= 7d+196) then
tmp = ((1.0d0 + (1.0d0 / eps_m)) + (1.0d0 - (1.0d0 / eps_m))) / 2.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 <= -2e-215) {
tmp = (1.0 + Math.exp((x * -eps_m))) / 2.0;
} else if (x <= 6.2e+54) {
tmp = (Math.exp((x * (-1.0 + eps_m))) + (1.0 - (x * eps_m))) / 2.0;
} else if (x <= 7e+196) {
tmp = ((1.0 + (1.0 / eps_m)) + (1.0 - (1.0 / eps_m))) / 2.0;
} else {
tmp = (x * eps_m) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= -2e-215: tmp = (1.0 + math.exp((x * -eps_m))) / 2.0 elif x <= 6.2e+54: tmp = (math.exp((x * (-1.0 + eps_m))) + (1.0 - (x * eps_m))) / 2.0 elif x <= 7e+196: tmp = ((1.0 + (1.0 / eps_m)) + (1.0 - (1.0 / eps_m))) / 2.0 else: tmp = (x * eps_m) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= -2e-215) tmp = Float64(Float64(1.0 + exp(Float64(x * Float64(-eps_m)))) / 2.0); elseif (x <= 6.2e+54) tmp = Float64(Float64(exp(Float64(x * Float64(-1.0 + eps_m))) + Float64(1.0 - Float64(x * eps_m))) / 2.0); elseif (x <= 7e+196) tmp = Float64(Float64(Float64(1.0 + Float64(1.0 / eps_m)) + Float64(1.0 - Float64(1.0 / eps_m))) / 2.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 <= -2e-215) tmp = (1.0 + exp((x * -eps_m))) / 2.0; elseif (x <= 6.2e+54) tmp = (exp((x * (-1.0 + eps_m))) + (1.0 - (x * eps_m))) / 2.0; elseif (x <= 7e+196) tmp = ((1.0 + (1.0 / eps_m)) + (1.0 - (1.0 / eps_m))) / 2.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, -2e-215], N[(N[(1.0 + N[Exp[N[(x * (-eps$95$m)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 6.2e+54], N[(N[(N[Exp[N[(x * N[(-1.0 + eps$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(1.0 - N[(x * eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 7e+196], N[(N[(N[(1.0 + N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], 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 -2 \cdot 10^{-215}:\\
\;\;\;\;\frac{1 + e^{x \cdot \left(-eps\_m\right)}}{2}\\
\mathbf{elif}\;x \leq 6.2 \cdot 10^{+54}:\\
\;\;\;\;\frac{e^{x \cdot \left(-1 + eps\_m\right)} + \left(1 - x \cdot eps\_m\right)}{2}\\
\mathbf{elif}\;x \leq 7 \cdot 10^{+196}:\\
\;\;\;\;\frac{\left(1 + \frac{1}{eps\_m}\right) + \left(1 - \frac{1}{eps\_m}\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot eps\_m}{2}\\
\end{array}
\end{array}
if x < -2.00000000000000008e-215Initial program 74.4%
Simplified63.4%
Taylor expanded in eps around inf 98.9%
Taylor expanded in eps around inf 98.9%
*-commutative98.9%
Simplified98.9%
Taylor expanded in x around 0 63.8%
if -2.00000000000000008e-215 < x < 6.1999999999999999e54Initial program 63.2%
Simplified40.9%
Taylor expanded in eps around inf 99.7%
Taylor expanded in eps around inf 95.6%
*-commutative95.6%
Simplified95.6%
Taylor expanded in x around 0 83.8%
mul-1-neg83.8%
*-commutative83.8%
unsub-neg83.8%
Simplified83.8%
if 6.1999999999999999e54 < x < 6.9999999999999997e196Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 18.3%
Taylor expanded in x around 0 63.3%
if 6.9999999999999997e196 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 44.3%
Taylor expanded in x around inf 44.3%
associate-*r*44.3%
*-commutative44.3%
associate-*r*44.3%
sub-neg44.3%
neg-mul-144.3%
associate-*r*44.3%
mul-1-neg44.3%
neg-sub044.3%
distribute-rgt-in44.3%
*-lft-identity44.3%
neg-mul-144.3%
cancel-sign-sub-inv44.3%
associate-+l-44.3%
neg-sub044.3%
neg-mul-144.3%
+-commutative44.3%
distribute-rgt-in44.3%
Simplified44.3%
Taylor expanded in eps around inf 44.6%
*-commutative44.6%
Simplified44.6%
Final simplification71.6%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<= x 4.5e-51)
(/ (+ 1.0 (exp (* x (- eps_m)))) 2.0)
(if (<= x 8.5e+54)
(/ (/ (- (* eps_m (+ 2.0 (* x eps_m))) x) eps_m) 2.0)
(if (<= x 3.4e+197)
(/ (+ (+ 1.0 (/ 1.0 eps_m)) (- 1.0 (/ 1.0 eps_m))) 2.0)
(/ (* x eps_m) 2.0)))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= 4.5e-51) {
tmp = (1.0 + exp((x * -eps_m))) / 2.0;
} else if (x <= 8.5e+54) {
tmp = (((eps_m * (2.0 + (x * eps_m))) - x) / eps_m) / 2.0;
} else if (x <= 3.4e+197) {
tmp = ((1.0 + (1.0 / eps_m)) + (1.0 - (1.0 / eps_m))) / 2.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 <= 4.5d-51) then
tmp = (1.0d0 + exp((x * -eps_m))) / 2.0d0
else if (x <= 8.5d+54) then
tmp = (((eps_m * (2.0d0 + (x * eps_m))) - x) / eps_m) / 2.0d0
else if (x <= 3.4d+197) then
tmp = ((1.0d0 + (1.0d0 / eps_m)) + (1.0d0 - (1.0d0 / eps_m))) / 2.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 <= 4.5e-51) {
tmp = (1.0 + Math.exp((x * -eps_m))) / 2.0;
} else if (x <= 8.5e+54) {
tmp = (((eps_m * (2.0 + (x * eps_m))) - x) / eps_m) / 2.0;
} else if (x <= 3.4e+197) {
tmp = ((1.0 + (1.0 / eps_m)) + (1.0 - (1.0 / eps_m))) / 2.0;
} else {
tmp = (x * eps_m) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= 4.5e-51: tmp = (1.0 + math.exp((x * -eps_m))) / 2.0 elif x <= 8.5e+54: tmp = (((eps_m * (2.0 + (x * eps_m))) - x) / eps_m) / 2.0 elif x <= 3.4e+197: tmp = ((1.0 + (1.0 / eps_m)) + (1.0 - (1.0 / eps_m))) / 2.0 else: tmp = (x * eps_m) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= 4.5e-51) tmp = Float64(Float64(1.0 + exp(Float64(x * Float64(-eps_m)))) / 2.0); elseif (x <= 8.5e+54) tmp = Float64(Float64(Float64(Float64(eps_m * Float64(2.0 + Float64(x * eps_m))) - x) / eps_m) / 2.0); elseif (x <= 3.4e+197) tmp = Float64(Float64(Float64(1.0 + Float64(1.0 / eps_m)) + Float64(1.0 - Float64(1.0 / eps_m))) / 2.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 <= 4.5e-51) tmp = (1.0 + exp((x * -eps_m))) / 2.0; elseif (x <= 8.5e+54) tmp = (((eps_m * (2.0 + (x * eps_m))) - x) / eps_m) / 2.0; elseif (x <= 3.4e+197) tmp = ((1.0 + (1.0 / eps_m)) + (1.0 - (1.0 / eps_m))) / 2.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, 4.5e-51], N[(N[(1.0 + N[Exp[N[(x * (-eps$95$m)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 8.5e+54], N[(N[(N[(N[(eps$95$m * N[(2.0 + N[(x * eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / eps$95$m), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 3.4e+197], N[(N[(N[(1.0 + N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], 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 4.5 \cdot 10^{-51}:\\
\;\;\;\;\frac{1 + e^{x \cdot \left(-eps\_m\right)}}{2}\\
\mathbf{elif}\;x \leq 8.5 \cdot 10^{+54}:\\
\;\;\;\;\frac{\frac{eps\_m \cdot \left(2 + x \cdot eps\_m\right) - x}{eps\_m}}{2}\\
\mathbf{elif}\;x \leq 3.4 \cdot 10^{+197}:\\
\;\;\;\;\frac{\left(1 + \frac{1}{eps\_m}\right) + \left(1 - \frac{1}{eps\_m}\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot eps\_m}{2}\\
\end{array}
\end{array}
if x < 4.49999999999999974e-51Initial program 63.5%
Simplified42.7%
Taylor expanded in eps around inf 99.4%
Taylor expanded in eps around inf 99.4%
*-commutative99.4%
Simplified99.4%
Taylor expanded in x around 0 77.4%
if 4.49999999999999974e-51 < x < 8.4999999999999995e54Initial program 91.1%
Simplified91.1%
Taylor expanded in x around 0 27.7%
Taylor expanded in x around 0 6.5%
Taylor expanded in eps around 0 28.9%
if 8.4999999999999995e54 < x < 3.40000000000000017e197Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 18.3%
Taylor expanded in x around 0 63.3%
if 3.40000000000000017e197 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 44.3%
Taylor expanded in x around inf 44.3%
associate-*r*44.3%
*-commutative44.3%
associate-*r*44.3%
sub-neg44.3%
neg-mul-144.3%
associate-*r*44.3%
mul-1-neg44.3%
neg-sub044.3%
distribute-rgt-in44.3%
*-lft-identity44.3%
neg-mul-144.3%
cancel-sign-sub-inv44.3%
associate-+l-44.3%
neg-sub044.3%
neg-mul-144.3%
+-commutative44.3%
distribute-rgt-in44.3%
Simplified44.3%
Taylor expanded in eps around inf 44.6%
*-commutative44.6%
Simplified44.6%
Final simplification67.0%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<= x 1.2e-50)
(/ (+ 1.0 (exp (- x))) 2.0)
(if (<= x 9e+54)
(/ (/ (- (* eps_m (+ 2.0 (* x eps_m))) x) eps_m) 2.0)
(if (<= x 9e+196)
(/ (+ (+ 1.0 (/ 1.0 eps_m)) (- 1.0 (/ 1.0 eps_m))) 2.0)
(/ (* x eps_m) 2.0)))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= 1.2e-50) {
tmp = (1.0 + exp(-x)) / 2.0;
} else if (x <= 9e+54) {
tmp = (((eps_m * (2.0 + (x * eps_m))) - x) / eps_m) / 2.0;
} else if (x <= 9e+196) {
tmp = ((1.0 + (1.0 / eps_m)) + (1.0 - (1.0 / eps_m))) / 2.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 <= 1.2d-50) then
tmp = (1.0d0 + exp(-x)) / 2.0d0
else if (x <= 9d+54) then
tmp = (((eps_m * (2.0d0 + (x * eps_m))) - x) / eps_m) / 2.0d0
else if (x <= 9d+196) then
tmp = ((1.0d0 + (1.0d0 / eps_m)) + (1.0d0 - (1.0d0 / eps_m))) / 2.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 <= 1.2e-50) {
tmp = (1.0 + Math.exp(-x)) / 2.0;
} else if (x <= 9e+54) {
tmp = (((eps_m * (2.0 + (x * eps_m))) - x) / eps_m) / 2.0;
} else if (x <= 9e+196) {
tmp = ((1.0 + (1.0 / eps_m)) + (1.0 - (1.0 / eps_m))) / 2.0;
} else {
tmp = (x * eps_m) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= 1.2e-50: tmp = (1.0 + math.exp(-x)) / 2.0 elif x <= 9e+54: tmp = (((eps_m * (2.0 + (x * eps_m))) - x) / eps_m) / 2.0 elif x <= 9e+196: tmp = ((1.0 + (1.0 / eps_m)) + (1.0 - (1.0 / eps_m))) / 2.0 else: tmp = (x * eps_m) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= 1.2e-50) tmp = Float64(Float64(1.0 + exp(Float64(-x))) / 2.0); elseif (x <= 9e+54) tmp = Float64(Float64(Float64(Float64(eps_m * Float64(2.0 + Float64(x * eps_m))) - x) / eps_m) / 2.0); elseif (x <= 9e+196) tmp = Float64(Float64(Float64(1.0 + Float64(1.0 / eps_m)) + Float64(1.0 - Float64(1.0 / eps_m))) / 2.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 <= 1.2e-50) tmp = (1.0 + exp(-x)) / 2.0; elseif (x <= 9e+54) tmp = (((eps_m * (2.0 + (x * eps_m))) - x) / eps_m) / 2.0; elseif (x <= 9e+196) tmp = ((1.0 + (1.0 / eps_m)) + (1.0 - (1.0 / eps_m))) / 2.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, 1.2e-50], N[(N[(1.0 + N[Exp[(-x)], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 9e+54], N[(N[(N[(N[(eps$95$m * N[(2.0 + N[(x * eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / eps$95$m), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 9e+196], N[(N[(N[(1.0 + N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], 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 1.2 \cdot 10^{-50}:\\
\;\;\;\;\frac{1 + e^{-x}}{2}\\
\mathbf{elif}\;x \leq 9 \cdot 10^{+54}:\\
\;\;\;\;\frac{\frac{eps\_m \cdot \left(2 + x \cdot eps\_m\right) - x}{eps\_m}}{2}\\
\mathbf{elif}\;x \leq 9 \cdot 10^{+196}:\\
\;\;\;\;\frac{\left(1 + \frac{1}{eps\_m}\right) + \left(1 - \frac{1}{eps\_m}\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot eps\_m}{2}\\
\end{array}
\end{array}
if x < 1.20000000000000001e-50Initial program 63.5%
Simplified42.7%
Taylor expanded in eps around inf 99.4%
Taylor expanded in eps around inf 99.4%
*-commutative99.4%
Simplified99.4%
Taylor expanded in eps around 0 81.3%
neg-mul-181.3%
Simplified81.3%
if 1.20000000000000001e-50 < x < 8.99999999999999968e54Initial program 91.1%
Simplified91.1%
Taylor expanded in x around 0 27.7%
Taylor expanded in x around 0 6.5%
Taylor expanded in eps around 0 28.9%
if 8.99999999999999968e54 < x < 8.99999999999999956e196Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 18.3%
Taylor expanded in x around 0 63.3%
if 8.99999999999999956e196 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 44.3%
Taylor expanded in x around inf 44.3%
associate-*r*44.3%
*-commutative44.3%
associate-*r*44.3%
sub-neg44.3%
neg-mul-144.3%
associate-*r*44.3%
mul-1-neg44.3%
neg-sub044.3%
distribute-rgt-in44.3%
*-lft-identity44.3%
neg-mul-144.3%
cancel-sign-sub-inv44.3%
associate-+l-44.3%
neg-sub044.3%
neg-mul-144.3%
+-commutative44.3%
distribute-rgt-in44.3%
Simplified44.3%
Taylor expanded in eps around inf 44.6%
*-commutative44.6%
Simplified44.6%
Final simplification69.7%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<= x -1.25e-49)
(/ (+ 2.0 (* x (* (+ 1.0 eps_m) (+ -1.0 (/ 1.0 eps_m))))) 2.0)
(if (<= x 1.6e-50)
1.0
(if (<= x 6.5e+54)
(/ (/ (- (* eps_m (+ 2.0 (* x eps_m))) x) eps_m) 2.0)
(if (<= x 4e+197)
(/ (+ (+ 1.0 (/ 1.0 eps_m)) (- 1.0 (/ 1.0 eps_m))) 2.0)
(/ (* x eps_m) 2.0))))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= -1.25e-49) {
tmp = (2.0 + (x * ((1.0 + eps_m) * (-1.0 + (1.0 / eps_m))))) / 2.0;
} else if (x <= 1.6e-50) {
tmp = 1.0;
} else if (x <= 6.5e+54) {
tmp = (((eps_m * (2.0 + (x * eps_m))) - x) / eps_m) / 2.0;
} else if (x <= 4e+197) {
tmp = ((1.0 + (1.0 / eps_m)) + (1.0 - (1.0 / eps_m))) / 2.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 <= (-1.25d-49)) then
tmp = (2.0d0 + (x * ((1.0d0 + eps_m) * ((-1.0d0) + (1.0d0 / eps_m))))) / 2.0d0
else if (x <= 1.6d-50) then
tmp = 1.0d0
else if (x <= 6.5d+54) then
tmp = (((eps_m * (2.0d0 + (x * eps_m))) - x) / eps_m) / 2.0d0
else if (x <= 4d+197) then
tmp = ((1.0d0 + (1.0d0 / eps_m)) + (1.0d0 - (1.0d0 / eps_m))) / 2.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 <= -1.25e-49) {
tmp = (2.0 + (x * ((1.0 + eps_m) * (-1.0 + (1.0 / eps_m))))) / 2.0;
} else if (x <= 1.6e-50) {
tmp = 1.0;
} else if (x <= 6.5e+54) {
tmp = (((eps_m * (2.0 + (x * eps_m))) - x) / eps_m) / 2.0;
} else if (x <= 4e+197) {
tmp = ((1.0 + (1.0 / eps_m)) + (1.0 - (1.0 / eps_m))) / 2.0;
} else {
tmp = (x * eps_m) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= -1.25e-49: tmp = (2.0 + (x * ((1.0 + eps_m) * (-1.0 + (1.0 / eps_m))))) / 2.0 elif x <= 1.6e-50: tmp = 1.0 elif x <= 6.5e+54: tmp = (((eps_m * (2.0 + (x * eps_m))) - x) / eps_m) / 2.0 elif x <= 4e+197: tmp = ((1.0 + (1.0 / eps_m)) + (1.0 - (1.0 / eps_m))) / 2.0 else: tmp = (x * eps_m) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= -1.25e-49) tmp = Float64(Float64(2.0 + Float64(x * Float64(Float64(1.0 + eps_m) * Float64(-1.0 + Float64(1.0 / eps_m))))) / 2.0); elseif (x <= 1.6e-50) tmp = 1.0; elseif (x <= 6.5e+54) tmp = Float64(Float64(Float64(Float64(eps_m * Float64(2.0 + Float64(x * eps_m))) - x) / eps_m) / 2.0); elseif (x <= 4e+197) tmp = Float64(Float64(Float64(1.0 + Float64(1.0 / eps_m)) + Float64(1.0 - Float64(1.0 / eps_m))) / 2.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 <= -1.25e-49) tmp = (2.0 + (x * ((1.0 + eps_m) * (-1.0 + (1.0 / eps_m))))) / 2.0; elseif (x <= 1.6e-50) tmp = 1.0; elseif (x <= 6.5e+54) tmp = (((eps_m * (2.0 + (x * eps_m))) - x) / eps_m) / 2.0; elseif (x <= 4e+197) tmp = ((1.0 + (1.0 / eps_m)) + (1.0 - (1.0 / eps_m))) / 2.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, -1.25e-49], N[(N[(2.0 + N[(x * N[(N[(1.0 + eps$95$m), $MachinePrecision] * N[(-1.0 + N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 1.6e-50], 1.0, If[LessEqual[x, 6.5e+54], N[(N[(N[(N[(eps$95$m * N[(2.0 + N[(x * eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / eps$95$m), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 4e+197], N[(N[(N[(1.0 + N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], 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 -1.25 \cdot 10^{-49}:\\
\;\;\;\;\frac{2 + x \cdot \left(\left(1 + eps\_m\right) \cdot \left(-1 + \frac{1}{eps\_m}\right)\right)}{2}\\
\mathbf{elif}\;x \leq 1.6 \cdot 10^{-50}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 6.5 \cdot 10^{+54}:\\
\;\;\;\;\frac{\frac{eps\_m \cdot \left(2 + x \cdot eps\_m\right) - x}{eps\_m}}{2}\\
\mathbf{elif}\;x \leq 4 \cdot 10^{+197}:\\
\;\;\;\;\frac{\left(1 + \frac{1}{eps\_m}\right) + \left(1 - \frac{1}{eps\_m}\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot eps\_m}{2}\\
\end{array}
\end{array}
if x < -1.25e-49Initial program 97.6%
Simplified97.6%
Taylor expanded in x around 0 40.9%
Taylor expanded in x around 0 25.2%
+-commutative25.2%
sub-neg25.2%
metadata-eval25.2%
+-commutative25.2%
Simplified25.2%
if -1.25e-49 < x < 1.6e-50Initial program 52.7%
Simplified52.7%
Taylor expanded in x around 0 81.4%
if 1.6e-50 < x < 6.5e54Initial program 91.1%
Simplified91.1%
Taylor expanded in x around 0 27.7%
Taylor expanded in x around 0 6.5%
Taylor expanded in eps around 0 28.9%
if 6.5e54 < x < 3.9999999999999998e197Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 18.3%
Taylor expanded in x around 0 63.3%
if 3.9999999999999998e197 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 44.3%
Taylor expanded in x around inf 44.3%
associate-*r*44.3%
*-commutative44.3%
associate-*r*44.3%
sub-neg44.3%
neg-mul-144.3%
associate-*r*44.3%
mul-1-neg44.3%
neg-sub044.3%
distribute-rgt-in44.3%
*-lft-identity44.3%
neg-mul-144.3%
cancel-sign-sub-inv44.3%
associate-+l-44.3%
neg-sub044.3%
neg-mul-144.3%
+-commutative44.3%
distribute-rgt-in44.3%
Simplified44.3%
Taylor expanded in eps around inf 44.6%
*-commutative44.6%
Simplified44.6%
Final simplification60.7%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<= x -1.25e-49)
(* (* x eps_m) -0.5)
(if (<= x 1.65e-9)
1.0
(if (<= x 1.9e+197)
(/ (+ (+ 1.0 (/ 1.0 eps_m)) (- 1.0 (/ 1.0 eps_m))) 2.0)
(/ (* x eps_m) 2.0)))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= -1.25e-49) {
tmp = (x * eps_m) * -0.5;
} else if (x <= 1.65e-9) {
tmp = 1.0;
} else if (x <= 1.9e+197) {
tmp = ((1.0 + (1.0 / eps_m)) + (1.0 - (1.0 / eps_m))) / 2.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 <= (-1.25d-49)) then
tmp = (x * eps_m) * (-0.5d0)
else if (x <= 1.65d-9) then
tmp = 1.0d0
else if (x <= 1.9d+197) then
tmp = ((1.0d0 + (1.0d0 / eps_m)) + (1.0d0 - (1.0d0 / eps_m))) / 2.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 <= -1.25e-49) {
tmp = (x * eps_m) * -0.5;
} else if (x <= 1.65e-9) {
tmp = 1.0;
} else if (x <= 1.9e+197) {
tmp = ((1.0 + (1.0 / eps_m)) + (1.0 - (1.0 / eps_m))) / 2.0;
} else {
tmp = (x * eps_m) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= -1.25e-49: tmp = (x * eps_m) * -0.5 elif x <= 1.65e-9: tmp = 1.0 elif x <= 1.9e+197: tmp = ((1.0 + (1.0 / eps_m)) + (1.0 - (1.0 / eps_m))) / 2.0 else: tmp = (x * eps_m) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= -1.25e-49) tmp = Float64(Float64(x * eps_m) * -0.5); elseif (x <= 1.65e-9) tmp = 1.0; elseif (x <= 1.9e+197) tmp = Float64(Float64(Float64(1.0 + Float64(1.0 / eps_m)) + Float64(1.0 - Float64(1.0 / eps_m))) / 2.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 <= -1.25e-49) tmp = (x * eps_m) * -0.5; elseif (x <= 1.65e-9) tmp = 1.0; elseif (x <= 1.9e+197) tmp = ((1.0 + (1.0 / eps_m)) + (1.0 - (1.0 / eps_m))) / 2.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, -1.25e-49], N[(N[(x * eps$95$m), $MachinePrecision] * -0.5), $MachinePrecision], If[LessEqual[x, 1.65e-9], 1.0, If[LessEqual[x, 1.9e+197], N[(N[(N[(1.0 + N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], 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 -1.25 \cdot 10^{-49}:\\
\;\;\;\;\left(x \cdot eps\_m\right) \cdot -0.5\\
\mathbf{elif}\;x \leq 1.65 \cdot 10^{-9}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 1.9 \cdot 10^{+197}:\\
\;\;\;\;\frac{\left(1 + \frac{1}{eps\_m}\right) + \left(1 - \frac{1}{eps\_m}\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot eps\_m}{2}\\
\end{array}
\end{array}
if x < -1.25e-49Initial program 97.6%
Simplified97.6%
Taylor expanded in x around 0 43.6%
Taylor expanded in x around inf 29.1%
associate-*r*29.1%
*-commutative29.1%
associate-*r*29.1%
sub-neg29.1%
neg-mul-129.1%
associate-*r*29.1%
mul-1-neg29.1%
neg-sub029.1%
distribute-rgt-in29.1%
*-lft-identity29.1%
neg-mul-129.1%
cancel-sign-sub-inv29.1%
associate-+l-29.1%
neg-sub029.1%
neg-mul-129.1%
+-commutative29.1%
distribute-rgt-in29.1%
Simplified29.1%
Taylor expanded in eps around inf 29.0%
*-commutative29.0%
Simplified29.0%
frac-2neg29.0%
mul-1-neg29.0%
div-inv29.0%
add-sqr-sqrt0.1%
sqrt-unprod0.2%
mul-1-neg0.2%
mul-1-neg0.2%
sqr-neg0.2%
sqrt-unprod0.2%
add-sqr-sqrt25.3%
metadata-eval25.3%
metadata-eval25.3%
Applied egg-rr25.3%
if -1.25e-49 < x < 1.65000000000000009e-9Initial program 54.9%
Simplified54.9%
Taylor expanded in x around 0 76.3%
if 1.65000000000000009e-9 < x < 1.9000000000000001e197Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 18.0%
Taylor expanded in x around 0 50.7%
if 1.9000000000000001e197 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 44.3%
Taylor expanded in x around inf 44.3%
associate-*r*44.3%
*-commutative44.3%
associate-*r*44.3%
sub-neg44.3%
neg-mul-144.3%
associate-*r*44.3%
mul-1-neg44.3%
neg-sub044.3%
distribute-rgt-in44.3%
*-lft-identity44.3%
neg-mul-144.3%
cancel-sign-sub-inv44.3%
associate-+l-44.3%
neg-sub044.3%
neg-mul-144.3%
+-commutative44.3%
distribute-rgt-in44.3%
Simplified44.3%
Taylor expanded in eps around inf 44.6%
*-commutative44.6%
Simplified44.6%
Final simplification60.5%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<= x -1.25e-49)
(/ (+ 2.0 (* x (* (+ 1.0 eps_m) (+ -1.0 (/ 1.0 eps_m))))) 2.0)
(if (<= x 1.65e-9)
1.0
(if (<= x 1e+197)
(/ (+ (+ 1.0 (/ 1.0 eps_m)) (- 1.0 (/ 1.0 eps_m))) 2.0)
(/ (* x eps_m) 2.0)))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= -1.25e-49) {
tmp = (2.0 + (x * ((1.0 + eps_m) * (-1.0 + (1.0 / eps_m))))) / 2.0;
} else if (x <= 1.65e-9) {
tmp = 1.0;
} else if (x <= 1e+197) {
tmp = ((1.0 + (1.0 / eps_m)) + (1.0 - (1.0 / eps_m))) / 2.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 <= (-1.25d-49)) then
tmp = (2.0d0 + (x * ((1.0d0 + eps_m) * ((-1.0d0) + (1.0d0 / eps_m))))) / 2.0d0
else if (x <= 1.65d-9) then
tmp = 1.0d0
else if (x <= 1d+197) then
tmp = ((1.0d0 + (1.0d0 / eps_m)) + (1.0d0 - (1.0d0 / eps_m))) / 2.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 <= -1.25e-49) {
tmp = (2.0 + (x * ((1.0 + eps_m) * (-1.0 + (1.0 / eps_m))))) / 2.0;
} else if (x <= 1.65e-9) {
tmp = 1.0;
} else if (x <= 1e+197) {
tmp = ((1.0 + (1.0 / eps_m)) + (1.0 - (1.0 / eps_m))) / 2.0;
} else {
tmp = (x * eps_m) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= -1.25e-49: tmp = (2.0 + (x * ((1.0 + eps_m) * (-1.0 + (1.0 / eps_m))))) / 2.0 elif x <= 1.65e-9: tmp = 1.0 elif x <= 1e+197: tmp = ((1.0 + (1.0 / eps_m)) + (1.0 - (1.0 / eps_m))) / 2.0 else: tmp = (x * eps_m) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= -1.25e-49) tmp = Float64(Float64(2.0 + Float64(x * Float64(Float64(1.0 + eps_m) * Float64(-1.0 + Float64(1.0 / eps_m))))) / 2.0); elseif (x <= 1.65e-9) tmp = 1.0; elseif (x <= 1e+197) tmp = Float64(Float64(Float64(1.0 + Float64(1.0 / eps_m)) + Float64(1.0 - Float64(1.0 / eps_m))) / 2.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 <= -1.25e-49) tmp = (2.0 + (x * ((1.0 + eps_m) * (-1.0 + (1.0 / eps_m))))) / 2.0; elseif (x <= 1.65e-9) tmp = 1.0; elseif (x <= 1e+197) tmp = ((1.0 + (1.0 / eps_m)) + (1.0 - (1.0 / eps_m))) / 2.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, -1.25e-49], N[(N[(2.0 + N[(x * N[(N[(1.0 + eps$95$m), $MachinePrecision] * N[(-1.0 + N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 1.65e-9], 1.0, If[LessEqual[x, 1e+197], N[(N[(N[(1.0 + N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], 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 -1.25 \cdot 10^{-49}:\\
\;\;\;\;\frac{2 + x \cdot \left(\left(1 + eps\_m\right) \cdot \left(-1 + \frac{1}{eps\_m}\right)\right)}{2}\\
\mathbf{elif}\;x \leq 1.65 \cdot 10^{-9}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 10^{+197}:\\
\;\;\;\;\frac{\left(1 + \frac{1}{eps\_m}\right) + \left(1 - \frac{1}{eps\_m}\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot eps\_m}{2}\\
\end{array}
\end{array}
if x < -1.25e-49Initial program 97.6%
Simplified97.6%
Taylor expanded in x around 0 40.9%
Taylor expanded in x around 0 25.2%
+-commutative25.2%
sub-neg25.2%
metadata-eval25.2%
+-commutative25.2%
Simplified25.2%
if -1.25e-49 < x < 1.65000000000000009e-9Initial program 54.9%
Simplified54.9%
Taylor expanded in x around 0 76.3%
if 1.65000000000000009e-9 < x < 9.9999999999999995e196Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 18.0%
Taylor expanded in x around 0 50.7%
if 9.9999999999999995e196 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 44.3%
Taylor expanded in x around inf 44.3%
associate-*r*44.3%
*-commutative44.3%
associate-*r*44.3%
sub-neg44.3%
neg-mul-144.3%
associate-*r*44.3%
mul-1-neg44.3%
neg-sub044.3%
distribute-rgt-in44.3%
*-lft-identity44.3%
neg-mul-144.3%
cancel-sign-sub-inv44.3%
associate-+l-44.3%
neg-sub044.3%
neg-mul-144.3%
+-commutative44.3%
distribute-rgt-in44.3%
Simplified44.3%
Taylor expanded in eps around inf 44.6%
*-commutative44.6%
Simplified44.6%
Final simplification60.4%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= x -1.25e-49) (* (* x eps_m) -0.5) (if (<= x 1.65e-9) 1.0 (/ (* x eps_m) 2.0))))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= -1.25e-49) {
tmp = (x * eps_m) * -0.5;
} else if (x <= 1.65e-9) {
tmp = 1.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 <= (-1.25d-49)) then
tmp = (x * eps_m) * (-0.5d0)
else if (x <= 1.65d-9) then
tmp = 1.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 <= -1.25e-49) {
tmp = (x * eps_m) * -0.5;
} else if (x <= 1.65e-9) {
tmp = 1.0;
} else {
tmp = (x * eps_m) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= -1.25e-49: tmp = (x * eps_m) * -0.5 elif x <= 1.65e-9: tmp = 1.0 else: tmp = (x * eps_m) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= -1.25e-49) tmp = Float64(Float64(x * eps_m) * -0.5); elseif (x <= 1.65e-9) tmp = 1.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 <= -1.25e-49) tmp = (x * eps_m) * -0.5; elseif (x <= 1.65e-9) tmp = 1.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, -1.25e-49], N[(N[(x * eps$95$m), $MachinePrecision] * -0.5), $MachinePrecision], If[LessEqual[x, 1.65e-9], 1.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 -1.25 \cdot 10^{-49}:\\
\;\;\;\;\left(x \cdot eps\_m\right) \cdot -0.5\\
\mathbf{elif}\;x \leq 1.65 \cdot 10^{-9}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot eps\_m}{2}\\
\end{array}
\end{array}
if x < -1.25e-49Initial program 97.6%
Simplified97.6%
Taylor expanded in x around 0 43.6%
Taylor expanded in x around inf 29.1%
associate-*r*29.1%
*-commutative29.1%
associate-*r*29.1%
sub-neg29.1%
neg-mul-129.1%
associate-*r*29.1%
mul-1-neg29.1%
neg-sub029.1%
distribute-rgt-in29.1%
*-lft-identity29.1%
neg-mul-129.1%
cancel-sign-sub-inv29.1%
associate-+l-29.1%
neg-sub029.1%
neg-mul-129.1%
+-commutative29.1%
distribute-rgt-in29.1%
Simplified29.1%
Taylor expanded in eps around inf 29.0%
*-commutative29.0%
Simplified29.0%
frac-2neg29.0%
mul-1-neg29.0%
div-inv29.0%
add-sqr-sqrt0.1%
sqrt-unprod0.2%
mul-1-neg0.2%
mul-1-neg0.2%
sqr-neg0.2%
sqrt-unprod0.2%
add-sqr-sqrt25.3%
metadata-eval25.3%
metadata-eval25.3%
Applied egg-rr25.3%
if -1.25e-49 < x < 1.65000000000000009e-9Initial program 54.9%
Simplified54.9%
Taylor expanded in x around 0 76.3%
if 1.65000000000000009e-9 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 21.4%
Taylor expanded in x around inf 14.6%
associate-*r*14.6%
*-commutative14.6%
associate-*r*14.6%
sub-neg14.6%
neg-mul-114.6%
associate-*r*14.6%
mul-1-neg14.6%
neg-sub014.6%
distribute-rgt-in14.6%
*-lft-identity14.6%
neg-mul-114.6%
cancel-sign-sub-inv14.6%
associate-+l-14.6%
neg-sub014.6%
neg-mul-114.6%
+-commutative14.6%
distribute-rgt-in14.6%
Simplified14.6%
Taylor expanded in eps around inf 15.5%
*-commutative15.5%
Simplified15.5%
Final simplification50.8%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= x -1.25e-49) (* (* x eps_m) -0.5) (/ (* eps_m (+ x (/ 2.0 eps_m))) 2.0)))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= -1.25e-49) {
tmp = (x * eps_m) * -0.5;
} else {
tmp = (eps_m * (x + (2.0 / 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 <= (-1.25d-49)) then
tmp = (x * eps_m) * (-0.5d0)
else
tmp = (eps_m * (x + (2.0d0 / 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 <= -1.25e-49) {
tmp = (x * eps_m) * -0.5;
} else {
tmp = (eps_m * (x + (2.0 / eps_m))) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= -1.25e-49: tmp = (x * eps_m) * -0.5 else: tmp = (eps_m * (x + (2.0 / eps_m))) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= -1.25e-49) tmp = Float64(Float64(x * eps_m) * -0.5); else tmp = Float64(Float64(eps_m * Float64(x + Float64(2.0 / eps_m))) / 2.0); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (x <= -1.25e-49) tmp = (x * eps_m) * -0.5; else tmp = (eps_m * (x + (2.0 / eps_m))) / 2.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, -1.25e-49], N[(N[(x * eps$95$m), $MachinePrecision] * -0.5), $MachinePrecision], N[(N[(eps$95$m * N[(x + N[(2.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.25 \cdot 10^{-49}:\\
\;\;\;\;\left(x \cdot eps\_m\right) \cdot -0.5\\
\mathbf{else}:\\
\;\;\;\;\frac{eps\_m \cdot \left(x + \frac{2}{eps\_m}\right)}{2}\\
\end{array}
\end{array}
if x < -1.25e-49Initial program 97.6%
Simplified97.6%
Taylor expanded in x around 0 43.6%
Taylor expanded in x around inf 29.1%
associate-*r*29.1%
*-commutative29.1%
associate-*r*29.1%
sub-neg29.1%
neg-mul-129.1%
associate-*r*29.1%
mul-1-neg29.1%
neg-sub029.1%
distribute-rgt-in29.1%
*-lft-identity29.1%
neg-mul-129.1%
cancel-sign-sub-inv29.1%
associate-+l-29.1%
neg-sub029.1%
neg-mul-129.1%
+-commutative29.1%
distribute-rgt-in29.1%
Simplified29.1%
Taylor expanded in eps around inf 29.0%
*-commutative29.0%
Simplified29.0%
frac-2neg29.0%
mul-1-neg29.0%
div-inv29.0%
add-sqr-sqrt0.1%
sqrt-unprod0.2%
mul-1-neg0.2%
mul-1-neg0.2%
sqr-neg0.2%
sqrt-unprod0.2%
add-sqr-sqrt25.3%
metadata-eval25.3%
metadata-eval25.3%
Applied egg-rr25.3%
if -1.25e-49 < x Initial program 70.2%
Simplified70.2%
Taylor expanded in x around 0 35.3%
Taylor expanded in x around 0 25.1%
Taylor expanded in eps around inf 54.9%
associate-*r/54.9%
metadata-eval54.9%
Simplified54.9%
Final simplification50.2%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= x -1.25e-49) (* (* x eps_m) -0.5) 1.0))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= -1.25e-49) {
tmp = (x * eps_m) * -0.5;
} else {
tmp = 1.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.25d-49)) then
tmp = (x * eps_m) * (-0.5d0)
else
tmp = 1.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.25e-49) {
tmp = (x * eps_m) * -0.5;
} else {
tmp = 1.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= -1.25e-49: tmp = (x * eps_m) * -0.5 else: tmp = 1.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= -1.25e-49) tmp = Float64(Float64(x * eps_m) * -0.5); else tmp = 1.0; end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (x <= -1.25e-49) tmp = (x * eps_m) * -0.5; else tmp = 1.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, -1.25e-49], N[(N[(x * eps$95$m), $MachinePrecision] * -0.5), $MachinePrecision], 1.0]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.25 \cdot 10^{-49}:\\
\;\;\;\;\left(x \cdot eps\_m\right) \cdot -0.5\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -1.25e-49Initial program 97.6%
Simplified97.6%
Taylor expanded in x around 0 43.6%
Taylor expanded in x around inf 29.1%
associate-*r*29.1%
*-commutative29.1%
associate-*r*29.1%
sub-neg29.1%
neg-mul-129.1%
associate-*r*29.1%
mul-1-neg29.1%
neg-sub029.1%
distribute-rgt-in29.1%
*-lft-identity29.1%
neg-mul-129.1%
cancel-sign-sub-inv29.1%
associate-+l-29.1%
neg-sub029.1%
neg-mul-129.1%
+-commutative29.1%
distribute-rgt-in29.1%
Simplified29.1%
Taylor expanded in eps around inf 29.0%
*-commutative29.0%
Simplified29.0%
frac-2neg29.0%
mul-1-neg29.0%
div-inv29.0%
add-sqr-sqrt0.1%
sqrt-unprod0.2%
mul-1-neg0.2%
mul-1-neg0.2%
sqr-neg0.2%
sqrt-unprod0.2%
add-sqr-sqrt25.3%
metadata-eval25.3%
metadata-eval25.3%
Applied egg-rr25.3%
if -1.25e-49 < x Initial program 70.2%
Simplified70.2%
Taylor expanded in x around 0 51.5%
Final simplification47.3%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 1.0)
eps_m = fabs(eps);
double code(double x, double eps_m) {
return 1.0;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
code = 1.0d0
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
return 1.0;
}
eps_m = math.fabs(eps) def code(x, eps_m): return 1.0
eps_m = abs(eps) function code(x, eps_m) return 1.0 end
eps_m = abs(eps); function tmp = code(x, eps_m) tmp = 1.0; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := 1.0
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
1
\end{array}
Initial program 74.6%
Simplified74.6%
Taylor expanded in x around 0 43.7%
Final simplification43.7%
herbie shell --seed 2024059
(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))