
(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 17 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) (exp (- x)))))
(if (<= eps_m 2e-40)
(/ (+ t_0 t_0) 2.0)
(/ (+ (exp (* x (+ eps_m -1.0))) (/ 1.0 (exp (+ x (* eps_m x))))) 2.0))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double t_0 = (x + 1.0) * exp(-x);
double tmp;
if (eps_m <= 2e-40) {
tmp = (t_0 + t_0) / 2.0;
} else {
tmp = (exp((x * (eps_m + -1.0))) + (1.0 / exp((x + (eps_m * 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 = (x + 1.0d0) * exp(-x)
if (eps_m <= 2d-40) then
tmp = (t_0 + t_0) / 2.0d0
else
tmp = (exp((x * (eps_m + (-1.0d0)))) + (1.0d0 / exp((x + (eps_m * 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 = (x + 1.0) * Math.exp(-x);
double tmp;
if (eps_m <= 2e-40) {
tmp = (t_0 + t_0) / 2.0;
} else {
tmp = (Math.exp((x * (eps_m + -1.0))) + (1.0 / Math.exp((x + (eps_m * x))))) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): t_0 = (x + 1.0) * math.exp(-x) tmp = 0 if eps_m <= 2e-40: tmp = (t_0 + t_0) / 2.0 else: tmp = (math.exp((x * (eps_m + -1.0))) + (1.0 / math.exp((x + (eps_m * x))))) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) t_0 = Float64(Float64(x + 1.0) * exp(Float64(-x))) tmp = 0.0 if (eps_m <= 2e-40) tmp = Float64(Float64(t_0 + t_0) / 2.0); else tmp = Float64(Float64(exp(Float64(x * Float64(eps_m + -1.0))) + Float64(1.0 / exp(Float64(x + Float64(eps_m * x))))) / 2.0); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) t_0 = (x + 1.0) * exp(-x); tmp = 0.0; if (eps_m <= 2e-40) tmp = (t_0 + t_0) / 2.0; else tmp = (exp((x * (eps_m + -1.0))) + (1.0 / exp((x + (eps_m * x))))) / 2.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision]
code[x_, eps$95$m_] := Block[{t$95$0 = N[(N[(x + 1.0), $MachinePrecision] * N[Exp[(-x)], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[eps$95$m, 2e-40], N[(N[(t$95$0 + t$95$0), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(N[Exp[N[(x * N[(eps$95$m + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(1.0 / N[Exp[N[(x + N[(eps$95$m * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
t_0 := \left(x + 1\right) \cdot e^{-x}\\
\mathbf{if}\;eps\_m \leq 2 \cdot 10^{-40}:\\
\;\;\;\;\frac{t\_0 + t\_0}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{x \cdot \left(eps\_m + -1\right)} + \frac{1}{e^{x + eps\_m \cdot x}}}{2}\\
\end{array}
\end{array}
if eps < 1.9999999999999999e-40Initial program 60.0%
Simplified60.0%
Taylor expanded in eps around 0 73.3%
distribute-rgt1-in73.3%
mul-1-neg73.3%
distribute-lft-out73.3%
distribute-rgt1-in73.9%
mul-1-neg73.9%
Simplified73.9%
if 1.9999999999999999e-40 < eps Initial program 98.8%
Simplified90.5%
Taylor expanded in eps around inf 100.0%
Final simplification82.0%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(let* ((t_0 (exp (- x))))
(if (<= eps_m 2e-38)
(/ (+ (* t_0 (+ x 2.0)) (* x t_0)) 2.0)
(/ (+ (exp (* x (+ eps_m -1.0))) (/ 1.0 (exp (+ x (* eps_m x))))) 2.0))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double t_0 = exp(-x);
double tmp;
if (eps_m <= 2e-38) {
tmp = ((t_0 * (x + 2.0)) + (x * t_0)) / 2.0;
} else {
tmp = (exp((x * (eps_m + -1.0))) + (1.0 / exp((x + (eps_m * 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)
if (eps_m <= 2d-38) then
tmp = ((t_0 * (x + 2.0d0)) + (x * t_0)) / 2.0d0
else
tmp = (exp((x * (eps_m + (-1.0d0)))) + (1.0d0 / exp((x + (eps_m * 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);
double tmp;
if (eps_m <= 2e-38) {
tmp = ((t_0 * (x + 2.0)) + (x * t_0)) / 2.0;
} else {
tmp = (Math.exp((x * (eps_m + -1.0))) + (1.0 / Math.exp((x + (eps_m * x))))) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): t_0 = math.exp(-x) tmp = 0 if eps_m <= 2e-38: tmp = ((t_0 * (x + 2.0)) + (x * t_0)) / 2.0 else: tmp = (math.exp((x * (eps_m + -1.0))) + (1.0 / math.exp((x + (eps_m * x))))) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) t_0 = exp(Float64(-x)) tmp = 0.0 if (eps_m <= 2e-38) tmp = Float64(Float64(Float64(t_0 * Float64(x + 2.0)) + Float64(x * t_0)) / 2.0); else tmp = Float64(Float64(exp(Float64(x * Float64(eps_m + -1.0))) + Float64(1.0 / exp(Float64(x + Float64(eps_m * x))))) / 2.0); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) t_0 = exp(-x); tmp = 0.0; if (eps_m <= 2e-38) tmp = ((t_0 * (x + 2.0)) + (x * t_0)) / 2.0; else tmp = (exp((x * (eps_m + -1.0))) + (1.0 / exp((x + (eps_m * 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[(-x)], $MachinePrecision]}, If[LessEqual[eps$95$m, 2e-38], N[(N[(N[(t$95$0 * N[(x + 2.0), $MachinePrecision]), $MachinePrecision] + N[(x * t$95$0), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(N[Exp[N[(x * N[(eps$95$m + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(1.0 / N[Exp[N[(x + N[(eps$95$m * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
t_0 := e^{-x}\\
\mathbf{if}\;eps\_m \leq 2 \cdot 10^{-38}:\\
\;\;\;\;\frac{t\_0 \cdot \left(x + 2\right) + x \cdot t\_0}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{x \cdot \left(eps\_m + -1\right)} + \frac{1}{e^{x + eps\_m \cdot x}}}{2}\\
\end{array}
\end{array}
if eps < 1.9999999999999999e-38Initial program 60.0%
Simplified60.0%
Taylor expanded in eps around 0 73.3%
associate--r+73.3%
associate-*r*73.3%
mul-1-neg73.3%
cancel-sign-sub73.3%
distribute-rgt1-in73.3%
distribute-rgt-out--73.9%
mul-1-neg73.9%
mul-1-neg73.9%
Simplified73.9%
Taylor expanded in x around 0 73.9%
+-commutative73.9%
Simplified73.9%
if 1.9999999999999999e-38 < eps Initial program 98.8%
Simplified90.5%
Taylor expanded in eps around inf 100.0%
Final simplification82.0%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(let* ((t_0 (exp (- x))))
(if (<= eps_m 1e-37)
(/ (+ (* t_0 (+ x 2.0)) (* x t_0)) 2.0)
(/ (+ (exp (* x (+ eps_m -1.0))) (exp (* eps_m (- x)))) 2.0))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double t_0 = exp(-x);
double tmp;
if (eps_m <= 1e-37) {
tmp = ((t_0 * (x + 2.0)) + (x * t_0)) / 2.0;
} else {
tmp = (exp((x * (eps_m + -1.0))) + exp((eps_m * -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)
if (eps_m <= 1d-37) then
tmp = ((t_0 * (x + 2.0d0)) + (x * t_0)) / 2.0d0
else
tmp = (exp((x * (eps_m + (-1.0d0)))) + exp((eps_m * -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);
double tmp;
if (eps_m <= 1e-37) {
tmp = ((t_0 * (x + 2.0)) + (x * t_0)) / 2.0;
} else {
tmp = (Math.exp((x * (eps_m + -1.0))) + Math.exp((eps_m * -x))) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): t_0 = math.exp(-x) tmp = 0 if eps_m <= 1e-37: tmp = ((t_0 * (x + 2.0)) + (x * t_0)) / 2.0 else: tmp = (math.exp((x * (eps_m + -1.0))) + math.exp((eps_m * -x))) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) t_0 = exp(Float64(-x)) tmp = 0.0 if (eps_m <= 1e-37) tmp = Float64(Float64(Float64(t_0 * Float64(x + 2.0)) + Float64(x * t_0)) / 2.0); else tmp = Float64(Float64(exp(Float64(x * Float64(eps_m + -1.0))) + exp(Float64(eps_m * Float64(-x)))) / 2.0); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) t_0 = exp(-x); tmp = 0.0; if (eps_m <= 1e-37) tmp = ((t_0 * (x + 2.0)) + (x * t_0)) / 2.0; else tmp = (exp((x * (eps_m + -1.0))) + exp((eps_m * -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[(-x)], $MachinePrecision]}, If[LessEqual[eps$95$m, 1e-37], N[(N[(N[(t$95$0 * N[(x + 2.0), $MachinePrecision]), $MachinePrecision] + N[(x * t$95$0), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(N[Exp[N[(x * N[(eps$95$m + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[Exp[N[(eps$95$m * (-x)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
t_0 := e^{-x}\\
\mathbf{if}\;eps\_m \leq 10^{-37}:\\
\;\;\;\;\frac{t\_0 \cdot \left(x + 2\right) + x \cdot t\_0}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{x \cdot \left(eps\_m + -1\right)} + e^{eps\_m \cdot \left(-x\right)}}{2}\\
\end{array}
\end{array}
if eps < 1.00000000000000007e-37Initial program 60.0%
Simplified60.0%
Taylor expanded in eps around 0 73.3%
associate--r+73.3%
associate-*r*73.3%
mul-1-neg73.3%
cancel-sign-sub73.3%
distribute-rgt1-in73.3%
distribute-rgt-out--73.9%
mul-1-neg73.9%
mul-1-neg73.9%
Simplified73.9%
Taylor expanded in x around 0 73.9%
+-commutative73.9%
Simplified73.9%
if 1.00000000000000007e-37 < eps Initial program 98.8%
Simplified90.5%
Taylor expanded in eps around inf 100.0%
Taylor expanded in eps around inf 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
rec-exp100.0%
*-commutative100.0%
distribute-rgt-neg-in100.0%
Simplified100.0%
Final simplification82.0%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= eps_m 1e-37) (/ (/ (* eps_m (* (exp (- x)) (+ 2.0 (* x 2.0)))) eps_m) 2.0) (/ (+ (exp (* x (+ eps_m -1.0))) (exp (* eps_m (- x)))) 2.0)))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (eps_m <= 1e-37) {
tmp = ((eps_m * (exp(-x) * (2.0 + (x * 2.0)))) / eps_m) / 2.0;
} else {
tmp = (exp((x * (eps_m + -1.0))) + exp((eps_m * -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 (eps_m <= 1d-37) then
tmp = ((eps_m * (exp(-x) * (2.0d0 + (x * 2.0d0)))) / eps_m) / 2.0d0
else
tmp = (exp((x * (eps_m + (-1.0d0)))) + exp((eps_m * -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 (eps_m <= 1e-37) {
tmp = ((eps_m * (Math.exp(-x) * (2.0 + (x * 2.0)))) / eps_m) / 2.0;
} else {
tmp = (Math.exp((x * (eps_m + -1.0))) + Math.exp((eps_m * -x))) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if eps_m <= 1e-37: tmp = ((eps_m * (math.exp(-x) * (2.0 + (x * 2.0)))) / eps_m) / 2.0 else: tmp = (math.exp((x * (eps_m + -1.0))) + math.exp((eps_m * -x))) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (eps_m <= 1e-37) tmp = Float64(Float64(Float64(eps_m * Float64(exp(Float64(-x)) * Float64(2.0 + Float64(x * 2.0)))) / eps_m) / 2.0); else tmp = Float64(Float64(exp(Float64(x * Float64(eps_m + -1.0))) + exp(Float64(eps_m * Float64(-x)))) / 2.0); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (eps_m <= 1e-37) tmp = ((eps_m * (exp(-x) * (2.0 + (x * 2.0)))) / eps_m) / 2.0; else tmp = (exp((x * (eps_m + -1.0))) + exp((eps_m * -x))) / 2.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[eps$95$m, 1e-37], N[(N[(N[(eps$95$m * N[(N[Exp[(-x)], $MachinePrecision] * N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / eps$95$m), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(N[Exp[N[(x * N[(eps$95$m + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[Exp[N[(eps$95$m * (-x)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;eps\_m \leq 10^{-37}:\\
\;\;\;\;\frac{\frac{eps\_m \cdot \left(e^{-x} \cdot \left(2 + x \cdot 2\right)\right)}{eps\_m}}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{x \cdot \left(eps\_m + -1\right)} + e^{eps\_m \cdot \left(-x\right)}}{2}\\
\end{array}
\end{array}
if eps < 1.00000000000000007e-37Initial program 60.0%
Simplified50.4%
Taylor expanded in eps around 0 34.0%
Simplified73.9%
if 1.00000000000000007e-37 < eps Initial program 98.8%
Simplified90.5%
Taylor expanded in eps around inf 100.0%
Taylor expanded in eps around inf 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
rec-exp100.0%
*-commutative100.0%
distribute-rgt-neg-in100.0%
Simplified100.0%
Final simplification81.9%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<= eps_m 2.35e-5)
(/ (/ (* eps_m (* (exp (- x)) (+ 2.0 (* x 2.0)))) eps_m) 2.0)
(if (or (<= eps_m 4e+145) (not (<= eps_m 6.8e+247)))
(/
(+
(+
1.0
(+ (/ 1.0 eps_m) (* x (* (+ -1.0 (/ -1.0 eps_m)) (- 1.0 eps_m)))))
(* (exp (* x (- -1.0 eps_m))) (- (/ -1.0 eps_m) -1.0)))
2.0)
(/ (+ (exp (* x (+ eps_m -1.0))) (- 1.0 (* eps_m x))) 2.0))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (eps_m <= 2.35e-5) {
tmp = ((eps_m * (exp(-x) * (2.0 + (x * 2.0)))) / eps_m) / 2.0;
} else if ((eps_m <= 4e+145) || !(eps_m <= 6.8e+247)) {
tmp = ((1.0 + ((1.0 / eps_m) + (x * ((-1.0 + (-1.0 / eps_m)) * (1.0 - eps_m))))) + (exp((x * (-1.0 - eps_m))) * ((-1.0 / eps_m) - -1.0))) / 2.0;
} else {
tmp = (exp((x * (eps_m + -1.0))) + (1.0 - (eps_m * 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 (eps_m <= 2.35d-5) then
tmp = ((eps_m * (exp(-x) * (2.0d0 + (x * 2.0d0)))) / eps_m) / 2.0d0
else if ((eps_m <= 4d+145) .or. (.not. (eps_m <= 6.8d+247))) then
tmp = ((1.0d0 + ((1.0d0 / eps_m) + (x * (((-1.0d0) + ((-1.0d0) / eps_m)) * (1.0d0 - eps_m))))) + (exp((x * ((-1.0d0) - eps_m))) * (((-1.0d0) / eps_m) - (-1.0d0)))) / 2.0d0
else
tmp = (exp((x * (eps_m + (-1.0d0)))) + (1.0d0 - (eps_m * 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 (eps_m <= 2.35e-5) {
tmp = ((eps_m * (Math.exp(-x) * (2.0 + (x * 2.0)))) / eps_m) / 2.0;
} else if ((eps_m <= 4e+145) || !(eps_m <= 6.8e+247)) {
tmp = ((1.0 + ((1.0 / eps_m) + (x * ((-1.0 + (-1.0 / eps_m)) * (1.0 - eps_m))))) + (Math.exp((x * (-1.0 - eps_m))) * ((-1.0 / eps_m) - -1.0))) / 2.0;
} else {
tmp = (Math.exp((x * (eps_m + -1.0))) + (1.0 - (eps_m * x))) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if eps_m <= 2.35e-5: tmp = ((eps_m * (math.exp(-x) * (2.0 + (x * 2.0)))) / eps_m) / 2.0 elif (eps_m <= 4e+145) or not (eps_m <= 6.8e+247): tmp = ((1.0 + ((1.0 / eps_m) + (x * ((-1.0 + (-1.0 / eps_m)) * (1.0 - eps_m))))) + (math.exp((x * (-1.0 - eps_m))) * ((-1.0 / eps_m) - -1.0))) / 2.0 else: tmp = (math.exp((x * (eps_m + -1.0))) + (1.0 - (eps_m * x))) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (eps_m <= 2.35e-5) tmp = Float64(Float64(Float64(eps_m * Float64(exp(Float64(-x)) * Float64(2.0 + Float64(x * 2.0)))) / eps_m) / 2.0); elseif ((eps_m <= 4e+145) || !(eps_m <= 6.8e+247)) tmp = Float64(Float64(Float64(1.0 + Float64(Float64(1.0 / eps_m) + Float64(x * Float64(Float64(-1.0 + Float64(-1.0 / eps_m)) * Float64(1.0 - eps_m))))) + Float64(exp(Float64(x * Float64(-1.0 - eps_m))) * Float64(Float64(-1.0 / eps_m) - -1.0))) / 2.0); else tmp = Float64(Float64(exp(Float64(x * Float64(eps_m + -1.0))) + Float64(1.0 - Float64(eps_m * x))) / 2.0); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (eps_m <= 2.35e-5) tmp = ((eps_m * (exp(-x) * (2.0 + (x * 2.0)))) / eps_m) / 2.0; elseif ((eps_m <= 4e+145) || ~((eps_m <= 6.8e+247))) tmp = ((1.0 + ((1.0 / eps_m) + (x * ((-1.0 + (-1.0 / eps_m)) * (1.0 - eps_m))))) + (exp((x * (-1.0 - eps_m))) * ((-1.0 / eps_m) - -1.0))) / 2.0; else tmp = (exp((x * (eps_m + -1.0))) + (1.0 - (eps_m * x))) / 2.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[eps$95$m, 2.35e-5], N[(N[(N[(eps$95$m * N[(N[Exp[(-x)], $MachinePrecision] * N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / eps$95$m), $MachinePrecision] / 2.0), $MachinePrecision], If[Or[LessEqual[eps$95$m, 4e+145], N[Not[LessEqual[eps$95$m, 6.8e+247]], $MachinePrecision]], N[(N[(N[(1.0 + N[(N[(1.0 / eps$95$m), $MachinePrecision] + N[(x * N[(N[(-1.0 + N[(-1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision] * N[(1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Exp[N[(x * N[(-1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(-1.0 / eps$95$m), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(N[Exp[N[(x * N[(eps$95$m + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(1.0 - N[(eps$95$m * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;eps\_m \leq 2.35 \cdot 10^{-5}:\\
\;\;\;\;\frac{\frac{eps\_m \cdot \left(e^{-x} \cdot \left(2 + x \cdot 2\right)\right)}{eps\_m}}{2}\\
\mathbf{elif}\;eps\_m \leq 4 \cdot 10^{+145} \lor \neg \left(eps\_m \leq 6.8 \cdot 10^{+247}\right):\\
\;\;\;\;\frac{\left(1 + \left(\frac{1}{eps\_m} + x \cdot \left(\left(-1 + \frac{-1}{eps\_m}\right) \cdot \left(1 - eps\_m\right)\right)\right)\right) + e^{x \cdot \left(-1 - eps\_m\right)} \cdot \left(\frac{-1}{eps\_m} - -1\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{x \cdot \left(eps\_m + -1\right)} + \left(1 - eps\_m \cdot x\right)}{2}\\
\end{array}
\end{array}
if eps < 2.34999999999999986e-5Initial program 60.8%
Simplified51.5%
Taylor expanded in eps around 0 34.9%
Simplified74.7%
if 2.34999999999999986e-5 < eps < 4e145 or 6.79999999999999961e247 < eps Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 78.9%
+-commutative78.9%
mul-1-neg78.9%
distribute-rgt-neg-in78.9%
*-commutative78.9%
distribute-rgt-neg-in78.9%
distribute-neg-in78.9%
metadata-eval78.9%
distribute-neg-frac78.9%
metadata-eval78.9%
Simplified78.9%
if 4e145 < eps < 6.79999999999999961e247Initial program 100.0%
Simplified80.0%
Taylor expanded in eps around inf 100.0%
Taylor expanded in eps around inf 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x around 0 80.0%
mul-1-neg80.0%
*-commutative80.0%
unsub-neg80.0%
*-commutative80.0%
Simplified80.0%
Final simplification76.1%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<= x -2e-275)
(/ (+ 1.0 (exp (- x))) 2.0)
(if (or (<= x 3600000000000.0)
(not (or (<= x 6.2e+37) (and (not (<= x 5.2e+91)) (<= x 9e+271)))))
(/ (+ 1.0 (exp (* x (+ eps_m -1.0)))) 2.0)
0.0)))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= -2e-275) {
tmp = (1.0 + exp(-x)) / 2.0;
} else if ((x <= 3600000000000.0) || !((x <= 6.2e+37) || (!(x <= 5.2e+91) && (x <= 9e+271)))) {
tmp = (1.0 + exp((x * (eps_m + -1.0)))) / 2.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 <= (-2d-275)) then
tmp = (1.0d0 + exp(-x)) / 2.0d0
else if ((x <= 3600000000000.0d0) .or. (.not. (x <= 6.2d+37) .or. (.not. (x <= 5.2d+91)) .and. (x <= 9d+271))) then
tmp = (1.0d0 + exp((x * (eps_m + (-1.0d0))))) / 2.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 <= -2e-275) {
tmp = (1.0 + Math.exp(-x)) / 2.0;
} else if ((x <= 3600000000000.0) || !((x <= 6.2e+37) || (!(x <= 5.2e+91) && (x <= 9e+271)))) {
tmp = (1.0 + Math.exp((x * (eps_m + -1.0)))) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= -2e-275: tmp = (1.0 + math.exp(-x)) / 2.0 elif (x <= 3600000000000.0) or not ((x <= 6.2e+37) or (not (x <= 5.2e+91) and (x <= 9e+271))): tmp = (1.0 + math.exp((x * (eps_m + -1.0)))) / 2.0 else: tmp = 0.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= -2e-275) tmp = Float64(Float64(1.0 + exp(Float64(-x))) / 2.0); elseif ((x <= 3600000000000.0) || !((x <= 6.2e+37) || (!(x <= 5.2e+91) && (x <= 9e+271)))) tmp = Float64(Float64(1.0 + exp(Float64(x * Float64(eps_m + -1.0)))) / 2.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 <= -2e-275) tmp = (1.0 + exp(-x)) / 2.0; elseif ((x <= 3600000000000.0) || ~(((x <= 6.2e+37) || (~((x <= 5.2e+91)) && (x <= 9e+271))))) tmp = (1.0 + exp((x * (eps_m + -1.0)))) / 2.0; else tmp = 0.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, -2e-275], N[(N[(1.0 + N[Exp[(-x)], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[Or[LessEqual[x, 3600000000000.0], N[Not[Or[LessEqual[x, 6.2e+37], And[N[Not[LessEqual[x, 5.2e+91]], $MachinePrecision], LessEqual[x, 9e+271]]]], $MachinePrecision]], N[(N[(1.0 + N[Exp[N[(x * N[(eps$95$m + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], 0.0]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2 \cdot 10^{-275}:\\
\;\;\;\;\frac{1 + e^{-x}}{2}\\
\mathbf{elif}\;x \leq 3600000000000 \lor \neg \left(x \leq 6.2 \cdot 10^{+37} \lor \neg \left(x \leq 5.2 \cdot 10^{+91}\right) \land x \leq 9 \cdot 10^{+271}\right):\\
\;\;\;\;\frac{1 + e^{x \cdot \left(eps\_m + -1\right)}}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < -1.99999999999999987e-275Initial program 64.8%
Simplified55.4%
Taylor expanded in eps around inf 97.0%
Taylor expanded in eps around inf 97.0%
*-commutative97.0%
Simplified97.0%
Taylor expanded in eps around 0 80.8%
neg-mul-180.8%
Simplified80.8%
if -1.99999999999999987e-275 < x < 3.6e12 or 6.2000000000000004e37 < x < 5.2000000000000001e91 or 8.9999999999999994e271 < x Initial program 66.8%
Simplified60.7%
Taylor expanded in eps around inf 97.7%
Taylor expanded in x around 0 73.7%
if 3.6e12 < x < 6.2000000000000004e37 or 5.2000000000000001e91 < x < 8.9999999999999994e271Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 72.2%
mul-1-neg72.2%
mul-1-neg72.2%
rec-exp72.2%
sub-neg72.2%
div-sub72.2%
mul-1-neg72.2%
rec-exp72.2%
+-inverses72.2%
Simplified72.2%
Final simplification76.3%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<= x -2e-275)
(/ (+ 1.0 (exp (* eps_m (- x)))) 2.0)
(if (or (<= x 2800000000000.0)
(and (not (<= x 6e+37)) (or (<= x 1.9e+91) (not (<= x 1.6e+271)))))
(/ (+ 1.0 (exp (* x (+ eps_m -1.0)))) 2.0)
0.0)))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= -2e-275) {
tmp = (1.0 + exp((eps_m * -x))) / 2.0;
} else if ((x <= 2800000000000.0) || (!(x <= 6e+37) && ((x <= 1.9e+91) || !(x <= 1.6e+271)))) {
tmp = (1.0 + exp((x * (eps_m + -1.0)))) / 2.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 <= (-2d-275)) then
tmp = (1.0d0 + exp((eps_m * -x))) / 2.0d0
else if ((x <= 2800000000000.0d0) .or. (.not. (x <= 6d+37)) .and. (x <= 1.9d+91) .or. (.not. (x <= 1.6d+271))) then
tmp = (1.0d0 + exp((x * (eps_m + (-1.0d0))))) / 2.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 <= -2e-275) {
tmp = (1.0 + Math.exp((eps_m * -x))) / 2.0;
} else if ((x <= 2800000000000.0) || (!(x <= 6e+37) && ((x <= 1.9e+91) || !(x <= 1.6e+271)))) {
tmp = (1.0 + Math.exp((x * (eps_m + -1.0)))) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= -2e-275: tmp = (1.0 + math.exp((eps_m * -x))) / 2.0 elif (x <= 2800000000000.0) or (not (x <= 6e+37) and ((x <= 1.9e+91) or not (x <= 1.6e+271))): tmp = (1.0 + math.exp((x * (eps_m + -1.0)))) / 2.0 else: tmp = 0.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= -2e-275) tmp = Float64(Float64(1.0 + exp(Float64(eps_m * Float64(-x)))) / 2.0); elseif ((x <= 2800000000000.0) || (!(x <= 6e+37) && ((x <= 1.9e+91) || !(x <= 1.6e+271)))) tmp = Float64(Float64(1.0 + exp(Float64(x * Float64(eps_m + -1.0)))) / 2.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 <= -2e-275) tmp = (1.0 + exp((eps_m * -x))) / 2.0; elseif ((x <= 2800000000000.0) || (~((x <= 6e+37)) && ((x <= 1.9e+91) || ~((x <= 1.6e+271))))) tmp = (1.0 + exp((x * (eps_m + -1.0)))) / 2.0; else tmp = 0.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, -2e-275], N[(N[(1.0 + N[Exp[N[(eps$95$m * (-x)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[Or[LessEqual[x, 2800000000000.0], And[N[Not[LessEqual[x, 6e+37]], $MachinePrecision], Or[LessEqual[x, 1.9e+91], N[Not[LessEqual[x, 1.6e+271]], $MachinePrecision]]]], N[(N[(1.0 + N[Exp[N[(x * N[(eps$95$m + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], 0.0]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2 \cdot 10^{-275}:\\
\;\;\;\;\frac{1 + e^{eps\_m \cdot \left(-x\right)}}{2}\\
\mathbf{elif}\;x \leq 2800000000000 \lor \neg \left(x \leq 6 \cdot 10^{+37}\right) \land \left(x \leq 1.9 \cdot 10^{+91} \lor \neg \left(x \leq 1.6 \cdot 10^{+271}\right)\right):\\
\;\;\;\;\frac{1 + e^{x \cdot \left(eps\_m + -1\right)}}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < -1.99999999999999987e-275Initial program 64.8%
Simplified64.8%
Taylor expanded in x around 0 43.0%
Taylor expanded in eps around inf 75.1%
sub-neg75.1%
mul-1-neg75.1%
remove-double-neg75.1%
associate-*r*75.1%
exp-prod69.4%
remove-double-neg69.4%
mul-1-neg69.4%
sub-neg69.4%
exp-prod75.1%
associate-*r*75.1%
remove-double-neg75.1%
mul-1-neg75.1%
sub-neg75.1%
mul-1-neg75.1%
mul-1-neg75.1%
distribute-rgt-neg-in75.1%
Simplified75.1%
Taylor expanded in eps around inf 75.6%
mul-1-neg75.6%
*-commutative75.6%
distribute-rgt-neg-in75.6%
Simplified75.6%
if -1.99999999999999987e-275 < x < 2.8e12 or 6.00000000000000043e37 < x < 1.8999999999999999e91 or 1.6000000000000001e271 < x Initial program 66.8%
Simplified60.7%
Taylor expanded in eps around inf 97.7%
Taylor expanded in x around 0 73.7%
if 2.8e12 < x < 6.00000000000000043e37 or 1.8999999999999999e91 < x < 1.6000000000000001e271Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 72.2%
mul-1-neg72.2%
mul-1-neg72.2%
rec-exp72.2%
sub-neg72.2%
div-sub72.2%
mul-1-neg72.2%
rec-exp72.2%
+-inverses72.2%
Simplified72.2%
Final simplification74.2%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(let* ((t_0 (exp (* x (+ eps_m -1.0)))))
(if (<= x -2e-275)
(/ (+ 1.0 (exp (* eps_m (- x)))) 2.0)
(if (<= x 4.3e+15)
(/ (+ t_0 (- 1.0 (* eps_m x))) 2.0)
(if (<= x 6.5e+37)
0.0
(if (or (<= x 3.5e+91) (not (<= x 7.6e+270)))
(/ (+ 1.0 t_0) 2.0)
0.0))))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double t_0 = exp((x * (eps_m + -1.0)));
double tmp;
if (x <= -2e-275) {
tmp = (1.0 + exp((eps_m * -x))) / 2.0;
} else if (x <= 4.3e+15) {
tmp = (t_0 + (1.0 - (eps_m * x))) / 2.0;
} else if (x <= 6.5e+37) {
tmp = 0.0;
} else if ((x <= 3.5e+91) || !(x <= 7.6e+270)) {
tmp = (1.0 + t_0) / 2.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) :: t_0
real(8) :: tmp
t_0 = exp((x * (eps_m + (-1.0d0))))
if (x <= (-2d-275)) then
tmp = (1.0d0 + exp((eps_m * -x))) / 2.0d0
else if (x <= 4.3d+15) then
tmp = (t_0 + (1.0d0 - (eps_m * x))) / 2.0d0
else if (x <= 6.5d+37) then
tmp = 0.0d0
else if ((x <= 3.5d+91) .or. (.not. (x <= 7.6d+270))) then
tmp = (1.0d0 + t_0) / 2.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 t_0 = Math.exp((x * (eps_m + -1.0)));
double tmp;
if (x <= -2e-275) {
tmp = (1.0 + Math.exp((eps_m * -x))) / 2.0;
} else if (x <= 4.3e+15) {
tmp = (t_0 + (1.0 - (eps_m * x))) / 2.0;
} else if (x <= 6.5e+37) {
tmp = 0.0;
} else if ((x <= 3.5e+91) || !(x <= 7.6e+270)) {
tmp = (1.0 + t_0) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): t_0 = math.exp((x * (eps_m + -1.0))) tmp = 0 if x <= -2e-275: tmp = (1.0 + math.exp((eps_m * -x))) / 2.0 elif x <= 4.3e+15: tmp = (t_0 + (1.0 - (eps_m * x))) / 2.0 elif x <= 6.5e+37: tmp = 0.0 elif (x <= 3.5e+91) or not (x <= 7.6e+270): tmp = (1.0 + t_0) / 2.0 else: tmp = 0.0 return tmp
eps_m = abs(eps) function code(x, eps_m) t_0 = exp(Float64(x * Float64(eps_m + -1.0))) tmp = 0.0 if (x <= -2e-275) tmp = Float64(Float64(1.0 + exp(Float64(eps_m * Float64(-x)))) / 2.0); elseif (x <= 4.3e+15) tmp = Float64(Float64(t_0 + Float64(1.0 - Float64(eps_m * x))) / 2.0); elseif (x <= 6.5e+37) tmp = 0.0; elseif ((x <= 3.5e+91) || !(x <= 7.6e+270)) tmp = Float64(Float64(1.0 + t_0) / 2.0); else tmp = 0.0; end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) t_0 = exp((x * (eps_m + -1.0))); tmp = 0.0; if (x <= -2e-275) tmp = (1.0 + exp((eps_m * -x))) / 2.0; elseif (x <= 4.3e+15) tmp = (t_0 + (1.0 - (eps_m * x))) / 2.0; elseif (x <= 6.5e+37) tmp = 0.0; elseif ((x <= 3.5e+91) || ~((x <= 7.6e+270))) tmp = (1.0 + t_0) / 2.0; else tmp = 0.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[(eps$95$m + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -2e-275], N[(N[(1.0 + N[Exp[N[(eps$95$m * (-x)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 4.3e+15], N[(N[(t$95$0 + N[(1.0 - N[(eps$95$m * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 6.5e+37], 0.0, If[Or[LessEqual[x, 3.5e+91], N[Not[LessEqual[x, 7.6e+270]], $MachinePrecision]], N[(N[(1.0 + t$95$0), $MachinePrecision] / 2.0), $MachinePrecision], 0.0]]]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
t_0 := e^{x \cdot \left(eps\_m + -1\right)}\\
\mathbf{if}\;x \leq -2 \cdot 10^{-275}:\\
\;\;\;\;\frac{1 + e^{eps\_m \cdot \left(-x\right)}}{2}\\
\mathbf{elif}\;x \leq 4.3 \cdot 10^{+15}:\\
\;\;\;\;\frac{t\_0 + \left(1 - eps\_m \cdot x\right)}{2}\\
\mathbf{elif}\;x \leq 6.5 \cdot 10^{+37}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 3.5 \cdot 10^{+91} \lor \neg \left(x \leq 7.6 \cdot 10^{+270}\right):\\
\;\;\;\;\frac{1 + t\_0}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < -1.99999999999999987e-275Initial program 64.8%
Simplified64.8%
Taylor expanded in x around 0 43.0%
Taylor expanded in eps around inf 75.1%
sub-neg75.1%
mul-1-neg75.1%
remove-double-neg75.1%
associate-*r*75.1%
exp-prod69.4%
remove-double-neg69.4%
mul-1-neg69.4%
sub-neg69.4%
exp-prod75.1%
associate-*r*75.1%
remove-double-neg75.1%
mul-1-neg75.1%
sub-neg75.1%
mul-1-neg75.1%
mul-1-neg75.1%
distribute-rgt-neg-in75.1%
Simplified75.1%
Taylor expanded in eps around inf 75.6%
mul-1-neg75.6%
*-commutative75.6%
distribute-rgt-neg-in75.6%
Simplified75.6%
if -1.99999999999999987e-275 < x < 4.3e15Initial program 56.3%
Simplified48.2%
Taylor expanded in eps around inf 96.9%
Taylor expanded in eps around inf 95.8%
*-commutative95.8%
Simplified95.8%
Taylor expanded in x around 0 85.8%
mul-1-neg85.8%
*-commutative85.8%
unsub-neg85.8%
*-commutative85.8%
Simplified85.8%
if 4.3e15 < x < 6.4999999999999998e37 or 3.50000000000000001e91 < x < 7.60000000000000036e270Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 72.2%
mul-1-neg72.2%
mul-1-neg72.2%
rec-exp72.2%
sub-neg72.2%
div-sub72.2%
mul-1-neg72.2%
rec-exp72.2%
+-inverses72.2%
Simplified72.2%
if 6.4999999999999998e37 < x < 3.50000000000000001e91 or 7.60000000000000036e270 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around inf 100.0%
Taylor expanded in x around 0 36.7%
Final simplification74.3%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<= x 2.05)
(/ (+ 1.0 (exp (- x))) 2.0)
(if (<= x 6e+37)
(/ (* x (/ 2.0 (exp x))) 2.0)
(if (<= x 1.6e+91)
(/ (* (* x 2.0) (exp x)) 2.0)
(if (<= x 1e+271) 0.0 (/ (* x (+ 2.0 (* x (+ x 2.0)))) 2.0))))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= 2.05) {
tmp = (1.0 + exp(-x)) / 2.0;
} else if (x <= 6e+37) {
tmp = (x * (2.0 / exp(x))) / 2.0;
} else if (x <= 1.6e+91) {
tmp = ((x * 2.0) * exp(x)) / 2.0;
} else if (x <= 1e+271) {
tmp = 0.0;
} else {
tmp = (x * (2.0 + (x * (x + 2.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) :: tmp
if (x <= 2.05d0) then
tmp = (1.0d0 + exp(-x)) / 2.0d0
else if (x <= 6d+37) then
tmp = (x * (2.0d0 / exp(x))) / 2.0d0
else if (x <= 1.6d+91) then
tmp = ((x * 2.0d0) * exp(x)) / 2.0d0
else if (x <= 1d+271) then
tmp = 0.0d0
else
tmp = (x * (2.0d0 + (x * (x + 2.0d0)))) / 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 <= 2.05) {
tmp = (1.0 + Math.exp(-x)) / 2.0;
} else if (x <= 6e+37) {
tmp = (x * (2.0 / Math.exp(x))) / 2.0;
} else if (x <= 1.6e+91) {
tmp = ((x * 2.0) * Math.exp(x)) / 2.0;
} else if (x <= 1e+271) {
tmp = 0.0;
} else {
tmp = (x * (2.0 + (x * (x + 2.0)))) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= 2.05: tmp = (1.0 + math.exp(-x)) / 2.0 elif x <= 6e+37: tmp = (x * (2.0 / math.exp(x))) / 2.0 elif x <= 1.6e+91: tmp = ((x * 2.0) * math.exp(x)) / 2.0 elif x <= 1e+271: tmp = 0.0 else: tmp = (x * (2.0 + (x * (x + 2.0)))) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= 2.05) tmp = Float64(Float64(1.0 + exp(Float64(-x))) / 2.0); elseif (x <= 6e+37) tmp = Float64(Float64(x * Float64(2.0 / exp(x))) / 2.0); elseif (x <= 1.6e+91) tmp = Float64(Float64(Float64(x * 2.0) * exp(x)) / 2.0); elseif (x <= 1e+271) tmp = 0.0; else tmp = Float64(Float64(x * Float64(2.0 + Float64(x * Float64(x + 2.0)))) / 2.0); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (x <= 2.05) tmp = (1.0 + exp(-x)) / 2.0; elseif (x <= 6e+37) tmp = (x * (2.0 / exp(x))) / 2.0; elseif (x <= 1.6e+91) tmp = ((x * 2.0) * exp(x)) / 2.0; elseif (x <= 1e+271) tmp = 0.0; else tmp = (x * (2.0 + (x * (x + 2.0)))) / 2.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, 2.05], N[(N[(1.0 + N[Exp[(-x)], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 6e+37], N[(N[(x * N[(2.0 / N[Exp[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 1.6e+91], N[(N[(N[(x * 2.0), $MachinePrecision] * N[Exp[x], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 1e+271], 0.0, N[(N[(x * N[(2.0 + N[(x * N[(x + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.05:\\
\;\;\;\;\frac{1 + e^{-x}}{2}\\
\mathbf{elif}\;x \leq 6 \cdot 10^{+37}:\\
\;\;\;\;\frac{x \cdot \frac{2}{e^{x}}}{2}\\
\mathbf{elif}\;x \leq 1.6 \cdot 10^{+91}:\\
\;\;\;\;\frac{\left(x \cdot 2\right) \cdot e^{x}}{2}\\
\mathbf{elif}\;x \leq 10^{+271}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(2 + x \cdot \left(x + 2\right)\right)}{2}\\
\end{array}
\end{array}
if x < 2.0499999999999998Initial program 60.5%
Simplified51.4%
Taylor expanded in eps around inf 97.3%
Taylor expanded in eps around inf 97.4%
*-commutative97.4%
Simplified97.4%
Taylor expanded in eps around 0 80.3%
neg-mul-180.3%
Simplified80.3%
if 2.0499999999999998 < x < 6.00000000000000043e37Initial program 93.1%
Simplified93.1%
Taylor expanded in eps around 0 72.0%
associate--r+72.0%
associate-*r*72.0%
mul-1-neg72.0%
cancel-sign-sub72.0%
distribute-rgt1-in72.0%
distribute-rgt-out--72.0%
mul-1-neg72.0%
mul-1-neg72.0%
Simplified72.0%
Taylor expanded in x around inf 66.7%
rec-exp66.7%
associate-*r*66.7%
*-commutative66.7%
rec-exp66.7%
neg-mul-166.7%
associate-*r*66.7%
neg-mul-166.7%
Simplified66.7%
Taylor expanded in x around inf 66.7%
associate-*r*66.7%
*-commutative66.7%
exp-neg66.7%
associate-/l*66.7%
*-rgt-identity66.7%
associate-/l*66.7%
Simplified66.7%
if 6.00000000000000043e37 < x < 1.59999999999999995e91Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 27.8%
associate--r+27.8%
associate-*r*27.8%
mul-1-neg27.8%
cancel-sign-sub27.8%
distribute-rgt1-in27.8%
distribute-rgt-out--27.8%
mul-1-neg27.8%
mul-1-neg27.8%
Simplified27.8%
Taylor expanded in x around inf 27.8%
rec-exp27.8%
associate-*r*27.8%
*-commutative27.8%
rec-exp27.8%
neg-mul-127.8%
associate-*r*27.8%
neg-mul-127.8%
Simplified27.8%
pow127.8%
associate-*r*27.8%
*-commutative27.8%
add-sqr-sqrt0.0%
sqrt-unprod73.8%
sqr-neg73.8%
sqrt-unprod73.8%
add-sqr-sqrt73.8%
Applied egg-rr73.8%
unpow173.8%
Simplified73.8%
if 1.59999999999999995e91 < x < 9.99999999999999953e270Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 68.1%
mul-1-neg68.1%
mul-1-neg68.1%
rec-exp68.1%
sub-neg68.1%
div-sub68.1%
mul-1-neg68.1%
rec-exp68.1%
+-inverses68.1%
Simplified68.1%
if 9.99999999999999953e270 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 28.4%
associate--r+28.4%
associate-*r*28.4%
mul-1-neg28.4%
cancel-sign-sub28.4%
distribute-rgt1-in28.4%
distribute-rgt-out--28.4%
mul-1-neg28.4%
mul-1-neg28.4%
Simplified28.4%
Taylor expanded in x around inf 28.4%
rec-exp28.4%
associate-*r*28.4%
*-commutative28.4%
rec-exp28.4%
neg-mul-128.4%
associate-*r*28.4%
neg-mul-128.4%
Simplified28.4%
pow128.4%
associate-*r*28.4%
*-commutative28.4%
add-sqr-sqrt0.0%
sqrt-unprod73.2%
sqr-neg73.2%
sqrt-unprod73.2%
add-sqr-sqrt73.2%
Applied egg-rr73.2%
unpow173.2%
Simplified73.2%
Taylor expanded in x around 0 73.2%
Final simplification77.1%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<= x 2.05)
(/ (+ 1.0 (exp (- x))) 2.0)
(if (<= x 6.5e+270)
(/ (* x (/ 2.0 (exp x))) 2.0)
(/ (* x (+ 2.0 (* x (+ x 2.0)))) 2.0))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= 2.05) {
tmp = (1.0 + exp(-x)) / 2.0;
} else if (x <= 6.5e+270) {
tmp = (x * (2.0 / exp(x))) / 2.0;
} else {
tmp = (x * (2.0 + (x * (x + 2.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) :: tmp
if (x <= 2.05d0) then
tmp = (1.0d0 + exp(-x)) / 2.0d0
else if (x <= 6.5d+270) then
tmp = (x * (2.0d0 / exp(x))) / 2.0d0
else
tmp = (x * (2.0d0 + (x * (x + 2.0d0)))) / 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 <= 2.05) {
tmp = (1.0 + Math.exp(-x)) / 2.0;
} else if (x <= 6.5e+270) {
tmp = (x * (2.0 / Math.exp(x))) / 2.0;
} else {
tmp = (x * (2.0 + (x * (x + 2.0)))) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= 2.05: tmp = (1.0 + math.exp(-x)) / 2.0 elif x <= 6.5e+270: tmp = (x * (2.0 / math.exp(x))) / 2.0 else: tmp = (x * (2.0 + (x * (x + 2.0)))) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= 2.05) tmp = Float64(Float64(1.0 + exp(Float64(-x))) / 2.0); elseif (x <= 6.5e+270) tmp = Float64(Float64(x * Float64(2.0 / exp(x))) / 2.0); else tmp = Float64(Float64(x * Float64(2.0 + Float64(x * Float64(x + 2.0)))) / 2.0); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (x <= 2.05) tmp = (1.0 + exp(-x)) / 2.0; elseif (x <= 6.5e+270) tmp = (x * (2.0 / exp(x))) / 2.0; else tmp = (x * (2.0 + (x * (x + 2.0)))) / 2.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, 2.05], N[(N[(1.0 + N[Exp[(-x)], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 6.5e+270], N[(N[(x * N[(2.0 / N[Exp[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(x * N[(2.0 + N[(x * N[(x + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.05:\\
\;\;\;\;\frac{1 + e^{-x}}{2}\\
\mathbf{elif}\;x \leq 6.5 \cdot 10^{+270}:\\
\;\;\;\;\frac{x \cdot \frac{2}{e^{x}}}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(2 + x \cdot \left(x + 2\right)\right)}{2}\\
\end{array}
\end{array}
if x < 2.0499999999999998Initial program 60.5%
Simplified51.4%
Taylor expanded in eps around inf 97.3%
Taylor expanded in eps around inf 97.4%
*-commutative97.4%
Simplified97.4%
Taylor expanded in eps around 0 80.3%
neg-mul-180.3%
Simplified80.3%
if 2.0499999999999998 < x < 6.4999999999999996e270Initial program 98.5%
Simplified98.5%
Taylor expanded in eps around 0 59.8%
associate--r+59.8%
associate-*r*59.8%
mul-1-neg59.8%
cancel-sign-sub59.8%
distribute-rgt1-in59.8%
distribute-rgt-out--59.8%
mul-1-neg59.8%
mul-1-neg59.8%
Simplified59.8%
Taylor expanded in x around inf 58.6%
rec-exp58.6%
associate-*r*58.6%
*-commutative58.6%
rec-exp58.6%
neg-mul-158.6%
associate-*r*58.6%
neg-mul-158.6%
Simplified58.6%
Taylor expanded in x around inf 58.6%
associate-*r*58.6%
*-commutative58.6%
exp-neg58.6%
associate-/l*58.6%
*-rgt-identity58.6%
associate-/l*58.6%
Simplified58.6%
if 6.4999999999999996e270 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 28.4%
associate--r+28.4%
associate-*r*28.4%
mul-1-neg28.4%
cancel-sign-sub28.4%
distribute-rgt1-in28.4%
distribute-rgt-out--28.4%
mul-1-neg28.4%
mul-1-neg28.4%
Simplified28.4%
Taylor expanded in x around inf 28.4%
rec-exp28.4%
associate-*r*28.4%
*-commutative28.4%
rec-exp28.4%
neg-mul-128.4%
associate-*r*28.4%
neg-mul-128.4%
Simplified28.4%
pow128.4%
associate-*r*28.4%
*-commutative28.4%
add-sqr-sqrt0.0%
sqrt-unprod73.2%
sqr-neg73.2%
sqrt-unprod73.2%
add-sqr-sqrt73.2%
Applied egg-rr73.2%
unpow173.2%
Simplified73.2%
Taylor expanded in x around 0 73.2%
Final simplification74.4%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= x 800000.0) (/ (+ 1.0 (exp (- x))) 2.0) (if (<= x 1e+271) 0.0 (/ (* x (+ 2.0 (* x (+ x 2.0)))) 2.0))))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= 800000.0) {
tmp = (1.0 + exp(-x)) / 2.0;
} else if (x <= 1e+271) {
tmp = 0.0;
} else {
tmp = (x * (2.0 + (x * (x + 2.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) :: tmp
if (x <= 800000.0d0) then
tmp = (1.0d0 + exp(-x)) / 2.0d0
else if (x <= 1d+271) then
tmp = 0.0d0
else
tmp = (x * (2.0d0 + (x * (x + 2.0d0)))) / 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 <= 800000.0) {
tmp = (1.0 + Math.exp(-x)) / 2.0;
} else if (x <= 1e+271) {
tmp = 0.0;
} else {
tmp = (x * (2.0 + (x * (x + 2.0)))) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= 800000.0: tmp = (1.0 + math.exp(-x)) / 2.0 elif x <= 1e+271: tmp = 0.0 else: tmp = (x * (2.0 + (x * (x + 2.0)))) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= 800000.0) tmp = Float64(Float64(1.0 + exp(Float64(-x))) / 2.0); elseif (x <= 1e+271) tmp = 0.0; else tmp = Float64(Float64(x * Float64(2.0 + Float64(x * Float64(x + 2.0)))) / 2.0); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (x <= 800000.0) tmp = (1.0 + exp(-x)) / 2.0; elseif (x <= 1e+271) tmp = 0.0; else tmp = (x * (2.0 + (x * (x + 2.0)))) / 2.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, 800000.0], N[(N[(1.0 + N[Exp[(-x)], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 1e+271], 0.0, N[(N[(x * N[(2.0 + N[(x * N[(x + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq 800000:\\
\;\;\;\;\frac{1 + e^{-x}}{2}\\
\mathbf{elif}\;x \leq 10^{+271}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(2 + x \cdot \left(x + 2\right)\right)}{2}\\
\end{array}
\end{array}
if x < 8e5Initial program 60.6%
Simplified51.7%
Taylor expanded in eps around inf 96.9%
Taylor expanded in eps around inf 96.9%
*-commutative96.9%
Simplified96.9%
Taylor expanded in eps around 0 79.0%
neg-mul-179.0%
Simplified79.0%
if 8e5 < x < 9.99999999999999953e270Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 60.9%
mul-1-neg60.9%
mul-1-neg60.9%
rec-exp60.9%
sub-neg60.9%
div-sub60.9%
mul-1-neg60.9%
rec-exp60.9%
+-inverses60.9%
Simplified60.9%
if 9.99999999999999953e270 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 28.4%
associate--r+28.4%
associate-*r*28.4%
mul-1-neg28.4%
cancel-sign-sub28.4%
distribute-rgt1-in28.4%
distribute-rgt-out--28.4%
mul-1-neg28.4%
mul-1-neg28.4%
Simplified28.4%
Taylor expanded in x around inf 28.4%
rec-exp28.4%
associate-*r*28.4%
*-commutative28.4%
rec-exp28.4%
neg-mul-128.4%
associate-*r*28.4%
neg-mul-128.4%
Simplified28.4%
pow128.4%
associate-*r*28.4%
*-commutative28.4%
add-sqr-sqrt0.0%
sqrt-unprod73.2%
sqr-neg73.2%
sqrt-unprod73.2%
add-sqr-sqrt73.2%
Applied egg-rr73.2%
unpow173.2%
Simplified73.2%
Taylor expanded in x around 0 73.2%
Final simplification74.3%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<= x -2.6e+143)
(/ (* x (+ 2.0 (* x 2.0))) 2.0)
(if (<= x 85.0)
(/ (- 2.0 (* eps_m x)) 2.0)
(if (<= x 4e+271) 0.0 (/ (* x (+ 2.0 (* x (+ x 2.0)))) 2.0)))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= -2.6e+143) {
tmp = (x * (2.0 + (x * 2.0))) / 2.0;
} else if (x <= 85.0) {
tmp = (2.0 - (eps_m * x)) / 2.0;
} else if (x <= 4e+271) {
tmp = 0.0;
} else {
tmp = (x * (2.0 + (x * (x + 2.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) :: tmp
if (x <= (-2.6d+143)) then
tmp = (x * (2.0d0 + (x * 2.0d0))) / 2.0d0
else if (x <= 85.0d0) then
tmp = (2.0d0 - (eps_m * x)) / 2.0d0
else if (x <= 4d+271) then
tmp = 0.0d0
else
tmp = (x * (2.0d0 + (x * (x + 2.0d0)))) / 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 <= -2.6e+143) {
tmp = (x * (2.0 + (x * 2.0))) / 2.0;
} else if (x <= 85.0) {
tmp = (2.0 - (eps_m * x)) / 2.0;
} else if (x <= 4e+271) {
tmp = 0.0;
} else {
tmp = (x * (2.0 + (x * (x + 2.0)))) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= -2.6e+143: tmp = (x * (2.0 + (x * 2.0))) / 2.0 elif x <= 85.0: tmp = (2.0 - (eps_m * x)) / 2.0 elif x <= 4e+271: tmp = 0.0 else: tmp = (x * (2.0 + (x * (x + 2.0)))) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= -2.6e+143) tmp = Float64(Float64(x * Float64(2.0 + Float64(x * 2.0))) / 2.0); elseif (x <= 85.0) tmp = Float64(Float64(2.0 - Float64(eps_m * x)) / 2.0); elseif (x <= 4e+271) tmp = 0.0; else tmp = Float64(Float64(x * Float64(2.0 + Float64(x * Float64(x + 2.0)))) / 2.0); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (x <= -2.6e+143) tmp = (x * (2.0 + (x * 2.0))) / 2.0; elseif (x <= 85.0) tmp = (2.0 - (eps_m * x)) / 2.0; elseif (x <= 4e+271) tmp = 0.0; else tmp = (x * (2.0 + (x * (x + 2.0)))) / 2.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, -2.6e+143], N[(N[(x * N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 85.0], N[(N[(2.0 - N[(eps$95$m * x), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 4e+271], 0.0, N[(N[(x * N[(2.0 + N[(x * N[(x + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.6 \cdot 10^{+143}:\\
\;\;\;\;\frac{x \cdot \left(2 + x \cdot 2\right)}{2}\\
\mathbf{elif}\;x \leq 85:\\
\;\;\;\;\frac{2 - eps\_m \cdot x}{2}\\
\mathbf{elif}\;x \leq 4 \cdot 10^{+271}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(2 + x \cdot \left(x + 2\right)\right)}{2}\\
\end{array}
\end{array}
if x < -2.5999999999999999e143Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 0.0%
associate--r+0.0%
associate-*r*0.0%
mul-1-neg0.0%
cancel-sign-sub0.0%
distribute-rgt1-in0.0%
distribute-rgt-out--0.0%
mul-1-neg0.0%
mul-1-neg0.0%
Simplified0.0%
Taylor expanded in x around inf 0.0%
rec-exp0.0%
associate-*r*0.0%
*-commutative0.0%
rec-exp0.0%
neg-mul-10.0%
associate-*r*0.0%
neg-mul-10.0%
Simplified0.0%
pow10.0%
associate-*r*0.0%
*-commutative0.0%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
sqr-neg0.0%
sqrt-unprod0.0%
add-sqr-sqrt1.6%
Applied egg-rr1.6%
unpow11.6%
Simplified1.6%
Taylor expanded in x around 0 95.7%
if -2.5999999999999999e143 < x < 85Initial program 54.9%
Simplified54.9%
Taylor expanded in x around 0 39.8%
Taylor expanded in x around 0 45.6%
Taylor expanded in eps around inf 70.1%
associate-*r*70.1%
mul-1-neg70.1%
Simplified70.1%
if 85 < x < 3.99999999999999981e271Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 59.1%
mul-1-neg59.1%
mul-1-neg59.1%
rec-exp59.1%
sub-neg59.1%
div-sub59.1%
mul-1-neg59.1%
rec-exp59.1%
+-inverses59.1%
Simplified59.1%
if 3.99999999999999981e271 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 28.4%
associate--r+28.4%
associate-*r*28.4%
mul-1-neg28.4%
cancel-sign-sub28.4%
distribute-rgt1-in28.4%
distribute-rgt-out--28.4%
mul-1-neg28.4%
mul-1-neg28.4%
Simplified28.4%
Taylor expanded in x around inf 28.4%
rec-exp28.4%
associate-*r*28.4%
*-commutative28.4%
rec-exp28.4%
neg-mul-128.4%
associate-*r*28.4%
neg-mul-128.4%
Simplified28.4%
pow128.4%
associate-*r*28.4%
*-commutative28.4%
add-sqr-sqrt0.0%
sqrt-unprod73.2%
sqr-neg73.2%
sqrt-unprod73.2%
add-sqr-sqrt73.2%
Applied egg-rr73.2%
unpow173.2%
Simplified73.2%
Taylor expanded in x around 0 73.2%
Final simplification69.5%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<= x -820.0)
(/ (* x (+ 2.0 (* x (+ 2.0 (* x (+ 1.0 (* x 0.3333333333333333))))))) 2.0)
(if (<= x 800000.0)
1.0
(if (<= x 1e+271) 0.0 (/ (* x (+ 2.0 (* x (+ x 2.0)))) 2.0)))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= -820.0) {
tmp = (x * (2.0 + (x * (2.0 + (x * (1.0 + (x * 0.3333333333333333))))))) / 2.0;
} else if (x <= 800000.0) {
tmp = 1.0;
} else if (x <= 1e+271) {
tmp = 0.0;
} else {
tmp = (x * (2.0 + (x * (x + 2.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) :: tmp
if (x <= (-820.0d0)) then
tmp = (x * (2.0d0 + (x * (2.0d0 + (x * (1.0d0 + (x * 0.3333333333333333d0))))))) / 2.0d0
else if (x <= 800000.0d0) then
tmp = 1.0d0
else if (x <= 1d+271) then
tmp = 0.0d0
else
tmp = (x * (2.0d0 + (x * (x + 2.0d0)))) / 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 <= -820.0) {
tmp = (x * (2.0 + (x * (2.0 + (x * (1.0 + (x * 0.3333333333333333))))))) / 2.0;
} else if (x <= 800000.0) {
tmp = 1.0;
} else if (x <= 1e+271) {
tmp = 0.0;
} else {
tmp = (x * (2.0 + (x * (x + 2.0)))) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= -820.0: tmp = (x * (2.0 + (x * (2.0 + (x * (1.0 + (x * 0.3333333333333333))))))) / 2.0 elif x <= 800000.0: tmp = 1.0 elif x <= 1e+271: tmp = 0.0 else: tmp = (x * (2.0 + (x * (x + 2.0)))) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= -820.0) tmp = Float64(Float64(x * Float64(2.0 + Float64(x * Float64(2.0 + Float64(x * Float64(1.0 + Float64(x * 0.3333333333333333))))))) / 2.0); elseif (x <= 800000.0) tmp = 1.0; elseif (x <= 1e+271) tmp = 0.0; else tmp = Float64(Float64(x * Float64(2.0 + Float64(x * Float64(x + 2.0)))) / 2.0); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (x <= -820.0) tmp = (x * (2.0 + (x * (2.0 + (x * (1.0 + (x * 0.3333333333333333))))))) / 2.0; elseif (x <= 800000.0) tmp = 1.0; elseif (x <= 1e+271) tmp = 0.0; else tmp = (x * (2.0 + (x * (x + 2.0)))) / 2.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, -820.0], N[(N[(x * N[(2.0 + N[(x * N[(2.0 + N[(x * N[(1.0 + N[(x * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 800000.0], 1.0, If[LessEqual[x, 1e+271], 0.0, N[(N[(x * N[(2.0 + N[(x * N[(x + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -820:\\
\;\;\;\;\frac{x \cdot \left(2 + x \cdot \left(2 + x \cdot \left(1 + x \cdot 0.3333333333333333\right)\right)\right)}{2}\\
\mathbf{elif}\;x \leq 800000:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 10^{+271}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(2 + x \cdot \left(x + 2\right)\right)}{2}\\
\end{array}
\end{array}
if x < -820Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 0.0%
associate--r+0.0%
associate-*r*0.0%
mul-1-neg0.0%
cancel-sign-sub0.0%
distribute-rgt1-in0.0%
distribute-rgt-out--0.0%
mul-1-neg0.0%
mul-1-neg0.0%
Simplified0.0%
Taylor expanded in x around inf 0.0%
rec-exp0.0%
associate-*r*0.0%
*-commutative0.0%
rec-exp0.0%
neg-mul-10.0%
associate-*r*0.0%
neg-mul-10.0%
Simplified0.0%
pow10.0%
associate-*r*0.0%
*-commutative0.0%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
sqr-neg0.0%
sqrt-unprod0.0%
add-sqr-sqrt1.6%
Applied egg-rr1.6%
unpow11.6%
Simplified1.6%
Taylor expanded in x around 0 76.7%
*-commutative76.7%
Simplified76.7%
if -820 < x < 8e5Initial program 50.5%
Simplified50.5%
Taylor expanded in x around 0 74.7%
if 8e5 < x < 9.99999999999999953e270Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 60.9%
mul-1-neg60.9%
mul-1-neg60.9%
rec-exp60.9%
sub-neg60.9%
div-sub60.9%
mul-1-neg60.9%
rec-exp60.9%
+-inverses60.9%
Simplified60.9%
if 9.99999999999999953e270 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 28.4%
associate--r+28.4%
associate-*r*28.4%
mul-1-neg28.4%
cancel-sign-sub28.4%
distribute-rgt1-in28.4%
distribute-rgt-out--28.4%
mul-1-neg28.4%
mul-1-neg28.4%
Simplified28.4%
Taylor expanded in x around inf 28.4%
rec-exp28.4%
associate-*r*28.4%
*-commutative28.4%
rec-exp28.4%
neg-mul-128.4%
associate-*r*28.4%
neg-mul-128.4%
Simplified28.4%
pow128.4%
associate-*r*28.4%
*-commutative28.4%
add-sqr-sqrt0.0%
sqrt-unprod73.2%
sqr-neg73.2%
sqrt-unprod73.2%
add-sqr-sqrt73.2%
Applied egg-rr73.2%
unpow173.2%
Simplified73.2%
Taylor expanded in x around 0 73.2%
Final simplification71.5%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(let* ((t_0 (/ (* x (+ 2.0 (* x 2.0))) 2.0)))
(if (<= x -2.6e+143)
t_0
(if (<= x 85.0) (/ (- 2.0 (* eps_m x)) 2.0) (if (<= x 1e+271) 0.0 t_0)))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double t_0 = (x * (2.0 + (x * 2.0))) / 2.0;
double tmp;
if (x <= -2.6e+143) {
tmp = t_0;
} else if (x <= 85.0) {
tmp = (2.0 - (eps_m * x)) / 2.0;
} else if (x <= 1e+271) {
tmp = 0.0;
} else {
tmp = t_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 = (x * (2.0d0 + (x * 2.0d0))) / 2.0d0
if (x <= (-2.6d+143)) then
tmp = t_0
else if (x <= 85.0d0) then
tmp = (2.0d0 - (eps_m * x)) / 2.0d0
else if (x <= 1d+271) then
tmp = 0.0d0
else
tmp = t_0
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double t_0 = (x * (2.0 + (x * 2.0))) / 2.0;
double tmp;
if (x <= -2.6e+143) {
tmp = t_0;
} else if (x <= 85.0) {
tmp = (2.0 - (eps_m * x)) / 2.0;
} else if (x <= 1e+271) {
tmp = 0.0;
} else {
tmp = t_0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): t_0 = (x * (2.0 + (x * 2.0))) / 2.0 tmp = 0 if x <= -2.6e+143: tmp = t_0 elif x <= 85.0: tmp = (2.0 - (eps_m * x)) / 2.0 elif x <= 1e+271: tmp = 0.0 else: tmp = t_0 return tmp
eps_m = abs(eps) function code(x, eps_m) t_0 = Float64(Float64(x * Float64(2.0 + Float64(x * 2.0))) / 2.0) tmp = 0.0 if (x <= -2.6e+143) tmp = t_0; elseif (x <= 85.0) tmp = Float64(Float64(2.0 - Float64(eps_m * x)) / 2.0); elseif (x <= 1e+271) tmp = 0.0; else tmp = t_0; end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) t_0 = (x * (2.0 + (x * 2.0))) / 2.0; tmp = 0.0; if (x <= -2.6e+143) tmp = t_0; elseif (x <= 85.0) tmp = (2.0 - (eps_m * x)) / 2.0; elseif (x <= 1e+271) tmp = 0.0; else tmp = t_0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision]
code[x_, eps$95$m_] := Block[{t$95$0 = N[(N[(x * N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]}, If[LessEqual[x, -2.6e+143], t$95$0, If[LessEqual[x, 85.0], N[(N[(2.0 - N[(eps$95$m * x), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 1e+271], 0.0, t$95$0]]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
t_0 := \frac{x \cdot \left(2 + x \cdot 2\right)}{2}\\
\mathbf{if}\;x \leq -2.6 \cdot 10^{+143}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 85:\\
\;\;\;\;\frac{2 - eps\_m \cdot x}{2}\\
\mathbf{elif}\;x \leq 10^{+271}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -2.5999999999999999e143 or 9.99999999999999953e270 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 9.8%
associate--r+9.8%
associate-*r*9.8%
mul-1-neg9.8%
cancel-sign-sub9.8%
distribute-rgt1-in9.8%
distribute-rgt-out--9.8%
mul-1-neg9.8%
mul-1-neg9.8%
Simplified9.8%
Taylor expanded in x around inf 9.8%
rec-exp9.8%
associate-*r*9.8%
*-commutative9.8%
rec-exp9.8%
neg-mul-19.8%
associate-*r*9.8%
neg-mul-19.8%
Simplified9.8%
pow19.8%
associate-*r*9.8%
*-commutative9.8%
add-sqr-sqrt0.0%
sqrt-unprod25.1%
sqr-neg25.1%
sqrt-unprod25.1%
add-sqr-sqrt26.2%
Applied egg-rr26.2%
unpow126.2%
Simplified26.2%
Taylor expanded in x around 0 87.9%
if -2.5999999999999999e143 < x < 85Initial program 54.9%
Simplified54.9%
Taylor expanded in x around 0 39.8%
Taylor expanded in x around 0 45.6%
Taylor expanded in eps around inf 70.1%
associate-*r*70.1%
mul-1-neg70.1%
Simplified70.1%
if 85 < x < 9.99999999999999953e270Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 59.1%
mul-1-neg59.1%
mul-1-neg59.1%
rec-exp59.1%
sub-neg59.1%
div-sub59.1%
mul-1-neg59.1%
rec-exp59.1%
+-inverses59.1%
Simplified59.1%
Final simplification69.5%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= x 85.0) (/ (- 2.0 (* eps_m x)) 2.0) 0.0))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= 85.0) {
tmp = (2.0 - (eps_m * x)) / 2.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 <= 85.0d0) then
tmp = (2.0d0 - (eps_m * x)) / 2.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 <= 85.0) {
tmp = (2.0 - (eps_m * x)) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= 85.0: tmp = (2.0 - (eps_m * x)) / 2.0 else: tmp = 0.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= 85.0) tmp = Float64(Float64(2.0 - Float64(eps_m * x)) / 2.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 <= 85.0) tmp = (2.0 - (eps_m * x)) / 2.0; else tmp = 0.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, 85.0], N[(N[(2.0 - N[(eps$95$m * x), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], 0.0]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq 85:\\
\;\;\;\;\frac{2 - eps\_m \cdot x}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 85Initial program 60.2%
Simplified60.2%
Taylor expanded in x around 0 43.6%
Taylor expanded in x around 0 45.6%
Taylor expanded in eps around inf 67.2%
associate-*r*67.2%
mul-1-neg67.2%
Simplified67.2%
if 85 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 54.7%
mul-1-neg54.7%
mul-1-neg54.7%
rec-exp54.7%
sub-neg54.7%
div-sub54.7%
mul-1-neg54.7%
rec-exp54.7%
+-inverses54.7%
Simplified54.7%
Final simplification63.4%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= x 800000.0) 1.0 0.0))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= 800000.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 <= 800000.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 <= 800000.0) {
tmp = 1.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= 800000.0: tmp = 1.0 else: tmp = 0.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= 800000.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 <= 800000.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, 800000.0], 1.0, 0.0]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq 800000:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 8e5Initial program 60.6%
Simplified60.6%
Taylor expanded in x around 0 60.2%
if 8e5 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 56.1%
mul-1-neg56.1%
mul-1-neg56.1%
rec-exp56.1%
sub-neg56.1%
div-sub56.1%
mul-1-neg56.1%
rec-exp56.1%
+-inverses56.1%
Simplified56.1%
Final simplification59.0%
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.0%
Simplified60.5%
Taylor expanded in eps around 0 17.8%
mul-1-neg17.8%
mul-1-neg17.8%
rec-exp17.8%
sub-neg17.8%
div-sub17.8%
mul-1-neg17.8%
rec-exp17.8%
+-inverses18.0%
Simplified18.0%
Final simplification18.0%
herbie shell --seed 2024081
(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))