
(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 13 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 (exp (* x (- 1.0 eps_m)))) (t_1 (exp (* x (- -1.0 eps_m)))))
(if (<= x -9.5e-228)
(+ 0.5 (* 0.5 t_1))
(if (<= x 7e-10)
(+ 0.5 (/ 0.5 t_0))
(+ (/ (+ 0.5 (/ 0.5 eps_m)) t_0) (* t_1 (- 0.5 (/ 0.5 eps_m))))))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double t_0 = exp((x * (1.0 - eps_m)));
double t_1 = exp((x * (-1.0 - eps_m)));
double tmp;
if (x <= -9.5e-228) {
tmp = 0.5 + (0.5 * t_1);
} else if (x <= 7e-10) {
tmp = 0.5 + (0.5 / t_0);
} else {
tmp = ((0.5 + (0.5 / eps_m)) / t_0) + (t_1 * (0.5 - (0.5 / eps_m)));
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = exp((x * (1.0d0 - eps_m)))
t_1 = exp((x * ((-1.0d0) - eps_m)))
if (x <= (-9.5d-228)) then
tmp = 0.5d0 + (0.5d0 * t_1)
else if (x <= 7d-10) then
tmp = 0.5d0 + (0.5d0 / t_0)
else
tmp = ((0.5d0 + (0.5d0 / eps_m)) / t_0) + (t_1 * (0.5d0 - (0.5d0 / eps_m)))
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double t_0 = Math.exp((x * (1.0 - eps_m)));
double t_1 = Math.exp((x * (-1.0 - eps_m)));
double tmp;
if (x <= -9.5e-228) {
tmp = 0.5 + (0.5 * t_1);
} else if (x <= 7e-10) {
tmp = 0.5 + (0.5 / t_0);
} else {
tmp = ((0.5 + (0.5 / eps_m)) / t_0) + (t_1 * (0.5 - (0.5 / eps_m)));
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): t_0 = math.exp((x * (1.0 - eps_m))) t_1 = math.exp((x * (-1.0 - eps_m))) tmp = 0 if x <= -9.5e-228: tmp = 0.5 + (0.5 * t_1) elif x <= 7e-10: tmp = 0.5 + (0.5 / t_0) else: tmp = ((0.5 + (0.5 / eps_m)) / t_0) + (t_1 * (0.5 - (0.5 / eps_m))) return tmp
eps_m = abs(eps) function code(x, eps_m) t_0 = exp(Float64(x * Float64(1.0 - eps_m))) t_1 = exp(Float64(x * Float64(-1.0 - eps_m))) tmp = 0.0 if (x <= -9.5e-228) tmp = Float64(0.5 + Float64(0.5 * t_1)); elseif (x <= 7e-10) tmp = Float64(0.5 + Float64(0.5 / t_0)); else tmp = Float64(Float64(Float64(0.5 + Float64(0.5 / eps_m)) / t_0) + Float64(t_1 * Float64(0.5 - Float64(0.5 / eps_m)))); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) t_0 = exp((x * (1.0 - eps_m))); t_1 = exp((x * (-1.0 - eps_m))); tmp = 0.0; if (x <= -9.5e-228) tmp = 0.5 + (0.5 * t_1); elseif (x <= 7e-10) tmp = 0.5 + (0.5 / t_0); else tmp = ((0.5 + (0.5 / eps_m)) / t_0) + (t_1 * (0.5 - (0.5 / eps_m))); end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision]
code[x_, eps$95$m_] := Block[{t$95$0 = N[Exp[N[(x * N[(1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Exp[N[(x * N[(-1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -9.5e-228], N[(0.5 + N[(0.5 * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 7e-10], N[(0.5 + N[(0.5 / t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(0.5 + N[(0.5 / eps$95$m), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision] + N[(t$95$1 * N[(0.5 - N[(0.5 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
t_0 := e^{x \cdot \left(1 - eps\_m\right)}\\
t_1 := e^{x \cdot \left(-1 - eps\_m\right)}\\
\mathbf{if}\;x \leq -9.5 \cdot 10^{-228}:\\
\;\;\;\;0.5 + 0.5 \cdot t\_1\\
\mathbf{elif}\;x \leq 7 \cdot 10^{-10}:\\
\;\;\;\;0.5 + \frac{0.5}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.5 + \frac{0.5}{eps\_m}}{t\_0} + t\_1 \cdot \left(0.5 - \frac{0.5}{eps\_m}\right)\\
\end{array}
\end{array}
if x < -9.50000000000000024e-228Initial program 72.9%
Simplified72.9%
Taylor expanded in x around 0
+-lowering-+.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f6441.0%
Simplified41.0%
Taylor expanded in eps around inf
*-commutativeN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
sub-negN/A
*-commutativeN/A
+-lowering-+.f64N/A
sub-negN/A
mul-1-negN/A
distribute-neg-inN/A
+-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
Simplified67.8%
if -9.50000000000000024e-228 < x < 6.99999999999999961e-10Initial program 53.7%
Simplified53.7%
Taylor expanded in x around 0
Simplified48.1%
Taylor expanded in eps around inf
associate-*r/N/A
sub-negN/A
mul-1-negN/A
associate-*r/N/A
+-lowering-+.f64N/A
associate-*r/N/A
metadata-evalN/A
mul-1-negN/A
sub-negN/A
/-lowering-/.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
--lowering--.f6494.2%
Simplified94.2%
if 6.99999999999999961e-10 < x Initial program 100.0%
Simplified100.0%
Final simplification86.3%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<= x -9.5e-228)
(+ 0.5 (* 0.5 (exp (* x (- -1.0 eps_m)))))
(if (<= x 1.95e+58)
(+ 0.5 (/ 0.5 (exp (* x (- 1.0 eps_m)))))
(/ (* x (* x (* eps_m eps_m))) 2.0))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= -9.5e-228) {
tmp = 0.5 + (0.5 * exp((x * (-1.0 - eps_m))));
} else if (x <= 1.95e+58) {
tmp = 0.5 + (0.5 / exp((x * (1.0 - eps_m))));
} else {
tmp = (x * (x * (eps_m * eps_m))) / 2.0;
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: tmp
if (x <= (-9.5d-228)) then
tmp = 0.5d0 + (0.5d0 * exp((x * ((-1.0d0) - eps_m))))
else if (x <= 1.95d+58) then
tmp = 0.5d0 + (0.5d0 / exp((x * (1.0d0 - eps_m))))
else
tmp = (x * (x * (eps_m * eps_m))) / 2.0d0
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (x <= -9.5e-228) {
tmp = 0.5 + (0.5 * Math.exp((x * (-1.0 - eps_m))));
} else if (x <= 1.95e+58) {
tmp = 0.5 + (0.5 / Math.exp((x * (1.0 - eps_m))));
} else {
tmp = (x * (x * (eps_m * eps_m))) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= -9.5e-228: tmp = 0.5 + (0.5 * math.exp((x * (-1.0 - eps_m)))) elif x <= 1.95e+58: tmp = 0.5 + (0.5 / math.exp((x * (1.0 - eps_m)))) else: tmp = (x * (x * (eps_m * eps_m))) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= -9.5e-228) tmp = Float64(0.5 + Float64(0.5 * exp(Float64(x * Float64(-1.0 - eps_m))))); elseif (x <= 1.95e+58) tmp = Float64(0.5 + Float64(0.5 / exp(Float64(x * Float64(1.0 - eps_m))))); else tmp = Float64(Float64(x * Float64(x * Float64(eps_m * eps_m))) / 2.0); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (x <= -9.5e-228) tmp = 0.5 + (0.5 * exp((x * (-1.0 - eps_m)))); elseif (x <= 1.95e+58) tmp = 0.5 + (0.5 / exp((x * (1.0 - eps_m)))); else tmp = (x * (x * (eps_m * eps_m))) / 2.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, -9.5e-228], N[(0.5 + N[(0.5 * N[Exp[N[(x * N[(-1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.95e+58], N[(0.5 + N[(0.5 / N[Exp[N[(x * N[(1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(x * N[(eps$95$m * eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.5 \cdot 10^{-228}:\\
\;\;\;\;0.5 + 0.5 \cdot e^{x \cdot \left(-1 - eps\_m\right)}\\
\mathbf{elif}\;x \leq 1.95 \cdot 10^{+58}:\\
\;\;\;\;0.5 + \frac{0.5}{e^{x \cdot \left(1 - eps\_m\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(x \cdot \left(eps\_m \cdot eps\_m\right)\right)}{2}\\
\end{array}
\end{array}
if x < -9.50000000000000024e-228Initial program 72.9%
Simplified72.9%
Taylor expanded in x around 0
+-lowering-+.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f6441.0%
Simplified41.0%
Taylor expanded in eps around inf
*-commutativeN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
sub-negN/A
*-commutativeN/A
+-lowering-+.f64N/A
sub-negN/A
mul-1-negN/A
distribute-neg-inN/A
+-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
Simplified67.8%
if -9.50000000000000024e-228 < x < 1.95000000000000005e58Initial program 60.5%
Simplified60.5%
Taylor expanded in x around 0
Simplified44.4%
Taylor expanded in eps around inf
associate-*r/N/A
sub-negN/A
mul-1-negN/A
associate-*r/N/A
+-lowering-+.f64N/A
associate-*r/N/A
metadata-evalN/A
mul-1-negN/A
sub-negN/A
/-lowering-/.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
--lowering--.f6483.8%
Simplified83.8%
if 1.95000000000000005e58 < x Initial program 100.0%
Taylor expanded in x around 0
Simplified58.0%
Taylor expanded in eps around inf
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6457.8%
Simplified57.8%
Taylor expanded in x around inf
unpow2N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6457.6%
Simplified57.6%
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6480.4%
Applied egg-rr80.4%
Final simplification77.2%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<= x 7.8e-256)
(+ 0.5 (* 0.5 (exp (* x (- -1.0 eps_m)))))
(if (<= x 285.0)
(/
(+
2.0
(*
x
(+
(* (+ -1.0 eps_m) (+ 1.0 (/ 1.0 eps_m)))
(+
(/ 1.0 eps_m)
(*
x
(+
(* (+ 0.5 (/ 0.5 eps_m)) (* (- 1.0 eps_m) (- 1.0 eps_m)))
(*
(* -0.5 (+ -1.0 (/ 1.0 eps_m)))
(* (+ eps_m 1.0) (+ eps_m 1.0)))))))))
2.0)
(/ (* x (* x (* eps_m eps_m))) 2.0))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= 7.8e-256) {
tmp = 0.5 + (0.5 * exp((x * (-1.0 - eps_m))));
} else if (x <= 285.0) {
tmp = (2.0 + (x * (((-1.0 + eps_m) * (1.0 + (1.0 / eps_m))) + ((1.0 / eps_m) + (x * (((0.5 + (0.5 / eps_m)) * ((1.0 - eps_m) * (1.0 - eps_m))) + ((-0.5 * (-1.0 + (1.0 / eps_m))) * ((eps_m + 1.0) * (eps_m + 1.0))))))))) / 2.0;
} else {
tmp = (x * (x * (eps_m * eps_m))) / 2.0;
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: tmp
if (x <= 7.8d-256) then
tmp = 0.5d0 + (0.5d0 * exp((x * ((-1.0d0) - eps_m))))
else if (x <= 285.0d0) then
tmp = (2.0d0 + (x * ((((-1.0d0) + eps_m) * (1.0d0 + (1.0d0 / eps_m))) + ((1.0d0 / eps_m) + (x * (((0.5d0 + (0.5d0 / eps_m)) * ((1.0d0 - eps_m) * (1.0d0 - eps_m))) + (((-0.5d0) * ((-1.0d0) + (1.0d0 / eps_m))) * ((eps_m + 1.0d0) * (eps_m + 1.0d0))))))))) / 2.0d0
else
tmp = (x * (x * (eps_m * eps_m))) / 2.0d0
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (x <= 7.8e-256) {
tmp = 0.5 + (0.5 * Math.exp((x * (-1.0 - eps_m))));
} else if (x <= 285.0) {
tmp = (2.0 + (x * (((-1.0 + eps_m) * (1.0 + (1.0 / eps_m))) + ((1.0 / eps_m) + (x * (((0.5 + (0.5 / eps_m)) * ((1.0 - eps_m) * (1.0 - eps_m))) + ((-0.5 * (-1.0 + (1.0 / eps_m))) * ((eps_m + 1.0) * (eps_m + 1.0))))))))) / 2.0;
} else {
tmp = (x * (x * (eps_m * eps_m))) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= 7.8e-256: tmp = 0.5 + (0.5 * math.exp((x * (-1.0 - eps_m)))) elif x <= 285.0: tmp = (2.0 + (x * (((-1.0 + eps_m) * (1.0 + (1.0 / eps_m))) + ((1.0 / eps_m) + (x * (((0.5 + (0.5 / eps_m)) * ((1.0 - eps_m) * (1.0 - eps_m))) + ((-0.5 * (-1.0 + (1.0 / eps_m))) * ((eps_m + 1.0) * (eps_m + 1.0))))))))) / 2.0 else: tmp = (x * (x * (eps_m * eps_m))) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= 7.8e-256) tmp = Float64(0.5 + Float64(0.5 * exp(Float64(x * Float64(-1.0 - eps_m))))); elseif (x <= 285.0) tmp = Float64(Float64(2.0 + Float64(x * Float64(Float64(Float64(-1.0 + eps_m) * Float64(1.0 + Float64(1.0 / eps_m))) + Float64(Float64(1.0 / eps_m) + Float64(x * Float64(Float64(Float64(0.5 + Float64(0.5 / eps_m)) * Float64(Float64(1.0 - eps_m) * Float64(1.0 - eps_m))) + Float64(Float64(-0.5 * Float64(-1.0 + Float64(1.0 / eps_m))) * Float64(Float64(eps_m + 1.0) * Float64(eps_m + 1.0))))))))) / 2.0); else tmp = Float64(Float64(x * Float64(x * Float64(eps_m * eps_m))) / 2.0); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (x <= 7.8e-256) tmp = 0.5 + (0.5 * exp((x * (-1.0 - eps_m)))); elseif (x <= 285.0) tmp = (2.0 + (x * (((-1.0 + eps_m) * (1.0 + (1.0 / eps_m))) + ((1.0 / eps_m) + (x * (((0.5 + (0.5 / eps_m)) * ((1.0 - eps_m) * (1.0 - eps_m))) + ((-0.5 * (-1.0 + (1.0 / eps_m))) * ((eps_m + 1.0) * (eps_m + 1.0))))))))) / 2.0; else tmp = (x * (x * (eps_m * eps_m))) / 2.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, 7.8e-256], N[(0.5 + N[(0.5 * N[Exp[N[(x * N[(-1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 285.0], N[(N[(2.0 + N[(x * N[(N[(N[(-1.0 + eps$95$m), $MachinePrecision] * N[(1.0 + N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / eps$95$m), $MachinePrecision] + N[(x * N[(N[(N[(0.5 + N[(0.5 / eps$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 - eps$95$m), $MachinePrecision] * N[(1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(-0.5 * N[(-1.0 + N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(eps$95$m + 1.0), $MachinePrecision] * N[(eps$95$m + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(x * N[(x * N[(eps$95$m * eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq 7.8 \cdot 10^{-256}:\\
\;\;\;\;0.5 + 0.5 \cdot e^{x \cdot \left(-1 - eps\_m\right)}\\
\mathbf{elif}\;x \leq 285:\\
\;\;\;\;\frac{2 + x \cdot \left(\left(-1 + eps\_m\right) \cdot \left(1 + \frac{1}{eps\_m}\right) + \left(\frac{1}{eps\_m} + x \cdot \left(\left(0.5 + \frac{0.5}{eps\_m}\right) \cdot \left(\left(1 - eps\_m\right) \cdot \left(1 - eps\_m\right)\right) + \left(-0.5 \cdot \left(-1 + \frac{1}{eps\_m}\right)\right) \cdot \left(\left(eps\_m + 1\right) \cdot \left(eps\_m + 1\right)\right)\right)\right)\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(x \cdot \left(eps\_m \cdot eps\_m\right)\right)}{2}\\
\end{array}
\end{array}
if x < 7.7999999999999997e-256Initial program 69.8%
Simplified69.8%
Taylor expanded in x around 0
+-lowering-+.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f6446.0%
Simplified46.0%
Taylor expanded in eps around inf
*-commutativeN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
sub-negN/A
*-commutativeN/A
+-lowering-+.f64N/A
sub-negN/A
mul-1-negN/A
distribute-neg-inN/A
+-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
Simplified76.1%
if 7.7999999999999997e-256 < x < 285Initial program 50.7%
Taylor expanded in x around 0
Simplified91.5%
Taylor expanded in eps around 0
/-lowering-/.f6491.5%
Simplified91.5%
if 285 < x Initial program 100.0%
Taylor expanded in x around 0
Simplified54.3%
Taylor expanded in eps around inf
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6454.1%
Simplified54.1%
Taylor expanded in x around inf
unpow2N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6455.2%
Simplified55.2%
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6473.7%
Applied egg-rr73.7%
Final simplification78.8%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<= x -2.6e-206)
(/ (+ 2.0 (* x (* x (* (/ 1.0 eps_m) (* eps_m (* eps_m eps_m)))))) 2.0)
(if (<= x 8e-256)
(/ (+ 2.0 (* (* x eps_m) (* x eps_m))) 2.0)
(if (<= x 285.0)
(/
(+
2.0
(*
x
(+
(* (+ -1.0 eps_m) (+ 1.0 (/ 1.0 eps_m)))
(+
(/ 1.0 eps_m)
(*
x
(+
(* (+ 0.5 (/ 0.5 eps_m)) (* (- 1.0 eps_m) (- 1.0 eps_m)))
(*
(* -0.5 (+ -1.0 (/ 1.0 eps_m)))
(* (+ eps_m 1.0) (+ eps_m 1.0)))))))))
2.0)
(/ (* x (* x (* eps_m eps_m))) 2.0)))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= -2.6e-206) {
tmp = (2.0 + (x * (x * ((1.0 / eps_m) * (eps_m * (eps_m * eps_m)))))) / 2.0;
} else if (x <= 8e-256) {
tmp = (2.0 + ((x * eps_m) * (x * eps_m))) / 2.0;
} else if (x <= 285.0) {
tmp = (2.0 + (x * (((-1.0 + eps_m) * (1.0 + (1.0 / eps_m))) + ((1.0 / eps_m) + (x * (((0.5 + (0.5 / eps_m)) * ((1.0 - eps_m) * (1.0 - eps_m))) + ((-0.5 * (-1.0 + (1.0 / eps_m))) * ((eps_m + 1.0) * (eps_m + 1.0))))))))) / 2.0;
} else {
tmp = (x * (x * (eps_m * eps_m))) / 2.0;
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: tmp
if (x <= (-2.6d-206)) then
tmp = (2.0d0 + (x * (x * ((1.0d0 / eps_m) * (eps_m * (eps_m * eps_m)))))) / 2.0d0
else if (x <= 8d-256) then
tmp = (2.0d0 + ((x * eps_m) * (x * eps_m))) / 2.0d0
else if (x <= 285.0d0) then
tmp = (2.0d0 + (x * ((((-1.0d0) + eps_m) * (1.0d0 + (1.0d0 / eps_m))) + ((1.0d0 / eps_m) + (x * (((0.5d0 + (0.5d0 / eps_m)) * ((1.0d0 - eps_m) * (1.0d0 - eps_m))) + (((-0.5d0) * ((-1.0d0) + (1.0d0 / eps_m))) * ((eps_m + 1.0d0) * (eps_m + 1.0d0))))))))) / 2.0d0
else
tmp = (x * (x * (eps_m * eps_m))) / 2.0d0
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (x <= -2.6e-206) {
tmp = (2.0 + (x * (x * ((1.0 / eps_m) * (eps_m * (eps_m * eps_m)))))) / 2.0;
} else if (x <= 8e-256) {
tmp = (2.0 + ((x * eps_m) * (x * eps_m))) / 2.0;
} else if (x <= 285.0) {
tmp = (2.0 + (x * (((-1.0 + eps_m) * (1.0 + (1.0 / eps_m))) + ((1.0 / eps_m) + (x * (((0.5 + (0.5 / eps_m)) * ((1.0 - eps_m) * (1.0 - eps_m))) + ((-0.5 * (-1.0 + (1.0 / eps_m))) * ((eps_m + 1.0) * (eps_m + 1.0))))))))) / 2.0;
} else {
tmp = (x * (x * (eps_m * eps_m))) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= -2.6e-206: tmp = (2.0 + (x * (x * ((1.0 / eps_m) * (eps_m * (eps_m * eps_m)))))) / 2.0 elif x <= 8e-256: tmp = (2.0 + ((x * eps_m) * (x * eps_m))) / 2.0 elif x <= 285.0: tmp = (2.0 + (x * (((-1.0 + eps_m) * (1.0 + (1.0 / eps_m))) + ((1.0 / eps_m) + (x * (((0.5 + (0.5 / eps_m)) * ((1.0 - eps_m) * (1.0 - eps_m))) + ((-0.5 * (-1.0 + (1.0 / eps_m))) * ((eps_m + 1.0) * (eps_m + 1.0))))))))) / 2.0 else: tmp = (x * (x * (eps_m * eps_m))) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= -2.6e-206) tmp = Float64(Float64(2.0 + Float64(x * Float64(x * Float64(Float64(1.0 / eps_m) * Float64(eps_m * Float64(eps_m * eps_m)))))) / 2.0); elseif (x <= 8e-256) tmp = Float64(Float64(2.0 + Float64(Float64(x * eps_m) * Float64(x * eps_m))) / 2.0); elseif (x <= 285.0) tmp = Float64(Float64(2.0 + Float64(x * Float64(Float64(Float64(-1.0 + eps_m) * Float64(1.0 + Float64(1.0 / eps_m))) + Float64(Float64(1.0 / eps_m) + Float64(x * Float64(Float64(Float64(0.5 + Float64(0.5 / eps_m)) * Float64(Float64(1.0 - eps_m) * Float64(1.0 - eps_m))) + Float64(Float64(-0.5 * Float64(-1.0 + Float64(1.0 / eps_m))) * Float64(Float64(eps_m + 1.0) * Float64(eps_m + 1.0))))))))) / 2.0); else tmp = Float64(Float64(x * Float64(x * Float64(eps_m * eps_m))) / 2.0); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (x <= -2.6e-206) tmp = (2.0 + (x * (x * ((1.0 / eps_m) * (eps_m * (eps_m * eps_m)))))) / 2.0; elseif (x <= 8e-256) tmp = (2.0 + ((x * eps_m) * (x * eps_m))) / 2.0; elseif (x <= 285.0) tmp = (2.0 + (x * (((-1.0 + eps_m) * (1.0 + (1.0 / eps_m))) + ((1.0 / eps_m) + (x * (((0.5 + (0.5 / eps_m)) * ((1.0 - eps_m) * (1.0 - eps_m))) + ((-0.5 * (-1.0 + (1.0 / eps_m))) * ((eps_m + 1.0) * (eps_m + 1.0))))))))) / 2.0; else tmp = (x * (x * (eps_m * eps_m))) / 2.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, -2.6e-206], N[(N[(2.0 + N[(x * N[(x * N[(N[(1.0 / eps$95$m), $MachinePrecision] * N[(eps$95$m * N[(eps$95$m * eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 8e-256], N[(N[(2.0 + N[(N[(x * eps$95$m), $MachinePrecision] * N[(x * eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 285.0], N[(N[(2.0 + N[(x * N[(N[(N[(-1.0 + eps$95$m), $MachinePrecision] * N[(1.0 + N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / eps$95$m), $MachinePrecision] + N[(x * N[(N[(N[(0.5 + N[(0.5 / eps$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 - eps$95$m), $MachinePrecision] * N[(1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(-0.5 * N[(-1.0 + N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(eps$95$m + 1.0), $MachinePrecision] * N[(eps$95$m + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(x * N[(x * N[(eps$95$m * eps$95$m), $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^{-206}:\\
\;\;\;\;\frac{2 + x \cdot \left(x \cdot \left(\frac{1}{eps\_m} \cdot \left(eps\_m \cdot \left(eps\_m \cdot eps\_m\right)\right)\right)\right)}{2}\\
\mathbf{elif}\;x \leq 8 \cdot 10^{-256}:\\
\;\;\;\;\frac{2 + \left(x \cdot eps\_m\right) \cdot \left(x \cdot eps\_m\right)}{2}\\
\mathbf{elif}\;x \leq 285:\\
\;\;\;\;\frac{2 + x \cdot \left(\left(-1 + eps\_m\right) \cdot \left(1 + \frac{1}{eps\_m}\right) + \left(\frac{1}{eps\_m} + x \cdot \left(\left(0.5 + \frac{0.5}{eps\_m}\right) \cdot \left(\left(1 - eps\_m\right) \cdot \left(1 - eps\_m\right)\right) + \left(-0.5 \cdot \left(-1 + \frac{1}{eps\_m}\right)\right) \cdot \left(\left(eps\_m + 1\right) \cdot \left(eps\_m + 1\right)\right)\right)\right)\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(x \cdot \left(eps\_m \cdot eps\_m\right)\right)}{2}\\
\end{array}
\end{array}
if x < -2.6e-206Initial program 72.0%
Taylor expanded in x around 0
Simplified92.6%
Taylor expanded in eps around inf
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6492.6%
Simplified92.6%
pow2N/A
metadata-evalN/A
pow-prod-upN/A
inv-powN/A
cube-unmultN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6496.8%
Applied egg-rr96.8%
if -2.6e-206 < x < 7.99999999999999982e-256Initial program 64.0%
Taylor expanded in x around 0
Simplified83.4%
Taylor expanded in eps around inf
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6483.4%
Simplified83.4%
associate-*r*N/A
unswap-sqrN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6497.2%
Applied egg-rr97.2%
if 7.99999999999999982e-256 < x < 285Initial program 50.7%
Taylor expanded in x around 0
Simplified91.5%
Taylor expanded in eps around 0
/-lowering-/.f6491.5%
Simplified91.5%
if 285 < x Initial program 100.0%
Taylor expanded in x around 0
Simplified54.3%
Taylor expanded in eps around inf
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6454.1%
Simplified54.1%
Taylor expanded in x around inf
unpow2N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6455.2%
Simplified55.2%
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6473.7%
Applied egg-rr73.7%
Final simplification89.0%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(let* ((t_0 (* x (* x (* eps_m eps_m)))))
(if (<= x -4.5e-207)
(/ (+ 2.0 (* x (* x (* (/ 1.0 eps_m) (* eps_m (* eps_m eps_m)))))) 2.0)
(if (<= x 7e-255)
(/ (+ 2.0 (* (* x eps_m) (* x eps_m))) 2.0)
(if (<= x 335.0) (/ (+ 2.0 t_0) 2.0) (/ t_0 2.0))))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double t_0 = x * (x * (eps_m * eps_m));
double tmp;
if (x <= -4.5e-207) {
tmp = (2.0 + (x * (x * ((1.0 / eps_m) * (eps_m * (eps_m * eps_m)))))) / 2.0;
} else if (x <= 7e-255) {
tmp = (2.0 + ((x * eps_m) * (x * eps_m))) / 2.0;
} else if (x <= 335.0) {
tmp = (2.0 + t_0) / 2.0;
} else {
tmp = t_0 / 2.0;
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: t_0
real(8) :: tmp
t_0 = x * (x * (eps_m * eps_m))
if (x <= (-4.5d-207)) then
tmp = (2.0d0 + (x * (x * ((1.0d0 / eps_m) * (eps_m * (eps_m * eps_m)))))) / 2.0d0
else if (x <= 7d-255) then
tmp = (2.0d0 + ((x * eps_m) * (x * eps_m))) / 2.0d0
else if (x <= 335.0d0) then
tmp = (2.0d0 + t_0) / 2.0d0
else
tmp = t_0 / 2.0d0
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double t_0 = x * (x * (eps_m * eps_m));
double tmp;
if (x <= -4.5e-207) {
tmp = (2.0 + (x * (x * ((1.0 / eps_m) * (eps_m * (eps_m * eps_m)))))) / 2.0;
} else if (x <= 7e-255) {
tmp = (2.0 + ((x * eps_m) * (x * eps_m))) / 2.0;
} else if (x <= 335.0) {
tmp = (2.0 + t_0) / 2.0;
} else {
tmp = t_0 / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): t_0 = x * (x * (eps_m * eps_m)) tmp = 0 if x <= -4.5e-207: tmp = (2.0 + (x * (x * ((1.0 / eps_m) * (eps_m * (eps_m * eps_m)))))) / 2.0 elif x <= 7e-255: tmp = (2.0 + ((x * eps_m) * (x * eps_m))) / 2.0 elif x <= 335.0: tmp = (2.0 + t_0) / 2.0 else: tmp = t_0 / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) t_0 = Float64(x * Float64(x * Float64(eps_m * eps_m))) tmp = 0.0 if (x <= -4.5e-207) tmp = Float64(Float64(2.0 + Float64(x * Float64(x * Float64(Float64(1.0 / eps_m) * Float64(eps_m * Float64(eps_m * eps_m)))))) / 2.0); elseif (x <= 7e-255) tmp = Float64(Float64(2.0 + Float64(Float64(x * eps_m) * Float64(x * eps_m))) / 2.0); elseif (x <= 335.0) tmp = Float64(Float64(2.0 + t_0) / 2.0); else tmp = Float64(t_0 / 2.0); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) t_0 = x * (x * (eps_m * eps_m)); tmp = 0.0; if (x <= -4.5e-207) tmp = (2.0 + (x * (x * ((1.0 / eps_m) * (eps_m * (eps_m * eps_m)))))) / 2.0; elseif (x <= 7e-255) tmp = (2.0 + ((x * eps_m) * (x * eps_m))) / 2.0; elseif (x <= 335.0) tmp = (2.0 + t_0) / 2.0; else tmp = t_0 / 2.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision]
code[x_, eps$95$m_] := Block[{t$95$0 = N[(x * N[(x * N[(eps$95$m * eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.5e-207], N[(N[(2.0 + N[(x * N[(x * N[(N[(1.0 / eps$95$m), $MachinePrecision] * N[(eps$95$m * N[(eps$95$m * eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 7e-255], N[(N[(2.0 + N[(N[(x * eps$95$m), $MachinePrecision] * N[(x * eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 335.0], N[(N[(2.0 + t$95$0), $MachinePrecision] / 2.0), $MachinePrecision], N[(t$95$0 / 2.0), $MachinePrecision]]]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
t_0 := x \cdot \left(x \cdot \left(eps\_m \cdot eps\_m\right)\right)\\
\mathbf{if}\;x \leq -4.5 \cdot 10^{-207}:\\
\;\;\;\;\frac{2 + x \cdot \left(x \cdot \left(\frac{1}{eps\_m} \cdot \left(eps\_m \cdot \left(eps\_m \cdot eps\_m\right)\right)\right)\right)}{2}\\
\mathbf{elif}\;x \leq 7 \cdot 10^{-255}:\\
\;\;\;\;\frac{2 + \left(x \cdot eps\_m\right) \cdot \left(x \cdot eps\_m\right)}{2}\\
\mathbf{elif}\;x \leq 335:\\
\;\;\;\;\frac{2 + t\_0}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_0}{2}\\
\end{array}
\end{array}
if x < -4.49999999999999992e-207Initial program 72.0%
Taylor expanded in x around 0
Simplified92.6%
Taylor expanded in eps around inf
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6492.6%
Simplified92.6%
pow2N/A
metadata-evalN/A
pow-prod-upN/A
inv-powN/A
cube-unmultN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6496.8%
Applied egg-rr96.8%
if -4.49999999999999992e-207 < x < 6.99999999999999958e-255Initial program 64.0%
Taylor expanded in x around 0
Simplified83.4%
Taylor expanded in eps around inf
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6483.4%
Simplified83.4%
associate-*r*N/A
unswap-sqrN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6497.2%
Applied egg-rr97.2%
if 6.99999999999999958e-255 < x < 335Initial program 50.7%
Taylor expanded in x around 0
Simplified91.5%
Taylor expanded in eps around inf
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6491.5%
Simplified91.5%
if 335 < x Initial program 100.0%
Taylor expanded in x around 0
Simplified54.3%
Taylor expanded in eps around inf
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6454.1%
Simplified54.1%
Taylor expanded in x around inf
unpow2N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6455.2%
Simplified55.2%
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6473.7%
Applied egg-rr73.7%
Final simplification89.0%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= x -1.45e-47) (/ (* (* eps_m eps_m) (* x x)) 2.0) (if (<= x 7.4e-30) 1.0 (/ (* x (* x (* eps_m eps_m))) 2.0))))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= -1.45e-47) {
tmp = ((eps_m * eps_m) * (x * x)) / 2.0;
} else if (x <= 7.4e-30) {
tmp = 1.0;
} else {
tmp = (x * (x * (eps_m * eps_m))) / 2.0;
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: tmp
if (x <= (-1.45d-47)) then
tmp = ((eps_m * eps_m) * (x * x)) / 2.0d0
else if (x <= 7.4d-30) then
tmp = 1.0d0
else
tmp = (x * (x * (eps_m * eps_m))) / 2.0d0
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (x <= -1.45e-47) {
tmp = ((eps_m * eps_m) * (x * x)) / 2.0;
} else if (x <= 7.4e-30) {
tmp = 1.0;
} else {
tmp = (x * (x * (eps_m * eps_m))) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= -1.45e-47: tmp = ((eps_m * eps_m) * (x * x)) / 2.0 elif x <= 7.4e-30: tmp = 1.0 else: tmp = (x * (x * (eps_m * eps_m))) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= -1.45e-47) tmp = Float64(Float64(Float64(eps_m * eps_m) * Float64(x * x)) / 2.0); elseif (x <= 7.4e-30) tmp = 1.0; else tmp = Float64(Float64(x * Float64(x * Float64(eps_m * eps_m))) / 2.0); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (x <= -1.45e-47) tmp = ((eps_m * eps_m) * (x * x)) / 2.0; elseif (x <= 7.4e-30) tmp = 1.0; else tmp = (x * (x * (eps_m * eps_m))) / 2.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, -1.45e-47], N[(N[(N[(eps$95$m * eps$95$m), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 7.4e-30], 1.0, N[(N[(x * N[(x * N[(eps$95$m * eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.45 \cdot 10^{-47}:\\
\;\;\;\;\frac{\left(eps\_m \cdot eps\_m\right) \cdot \left(x \cdot x\right)}{2}\\
\mathbf{elif}\;x \leq 7.4 \cdot 10^{-30}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(x \cdot \left(eps\_m \cdot eps\_m\right)\right)}{2}\\
\end{array}
\end{array}
if x < -1.45e-47Initial program 91.9%
Taylor expanded in x around 0
Simplified90.2%
Taylor expanded in eps around inf
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6490.2%
Simplified90.2%
Taylor expanded in x around inf
unpow2N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6474.6%
Simplified74.6%
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6482.1%
Applied egg-rr82.1%
if -1.45e-47 < x < 7.4000000000000006e-30Initial program 52.7%
Simplified52.7%
Taylor expanded in x around 0
Simplified78.7%
if 7.4000000000000006e-30 < x Initial program 97.6%
Taylor expanded in x around 0
Simplified55.8%
Taylor expanded in eps around inf
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6455.7%
Simplified55.7%
Taylor expanded in x around inf
unpow2N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6453.2%
Simplified53.2%
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6471.2%
Applied egg-rr71.2%
Final simplification77.0%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (let* ((t_0 (/ (* (* eps_m eps_m) (* x x)) 2.0))) (if (<= x -2.6e-45) t_0 (if (<= x 1.05e-29) 1.0 t_0))))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double t_0 = ((eps_m * eps_m) * (x * x)) / 2.0;
double tmp;
if (x <= -2.6e-45) {
tmp = t_0;
} else if (x <= 1.05e-29) {
tmp = 1.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 = ((eps_m * eps_m) * (x * x)) / 2.0d0
if (x <= (-2.6d-45)) then
tmp = t_0
else if (x <= 1.05d-29) then
tmp = 1.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 = ((eps_m * eps_m) * (x * x)) / 2.0;
double tmp;
if (x <= -2.6e-45) {
tmp = t_0;
} else if (x <= 1.05e-29) {
tmp = 1.0;
} else {
tmp = t_0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): t_0 = ((eps_m * eps_m) * (x * x)) / 2.0 tmp = 0 if x <= -2.6e-45: tmp = t_0 elif x <= 1.05e-29: tmp = 1.0 else: tmp = t_0 return tmp
eps_m = abs(eps) function code(x, eps_m) t_0 = Float64(Float64(Float64(eps_m * eps_m) * Float64(x * x)) / 2.0) tmp = 0.0 if (x <= -2.6e-45) tmp = t_0; elseif (x <= 1.05e-29) tmp = 1.0; else tmp = t_0; end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) t_0 = ((eps_m * eps_m) * (x * x)) / 2.0; tmp = 0.0; if (x <= -2.6e-45) tmp = t_0; elseif (x <= 1.05e-29) tmp = 1.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[(N[(eps$95$m * eps$95$m), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]}, If[LessEqual[x, -2.6e-45], t$95$0, If[LessEqual[x, 1.05e-29], 1.0, t$95$0]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
t_0 := \frac{\left(eps\_m \cdot eps\_m\right) \cdot \left(x \cdot x\right)}{2}\\
\mathbf{if}\;x \leq -2.6 \cdot 10^{-45}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.05 \cdot 10^{-29}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -2.59999999999999987e-45 or 1.04999999999999995e-29 < x Initial program 95.5%
Taylor expanded in x around 0
Simplified68.6%
Taylor expanded in eps around inf
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6468.5%
Simplified68.5%
Taylor expanded in x around inf
unpow2N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6461.2%
Simplified61.2%
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6466.7%
Applied egg-rr66.7%
if -2.59999999999999987e-45 < x < 1.04999999999999995e-29Initial program 52.7%
Simplified52.7%
Taylor expanded in x around 0
Simplified78.7%
Final simplification72.7%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= x -7.5e-35) (/ (* eps_m (* eps_m (* x x))) 2.0) (if (<= x 3.7e-28) 1.0 (/ (* (* x eps_m) (* x eps_m)) 2.0))))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= -7.5e-35) {
tmp = (eps_m * (eps_m * (x * x))) / 2.0;
} else if (x <= 3.7e-28) {
tmp = 1.0;
} else {
tmp = ((x * eps_m) * (x * eps_m)) / 2.0;
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: tmp
if (x <= (-7.5d-35)) then
tmp = (eps_m * (eps_m * (x * x))) / 2.0d0
else if (x <= 3.7d-28) then
tmp = 1.0d0
else
tmp = ((x * eps_m) * (x * eps_m)) / 2.0d0
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (x <= -7.5e-35) {
tmp = (eps_m * (eps_m * (x * x))) / 2.0;
} else if (x <= 3.7e-28) {
tmp = 1.0;
} else {
tmp = ((x * eps_m) * (x * eps_m)) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= -7.5e-35: tmp = (eps_m * (eps_m * (x * x))) / 2.0 elif x <= 3.7e-28: tmp = 1.0 else: tmp = ((x * eps_m) * (x * eps_m)) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= -7.5e-35) tmp = Float64(Float64(eps_m * Float64(eps_m * Float64(x * x))) / 2.0); elseif (x <= 3.7e-28) tmp = 1.0; else tmp = Float64(Float64(Float64(x * eps_m) * Float64(x * eps_m)) / 2.0); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (x <= -7.5e-35) tmp = (eps_m * (eps_m * (x * x))) / 2.0; elseif (x <= 3.7e-28) tmp = 1.0; else tmp = ((x * eps_m) * (x * eps_m)) / 2.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, -7.5e-35], N[(N[(eps$95$m * N[(eps$95$m * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 3.7e-28], 1.0, N[(N[(N[(x * eps$95$m), $MachinePrecision] * N[(x * eps$95$m), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.5 \cdot 10^{-35}:\\
\;\;\;\;\frac{eps\_m \cdot \left(eps\_m \cdot \left(x \cdot x\right)\right)}{2}\\
\mathbf{elif}\;x \leq 3.7 \cdot 10^{-28}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x \cdot eps\_m\right) \cdot \left(x \cdot eps\_m\right)}{2}\\
\end{array}
\end{array}
if x < -7.5e-35Initial program 97.6%
Taylor expanded in x around 0
Simplified90.8%
Taylor expanded in eps around inf
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6490.8%
Simplified90.8%
Taylor expanded in x around inf
unpow2N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6484.1%
Simplified84.1%
if -7.5e-35 < x < 3.7000000000000002e-28Initial program 53.0%
Simplified53.0%
Taylor expanded in x around 0
Simplified76.9%
if 3.7000000000000002e-28 < x Initial program 97.6%
Taylor expanded in x around 0
Simplified55.8%
Taylor expanded in eps around inf
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6455.7%
Simplified55.7%
Taylor expanded in x around inf
unpow2N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6453.2%
Simplified53.2%
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
/-lowering-/.f64N/A
associate-*r*N/A
*-commutativeN/A
swap-sqrN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6453.5%
Applied egg-rr53.5%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (let* ((t_0 (/ (* eps_m (* eps_m (* x x))) 2.0))) (if (<= x -8.5e-35) t_0 (if (<= x 5e-28) 1.0 t_0))))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double t_0 = (eps_m * (eps_m * (x * x))) / 2.0;
double tmp;
if (x <= -8.5e-35) {
tmp = t_0;
} else if (x <= 5e-28) {
tmp = 1.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 = (eps_m * (eps_m * (x * x))) / 2.0d0
if (x <= (-8.5d-35)) then
tmp = t_0
else if (x <= 5d-28) then
tmp = 1.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 = (eps_m * (eps_m * (x * x))) / 2.0;
double tmp;
if (x <= -8.5e-35) {
tmp = t_0;
} else if (x <= 5e-28) {
tmp = 1.0;
} else {
tmp = t_0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): t_0 = (eps_m * (eps_m * (x * x))) / 2.0 tmp = 0 if x <= -8.5e-35: tmp = t_0 elif x <= 5e-28: tmp = 1.0 else: tmp = t_0 return tmp
eps_m = abs(eps) function code(x, eps_m) t_0 = Float64(Float64(eps_m * Float64(eps_m * Float64(x * x))) / 2.0) tmp = 0.0 if (x <= -8.5e-35) tmp = t_0; elseif (x <= 5e-28) tmp = 1.0; else tmp = t_0; end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) t_0 = (eps_m * (eps_m * (x * x))) / 2.0; tmp = 0.0; if (x <= -8.5e-35) tmp = t_0; elseif (x <= 5e-28) tmp = 1.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[(eps$95$m * N[(eps$95$m * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]}, If[LessEqual[x, -8.5e-35], t$95$0, If[LessEqual[x, 5e-28], 1.0, t$95$0]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
t_0 := \frac{eps\_m \cdot \left(eps\_m \cdot \left(x \cdot x\right)\right)}{2}\\
\mathbf{if}\;x \leq -8.5 \cdot 10^{-35}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 5 \cdot 10^{-28}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -8.5000000000000001e-35 or 5.0000000000000002e-28 < x Initial program 97.6%
Taylor expanded in x around 0
Simplified67.6%
Taylor expanded in eps around inf
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6467.5%
Simplified67.5%
Taylor expanded in x around inf
unpow2N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6463.6%
Simplified63.6%
if -8.5000000000000001e-35 < x < 5.0000000000000002e-28Initial program 53.0%
Simplified53.0%
Taylor expanded in x around 0
Simplified76.9%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= x 31000000000.0) 1.0 (if (<= x 2.5e+166) 0.0 (/ (+ 2.0 (* x eps_m)) 2.0))))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= 31000000000.0) {
tmp = 1.0;
} else if (x <= 2.5e+166) {
tmp = 0.0;
} else {
tmp = (2.0 + (x * eps_m)) / 2.0;
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: tmp
if (x <= 31000000000.0d0) then
tmp = 1.0d0
else if (x <= 2.5d+166) then
tmp = 0.0d0
else
tmp = (2.0d0 + (x * eps_m)) / 2.0d0
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (x <= 31000000000.0) {
tmp = 1.0;
} else if (x <= 2.5e+166) {
tmp = 0.0;
} else {
tmp = (2.0 + (x * eps_m)) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= 31000000000.0: tmp = 1.0 elif x <= 2.5e+166: tmp = 0.0 else: tmp = (2.0 + (x * eps_m)) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= 31000000000.0) tmp = 1.0; elseif (x <= 2.5e+166) tmp = 0.0; else tmp = Float64(Float64(2.0 + Float64(x * eps_m)) / 2.0); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (x <= 31000000000.0) tmp = 1.0; elseif (x <= 2.5e+166) tmp = 0.0; else tmp = (2.0 + (x * eps_m)) / 2.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, 31000000000.0], 1.0, If[LessEqual[x, 2.5e+166], 0.0, N[(N[(2.0 + N[(x * eps$95$m), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq 31000000000:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 2.5 \cdot 10^{+166}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + x \cdot eps\_m}{2}\\
\end{array}
\end{array}
if x < 3.1e10Initial program 64.0%
Simplified64.0%
Taylor expanded in x around 0
Simplified58.7%
if 3.1e10 < x < 2.5000000000000001e166Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0
*-commutativeN/A
neg-mul-1N/A
rec-expN/A
*-commutativeN/A
distribute-lft-outN/A
metadata-evalN/A
mul0-rgtN/A
div049.1%
Simplified49.1%
if 2.5000000000000001e166 < x Initial program 100.0%
Taylor expanded in x around 0
Simplified62.6%
Taylor expanded in eps around 0
/-lowering-/.f6462.6%
Simplified62.6%
Taylor expanded in eps around inf
+-commutativeN/A
distribute-rgt-inN/A
unpow2N/A
associate-*r*N/A
lft-mult-inverseN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f6462.3%
Simplified62.3%
Taylor expanded in x around 0
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f6415.3%
Simplified15.3%
Final simplification50.2%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (let* ((t_0 (* x (* x (* eps_m eps_m))))) (if (<= x 145.0) (/ (+ 2.0 t_0) 2.0) (/ t_0 2.0))))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double t_0 = x * (x * (eps_m * eps_m));
double tmp;
if (x <= 145.0) {
tmp = (2.0 + t_0) / 2.0;
} else {
tmp = t_0 / 2.0;
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: t_0
real(8) :: tmp
t_0 = x * (x * (eps_m * eps_m))
if (x <= 145.0d0) then
tmp = (2.0d0 + t_0) / 2.0d0
else
tmp = t_0 / 2.0d0
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double t_0 = x * (x * (eps_m * eps_m));
double tmp;
if (x <= 145.0) {
tmp = (2.0 + t_0) / 2.0;
} else {
tmp = t_0 / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): t_0 = x * (x * (eps_m * eps_m)) tmp = 0 if x <= 145.0: tmp = (2.0 + t_0) / 2.0 else: tmp = t_0 / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) t_0 = Float64(x * Float64(x * Float64(eps_m * eps_m))) tmp = 0.0 if (x <= 145.0) tmp = Float64(Float64(2.0 + t_0) / 2.0); else tmp = Float64(t_0 / 2.0); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) t_0 = x * (x * (eps_m * eps_m)); tmp = 0.0; if (x <= 145.0) tmp = (2.0 + t_0) / 2.0; else tmp = t_0 / 2.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision]
code[x_, eps$95$m_] := Block[{t$95$0 = N[(x * N[(x * N[(eps$95$m * eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 145.0], N[(N[(2.0 + t$95$0), $MachinePrecision] / 2.0), $MachinePrecision], N[(t$95$0 / 2.0), $MachinePrecision]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
t_0 := x \cdot \left(x \cdot \left(eps\_m \cdot eps\_m\right)\right)\\
\mathbf{if}\;x \leq 145:\\
\;\;\;\;\frac{2 + t\_0}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_0}{2}\\
\end{array}
\end{array}
if x < 145Initial program 63.8%
Taylor expanded in x around 0
Simplified90.5%
Taylor expanded in eps around inf
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6490.5%
Simplified90.5%
if 145 < x Initial program 100.0%
Taylor expanded in x around 0
Simplified54.3%
Taylor expanded in eps around inf
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6454.1%
Simplified54.1%
Taylor expanded in x around inf
unpow2N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6455.2%
Simplified55.2%
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6473.7%
Applied egg-rr73.7%
Final simplification85.7%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= x 31000000000.0) 1.0 0.0))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= 31000000000.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 <= 31000000000.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 <= 31000000000.0) {
tmp = 1.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= 31000000000.0: tmp = 1.0 else: tmp = 0.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= 31000000000.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 <= 31000000000.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, 31000000000.0], 1.0, 0.0]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq 31000000000:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 3.1e10Initial program 64.0%
Simplified64.0%
Taylor expanded in x around 0
Simplified58.7%
if 3.1e10 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0
*-commutativeN/A
neg-mul-1N/A
rec-expN/A
*-commutativeN/A
distribute-lft-outN/A
metadata-evalN/A
mul0-rgtN/A
div043.4%
Simplified43.4%
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 74.2%
Simplified74.3%
Taylor expanded in eps around 0
*-commutativeN/A
neg-mul-1N/A
rec-expN/A
*-commutativeN/A
distribute-lft-outN/A
metadata-evalN/A
mul0-rgtN/A
div014.1%
Simplified14.1%
herbie shell --seed 2024192
(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))