
(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 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x eps) :precision binary64 (/ (- (* (+ 1.0 (/ 1.0 eps)) (exp (- (* (- 1.0 eps) x)))) (* (- (/ 1.0 eps) 1.0) (exp (- (* (+ 1.0 eps) x))))) 2.0))
double code(double x, double eps) {
return (((1.0 + (1.0 / eps)) * exp(-((1.0 - eps) * x))) - (((1.0 / eps) - 1.0) * exp(-((1.0 + eps) * x)))) / 2.0;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
code = (((1.0d0 + (1.0d0 / eps)) * exp(-((1.0d0 - eps) * x))) - (((1.0d0 / eps) - 1.0d0) * exp(-((1.0d0 + eps) * x)))) / 2.0d0
end function
public static double code(double x, double eps) {
return (((1.0 + (1.0 / eps)) * Math.exp(-((1.0 - eps) * x))) - (((1.0 / eps) - 1.0) * Math.exp(-((1.0 + eps) * x)))) / 2.0;
}
def code(x, eps): return (((1.0 + (1.0 / eps)) * math.exp(-((1.0 - eps) * x))) - (((1.0 / eps) - 1.0) * math.exp(-((1.0 + eps) * x)))) / 2.0
function code(x, eps) return Float64(Float64(Float64(Float64(1.0 + Float64(1.0 / eps)) * exp(Float64(-Float64(Float64(1.0 - eps) * x)))) - Float64(Float64(Float64(1.0 / eps) - 1.0) * exp(Float64(-Float64(Float64(1.0 + eps) * x))))) / 2.0) end
function tmp = code(x, eps) tmp = (((1.0 + (1.0 / eps)) * exp(-((1.0 - eps) * x))) - (((1.0 / eps) - 1.0) * exp(-((1.0 + eps) * x)))) / 2.0; end
code[x_, eps_] := N[(N[(N[(N[(1.0 + N[(1.0 / eps), $MachinePrecision]), $MachinePrecision] * N[Exp[(-N[(N[(1.0 - eps), $MachinePrecision] * x), $MachinePrecision])], $MachinePrecision]), $MachinePrecision] - N[(N[(N[(1.0 / eps), $MachinePrecision] - 1.0), $MachinePrecision] * N[Exp[(-N[(N[(1.0 + eps), $MachinePrecision] * x), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot e^{-\left(1 - \varepsilon\right) \cdot x} - \left(\frac{1}{\varepsilon} - 1\right) \cdot e^{-\left(1 + \varepsilon\right) \cdot x}}{2}
\end{array}
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= eps_m 1e-40) (/ (* 2.0 (* (exp (- x)) (+ x 1.0))) 2.0) (/ (+ (exp (* x (+ -1.0 eps_m))) (exp (* x (- eps_m)))) 2.0)))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (eps_m <= 1e-40) {
tmp = (2.0 * (exp(-x) * (x + 1.0))) / 2.0;
} else {
tmp = (exp((x * (-1.0 + eps_m))) + exp((x * -eps_m))) / 2.0;
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: tmp
if (eps_m <= 1d-40) then
tmp = (2.0d0 * (exp(-x) * (x + 1.0d0))) / 2.0d0
else
tmp = (exp((x * ((-1.0d0) + eps_m))) + exp((x * -eps_m))) / 2.0d0
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (eps_m <= 1e-40) {
tmp = (2.0 * (Math.exp(-x) * (x + 1.0))) / 2.0;
} else {
tmp = (Math.exp((x * (-1.0 + eps_m))) + Math.exp((x * -eps_m))) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if eps_m <= 1e-40: tmp = (2.0 * (math.exp(-x) * (x + 1.0))) / 2.0 else: tmp = (math.exp((x * (-1.0 + eps_m))) + math.exp((x * -eps_m))) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (eps_m <= 1e-40) tmp = Float64(Float64(2.0 * Float64(exp(Float64(-x)) * Float64(x + 1.0))) / 2.0); else tmp = Float64(Float64(exp(Float64(x * Float64(-1.0 + eps_m))) + exp(Float64(x * Float64(-eps_m)))) / 2.0); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (eps_m <= 1e-40) tmp = (2.0 * (exp(-x) * (x + 1.0))) / 2.0; else tmp = (exp((x * (-1.0 + eps_m))) + exp((x * -eps_m))) / 2.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[eps$95$m, 1e-40], N[(N[(2.0 * N[(N[Exp[(-x)], $MachinePrecision] * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(N[Exp[N[(x * N[(-1.0 + eps$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[Exp[N[(x * (-eps$95$m)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;eps\_m \leq 10^{-40}:\\
\;\;\;\;\frac{2 \cdot \left(e^{-x} \cdot \left(x + 1\right)\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{x \cdot \left(-1 + eps\_m\right)} + e^{x \cdot \left(-eps\_m\right)}}{2}\\
\end{array}
\end{array}
if eps < 9.9999999999999993e-41Initial program 62.7%
Simplified62.7%
Taylor expanded in eps around 0 73.1%
sub-neg73.1%
remove-double-neg73.1%
mul-1-neg73.1%
distribute-lft-out73.1%
*-lft-identity73.1%
distribute-rgt1-in73.1%
metadata-eval73.1%
distribute-lft-out73.1%
mul-1-neg73.1%
remove-double-neg73.1%
distribute-rgt1-in73.6%
*-commutative73.6%
mul-1-neg73.6%
Simplified73.6%
if 9.9999999999999993e-41 < eps Initial program 97.4%
Simplified97.4%
Taylor expanded in eps around inf 100.0%
Taylor expanded in eps around inf 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification81.2%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<= eps_m 1.26e+245)
(/ (+ (exp (* x (+ -1.0 eps_m))) (exp (- x))) 2.0)
(/
(+
2.0
(*
x
(+
-1.0
(+ (+ -1.0 eps_m) (* x (+ 0.5 (* 0.5 (pow (- 1.0 eps_m) 2.0))))))))
2.0)))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (eps_m <= 1.26e+245) {
tmp = (exp((x * (-1.0 + eps_m))) + exp(-x)) / 2.0;
} else {
tmp = (2.0 + (x * (-1.0 + ((-1.0 + eps_m) + (x * (0.5 + (0.5 * pow((1.0 - eps_m), 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 (eps_m <= 1.26d+245) then
tmp = (exp((x * ((-1.0d0) + eps_m))) + exp(-x)) / 2.0d0
else
tmp = (2.0d0 + (x * ((-1.0d0) + (((-1.0d0) + eps_m) + (x * (0.5d0 + (0.5d0 * ((1.0d0 - eps_m) ** 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 (eps_m <= 1.26e+245) {
tmp = (Math.exp((x * (-1.0 + eps_m))) + Math.exp(-x)) / 2.0;
} else {
tmp = (2.0 + (x * (-1.0 + ((-1.0 + eps_m) + (x * (0.5 + (0.5 * Math.pow((1.0 - eps_m), 2.0)))))))) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if eps_m <= 1.26e+245: tmp = (math.exp((x * (-1.0 + eps_m))) + math.exp(-x)) / 2.0 else: tmp = (2.0 + (x * (-1.0 + ((-1.0 + eps_m) + (x * (0.5 + (0.5 * math.pow((1.0 - eps_m), 2.0)))))))) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (eps_m <= 1.26e+245) tmp = Float64(Float64(exp(Float64(x * Float64(-1.0 + eps_m))) + exp(Float64(-x))) / 2.0); else tmp = Float64(Float64(2.0 + Float64(x * Float64(-1.0 + Float64(Float64(-1.0 + eps_m) + Float64(x * Float64(0.5 + Float64(0.5 * (Float64(1.0 - eps_m) ^ 2.0)))))))) / 2.0); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (eps_m <= 1.26e+245) tmp = (exp((x * (-1.0 + eps_m))) + exp(-x)) / 2.0; else tmp = (2.0 + (x * (-1.0 + ((-1.0 + eps_m) + (x * (0.5 + (0.5 * ((1.0 - eps_m) ^ 2.0)))))))) / 2.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[eps$95$m, 1.26e+245], N[(N[(N[Exp[N[(x * N[(-1.0 + eps$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[Exp[(-x)], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(2.0 + N[(x * N[(-1.0 + N[(N[(-1.0 + eps$95$m), $MachinePrecision] + N[(x * N[(0.5 + N[(0.5 * N[Power[N[(1.0 - eps$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;eps\_m \leq 1.26 \cdot 10^{+245}:\\
\;\;\;\;\frac{e^{x \cdot \left(-1 + eps\_m\right)} + e^{-x}}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + x \cdot \left(-1 + \left(\left(-1 + eps\_m\right) + x \cdot \left(0.5 + 0.5 \cdot {\left(1 - eps\_m\right)}^{2}\right)\right)\right)}{2}\\
\end{array}
\end{array}
if eps < 1.2599999999999999e245Initial program 70.9%
Simplified70.9%
Taylor expanded in eps around inf 99.6%
Taylor expanded in eps around 0 89.2%
Taylor expanded in eps around -inf 89.2%
associate-*r*89.2%
mul-1-neg89.2%
mul-1-neg89.2%
sub-neg89.2%
mul-1-neg89.2%
mul-1-neg89.2%
Simplified89.2%
Taylor expanded in x around inf 89.2%
+-commutative89.2%
associate-*r*89.2%
sub-neg89.2%
mul-1-neg89.2%
associate-*r*89.2%
associate-*r*89.2%
neg-mul-189.2%
mul-1-neg89.2%
sub-neg89.2%
Simplified89.2%
if 1.2599999999999999e245 < eps Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around inf 100.0%
Taylor expanded in eps around 0 81.8%
Taylor expanded in x around 0 100.0%
Final simplification89.8%
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 72.7%
Simplified72.7%
Taylor expanded in eps around inf 99.6%
Final simplification99.6%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<= eps_m 6.1e+54)
(/ (* 2.0 (exp (- x))) 2.0)
(/
(+
2.0
(*
x
(+
-1.0
(+ (+ -1.0 eps_m) (* x (+ 0.5 (* 0.5 (pow (- 1.0 eps_m) 2.0))))))))
2.0)))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (eps_m <= 6.1e+54) {
tmp = (2.0 * exp(-x)) / 2.0;
} else {
tmp = (2.0 + (x * (-1.0 + ((-1.0 + eps_m) + (x * (0.5 + (0.5 * pow((1.0 - eps_m), 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 (eps_m <= 6.1d+54) then
tmp = (2.0d0 * exp(-x)) / 2.0d0
else
tmp = (2.0d0 + (x * ((-1.0d0) + (((-1.0d0) + eps_m) + (x * (0.5d0 + (0.5d0 * ((1.0d0 - eps_m) ** 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 (eps_m <= 6.1e+54) {
tmp = (2.0 * Math.exp(-x)) / 2.0;
} else {
tmp = (2.0 + (x * (-1.0 + ((-1.0 + eps_m) + (x * (0.5 + (0.5 * Math.pow((1.0 - eps_m), 2.0)))))))) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if eps_m <= 6.1e+54: tmp = (2.0 * math.exp(-x)) / 2.0 else: tmp = (2.0 + (x * (-1.0 + ((-1.0 + eps_m) + (x * (0.5 + (0.5 * math.pow((1.0 - eps_m), 2.0)))))))) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (eps_m <= 6.1e+54) tmp = Float64(Float64(2.0 * exp(Float64(-x))) / 2.0); else tmp = Float64(Float64(2.0 + Float64(x * Float64(-1.0 + Float64(Float64(-1.0 + eps_m) + Float64(x * Float64(0.5 + Float64(0.5 * (Float64(1.0 - eps_m) ^ 2.0)))))))) / 2.0); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (eps_m <= 6.1e+54) tmp = (2.0 * exp(-x)) / 2.0; else tmp = (2.0 + (x * (-1.0 + ((-1.0 + eps_m) + (x * (0.5 + (0.5 * ((1.0 - eps_m) ^ 2.0)))))))) / 2.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[eps$95$m, 6.1e+54], N[(N[(2.0 * N[Exp[(-x)], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(2.0 + N[(x * N[(-1.0 + N[(N[(-1.0 + eps$95$m), $MachinePrecision] + N[(x * N[(0.5 + N[(0.5 * N[Power[N[(1.0 - eps$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;eps\_m \leq 6.1 \cdot 10^{+54}:\\
\;\;\;\;\frac{2 \cdot e^{-x}}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + x \cdot \left(-1 + \left(\left(-1 + eps\_m\right) + x \cdot \left(0.5 + 0.5 \cdot {\left(1 - eps\_m\right)}^{2}\right)\right)\right)}{2}\\
\end{array}
\end{array}
if eps < 6.0999999999999998e54Initial program 65.5%
Simplified65.5%
Taylor expanded in eps around inf 99.5%
Taylor expanded in eps around 0 89.2%
Taylor expanded in eps around 0 83.7%
cancel-sign-sub-inv83.7%
metadata-eval83.7%
distribute-rgt1-in83.7%
metadata-eval83.7%
mul-1-neg83.7%
Simplified83.7%
if 6.0999999999999998e54 < eps Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around inf 100.0%
Taylor expanded in eps around 0 87.0%
Taylor expanded in x around 0 82.8%
Final simplification83.5%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (/ (* 2.0 (exp (- x))) 2.0))
eps_m = fabs(eps);
double code(double x, double eps_m) {
return (2.0 * exp(-x)) / 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 = (2.0d0 * exp(-x)) / 2.0d0
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
return (2.0 * Math.exp(-x)) / 2.0;
}
eps_m = math.fabs(eps) def code(x, eps_m): return (2.0 * math.exp(-x)) / 2.0
eps_m = abs(eps) function code(x, eps_m) return Float64(Float64(2.0 * exp(Float64(-x))) / 2.0) end
eps_m = abs(eps); function tmp = code(x, eps_m) tmp = (2.0 * exp(-x)) / 2.0; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := N[(N[(2.0 * N[Exp[(-x)], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\frac{2 \cdot e^{-x}}{2}
\end{array}
Initial program 72.7%
Simplified72.7%
Taylor expanded in eps around inf 99.6%
Taylor expanded in eps around 0 88.7%
Taylor expanded in eps around 0 75.4%
cancel-sign-sub-inv75.4%
metadata-eval75.4%
distribute-rgt1-in75.4%
metadata-eval75.4%
mul-1-neg75.4%
Simplified75.4%
Final simplification75.4%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<= x -48.0)
(/
(* 2.0 (* x (+ 1.0 (* x (+ 1.0 (* x (+ 0.5 (* x 0.16666666666666666))))))))
2.0)
(/
(* 2.0 (+ 1.0 (* x (+ 2.0 (* x (+ 1.5 (* x 0.6666666666666666)))))))
2.0)))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= -48.0) {
tmp = (2.0 * (x * (1.0 + (x * (1.0 + (x * (0.5 + (x * 0.16666666666666666)))))))) / 2.0;
} else {
tmp = (2.0 * (1.0 + (x * (2.0 + (x * (1.5 + (x * 0.6666666666666666))))))) / 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 <= (-48.0d0)) then
tmp = (2.0d0 * (x * (1.0d0 + (x * (1.0d0 + (x * (0.5d0 + (x * 0.16666666666666666d0)))))))) / 2.0d0
else
tmp = (2.0d0 * (1.0d0 + (x * (2.0d0 + (x * (1.5d0 + (x * 0.6666666666666666d0))))))) / 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 <= -48.0) {
tmp = (2.0 * (x * (1.0 + (x * (1.0 + (x * (0.5 + (x * 0.16666666666666666)))))))) / 2.0;
} else {
tmp = (2.0 * (1.0 + (x * (2.0 + (x * (1.5 + (x * 0.6666666666666666))))))) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= -48.0: tmp = (2.0 * (x * (1.0 + (x * (1.0 + (x * (0.5 + (x * 0.16666666666666666)))))))) / 2.0 else: tmp = (2.0 * (1.0 + (x * (2.0 + (x * (1.5 + (x * 0.6666666666666666))))))) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= -48.0) tmp = Float64(Float64(2.0 * Float64(x * Float64(1.0 + Float64(x * Float64(1.0 + Float64(x * Float64(0.5 + Float64(x * 0.16666666666666666)))))))) / 2.0); else tmp = Float64(Float64(2.0 * Float64(1.0 + Float64(x * Float64(2.0 + Float64(x * Float64(1.5 + Float64(x * 0.6666666666666666))))))) / 2.0); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (x <= -48.0) tmp = (2.0 * (x * (1.0 + (x * (1.0 + (x * (0.5 + (x * 0.16666666666666666)))))))) / 2.0; else tmp = (2.0 * (1.0 + (x * (2.0 + (x * (1.5 + (x * 0.6666666666666666))))))) / 2.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, -48.0], N[(N[(2.0 * N[(x * N[(1.0 + N[(x * N[(1.0 + N[(x * N[(0.5 + N[(x * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(2.0 * N[(1.0 + N[(x * N[(2.0 + N[(x * N[(1.5 + N[(x * 0.6666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -48:\\
\;\;\;\;\frac{2 \cdot \left(x \cdot \left(1 + x \cdot \left(1 + x \cdot \left(0.5 + x \cdot 0.16666666666666666\right)\right)\right)\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 \cdot \left(1 + x \cdot \left(2 + x \cdot \left(1.5 + x \cdot 0.6666666666666666\right)\right)\right)}{2}\\
\end{array}
\end{array}
if x < -48Initial program 97.7%
Simplified97.7%
Taylor expanded in eps around 0 0.0%
sub-neg0.0%
remove-double-neg0.0%
mul-1-neg0.0%
distribute-lft-out0.0%
*-lft-identity0.0%
distribute-rgt1-in0.0%
metadata-eval0.0%
distribute-lft-out0.0%
mul-1-neg0.0%
remove-double-neg0.0%
distribute-rgt1-in2.3%
*-commutative2.3%
mul-1-neg2.3%
Simplified2.3%
Taylor expanded in x around inf 2.3%
exp-neg2.3%
associate-*r/2.3%
*-rgt-identity2.3%
Simplified2.3%
add-exp-log0.0%
div-inv0.0%
log-prod0.0%
neg-log0.0%
add-log-exp0.0%
mul-1-neg0.0%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
mul-1-neg0.0%
mul-1-neg0.0%
sqr-neg0.0%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
prod-exp0.0%
add-exp-log1.5%
*-commutative1.5%
Applied egg-rr1.5%
Taylor expanded in x around 0 82.0%
*-commutative82.0%
Simplified82.0%
if -48 < x Initial program 67.7%
Simplified67.7%
Taylor expanded in eps around 0 71.4%
sub-neg71.4%
remove-double-neg71.4%
mul-1-neg71.4%
distribute-lft-out71.4%
*-lft-identity71.4%
distribute-rgt1-in71.4%
metadata-eval71.4%
distribute-lft-out71.4%
mul-1-neg71.4%
remove-double-neg71.4%
distribute-rgt1-in71.4%
*-commutative71.4%
mul-1-neg71.4%
Simplified71.4%
+-commutative71.4%
distribute-rgt-in71.4%
*-un-lft-identity71.4%
add-sqr-sqrt22.4%
sqrt-unprod64.4%
sqr-neg64.4%
sqrt-unprod42.1%
add-sqr-sqrt64.4%
add-sqr-sqrt22.4%
sqrt-unprod64.4%
sqr-neg64.4%
sqrt-unprod42.1%
add-sqr-sqrt64.4%
Applied egg-rr64.4%
distribute-rgt1-in64.4%
+-commutative64.4%
Simplified64.4%
Taylor expanded in x around 0 59.6%
*-commutative59.6%
Simplified59.6%
Final simplification63.4%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<= x 1e+59)
(/ (* 2.0 (+ 1.0 (* x (* x 1.5)))) 2.0)
(/
(* 2.0 (+ 1.0 (* x (+ 2.0 (* x (+ 1.5 (* x 0.6666666666666666)))))))
2.0)))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= 1e+59) {
tmp = (2.0 * (1.0 + (x * (x * 1.5)))) / 2.0;
} else {
tmp = (2.0 * (1.0 + (x * (2.0 + (x * (1.5 + (x * 0.6666666666666666))))))) / 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+59) then
tmp = (2.0d0 * (1.0d0 + (x * (x * 1.5d0)))) / 2.0d0
else
tmp = (2.0d0 * (1.0d0 + (x * (2.0d0 + (x * (1.5d0 + (x * 0.6666666666666666d0))))))) / 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+59) {
tmp = (2.0 * (1.0 + (x * (x * 1.5)))) / 2.0;
} else {
tmp = (2.0 * (1.0 + (x * (2.0 + (x * (1.5 + (x * 0.6666666666666666))))))) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= 1e+59: tmp = (2.0 * (1.0 + (x * (x * 1.5)))) / 2.0 else: tmp = (2.0 * (1.0 + (x * (2.0 + (x * (1.5 + (x * 0.6666666666666666))))))) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= 1e+59) tmp = Float64(Float64(2.0 * Float64(1.0 + Float64(x * Float64(x * 1.5)))) / 2.0); else tmp = Float64(Float64(2.0 * Float64(1.0 + Float64(x * Float64(2.0 + Float64(x * Float64(1.5 + Float64(x * 0.6666666666666666))))))) / 2.0); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (x <= 1e+59) tmp = (2.0 * (1.0 + (x * (x * 1.5)))) / 2.0; else tmp = (2.0 * (1.0 + (x * (2.0 + (x * (1.5 + (x * 0.6666666666666666))))))) / 2.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, 1e+59], N[(N[(2.0 * N[(1.0 + N[(x * N[(x * 1.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(2.0 * N[(1.0 + N[(x * N[(2.0 + N[(x * N[(1.5 + N[(x * 0.6666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq 10^{+59}:\\
\;\;\;\;\frac{2 \cdot \left(1 + x \cdot \left(x \cdot 1.5\right)\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 \cdot \left(1 + x \cdot \left(2 + x \cdot \left(1.5 + x \cdot 0.6666666666666666\right)\right)\right)}{2}\\
\end{array}
\end{array}
if x < 9.99999999999999972e58Initial program 64.9%
Simplified64.9%
Taylor expanded in eps around 0 60.1%
sub-neg60.1%
remove-double-neg60.1%
mul-1-neg60.1%
distribute-lft-out60.1%
*-lft-identity60.1%
distribute-rgt1-in60.1%
metadata-eval60.1%
distribute-lft-out60.1%
mul-1-neg60.1%
remove-double-neg60.1%
distribute-rgt1-in60.6%
*-commutative60.6%
mul-1-neg60.6%
Simplified60.6%
+-commutative60.6%
distribute-rgt-in60.1%
*-un-lft-identity60.1%
add-sqr-sqrt24.0%
sqrt-unprod56.2%
sqr-neg56.2%
sqrt-unprod32.2%
add-sqr-sqrt56.7%
add-sqr-sqrt24.5%
sqrt-unprod56.7%
sqr-neg56.7%
sqrt-unprod32.2%
add-sqr-sqrt56.5%
Applied egg-rr56.5%
distribute-rgt1-in56.5%
+-commutative56.5%
Simplified56.5%
Taylor expanded in x around 0 66.3%
*-commutative66.3%
Simplified66.3%
Taylor expanded in x around inf 66.3%
*-commutative66.3%
Simplified66.3%
if 9.99999999999999972e58 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 56.8%
sub-neg56.8%
remove-double-neg56.8%
mul-1-neg56.8%
distribute-lft-out56.8%
*-lft-identity56.8%
distribute-rgt1-in56.8%
metadata-eval56.8%
distribute-lft-out56.8%
mul-1-neg56.8%
remove-double-neg56.8%
distribute-rgt1-in56.8%
*-commutative56.8%
mul-1-neg56.8%
Simplified56.8%
+-commutative56.8%
distribute-rgt-in56.8%
*-un-lft-identity56.8%
add-sqr-sqrt0.0%
sqrt-unprod44.7%
sqr-neg44.7%
sqrt-unprod44.7%
add-sqr-sqrt44.7%
add-sqr-sqrt0.0%
sqrt-unprod44.7%
sqr-neg44.7%
sqrt-unprod44.7%
add-sqr-sqrt44.7%
Applied egg-rr44.7%
distribute-rgt1-in44.7%
+-commutative44.7%
Simplified44.7%
Taylor expanded in x around 0 35.0%
*-commutative35.0%
Simplified35.0%
Final simplification59.3%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<= x 6500.0)
(/ (* 2.0 (+ 1.0 (* x (+ 2.0 (* x (- 1.5 (* x 0.6666666666666666))))))) 2.0)
(/
(* 2.0 (+ 1.0 (* x (+ 2.0 (* x (+ 1.5 (* x 0.6666666666666666)))))))
2.0)))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= 6500.0) {
tmp = (2.0 * (1.0 + (x * (2.0 + (x * (1.5 - (x * 0.6666666666666666))))))) / 2.0;
} else {
tmp = (2.0 * (1.0 + (x * (2.0 + (x * (1.5 + (x * 0.6666666666666666))))))) / 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 <= 6500.0d0) then
tmp = (2.0d0 * (1.0d0 + (x * (2.0d0 + (x * (1.5d0 - (x * 0.6666666666666666d0))))))) / 2.0d0
else
tmp = (2.0d0 * (1.0d0 + (x * (2.0d0 + (x * (1.5d0 + (x * 0.6666666666666666d0))))))) / 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 <= 6500.0) {
tmp = (2.0 * (1.0 + (x * (2.0 + (x * (1.5 - (x * 0.6666666666666666))))))) / 2.0;
} else {
tmp = (2.0 * (1.0 + (x * (2.0 + (x * (1.5 + (x * 0.6666666666666666))))))) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= 6500.0: tmp = (2.0 * (1.0 + (x * (2.0 + (x * (1.5 - (x * 0.6666666666666666))))))) / 2.0 else: tmp = (2.0 * (1.0 + (x * (2.0 + (x * (1.5 + (x * 0.6666666666666666))))))) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= 6500.0) tmp = Float64(Float64(2.0 * Float64(1.0 + Float64(x * Float64(2.0 + Float64(x * Float64(1.5 - Float64(x * 0.6666666666666666))))))) / 2.0); else tmp = Float64(Float64(2.0 * Float64(1.0 + Float64(x * Float64(2.0 + Float64(x * Float64(1.5 + Float64(x * 0.6666666666666666))))))) / 2.0); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (x <= 6500.0) tmp = (2.0 * (1.0 + (x * (2.0 + (x * (1.5 - (x * 0.6666666666666666))))))) / 2.0; else tmp = (2.0 * (1.0 + (x * (2.0 + (x * (1.5 + (x * 0.6666666666666666))))))) / 2.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, 6500.0], N[(N[(2.0 * N[(1.0 + N[(x * N[(2.0 + N[(x * N[(1.5 - N[(x * 0.6666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(2.0 * N[(1.0 + N[(x * N[(2.0 + N[(x * N[(1.5 + N[(x * 0.6666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq 6500:\\
\;\;\;\;\frac{2 \cdot \left(1 + x \cdot \left(2 + x \cdot \left(1.5 - x \cdot 0.6666666666666666\right)\right)\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 \cdot \left(1 + x \cdot \left(2 + x \cdot \left(1.5 + x \cdot 0.6666666666666666\right)\right)\right)}{2}\\
\end{array}
\end{array}
if x < 6500Initial program 61.7%
Simplified61.7%
Taylor expanded in eps around 0 59.1%
sub-neg59.1%
remove-double-neg59.1%
mul-1-neg59.1%
distribute-lft-out59.1%
*-lft-identity59.1%
distribute-rgt1-in59.1%
metadata-eval59.1%
distribute-lft-out59.1%
mul-1-neg59.1%
remove-double-neg59.1%
distribute-rgt1-in59.6%
*-commutative59.6%
mul-1-neg59.6%
Simplified59.6%
+-commutative59.6%
distribute-rgt-in59.1%
*-un-lft-identity59.1%
add-sqr-sqrt26.2%
sqrt-unprod58.6%
sqr-neg58.6%
sqrt-unprod32.4%
add-sqr-sqrt59.1%
add-sqr-sqrt26.7%
sqrt-unprod59.1%
sqr-neg59.1%
sqrt-unprod32.4%
add-sqr-sqrt58.9%
Applied egg-rr58.9%
distribute-rgt1-in58.9%
+-commutative58.9%
Simplified58.9%
Taylor expanded in x around 0 58.6%
*-commutative58.6%
Simplified58.6%
add-sqr-sqrt32.4%
sqrt-unprod75.4%
sqr-neg75.4%
sqrt-unprod43.0%
add-sqr-sqrt75.4%
cancel-sign-sub-inv75.4%
Applied egg-rr75.4%
if 6500 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 60.1%
sub-neg60.1%
remove-double-neg60.1%
mul-1-neg60.1%
distribute-lft-out60.1%
*-lft-identity60.1%
distribute-rgt1-in60.1%
metadata-eval60.1%
distribute-lft-out60.1%
mul-1-neg60.1%
remove-double-neg60.1%
distribute-rgt1-in60.1%
*-commutative60.1%
mul-1-neg60.1%
Simplified60.1%
+-commutative60.1%
distribute-rgt-in60.1%
*-un-lft-identity60.1%
add-sqr-sqrt0.0%
sqrt-unprod41.5%
sqr-neg41.5%
sqrt-unprod41.5%
add-sqr-sqrt41.5%
add-sqr-sqrt0.0%
sqrt-unprod41.5%
sqr-neg41.5%
sqrt-unprod41.5%
add-sqr-sqrt41.5%
Applied egg-rr41.5%
distribute-rgt1-in41.5%
+-commutative41.5%
Simplified41.5%
Taylor expanded in x around 0 27.6%
*-commutative27.6%
Simplified27.6%
Final simplification61.6%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= x 1.35e+59) (/ (* 2.0 (+ 1.0 (* x (* x 1.5)))) 2.0) (/ (* 2.0 (* x (+ 1.0 (* x (+ -1.0 (* x 0.5)))))) 2.0)))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= 1.35e+59) {
tmp = (2.0 * (1.0 + (x * (x * 1.5)))) / 2.0;
} else {
tmp = (2.0 * (x * (1.0 + (x * (-1.0 + (x * 0.5)))))) / 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.35d+59) then
tmp = (2.0d0 * (1.0d0 + (x * (x * 1.5d0)))) / 2.0d0
else
tmp = (2.0d0 * (x * (1.0d0 + (x * ((-1.0d0) + (x * 0.5d0)))))) / 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.35e+59) {
tmp = (2.0 * (1.0 + (x * (x * 1.5)))) / 2.0;
} else {
tmp = (2.0 * (x * (1.0 + (x * (-1.0 + (x * 0.5)))))) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= 1.35e+59: tmp = (2.0 * (1.0 + (x * (x * 1.5)))) / 2.0 else: tmp = (2.0 * (x * (1.0 + (x * (-1.0 + (x * 0.5)))))) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= 1.35e+59) tmp = Float64(Float64(2.0 * Float64(1.0 + Float64(x * Float64(x * 1.5)))) / 2.0); else tmp = Float64(Float64(2.0 * Float64(x * Float64(1.0 + Float64(x * Float64(-1.0 + Float64(x * 0.5)))))) / 2.0); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (x <= 1.35e+59) tmp = (2.0 * (1.0 + (x * (x * 1.5)))) / 2.0; else tmp = (2.0 * (x * (1.0 + (x * (-1.0 + (x * 0.5)))))) / 2.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, 1.35e+59], N[(N[(2.0 * N[(1.0 + N[(x * N[(x * 1.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(2.0 * N[(x * N[(1.0 + N[(x * N[(-1.0 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.35 \cdot 10^{+59}:\\
\;\;\;\;\frac{2 \cdot \left(1 + x \cdot \left(x \cdot 1.5\right)\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 \cdot \left(x \cdot \left(1 + x \cdot \left(-1 + x \cdot 0.5\right)\right)\right)}{2}\\
\end{array}
\end{array}
if x < 1.3500000000000001e59Initial program 64.9%
Simplified64.9%
Taylor expanded in eps around 0 60.1%
sub-neg60.1%
remove-double-neg60.1%
mul-1-neg60.1%
distribute-lft-out60.1%
*-lft-identity60.1%
distribute-rgt1-in60.1%
metadata-eval60.1%
distribute-lft-out60.1%
mul-1-neg60.1%
remove-double-neg60.1%
distribute-rgt1-in60.6%
*-commutative60.6%
mul-1-neg60.6%
Simplified60.6%
+-commutative60.6%
distribute-rgt-in60.1%
*-un-lft-identity60.1%
add-sqr-sqrt24.0%
sqrt-unprod56.2%
sqr-neg56.2%
sqrt-unprod32.2%
add-sqr-sqrt56.7%
add-sqr-sqrt24.5%
sqrt-unprod56.7%
sqr-neg56.7%
sqrt-unprod32.2%
add-sqr-sqrt56.5%
Applied egg-rr56.5%
distribute-rgt1-in56.5%
+-commutative56.5%
Simplified56.5%
Taylor expanded in x around 0 66.3%
*-commutative66.3%
Simplified66.3%
Taylor expanded in x around inf 66.3%
*-commutative66.3%
Simplified66.3%
if 1.3500000000000001e59 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 56.8%
sub-neg56.8%
remove-double-neg56.8%
mul-1-neg56.8%
distribute-lft-out56.8%
*-lft-identity56.8%
distribute-rgt1-in56.8%
metadata-eval56.8%
distribute-lft-out56.8%
mul-1-neg56.8%
remove-double-neg56.8%
distribute-rgt1-in56.8%
*-commutative56.8%
mul-1-neg56.8%
Simplified56.8%
Taylor expanded in x around inf 56.8%
exp-neg56.8%
associate-*r/56.8%
*-rgt-identity56.8%
Simplified56.8%
Taylor expanded in x around 0 35.0%
Final simplification59.3%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (or (<= x -1.6) (not (<= x 1e+59))) (/ (* 2.0 (* x (+ x 1.0))) 2.0) 1.0))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if ((x <= -1.6) || !(x <= 1e+59)) {
tmp = (2.0 * (x * (x + 1.0))) / 2.0;
} 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.6d0)) .or. (.not. (x <= 1d+59))) then
tmp = (2.0d0 * (x * (x + 1.0d0))) / 2.0d0
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.6) || !(x <= 1e+59)) {
tmp = (2.0 * (x * (x + 1.0))) / 2.0;
} else {
tmp = 1.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if (x <= -1.6) or not (x <= 1e+59): tmp = (2.0 * (x * (x + 1.0))) / 2.0 else: tmp = 1.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if ((x <= -1.6) || !(x <= 1e+59)) tmp = Float64(Float64(2.0 * Float64(x * Float64(x + 1.0))) / 2.0); 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.6) || ~((x <= 1e+59))) tmp = (2.0 * (x * (x + 1.0))) / 2.0; else tmp = 1.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[Or[LessEqual[x, -1.6], N[Not[LessEqual[x, 1e+59]], $MachinePrecision]], N[(N[(2.0 * N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], 1.0]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.6 \lor \neg \left(x \leq 10^{+59}\right):\\
\;\;\;\;\frac{2 \cdot \left(x \cdot \left(x + 1\right)\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -1.6000000000000001 or 9.99999999999999972e58 < x Initial program 99.0%
Simplified99.0%
Taylor expanded in eps around 0 32.4%
sub-neg32.4%
remove-double-neg32.4%
mul-1-neg32.4%
distribute-lft-out32.4%
*-lft-identity32.4%
distribute-rgt1-in32.4%
metadata-eval32.4%
distribute-lft-out32.4%
mul-1-neg32.4%
remove-double-neg32.4%
distribute-rgt1-in33.4%
*-commutative33.4%
mul-1-neg33.4%
Simplified33.4%
Taylor expanded in x around inf 33.4%
exp-neg33.4%
associate-*r/33.4%
*-rgt-identity33.4%
Simplified33.4%
add-exp-log32.4%
div-inv32.4%
log-prod32.4%
neg-log32.4%
add-log-exp32.4%
mul-1-neg32.4%
add-sqr-sqrt0.0%
sqrt-unprod25.5%
mul-1-neg25.5%
mul-1-neg25.5%
sqr-neg25.5%
sqrt-unprod25.5%
add-sqr-sqrt25.5%
prod-exp25.5%
add-exp-log26.2%
*-commutative26.2%
Applied egg-rr26.2%
Taylor expanded in x around 0 40.2%
+-commutative40.2%
Simplified40.2%
if -1.6000000000000001 < x < 9.99999999999999972e58Initial program 55.9%
Simplified55.9%
Taylor expanded in x around 0 68.7%
Final simplification57.5%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (/ (* 2.0 (+ 1.0 (* x (* x 1.5)))) 2.0))
eps_m = fabs(eps);
double code(double x, double eps_m) {
return (2.0 * (1.0 + (x * (x * 1.5)))) / 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 = (2.0d0 * (1.0d0 + (x * (x * 1.5d0)))) / 2.0d0
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
return (2.0 * (1.0 + (x * (x * 1.5)))) / 2.0;
}
eps_m = math.fabs(eps) def code(x, eps_m): return (2.0 * (1.0 + (x * (x * 1.5)))) / 2.0
eps_m = abs(eps) function code(x, eps_m) return Float64(Float64(2.0 * Float64(1.0 + Float64(x * Float64(x * 1.5)))) / 2.0) end
eps_m = abs(eps); function tmp = code(x, eps_m) tmp = (2.0 * (1.0 + (x * (x * 1.5)))) / 2.0; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := N[(N[(2.0 * N[(1.0 + N[(x * N[(x * 1.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\frac{2 \cdot \left(1 + x \cdot \left(x \cdot 1.5\right)\right)}{2}
\end{array}
Initial program 72.7%
Simplified72.7%
Taylor expanded in eps around 0 59.4%
sub-neg59.4%
remove-double-neg59.4%
mul-1-neg59.4%
distribute-lft-out59.4%
*-lft-identity59.4%
distribute-rgt1-in59.4%
metadata-eval59.4%
distribute-lft-out59.4%
mul-1-neg59.4%
remove-double-neg59.4%
distribute-rgt1-in59.8%
*-commutative59.8%
mul-1-neg59.8%
Simplified59.8%
+-commutative59.8%
distribute-rgt-in59.4%
*-un-lft-identity59.4%
add-sqr-sqrt18.6%
sqrt-unprod53.6%
sqr-neg53.6%
sqrt-unprod35.0%
add-sqr-sqrt54.0%
add-sqr-sqrt19.0%
sqrt-unprod54.0%
sqr-neg54.0%
sqrt-unprod35.0%
add-sqr-sqrt53.9%
Applied egg-rr53.9%
distribute-rgt1-in53.9%
+-commutative53.9%
Simplified53.9%
Taylor expanded in x around 0 57.5%
*-commutative57.5%
Simplified57.5%
Taylor expanded in x around inf 57.5%
*-commutative57.5%
Simplified57.5%
Final simplification57.5%
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 72.7%
Simplified72.7%
Taylor expanded in x around 0 43.0%
Final simplification43.0%
herbie shell --seed 2024130
(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))