
(FPCore (x eps) :precision binary64 (/ (- (* (+ 1.0 (/ 1.0 eps)) (exp (- (* (- 1.0 eps) x)))) (* (- (/ 1.0 eps) 1.0) (exp (- (* (+ 1.0 eps) x))))) 2.0))
double code(double x, double eps) {
return (((1.0 + (1.0 / eps)) * exp(-((1.0 - eps) * x))) - (((1.0 / eps) - 1.0) * exp(-((1.0 + eps) * x)))) / 2.0;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
code = (((1.0d0 + (1.0d0 / eps)) * exp(-((1.0d0 - eps) * x))) - (((1.0d0 / eps) - 1.0d0) * exp(-((1.0d0 + eps) * x)))) / 2.0d0
end function
public static double code(double x, double eps) {
return (((1.0 + (1.0 / eps)) * Math.exp(-((1.0 - eps) * x))) - (((1.0 / eps) - 1.0) * Math.exp(-((1.0 + eps) * x)))) / 2.0;
}
def code(x, eps): return (((1.0 + (1.0 / eps)) * math.exp(-((1.0 - eps) * x))) - (((1.0 / eps) - 1.0) * math.exp(-((1.0 + eps) * x)))) / 2.0
function code(x, eps) return Float64(Float64(Float64(Float64(1.0 + Float64(1.0 / eps)) * exp(Float64(-Float64(Float64(1.0 - eps) * x)))) - Float64(Float64(Float64(1.0 / eps) - 1.0) * exp(Float64(-Float64(Float64(1.0 + eps) * x))))) / 2.0) end
function tmp = code(x, eps) tmp = (((1.0 + (1.0 / eps)) * exp(-((1.0 - eps) * x))) - (((1.0 / eps) - 1.0) * exp(-((1.0 + eps) * x)))) / 2.0; end
code[x_, eps_] := N[(N[(N[(N[(1.0 + N[(1.0 / eps), $MachinePrecision]), $MachinePrecision] * N[Exp[(-N[(N[(1.0 - eps), $MachinePrecision] * x), $MachinePrecision])], $MachinePrecision]), $MachinePrecision] - N[(N[(N[(1.0 / eps), $MachinePrecision] - 1.0), $MachinePrecision] * N[Exp[(-N[(N[(1.0 + eps), $MachinePrecision] * x), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot e^{-\left(1 - \varepsilon\right) \cdot x} - \left(\frac{1}{\varepsilon} - 1\right) \cdot e^{-\left(1 + \varepsilon\right) \cdot x}}{2}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x eps) :precision binary64 (/ (- (* (+ 1.0 (/ 1.0 eps)) (exp (- (* (- 1.0 eps) x)))) (* (- (/ 1.0 eps) 1.0) (exp (- (* (+ 1.0 eps) x))))) 2.0))
double code(double x, double eps) {
return (((1.0 + (1.0 / eps)) * exp(-((1.0 - eps) * x))) - (((1.0 / eps) - 1.0) * exp(-((1.0 + eps) * x)))) / 2.0;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
code = (((1.0d0 + (1.0d0 / eps)) * exp(-((1.0d0 - eps) * x))) - (((1.0d0 / eps) - 1.0d0) * exp(-((1.0d0 + eps) * x)))) / 2.0d0
end function
public static double code(double x, double eps) {
return (((1.0 + (1.0 / eps)) * Math.exp(-((1.0 - eps) * x))) - (((1.0 / eps) - 1.0) * Math.exp(-((1.0 + eps) * x)))) / 2.0;
}
def code(x, eps): return (((1.0 + (1.0 / eps)) * math.exp(-((1.0 - eps) * x))) - (((1.0 / eps) - 1.0) * math.exp(-((1.0 + eps) * x)))) / 2.0
function code(x, eps) return Float64(Float64(Float64(Float64(1.0 + Float64(1.0 / eps)) * exp(Float64(-Float64(Float64(1.0 - eps) * x)))) - Float64(Float64(Float64(1.0 / eps) - 1.0) * exp(Float64(-Float64(Float64(1.0 + eps) * x))))) / 2.0) end
function tmp = code(x, eps) tmp = (((1.0 + (1.0 / eps)) * exp(-((1.0 - eps) * x))) - (((1.0 / eps) - 1.0) * exp(-((1.0 + eps) * x)))) / 2.0; end
code[x_, eps_] := N[(N[(N[(N[(1.0 + N[(1.0 / eps), $MachinePrecision]), $MachinePrecision] * N[Exp[(-N[(N[(1.0 - eps), $MachinePrecision] * x), $MachinePrecision])], $MachinePrecision]), $MachinePrecision] - N[(N[(N[(1.0 / eps), $MachinePrecision] - 1.0), $MachinePrecision] * N[Exp[(-N[(N[(1.0 + eps), $MachinePrecision] * x), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot e^{-\left(1 - \varepsilon\right) \cdot x} - \left(\frac{1}{\varepsilon} - 1\right) \cdot e^{-\left(1 + \varepsilon\right) \cdot x}}{2}
\end{array}
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(let* ((t_0 (exp (* x eps_m))))
(if (<= eps_m 0.29)
(* (+ x 1.0) (exp (- 0.0 x)))
(* 0.5 (+ t_0 (/ 1.0 t_0))))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double t_0 = exp((x * eps_m));
double tmp;
if (eps_m <= 0.29) {
tmp = (x + 1.0) * exp((0.0 - x));
} else {
tmp = 0.5 * (t_0 + (1.0 / 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 = exp((x * eps_m))
if (eps_m <= 0.29d0) then
tmp = (x + 1.0d0) * exp((0.0d0 - x))
else
tmp = 0.5d0 * (t_0 + (1.0d0 / 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 = Math.exp((x * eps_m));
double tmp;
if (eps_m <= 0.29) {
tmp = (x + 1.0) * Math.exp((0.0 - x));
} else {
tmp = 0.5 * (t_0 + (1.0 / t_0));
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): t_0 = math.exp((x * eps_m)) tmp = 0 if eps_m <= 0.29: tmp = (x + 1.0) * math.exp((0.0 - x)) else: tmp = 0.5 * (t_0 + (1.0 / t_0)) return tmp
eps_m = abs(eps) function code(x, eps_m) t_0 = exp(Float64(x * eps_m)) tmp = 0.0 if (eps_m <= 0.29) tmp = Float64(Float64(x + 1.0) * exp(Float64(0.0 - x))); else tmp = Float64(0.5 * Float64(t_0 + Float64(1.0 / t_0))); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) t_0 = exp((x * eps_m)); tmp = 0.0; if (eps_m <= 0.29) tmp = (x + 1.0) * exp((0.0 - x)); else tmp = 0.5 * (t_0 + (1.0 / t_0)); end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision]
code[x_, eps$95$m_] := Block[{t$95$0 = N[Exp[N[(x * eps$95$m), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[eps$95$m, 0.29], N[(N[(x + 1.0), $MachinePrecision] * N[Exp[N[(0.0 - x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(t$95$0 + N[(1.0 / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
t_0 := e^{x \cdot eps\_m}\\
\mathbf{if}\;eps\_m \leq 0.29:\\
\;\;\;\;\left(x + 1\right) \cdot e^{0 - x}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(t\_0 + \frac{1}{t\_0}\right)\\
\end{array}
\end{array}
if eps < 0.28999999999999998Initial program 65.6%
Simplified65.6%
Taylor expanded in eps around 0
distribute-lft-outN/A
distribute-lft-outN/A
distribute-rgt-out--N/A
metadata-evalN/A
*-rgt-identityN/A
distribute-rgt1-inN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
mul-1-negN/A
neg-sub0N/A
--lowering--.f6468.7%
Simplified68.7%
if 0.28999999999999998 < eps Initial program 99.9%
Simplified99.9%
Taylor expanded in eps around inf
cancel-sign-sub-invN/A
metadata-evalN/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-*r*N/A
exp-lowering-exp.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
distribute-lft-inN/A
metadata-evalN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f6499.9%
Simplified99.9%
Taylor expanded in eps around inf
*-commutativeN/A
*-lowering-*.f6499.9%
Simplified99.9%
exp-prodN/A
pow-subN/A
exp-prodN/A
/-lowering-/.f64N/A
unpow-1N/A
/-lowering-/.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f6499.9%
Applied egg-rr99.9%
Taylor expanded in x around 0
Simplified99.9%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= eps_m 0.29) (* (+ x 1.0) (exp (- 0.0 x))) (* 0.5 (+ (exp (* x (- -1.0 eps_m))) (exp (* x eps_m))))))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (eps_m <= 0.29) {
tmp = (x + 1.0) * exp((0.0 - x));
} else {
tmp = 0.5 * (exp((x * (-1.0 - eps_m))) + exp((x * eps_m)));
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: tmp
if (eps_m <= 0.29d0) then
tmp = (x + 1.0d0) * exp((0.0d0 - x))
else
tmp = 0.5d0 * (exp((x * ((-1.0d0) - eps_m))) + exp((x * eps_m)))
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (eps_m <= 0.29) {
tmp = (x + 1.0) * Math.exp((0.0 - x));
} else {
tmp = 0.5 * (Math.exp((x * (-1.0 - eps_m))) + Math.exp((x * eps_m)));
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if eps_m <= 0.29: tmp = (x + 1.0) * math.exp((0.0 - x)) else: tmp = 0.5 * (math.exp((x * (-1.0 - eps_m))) + math.exp((x * eps_m))) return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (eps_m <= 0.29) tmp = Float64(Float64(x + 1.0) * exp(Float64(0.0 - x))); else tmp = Float64(0.5 * Float64(exp(Float64(x * Float64(-1.0 - eps_m))) + exp(Float64(x * eps_m)))); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (eps_m <= 0.29) tmp = (x + 1.0) * exp((0.0 - x)); else tmp = 0.5 * (exp((x * (-1.0 - eps_m))) + exp((x * eps_m))); end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[eps$95$m, 0.29], N[(N[(x + 1.0), $MachinePrecision] * N[Exp[N[(0.0 - x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(N[Exp[N[(x * N[(-1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[Exp[N[(x * eps$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;eps\_m \leq 0.29:\\
\;\;\;\;\left(x + 1\right) \cdot e^{0 - x}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(e^{x \cdot \left(-1 - eps\_m\right)} + e^{x \cdot eps\_m}\right)\\
\end{array}
\end{array}
if eps < 0.28999999999999998Initial program 65.6%
Simplified65.6%
Taylor expanded in eps around 0
distribute-lft-outN/A
distribute-lft-outN/A
distribute-rgt-out--N/A
metadata-evalN/A
*-rgt-identityN/A
distribute-rgt1-inN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
mul-1-negN/A
neg-sub0N/A
--lowering--.f6468.7%
Simplified68.7%
if 0.28999999999999998 < eps Initial program 99.9%
Simplified99.9%
Taylor expanded in eps around inf
cancel-sign-sub-invN/A
metadata-evalN/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-*r*N/A
exp-lowering-exp.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
distribute-lft-inN/A
metadata-evalN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f6499.9%
Simplified99.9%
Taylor expanded in eps around inf
*-commutativeN/A
*-lowering-*.f6499.9%
Simplified99.9%
Final simplification77.2%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (* 0.5 (+ (exp (* x (+ eps_m -1.0))) (exp (* x (- -1.0 eps_m))))))
eps_m = fabs(eps);
double code(double x, double eps_m) {
return 0.5 * (exp((x * (eps_m + -1.0))) + exp((x * (-1.0 - eps_m))));
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
code = 0.5d0 * (exp((x * (eps_m + (-1.0d0)))) + exp((x * ((-1.0d0) - eps_m))))
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
return 0.5 * (Math.exp((x * (eps_m + -1.0))) + Math.exp((x * (-1.0 - eps_m))));
}
eps_m = math.fabs(eps) def code(x, eps_m): return 0.5 * (math.exp((x * (eps_m + -1.0))) + math.exp((x * (-1.0 - eps_m))))
eps_m = abs(eps) function code(x, eps_m) return Float64(0.5 * Float64(exp(Float64(x * Float64(eps_m + -1.0))) + exp(Float64(x * Float64(-1.0 - eps_m))))) end
eps_m = abs(eps); function tmp = code(x, eps_m) tmp = 0.5 * (exp((x * (eps_m + -1.0))) + exp((x * (-1.0 - eps_m)))); end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := N[(0.5 * N[(N[Exp[N[(x * N[(eps$95$m + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[Exp[N[(x * N[(-1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
0.5 \cdot \left(e^{x \cdot \left(eps\_m + -1\right)} + e^{x \cdot \left(-1 - eps\_m\right)}\right)
\end{array}
Initial program 75.0%
Simplified75.0%
Taylor expanded in eps around inf
cancel-sign-sub-invN/A
metadata-evalN/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-*r*N/A
exp-lowering-exp.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
distribute-lft-inN/A
metadata-evalN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f6499.2%
Simplified99.2%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<= eps_m 0.29)
(* (+ x 1.0) (exp (- 0.0 x)))
(-
(*
(+
1.0
(* x (+ -1.0 (+ eps_m (* x (* 0.5 (* (+ eps_m -1.0) (+ eps_m -1.0))))))))
(- 0.5 (/ -0.5 eps_m)))
(* (exp (* x (- -1.0 eps_m))) (+ -0.5 (/ 0.5 eps_m))))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (eps_m <= 0.29) {
tmp = (x + 1.0) * exp((0.0 - x));
} else {
tmp = ((1.0 + (x * (-1.0 + (eps_m + (x * (0.5 * ((eps_m + -1.0) * (eps_m + -1.0)))))))) * (0.5 - (-0.5 / eps_m))) - (exp((x * (-1.0 - eps_m))) * (-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) :: tmp
if (eps_m <= 0.29d0) then
tmp = (x + 1.0d0) * exp((0.0d0 - x))
else
tmp = ((1.0d0 + (x * ((-1.0d0) + (eps_m + (x * (0.5d0 * ((eps_m + (-1.0d0)) * (eps_m + (-1.0d0))))))))) * (0.5d0 - ((-0.5d0) / eps_m))) - (exp((x * ((-1.0d0) - eps_m))) * ((-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 tmp;
if (eps_m <= 0.29) {
tmp = (x + 1.0) * Math.exp((0.0 - x));
} else {
tmp = ((1.0 + (x * (-1.0 + (eps_m + (x * (0.5 * ((eps_m + -1.0) * (eps_m + -1.0)))))))) * (0.5 - (-0.5 / eps_m))) - (Math.exp((x * (-1.0 - eps_m))) * (-0.5 + (0.5 / eps_m)));
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if eps_m <= 0.29: tmp = (x + 1.0) * math.exp((0.0 - x)) else: tmp = ((1.0 + (x * (-1.0 + (eps_m + (x * (0.5 * ((eps_m + -1.0) * (eps_m + -1.0)))))))) * (0.5 - (-0.5 / eps_m))) - (math.exp((x * (-1.0 - eps_m))) * (-0.5 + (0.5 / eps_m))) return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (eps_m <= 0.29) tmp = Float64(Float64(x + 1.0) * exp(Float64(0.0 - x))); else tmp = Float64(Float64(Float64(1.0 + Float64(x * Float64(-1.0 + Float64(eps_m + Float64(x * Float64(0.5 * Float64(Float64(eps_m + -1.0) * Float64(eps_m + -1.0)))))))) * Float64(0.5 - Float64(-0.5 / eps_m))) - Float64(exp(Float64(x * Float64(-1.0 - eps_m))) * Float64(-0.5 + Float64(0.5 / eps_m)))); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (eps_m <= 0.29) tmp = (x + 1.0) * exp((0.0 - x)); else tmp = ((1.0 + (x * (-1.0 + (eps_m + (x * (0.5 * ((eps_m + -1.0) * (eps_m + -1.0)))))))) * (0.5 - (-0.5 / eps_m))) - (exp((x * (-1.0 - eps_m))) * (-0.5 + (0.5 / eps_m))); end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[eps$95$m, 0.29], N[(N[(x + 1.0), $MachinePrecision] * N[Exp[N[(0.0 - x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + N[(x * N[(-1.0 + N[(eps$95$m + N[(x * N[(0.5 * N[(N[(eps$95$m + -1.0), $MachinePrecision] * N[(eps$95$m + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.5 - N[(-0.5 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Exp[N[(x * N[(-1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-0.5 + N[(0.5 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;eps\_m \leq 0.29:\\
\;\;\;\;\left(x + 1\right) \cdot e^{0 - x}\\
\mathbf{else}:\\
\;\;\;\;\left(1 + x \cdot \left(-1 + \left(eps\_m + x \cdot \left(0.5 \cdot \left(\left(eps\_m + -1\right) \cdot \left(eps\_m + -1\right)\right)\right)\right)\right)\right) \cdot \left(0.5 - \frac{-0.5}{eps\_m}\right) - e^{x \cdot \left(-1 - eps\_m\right)} \cdot \left(-0.5 + \frac{0.5}{eps\_m}\right)\\
\end{array}
\end{array}
if eps < 0.28999999999999998Initial program 65.6%
Simplified65.6%
Taylor expanded in eps around 0
distribute-lft-outN/A
distribute-lft-outN/A
distribute-rgt-out--N/A
metadata-evalN/A
*-rgt-identityN/A
distribute-rgt1-inN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
mul-1-negN/A
neg-sub0N/A
--lowering--.f6468.7%
Simplified68.7%
if 0.28999999999999998 < eps Initial program 99.9%
Simplified99.9%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6486.6%
Simplified86.6%
Final simplification73.6%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(let* ((t_0 (+ -0.5 (/ 0.5 eps_m))) (t_1 (+ 0.5 (/ 0.5 eps_m))))
(if (<= eps_m 0.29)
(* (+ x 1.0) (exp (- 0.0 x)))
(+
1.0
(*
x
(+
(* (+ eps_m -1.0) t_1)
(+
(*
(* 0.5 x)
(+
(* (* (+ eps_m -1.0) (+ eps_m -1.0)) t_1)
(* (+ eps_m 1.0) (* (- -1.0 eps_m) t_0))))
(* t_0 (+ eps_m 1.0)))))))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double t_0 = -0.5 + (0.5 / eps_m);
double t_1 = 0.5 + (0.5 / eps_m);
double tmp;
if (eps_m <= 0.29) {
tmp = (x + 1.0) * exp((0.0 - x));
} else {
tmp = 1.0 + (x * (((eps_m + -1.0) * t_1) + (((0.5 * x) * ((((eps_m + -1.0) * (eps_m + -1.0)) * t_1) + ((eps_m + 1.0) * ((-1.0 - eps_m) * t_0)))) + (t_0 * (eps_m + 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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (-0.5d0) + (0.5d0 / eps_m)
t_1 = 0.5d0 + (0.5d0 / eps_m)
if (eps_m <= 0.29d0) then
tmp = (x + 1.0d0) * exp((0.0d0 - x))
else
tmp = 1.0d0 + (x * (((eps_m + (-1.0d0)) * t_1) + (((0.5d0 * x) * ((((eps_m + (-1.0d0)) * (eps_m + (-1.0d0))) * t_1) + ((eps_m + 1.0d0) * (((-1.0d0) - eps_m) * t_0)))) + (t_0 * (eps_m + 1.0d0)))))
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double t_0 = -0.5 + (0.5 / eps_m);
double t_1 = 0.5 + (0.5 / eps_m);
double tmp;
if (eps_m <= 0.29) {
tmp = (x + 1.0) * Math.exp((0.0 - x));
} else {
tmp = 1.0 + (x * (((eps_m + -1.0) * t_1) + (((0.5 * x) * ((((eps_m + -1.0) * (eps_m + -1.0)) * t_1) + ((eps_m + 1.0) * ((-1.0 - eps_m) * t_0)))) + (t_0 * (eps_m + 1.0)))));
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): t_0 = -0.5 + (0.5 / eps_m) t_1 = 0.5 + (0.5 / eps_m) tmp = 0 if eps_m <= 0.29: tmp = (x + 1.0) * math.exp((0.0 - x)) else: tmp = 1.0 + (x * (((eps_m + -1.0) * t_1) + (((0.5 * x) * ((((eps_m + -1.0) * (eps_m + -1.0)) * t_1) + ((eps_m + 1.0) * ((-1.0 - eps_m) * t_0)))) + (t_0 * (eps_m + 1.0))))) return tmp
eps_m = abs(eps) function code(x, eps_m) t_0 = Float64(-0.5 + Float64(0.5 / eps_m)) t_1 = Float64(0.5 + Float64(0.5 / eps_m)) tmp = 0.0 if (eps_m <= 0.29) tmp = Float64(Float64(x + 1.0) * exp(Float64(0.0 - x))); else tmp = Float64(1.0 + Float64(x * Float64(Float64(Float64(eps_m + -1.0) * t_1) + Float64(Float64(Float64(0.5 * x) * Float64(Float64(Float64(Float64(eps_m + -1.0) * Float64(eps_m + -1.0)) * t_1) + Float64(Float64(eps_m + 1.0) * Float64(Float64(-1.0 - eps_m) * t_0)))) + Float64(t_0 * Float64(eps_m + 1.0)))))); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) t_0 = -0.5 + (0.5 / eps_m); t_1 = 0.5 + (0.5 / eps_m); tmp = 0.0; if (eps_m <= 0.29) tmp = (x + 1.0) * exp((0.0 - x)); else tmp = 1.0 + (x * (((eps_m + -1.0) * t_1) + (((0.5 * x) * ((((eps_m + -1.0) * (eps_m + -1.0)) * t_1) + ((eps_m + 1.0) * ((-1.0 - eps_m) * t_0)))) + (t_0 * (eps_m + 1.0))))); end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision]
code[x_, eps$95$m_] := Block[{t$95$0 = N[(-0.5 + N[(0.5 / eps$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.5 + N[(0.5 / eps$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[eps$95$m, 0.29], N[(N[(x + 1.0), $MachinePrecision] * N[Exp[N[(0.0 - x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x * N[(N[(N[(eps$95$m + -1.0), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(N[(N[(0.5 * x), $MachinePrecision] * N[(N[(N[(N[(eps$95$m + -1.0), $MachinePrecision] * N[(eps$95$m + -1.0), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(N[(eps$95$m + 1.0), $MachinePrecision] * N[(N[(-1.0 - eps$95$m), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(eps$95$m + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
t_0 := -0.5 + \frac{0.5}{eps\_m}\\
t_1 := 0.5 + \frac{0.5}{eps\_m}\\
\mathbf{if}\;eps\_m \leq 0.29:\\
\;\;\;\;\left(x + 1\right) \cdot e^{0 - x}\\
\mathbf{else}:\\
\;\;\;\;1 + x \cdot \left(\left(eps\_m + -1\right) \cdot t\_1 + \left(\left(0.5 \cdot x\right) \cdot \left(\left(\left(eps\_m + -1\right) \cdot \left(eps\_m + -1\right)\right) \cdot t\_1 + \left(eps\_m + 1\right) \cdot \left(\left(-1 - eps\_m\right) \cdot t\_0\right)\right) + t\_0 \cdot \left(eps\_m + 1\right)\right)\right)\\
\end{array}
\end{array}
if eps < 0.28999999999999998Initial program 65.6%
Simplified65.6%
Taylor expanded in eps around 0
distribute-lft-outN/A
distribute-lft-outN/A
distribute-rgt-out--N/A
metadata-evalN/A
*-rgt-identityN/A
distribute-rgt1-inN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
mul-1-negN/A
neg-sub0N/A
--lowering--.f6468.7%
Simplified68.7%
if 0.28999999999999998 < eps Initial program 99.9%
Simplified99.9%
Taylor expanded in x around 0
Simplified78.4%
Final simplification71.4%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(let* ((t_0 (+ 0.5 (/ 0.5 eps_m))) (t_1 (+ -0.5 (/ 0.5 eps_m))))
(if (<= eps_m 0.29)
(exp (- 0.0 x))
(+
1.0
(*
x
(+
(* (+ eps_m -1.0) t_0)
(+
(*
(* 0.5 x)
(+
(* (* (+ eps_m -1.0) (+ eps_m -1.0)) t_0)
(* (+ eps_m 1.0) (* (- -1.0 eps_m) t_1))))
(* t_1 (+ eps_m 1.0)))))))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double t_0 = 0.5 + (0.5 / eps_m);
double t_1 = -0.5 + (0.5 / eps_m);
double tmp;
if (eps_m <= 0.29) {
tmp = exp((0.0 - x));
} else {
tmp = 1.0 + (x * (((eps_m + -1.0) * t_0) + (((0.5 * x) * ((((eps_m + -1.0) * (eps_m + -1.0)) * t_0) + ((eps_m + 1.0) * ((-1.0 - eps_m) * t_1)))) + (t_1 * (eps_m + 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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = 0.5d0 + (0.5d0 / eps_m)
t_1 = (-0.5d0) + (0.5d0 / eps_m)
if (eps_m <= 0.29d0) then
tmp = exp((0.0d0 - x))
else
tmp = 1.0d0 + (x * (((eps_m + (-1.0d0)) * t_0) + (((0.5d0 * x) * ((((eps_m + (-1.0d0)) * (eps_m + (-1.0d0))) * t_0) + ((eps_m + 1.0d0) * (((-1.0d0) - eps_m) * t_1)))) + (t_1 * (eps_m + 1.0d0)))))
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double t_0 = 0.5 + (0.5 / eps_m);
double t_1 = -0.5 + (0.5 / eps_m);
double tmp;
if (eps_m <= 0.29) {
tmp = Math.exp((0.0 - x));
} else {
tmp = 1.0 + (x * (((eps_m + -1.0) * t_0) + (((0.5 * x) * ((((eps_m + -1.0) * (eps_m + -1.0)) * t_0) + ((eps_m + 1.0) * ((-1.0 - eps_m) * t_1)))) + (t_1 * (eps_m + 1.0)))));
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): t_0 = 0.5 + (0.5 / eps_m) t_1 = -0.5 + (0.5 / eps_m) tmp = 0 if eps_m <= 0.29: tmp = math.exp((0.0 - x)) else: tmp = 1.0 + (x * (((eps_m + -1.0) * t_0) + (((0.5 * x) * ((((eps_m + -1.0) * (eps_m + -1.0)) * t_0) + ((eps_m + 1.0) * ((-1.0 - eps_m) * t_1)))) + (t_1 * (eps_m + 1.0))))) return tmp
eps_m = abs(eps) function code(x, eps_m) t_0 = Float64(0.5 + Float64(0.5 / eps_m)) t_1 = Float64(-0.5 + Float64(0.5 / eps_m)) tmp = 0.0 if (eps_m <= 0.29) tmp = exp(Float64(0.0 - x)); else tmp = Float64(1.0 + Float64(x * Float64(Float64(Float64(eps_m + -1.0) * t_0) + Float64(Float64(Float64(0.5 * x) * Float64(Float64(Float64(Float64(eps_m + -1.0) * Float64(eps_m + -1.0)) * t_0) + Float64(Float64(eps_m + 1.0) * Float64(Float64(-1.0 - eps_m) * t_1)))) + Float64(t_1 * Float64(eps_m + 1.0)))))); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) t_0 = 0.5 + (0.5 / eps_m); t_1 = -0.5 + (0.5 / eps_m); tmp = 0.0; if (eps_m <= 0.29) tmp = exp((0.0 - x)); else tmp = 1.0 + (x * (((eps_m + -1.0) * t_0) + (((0.5 * x) * ((((eps_m + -1.0) * (eps_m + -1.0)) * t_0) + ((eps_m + 1.0) * ((-1.0 - eps_m) * t_1)))) + (t_1 * (eps_m + 1.0))))); end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision]
code[x_, eps$95$m_] := Block[{t$95$0 = N[(0.5 + N[(0.5 / eps$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-0.5 + N[(0.5 / eps$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[eps$95$m, 0.29], N[Exp[N[(0.0 - x), $MachinePrecision]], $MachinePrecision], N[(1.0 + N[(x * N[(N[(N[(eps$95$m + -1.0), $MachinePrecision] * t$95$0), $MachinePrecision] + N[(N[(N[(0.5 * x), $MachinePrecision] * N[(N[(N[(N[(eps$95$m + -1.0), $MachinePrecision] * N[(eps$95$m + -1.0), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] + N[(N[(eps$95$m + 1.0), $MachinePrecision] * N[(N[(-1.0 - eps$95$m), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * N[(eps$95$m + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
t_0 := 0.5 + \frac{0.5}{eps\_m}\\
t_1 := -0.5 + \frac{0.5}{eps\_m}\\
\mathbf{if}\;eps\_m \leq 0.29:\\
\;\;\;\;e^{0 - x}\\
\mathbf{else}:\\
\;\;\;\;1 + x \cdot \left(\left(eps\_m + -1\right) \cdot t\_0 + \left(\left(0.5 \cdot x\right) \cdot \left(\left(\left(eps\_m + -1\right) \cdot \left(eps\_m + -1\right)\right) \cdot t\_0 + \left(eps\_m + 1\right) \cdot \left(\left(-1 - eps\_m\right) \cdot t\_1\right)\right) + t\_1 \cdot \left(eps\_m + 1\right)\right)\right)\\
\end{array}
\end{array}
if eps < 0.28999999999999998Initial program 65.6%
Simplified65.6%
Taylor expanded in eps around inf
cancel-sign-sub-invN/A
metadata-evalN/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-*r*N/A
exp-lowering-exp.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
distribute-lft-inN/A
metadata-evalN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f6499.0%
Simplified99.0%
Taylor expanded in eps around 0
exp-lowering-exp.f64N/A
mul-1-negN/A
neg-sub0N/A
--lowering--.f6479.0%
Simplified79.0%
if 0.28999999999999998 < eps Initial program 99.9%
Simplified99.9%
Taylor expanded in x around 0
Simplified78.4%
Final simplification78.8%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(let* ((t_0 (+ -0.5 (/ 0.5 eps_m)))
(t_1 (* t_0 (+ eps_m 1.0)))
(t_2 (* (+ eps_m -1.0) (+ eps_m -1.0)))
(t_3 (+ 0.5 (/ 0.5 eps_m))))
(if (<= x -7.5e-126)
(+
1.0
(*
x
(+
(* (+ eps_m -1.0) t_3)
(+
t_1
(*
x
(+
(*
x
(*
0.16666666666666666
(+
(* t_2 (/ -0.5 eps_m))
(* t_1 (* (+ eps_m 1.0) (+ eps_m 1.0))))))
(*
0.5
(+ (* t_2 t_3) (* (+ eps_m 1.0) (* (- -1.0 eps_m) t_0))))))))))
(if (<= x 8.2e-135)
(+
1.0
(* x (* eps_m (* eps_m (* x (+ 0.5 (* x -0.3333333333333333)))))))
(if (<= x 600.0)
(+
1.0
(*
x
(+
(+ -0.5 (* 0.5 eps_m))
(*
x
(+
(* 0.08333333333333333 (* x (* (+ eps_m -1.0) t_2)))
(* (+ eps_m -1.0) (* (+ eps_m -1.0) 0.25)))))))
(* (* x (* eps_m eps_m)) (* x 0.25)))))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double t_0 = -0.5 + (0.5 / eps_m);
double t_1 = t_0 * (eps_m + 1.0);
double t_2 = (eps_m + -1.0) * (eps_m + -1.0);
double t_3 = 0.5 + (0.5 / eps_m);
double tmp;
if (x <= -7.5e-126) {
tmp = 1.0 + (x * (((eps_m + -1.0) * t_3) + (t_1 + (x * ((x * (0.16666666666666666 * ((t_2 * (-0.5 / eps_m)) + (t_1 * ((eps_m + 1.0) * (eps_m + 1.0)))))) + (0.5 * ((t_2 * t_3) + ((eps_m + 1.0) * ((-1.0 - eps_m) * t_0)))))))));
} else if (x <= 8.2e-135) {
tmp = 1.0 + (x * (eps_m * (eps_m * (x * (0.5 + (x * -0.3333333333333333))))));
} else if (x <= 600.0) {
tmp = 1.0 + (x * ((-0.5 + (0.5 * eps_m)) + (x * ((0.08333333333333333 * (x * ((eps_m + -1.0) * t_2))) + ((eps_m + -1.0) * ((eps_m + -1.0) * 0.25))))));
} else {
tmp = (x * (eps_m * eps_m)) * (x * 0.25);
}
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) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = (-0.5d0) + (0.5d0 / eps_m)
t_1 = t_0 * (eps_m + 1.0d0)
t_2 = (eps_m + (-1.0d0)) * (eps_m + (-1.0d0))
t_3 = 0.5d0 + (0.5d0 / eps_m)
if (x <= (-7.5d-126)) then
tmp = 1.0d0 + (x * (((eps_m + (-1.0d0)) * t_3) + (t_1 + (x * ((x * (0.16666666666666666d0 * ((t_2 * ((-0.5d0) / eps_m)) + (t_1 * ((eps_m + 1.0d0) * (eps_m + 1.0d0)))))) + (0.5d0 * ((t_2 * t_3) + ((eps_m + 1.0d0) * (((-1.0d0) - eps_m) * t_0)))))))))
else if (x <= 8.2d-135) then
tmp = 1.0d0 + (x * (eps_m * (eps_m * (x * (0.5d0 + (x * (-0.3333333333333333d0)))))))
else if (x <= 600.0d0) then
tmp = 1.0d0 + (x * (((-0.5d0) + (0.5d0 * eps_m)) + (x * ((0.08333333333333333d0 * (x * ((eps_m + (-1.0d0)) * t_2))) + ((eps_m + (-1.0d0)) * ((eps_m + (-1.0d0)) * 0.25d0))))))
else
tmp = (x * (eps_m * eps_m)) * (x * 0.25d0)
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double t_0 = -0.5 + (0.5 / eps_m);
double t_1 = t_0 * (eps_m + 1.0);
double t_2 = (eps_m + -1.0) * (eps_m + -1.0);
double t_3 = 0.5 + (0.5 / eps_m);
double tmp;
if (x <= -7.5e-126) {
tmp = 1.0 + (x * (((eps_m + -1.0) * t_3) + (t_1 + (x * ((x * (0.16666666666666666 * ((t_2 * (-0.5 / eps_m)) + (t_1 * ((eps_m + 1.0) * (eps_m + 1.0)))))) + (0.5 * ((t_2 * t_3) + ((eps_m + 1.0) * ((-1.0 - eps_m) * t_0)))))))));
} else if (x <= 8.2e-135) {
tmp = 1.0 + (x * (eps_m * (eps_m * (x * (0.5 + (x * -0.3333333333333333))))));
} else if (x <= 600.0) {
tmp = 1.0 + (x * ((-0.5 + (0.5 * eps_m)) + (x * ((0.08333333333333333 * (x * ((eps_m + -1.0) * t_2))) + ((eps_m + -1.0) * ((eps_m + -1.0) * 0.25))))));
} else {
tmp = (x * (eps_m * eps_m)) * (x * 0.25);
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): t_0 = -0.5 + (0.5 / eps_m) t_1 = t_0 * (eps_m + 1.0) t_2 = (eps_m + -1.0) * (eps_m + -1.0) t_3 = 0.5 + (0.5 / eps_m) tmp = 0 if x <= -7.5e-126: tmp = 1.0 + (x * (((eps_m + -1.0) * t_3) + (t_1 + (x * ((x * (0.16666666666666666 * ((t_2 * (-0.5 / eps_m)) + (t_1 * ((eps_m + 1.0) * (eps_m + 1.0)))))) + (0.5 * ((t_2 * t_3) + ((eps_m + 1.0) * ((-1.0 - eps_m) * t_0))))))))) elif x <= 8.2e-135: tmp = 1.0 + (x * (eps_m * (eps_m * (x * (0.5 + (x * -0.3333333333333333)))))) elif x <= 600.0: tmp = 1.0 + (x * ((-0.5 + (0.5 * eps_m)) + (x * ((0.08333333333333333 * (x * ((eps_m + -1.0) * t_2))) + ((eps_m + -1.0) * ((eps_m + -1.0) * 0.25)))))) else: tmp = (x * (eps_m * eps_m)) * (x * 0.25) return tmp
eps_m = abs(eps) function code(x, eps_m) t_0 = Float64(-0.5 + Float64(0.5 / eps_m)) t_1 = Float64(t_0 * Float64(eps_m + 1.0)) t_2 = Float64(Float64(eps_m + -1.0) * Float64(eps_m + -1.0)) t_3 = Float64(0.5 + Float64(0.5 / eps_m)) tmp = 0.0 if (x <= -7.5e-126) tmp = Float64(1.0 + Float64(x * Float64(Float64(Float64(eps_m + -1.0) * t_3) + Float64(t_1 + Float64(x * Float64(Float64(x * Float64(0.16666666666666666 * Float64(Float64(t_2 * Float64(-0.5 / eps_m)) + Float64(t_1 * Float64(Float64(eps_m + 1.0) * Float64(eps_m + 1.0)))))) + Float64(0.5 * Float64(Float64(t_2 * t_3) + Float64(Float64(eps_m + 1.0) * Float64(Float64(-1.0 - eps_m) * t_0)))))))))); elseif (x <= 8.2e-135) tmp = Float64(1.0 + Float64(x * Float64(eps_m * Float64(eps_m * Float64(x * Float64(0.5 + Float64(x * -0.3333333333333333))))))); elseif (x <= 600.0) tmp = Float64(1.0 + Float64(x * Float64(Float64(-0.5 + Float64(0.5 * eps_m)) + Float64(x * Float64(Float64(0.08333333333333333 * Float64(x * Float64(Float64(eps_m + -1.0) * t_2))) + Float64(Float64(eps_m + -1.0) * Float64(Float64(eps_m + -1.0) * 0.25))))))); else tmp = Float64(Float64(x * Float64(eps_m * eps_m)) * Float64(x * 0.25)); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) t_0 = -0.5 + (0.5 / eps_m); t_1 = t_0 * (eps_m + 1.0); t_2 = (eps_m + -1.0) * (eps_m + -1.0); t_3 = 0.5 + (0.5 / eps_m); tmp = 0.0; if (x <= -7.5e-126) tmp = 1.0 + (x * (((eps_m + -1.0) * t_3) + (t_1 + (x * ((x * (0.16666666666666666 * ((t_2 * (-0.5 / eps_m)) + (t_1 * ((eps_m + 1.0) * (eps_m + 1.0)))))) + (0.5 * ((t_2 * t_3) + ((eps_m + 1.0) * ((-1.0 - eps_m) * t_0))))))))); elseif (x <= 8.2e-135) tmp = 1.0 + (x * (eps_m * (eps_m * (x * (0.5 + (x * -0.3333333333333333)))))); elseif (x <= 600.0) tmp = 1.0 + (x * ((-0.5 + (0.5 * eps_m)) + (x * ((0.08333333333333333 * (x * ((eps_m + -1.0) * t_2))) + ((eps_m + -1.0) * ((eps_m + -1.0) * 0.25)))))); else tmp = (x * (eps_m * eps_m)) * (x * 0.25); end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision]
code[x_, eps$95$m_] := Block[{t$95$0 = N[(-0.5 + N[(0.5 / eps$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[(eps$95$m + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(eps$95$m + -1.0), $MachinePrecision] * N[(eps$95$m + -1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(0.5 + N[(0.5 / eps$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -7.5e-126], N[(1.0 + N[(x * N[(N[(N[(eps$95$m + -1.0), $MachinePrecision] * t$95$3), $MachinePrecision] + N[(t$95$1 + N[(x * N[(N[(x * N[(0.16666666666666666 * N[(N[(t$95$2 * N[(-0.5 / eps$95$m), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * N[(N[(eps$95$m + 1.0), $MachinePrecision] * N[(eps$95$m + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(N[(t$95$2 * t$95$3), $MachinePrecision] + N[(N[(eps$95$m + 1.0), $MachinePrecision] * N[(N[(-1.0 - eps$95$m), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 8.2e-135], N[(1.0 + N[(x * N[(eps$95$m * N[(eps$95$m * N[(x * N[(0.5 + N[(x * -0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 600.0], N[(1.0 + N[(x * N[(N[(-0.5 + N[(0.5 * eps$95$m), $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[(0.08333333333333333 * N[(x * N[(N[(eps$95$m + -1.0), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(eps$95$m + -1.0), $MachinePrecision] * N[(N[(eps$95$m + -1.0), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(eps$95$m * eps$95$m), $MachinePrecision]), $MachinePrecision] * N[(x * 0.25), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
t_0 := -0.5 + \frac{0.5}{eps\_m}\\
t_1 := t\_0 \cdot \left(eps\_m + 1\right)\\
t_2 := \left(eps\_m + -1\right) \cdot \left(eps\_m + -1\right)\\
t_3 := 0.5 + \frac{0.5}{eps\_m}\\
\mathbf{if}\;x \leq -7.5 \cdot 10^{-126}:\\
\;\;\;\;1 + x \cdot \left(\left(eps\_m + -1\right) \cdot t\_3 + \left(t\_1 + x \cdot \left(x \cdot \left(0.16666666666666666 \cdot \left(t\_2 \cdot \frac{-0.5}{eps\_m} + t\_1 \cdot \left(\left(eps\_m + 1\right) \cdot \left(eps\_m + 1\right)\right)\right)\right) + 0.5 \cdot \left(t\_2 \cdot t\_3 + \left(eps\_m + 1\right) \cdot \left(\left(-1 - eps\_m\right) \cdot t\_0\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x \leq 8.2 \cdot 10^{-135}:\\
\;\;\;\;1 + x \cdot \left(eps\_m \cdot \left(eps\_m \cdot \left(x \cdot \left(0.5 + x \cdot -0.3333333333333333\right)\right)\right)\right)\\
\mathbf{elif}\;x \leq 600:\\
\;\;\;\;1 + x \cdot \left(\left(-0.5 + 0.5 \cdot eps\_m\right) + x \cdot \left(0.08333333333333333 \cdot \left(x \cdot \left(\left(eps\_m + -1\right) \cdot t\_2\right)\right) + \left(eps\_m + -1\right) \cdot \left(\left(eps\_m + -1\right) \cdot 0.25\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot \left(eps\_m \cdot eps\_m\right)\right) \cdot \left(x \cdot 0.25\right)\\
\end{array}
\end{array}
if x < -7.49999999999999976e-126Initial program 80.6%
Simplified80.6%
Taylor expanded in x around 0
Simplified34.9%
Taylor expanded in eps around 0
/-lowering-/.f6454.9%
Simplified54.9%
if -7.49999999999999976e-126 < x < 8.2000000000000002e-135Initial program 56.9%
Simplified56.9%
Taylor expanded in x around 0
Simplified64.2%
Taylor expanded in eps around inf
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6493.2%
Simplified93.2%
if 8.2000000000000002e-135 < x < 600Initial program 55.7%
Simplified55.7%
Taylor expanded in eps around inf
cancel-sign-sub-invN/A
metadata-evalN/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-*r*N/A
exp-lowering-exp.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
distribute-lft-inN/A
metadata-evalN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f6497.6%
Simplified97.6%
Taylor expanded in x around 0
Simplified82.7%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
Simplified82.2%
if 600 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6453.7%
Simplified53.7%
Taylor expanded in eps around inf
*-commutativeN/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6458.8%
Simplified58.8%
associate-*r*N/A
associate-*l*N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6473.6%
Applied egg-rr73.6%
Final simplification75.9%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<= x -1.55e-128)
(+ 1.0 (* x (* (* eps_m (* eps_m eps_m)) (* (* x x) -0.08333333333333333))))
(if (<= x 8.2e-135)
(+ 1.0 (* x (* eps_m (* eps_m (* x (+ 0.5 (* x -0.3333333333333333)))))))
(if (<= x 14200000000.0)
(+
1.0
(*
x
(+
(+ -0.5 (* 0.5 eps_m))
(*
x
(+
(*
0.08333333333333333
(* x (* (+ eps_m -1.0) (* (+ eps_m -1.0) (+ eps_m -1.0)))))
(* (+ eps_m -1.0) (* (+ eps_m -1.0) 0.25)))))))
(* (* x (* eps_m eps_m)) (* x 0.25))))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= -1.55e-128) {
tmp = 1.0 + (x * ((eps_m * (eps_m * eps_m)) * ((x * x) * -0.08333333333333333)));
} else if (x <= 8.2e-135) {
tmp = 1.0 + (x * (eps_m * (eps_m * (x * (0.5 + (x * -0.3333333333333333))))));
} else if (x <= 14200000000.0) {
tmp = 1.0 + (x * ((-0.5 + (0.5 * eps_m)) + (x * ((0.08333333333333333 * (x * ((eps_m + -1.0) * ((eps_m + -1.0) * (eps_m + -1.0))))) + ((eps_m + -1.0) * ((eps_m + -1.0) * 0.25))))));
} else {
tmp = (x * (eps_m * eps_m)) * (x * 0.25);
}
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.55d-128)) then
tmp = 1.0d0 + (x * ((eps_m * (eps_m * eps_m)) * ((x * x) * (-0.08333333333333333d0))))
else if (x <= 8.2d-135) then
tmp = 1.0d0 + (x * (eps_m * (eps_m * (x * (0.5d0 + (x * (-0.3333333333333333d0)))))))
else if (x <= 14200000000.0d0) then
tmp = 1.0d0 + (x * (((-0.5d0) + (0.5d0 * eps_m)) + (x * ((0.08333333333333333d0 * (x * ((eps_m + (-1.0d0)) * ((eps_m + (-1.0d0)) * (eps_m + (-1.0d0)))))) + ((eps_m + (-1.0d0)) * ((eps_m + (-1.0d0)) * 0.25d0))))))
else
tmp = (x * (eps_m * eps_m)) * (x * 0.25d0)
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.55e-128) {
tmp = 1.0 + (x * ((eps_m * (eps_m * eps_m)) * ((x * x) * -0.08333333333333333)));
} else if (x <= 8.2e-135) {
tmp = 1.0 + (x * (eps_m * (eps_m * (x * (0.5 + (x * -0.3333333333333333))))));
} else if (x <= 14200000000.0) {
tmp = 1.0 + (x * ((-0.5 + (0.5 * eps_m)) + (x * ((0.08333333333333333 * (x * ((eps_m + -1.0) * ((eps_m + -1.0) * (eps_m + -1.0))))) + ((eps_m + -1.0) * ((eps_m + -1.0) * 0.25))))));
} else {
tmp = (x * (eps_m * eps_m)) * (x * 0.25);
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= -1.55e-128: tmp = 1.0 + (x * ((eps_m * (eps_m * eps_m)) * ((x * x) * -0.08333333333333333))) elif x <= 8.2e-135: tmp = 1.0 + (x * (eps_m * (eps_m * (x * (0.5 + (x * -0.3333333333333333)))))) elif x <= 14200000000.0: tmp = 1.0 + (x * ((-0.5 + (0.5 * eps_m)) + (x * ((0.08333333333333333 * (x * ((eps_m + -1.0) * ((eps_m + -1.0) * (eps_m + -1.0))))) + ((eps_m + -1.0) * ((eps_m + -1.0) * 0.25)))))) else: tmp = (x * (eps_m * eps_m)) * (x * 0.25) return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= -1.55e-128) tmp = Float64(1.0 + Float64(x * Float64(Float64(eps_m * Float64(eps_m * eps_m)) * Float64(Float64(x * x) * -0.08333333333333333)))); elseif (x <= 8.2e-135) tmp = Float64(1.0 + Float64(x * Float64(eps_m * Float64(eps_m * Float64(x * Float64(0.5 + Float64(x * -0.3333333333333333))))))); elseif (x <= 14200000000.0) tmp = Float64(1.0 + Float64(x * Float64(Float64(-0.5 + Float64(0.5 * eps_m)) + Float64(x * Float64(Float64(0.08333333333333333 * Float64(x * Float64(Float64(eps_m + -1.0) * Float64(Float64(eps_m + -1.0) * Float64(eps_m + -1.0))))) + Float64(Float64(eps_m + -1.0) * Float64(Float64(eps_m + -1.0) * 0.25))))))); else tmp = Float64(Float64(x * Float64(eps_m * eps_m)) * Float64(x * 0.25)); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (x <= -1.55e-128) tmp = 1.0 + (x * ((eps_m * (eps_m * eps_m)) * ((x * x) * -0.08333333333333333))); elseif (x <= 8.2e-135) tmp = 1.0 + (x * (eps_m * (eps_m * (x * (0.5 + (x * -0.3333333333333333)))))); elseif (x <= 14200000000.0) tmp = 1.0 + (x * ((-0.5 + (0.5 * eps_m)) + (x * ((0.08333333333333333 * (x * ((eps_m + -1.0) * ((eps_m + -1.0) * (eps_m + -1.0))))) + ((eps_m + -1.0) * ((eps_m + -1.0) * 0.25)))))); else tmp = (x * (eps_m * eps_m)) * (x * 0.25); end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, -1.55e-128], N[(1.0 + N[(x * N[(N[(eps$95$m * N[(eps$95$m * eps$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * -0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 8.2e-135], N[(1.0 + N[(x * N[(eps$95$m * N[(eps$95$m * N[(x * N[(0.5 + N[(x * -0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 14200000000.0], N[(1.0 + N[(x * N[(N[(-0.5 + N[(0.5 * eps$95$m), $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[(0.08333333333333333 * N[(x * N[(N[(eps$95$m + -1.0), $MachinePrecision] * N[(N[(eps$95$m + -1.0), $MachinePrecision] * N[(eps$95$m + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(eps$95$m + -1.0), $MachinePrecision] * N[(N[(eps$95$m + -1.0), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(eps$95$m * eps$95$m), $MachinePrecision]), $MachinePrecision] * N[(x * 0.25), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.55 \cdot 10^{-128}:\\
\;\;\;\;1 + x \cdot \left(\left(eps\_m \cdot \left(eps\_m \cdot eps\_m\right)\right) \cdot \left(\left(x \cdot x\right) \cdot -0.08333333333333333\right)\right)\\
\mathbf{elif}\;x \leq 8.2 \cdot 10^{-135}:\\
\;\;\;\;1 + x \cdot \left(eps\_m \cdot \left(eps\_m \cdot \left(x \cdot \left(0.5 + x \cdot -0.3333333333333333\right)\right)\right)\right)\\
\mathbf{elif}\;x \leq 14200000000:\\
\;\;\;\;1 + x \cdot \left(\left(-0.5 + 0.5 \cdot eps\_m\right) + x \cdot \left(0.08333333333333333 \cdot \left(x \cdot \left(\left(eps\_m + -1\right) \cdot \left(\left(eps\_m + -1\right) \cdot \left(eps\_m + -1\right)\right)\right)\right) + \left(eps\_m + -1\right) \cdot \left(\left(eps\_m + -1\right) \cdot 0.25\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot \left(eps\_m \cdot eps\_m\right)\right) \cdot \left(x \cdot 0.25\right)\\
\end{array}
\end{array}
if x < -1.55000000000000001e-128Initial program 80.6%
Simplified80.6%
Taylor expanded in x around 0
+-lowering-+.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f6440.3%
Simplified40.3%
Taylor expanded in x around 0
Simplified38.3%
Taylor expanded in eps around inf
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6454.5%
Simplified54.5%
if -1.55000000000000001e-128 < x < 8.2000000000000002e-135Initial program 56.9%
Simplified56.9%
Taylor expanded in x around 0
Simplified64.2%
Taylor expanded in eps around inf
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6493.2%
Simplified93.2%
if 8.2000000000000002e-135 < x < 1.42e10Initial program 55.7%
Simplified55.7%
Taylor expanded in eps around inf
cancel-sign-sub-invN/A
metadata-evalN/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-*r*N/A
exp-lowering-exp.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
distribute-lft-inN/A
metadata-evalN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f6497.6%
Simplified97.6%
Taylor expanded in x around 0
Simplified82.7%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
Simplified82.2%
if 1.42e10 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6453.7%
Simplified53.7%
Taylor expanded in eps around inf
*-commutativeN/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6458.8%
Simplified58.8%
associate-*r*N/A
associate-*l*N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6473.6%
Applied egg-rr73.6%
Final simplification75.7%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<= x -1.7e-128)
(+ 1.0 (* x (* (* eps_m (* eps_m eps_m)) (* (* x x) -0.08333333333333333))))
(if (<= x 1.5)
(+ 1.0 (* x (* eps_m (* eps_m (* x (+ 0.5 (* x -0.3333333333333333)))))))
(* (* x (* eps_m eps_m)) (* x 0.25)))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= -1.7e-128) {
tmp = 1.0 + (x * ((eps_m * (eps_m * eps_m)) * ((x * x) * -0.08333333333333333)));
} else if (x <= 1.5) {
tmp = 1.0 + (x * (eps_m * (eps_m * (x * (0.5 + (x * -0.3333333333333333))))));
} else {
tmp = (x * (eps_m * eps_m)) * (x * 0.25);
}
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.7d-128)) then
tmp = 1.0d0 + (x * ((eps_m * (eps_m * eps_m)) * ((x * x) * (-0.08333333333333333d0))))
else if (x <= 1.5d0) then
tmp = 1.0d0 + (x * (eps_m * (eps_m * (x * (0.5d0 + (x * (-0.3333333333333333d0)))))))
else
tmp = (x * (eps_m * eps_m)) * (x * 0.25d0)
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.7e-128) {
tmp = 1.0 + (x * ((eps_m * (eps_m * eps_m)) * ((x * x) * -0.08333333333333333)));
} else if (x <= 1.5) {
tmp = 1.0 + (x * (eps_m * (eps_m * (x * (0.5 + (x * -0.3333333333333333))))));
} else {
tmp = (x * (eps_m * eps_m)) * (x * 0.25);
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= -1.7e-128: tmp = 1.0 + (x * ((eps_m * (eps_m * eps_m)) * ((x * x) * -0.08333333333333333))) elif x <= 1.5: tmp = 1.0 + (x * (eps_m * (eps_m * (x * (0.5 + (x * -0.3333333333333333)))))) else: tmp = (x * (eps_m * eps_m)) * (x * 0.25) return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= -1.7e-128) tmp = Float64(1.0 + Float64(x * Float64(Float64(eps_m * Float64(eps_m * eps_m)) * Float64(Float64(x * x) * -0.08333333333333333)))); elseif (x <= 1.5) tmp = Float64(1.0 + Float64(x * Float64(eps_m * Float64(eps_m * Float64(x * Float64(0.5 + Float64(x * -0.3333333333333333))))))); else tmp = Float64(Float64(x * Float64(eps_m * eps_m)) * Float64(x * 0.25)); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (x <= -1.7e-128) tmp = 1.0 + (x * ((eps_m * (eps_m * eps_m)) * ((x * x) * -0.08333333333333333))); elseif (x <= 1.5) tmp = 1.0 + (x * (eps_m * (eps_m * (x * (0.5 + (x * -0.3333333333333333)))))); else tmp = (x * (eps_m * eps_m)) * (x * 0.25); end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, -1.7e-128], N[(1.0 + N[(x * N[(N[(eps$95$m * N[(eps$95$m * eps$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * -0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.5], N[(1.0 + N[(x * N[(eps$95$m * N[(eps$95$m * N[(x * N[(0.5 + N[(x * -0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(eps$95$m * eps$95$m), $MachinePrecision]), $MachinePrecision] * N[(x * 0.25), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.7 \cdot 10^{-128}:\\
\;\;\;\;1 + x \cdot \left(\left(eps\_m \cdot \left(eps\_m \cdot eps\_m\right)\right) \cdot \left(\left(x \cdot x\right) \cdot -0.08333333333333333\right)\right)\\
\mathbf{elif}\;x \leq 1.5:\\
\;\;\;\;1 + x \cdot \left(eps\_m \cdot \left(eps\_m \cdot \left(x \cdot \left(0.5 + x \cdot -0.3333333333333333\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot \left(eps\_m \cdot eps\_m\right)\right) \cdot \left(x \cdot 0.25\right)\\
\end{array}
\end{array}
if x < -1.69999999999999987e-128Initial program 80.6%
Simplified80.6%
Taylor expanded in x around 0
+-lowering-+.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f6440.3%
Simplified40.3%
Taylor expanded in x around 0
Simplified38.3%
Taylor expanded in eps around inf
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6454.5%
Simplified54.5%
if -1.69999999999999987e-128 < x < 1.5Initial program 55.8%
Simplified55.8%
Taylor expanded in x around 0
Simplified64.8%
Taylor expanded in eps around inf
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6490.9%
Simplified90.9%
if 1.5 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6453.7%
Simplified53.7%
Taylor expanded in eps around inf
*-commutativeN/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6458.7%
Simplified58.7%
associate-*r*N/A
associate-*l*N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6473.0%
Applied egg-rr73.0%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<= x -0.00019)
(* -0.3333333333333333 (* eps_m (* x (* x (* x eps_m)))))
(if (<= x 0.0125)
(+ 1.0 (* x (* x (+ -0.5 (* x 0.3333333333333333)))))
(* (* x (* eps_m eps_m)) (* x 0.25)))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= -0.00019) {
tmp = -0.3333333333333333 * (eps_m * (x * (x * (x * eps_m))));
} else if (x <= 0.0125) {
tmp = 1.0 + (x * (x * (-0.5 + (x * 0.3333333333333333))));
} else {
tmp = (x * (eps_m * eps_m)) * (x * 0.25);
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: tmp
if (x <= (-0.00019d0)) then
tmp = (-0.3333333333333333d0) * (eps_m * (x * (x * (x * eps_m))))
else if (x <= 0.0125d0) then
tmp = 1.0d0 + (x * (x * ((-0.5d0) + (x * 0.3333333333333333d0))))
else
tmp = (x * (eps_m * eps_m)) * (x * 0.25d0)
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (x <= -0.00019) {
tmp = -0.3333333333333333 * (eps_m * (x * (x * (x * eps_m))));
} else if (x <= 0.0125) {
tmp = 1.0 + (x * (x * (-0.5 + (x * 0.3333333333333333))));
} else {
tmp = (x * (eps_m * eps_m)) * (x * 0.25);
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= -0.00019: tmp = -0.3333333333333333 * (eps_m * (x * (x * (x * eps_m)))) elif x <= 0.0125: tmp = 1.0 + (x * (x * (-0.5 + (x * 0.3333333333333333)))) else: tmp = (x * (eps_m * eps_m)) * (x * 0.25) return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= -0.00019) tmp = Float64(-0.3333333333333333 * Float64(eps_m * Float64(x * Float64(x * Float64(x * eps_m))))); elseif (x <= 0.0125) tmp = Float64(1.0 + Float64(x * Float64(x * Float64(-0.5 + Float64(x * 0.3333333333333333))))); else tmp = Float64(Float64(x * Float64(eps_m * eps_m)) * Float64(x * 0.25)); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (x <= -0.00019) tmp = -0.3333333333333333 * (eps_m * (x * (x * (x * eps_m)))); elseif (x <= 0.0125) tmp = 1.0 + (x * (x * (-0.5 + (x * 0.3333333333333333)))); else tmp = (x * (eps_m * eps_m)) * (x * 0.25); end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, -0.00019], N[(-0.3333333333333333 * N[(eps$95$m * N[(x * N[(x * N[(x * eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 0.0125], N[(1.0 + N[(x * N[(x * N[(-0.5 + N[(x * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(eps$95$m * eps$95$m), $MachinePrecision]), $MachinePrecision] * N[(x * 0.25), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.00019:\\
\;\;\;\;-0.3333333333333333 \cdot \left(eps\_m \cdot \left(x \cdot \left(x \cdot \left(x \cdot eps\_m\right)\right)\right)\right)\\
\mathbf{elif}\;x \leq 0.0125:\\
\;\;\;\;1 + x \cdot \left(x \cdot \left(-0.5 + x \cdot 0.3333333333333333\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot \left(eps\_m \cdot eps\_m\right)\right) \cdot \left(x \cdot 0.25\right)\\
\end{array}
\end{array}
if x < -1.9000000000000001e-4Initial program 97.6%
Simplified97.6%
Taylor expanded in x around 0
Simplified19.9%
Taylor expanded in eps around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6490.9%
Simplified90.9%
Taylor expanded in x around inf
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
cube-multN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6490.9%
Simplified90.9%
if -1.9000000000000001e-4 < x < 0.012500000000000001Initial program 55.9%
Simplified55.9%
Taylor expanded in x around 0
Simplified63.1%
Taylor expanded in eps around 0
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6476.3%
Simplified76.3%
if 0.012500000000000001 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6453.7%
Simplified53.7%
Taylor expanded in eps around inf
*-commutativeN/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6458.7%
Simplified58.7%
associate-*r*N/A
associate-*l*N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6473.0%
Applied egg-rr73.0%
Final simplification77.7%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= x 1.5) (+ 1.0 (* x (* eps_m (* eps_m (* x (+ 0.5 (* x -0.3333333333333333))))))) (* (* x (* eps_m eps_m)) (* x 0.25))))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= 1.5) {
tmp = 1.0 + (x * (eps_m * (eps_m * (x * (0.5 + (x * -0.3333333333333333))))));
} else {
tmp = (x * (eps_m * eps_m)) * (x * 0.25);
}
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.5d0) then
tmp = 1.0d0 + (x * (eps_m * (eps_m * (x * (0.5d0 + (x * (-0.3333333333333333d0)))))))
else
tmp = (x * (eps_m * eps_m)) * (x * 0.25d0)
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.5) {
tmp = 1.0 + (x * (eps_m * (eps_m * (x * (0.5 + (x * -0.3333333333333333))))));
} else {
tmp = (x * (eps_m * eps_m)) * (x * 0.25);
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= 1.5: tmp = 1.0 + (x * (eps_m * (eps_m * (x * (0.5 + (x * -0.3333333333333333)))))) else: tmp = (x * (eps_m * eps_m)) * (x * 0.25) return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= 1.5) tmp = Float64(1.0 + Float64(x * Float64(eps_m * Float64(eps_m * Float64(x * Float64(0.5 + Float64(x * -0.3333333333333333))))))); else tmp = Float64(Float64(x * Float64(eps_m * eps_m)) * Float64(x * 0.25)); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (x <= 1.5) tmp = 1.0 + (x * (eps_m * (eps_m * (x * (0.5 + (x * -0.3333333333333333)))))); else tmp = (x * (eps_m * eps_m)) * (x * 0.25); end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, 1.5], N[(1.0 + N[(x * N[(eps$95$m * N[(eps$95$m * N[(x * N[(0.5 + N[(x * -0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(eps$95$m * eps$95$m), $MachinePrecision]), $MachinePrecision] * N[(x * 0.25), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.5:\\
\;\;\;\;1 + x \cdot \left(eps\_m \cdot \left(eps\_m \cdot \left(x \cdot \left(0.5 + x \cdot -0.3333333333333333\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot \left(eps\_m \cdot eps\_m\right)\right) \cdot \left(x \cdot 0.25\right)\\
\end{array}
\end{array}
if x < 1.5Initial program 65.2%
Simplified65.2%
Taylor expanded in x around 0
Simplified53.5%
Taylor expanded in eps around inf
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6487.7%
Simplified87.7%
if 1.5 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6453.7%
Simplified53.7%
Taylor expanded in eps around inf
*-commutativeN/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6458.7%
Simplified58.7%
associate-*r*N/A
associate-*l*N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6473.0%
Applied egg-rr73.0%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= x -5.8e-5) (* -0.3333333333333333 (* eps_m (* x (* x (* x eps_m))))) (if (<= x 8.8e-7) 1.0 (* (* x (* eps_m eps_m)) (* x 0.25)))))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= -5.8e-5) {
tmp = -0.3333333333333333 * (eps_m * (x * (x * (x * eps_m))));
} else if (x <= 8.8e-7) {
tmp = 1.0;
} else {
tmp = (x * (eps_m * eps_m)) * (x * 0.25);
}
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 <= (-5.8d-5)) then
tmp = (-0.3333333333333333d0) * (eps_m * (x * (x * (x * eps_m))))
else if (x <= 8.8d-7) then
tmp = 1.0d0
else
tmp = (x * (eps_m * eps_m)) * (x * 0.25d0)
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (x <= -5.8e-5) {
tmp = -0.3333333333333333 * (eps_m * (x * (x * (x * eps_m))));
} else if (x <= 8.8e-7) {
tmp = 1.0;
} else {
tmp = (x * (eps_m * eps_m)) * (x * 0.25);
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= -5.8e-5: tmp = -0.3333333333333333 * (eps_m * (x * (x * (x * eps_m)))) elif x <= 8.8e-7: tmp = 1.0 else: tmp = (x * (eps_m * eps_m)) * (x * 0.25) return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= -5.8e-5) tmp = Float64(-0.3333333333333333 * Float64(eps_m * Float64(x * Float64(x * Float64(x * eps_m))))); elseif (x <= 8.8e-7) tmp = 1.0; else tmp = Float64(Float64(x * Float64(eps_m * eps_m)) * Float64(x * 0.25)); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (x <= -5.8e-5) tmp = -0.3333333333333333 * (eps_m * (x * (x * (x * eps_m)))); elseif (x <= 8.8e-7) tmp = 1.0; else tmp = (x * (eps_m * eps_m)) * (x * 0.25); end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, -5.8e-5], N[(-0.3333333333333333 * N[(eps$95$m * N[(x * N[(x * N[(x * eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 8.8e-7], 1.0, N[(N[(x * N[(eps$95$m * eps$95$m), $MachinePrecision]), $MachinePrecision] * N[(x * 0.25), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.8 \cdot 10^{-5}:\\
\;\;\;\;-0.3333333333333333 \cdot \left(eps\_m \cdot \left(x \cdot \left(x \cdot \left(x \cdot eps\_m\right)\right)\right)\right)\\
\mathbf{elif}\;x \leq 8.8 \cdot 10^{-7}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot \left(eps\_m \cdot eps\_m\right)\right) \cdot \left(x \cdot 0.25\right)\\
\end{array}
\end{array}
if x < -5.8e-5Initial program 97.6%
Simplified97.6%
Taylor expanded in x around 0
Simplified19.9%
Taylor expanded in eps around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6490.9%
Simplified90.9%
Taylor expanded in x around inf
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
cube-multN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6490.9%
Simplified90.9%
if -5.8e-5 < x < 8.8000000000000004e-7Initial program 55.9%
Simplified55.9%
Taylor expanded in x around 0
Simplified76.3%
if 8.8000000000000004e-7 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6453.7%
Simplified53.7%
Taylor expanded in eps around inf
*-commutativeN/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6458.7%
Simplified58.7%
associate-*r*N/A
associate-*l*N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6473.0%
Applied egg-rr73.0%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= x -1e-5) (* eps_m (* eps_m (* 0.25 (* x x)))) (if (<= x 5.2e-7) 1.0 (* (* x (* eps_m eps_m)) (* x 0.25)))))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= -1e-5) {
tmp = eps_m * (eps_m * (0.25 * (x * x)));
} else if (x <= 5.2e-7) {
tmp = 1.0;
} else {
tmp = (x * (eps_m * eps_m)) * (x * 0.25);
}
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-5)) then
tmp = eps_m * (eps_m * (0.25d0 * (x * x)))
else if (x <= 5.2d-7) then
tmp = 1.0d0
else
tmp = (x * (eps_m * eps_m)) * (x * 0.25d0)
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-5) {
tmp = eps_m * (eps_m * (0.25 * (x * x)));
} else if (x <= 5.2e-7) {
tmp = 1.0;
} else {
tmp = (x * (eps_m * eps_m)) * (x * 0.25);
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= -1e-5: tmp = eps_m * (eps_m * (0.25 * (x * x))) elif x <= 5.2e-7: tmp = 1.0 else: tmp = (x * (eps_m * eps_m)) * (x * 0.25) return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= -1e-5) tmp = Float64(eps_m * Float64(eps_m * Float64(0.25 * Float64(x * x)))); elseif (x <= 5.2e-7) tmp = 1.0; else tmp = Float64(Float64(x * Float64(eps_m * eps_m)) * Float64(x * 0.25)); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (x <= -1e-5) tmp = eps_m * (eps_m * (0.25 * (x * x))); elseif (x <= 5.2e-7) tmp = 1.0; else tmp = (x * (eps_m * eps_m)) * (x * 0.25); end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, -1e-5], N[(eps$95$m * N[(eps$95$m * N[(0.25 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5.2e-7], 1.0, N[(N[(x * N[(eps$95$m * eps$95$m), $MachinePrecision]), $MachinePrecision] * N[(x * 0.25), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1 \cdot 10^{-5}:\\
\;\;\;\;eps\_m \cdot \left(eps\_m \cdot \left(0.25 \cdot \left(x \cdot x\right)\right)\right)\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{-7}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot \left(eps\_m \cdot eps\_m\right)\right) \cdot \left(x \cdot 0.25\right)\\
\end{array}
\end{array}
if x < -1.00000000000000008e-5Initial program 97.6%
Simplified97.6%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6495.4%
Simplified95.4%
Taylor expanded in eps around inf
*-commutativeN/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6490.8%
Simplified90.8%
if -1.00000000000000008e-5 < x < 5.19999999999999998e-7Initial program 55.9%
Simplified55.9%
Taylor expanded in x around 0
Simplified76.3%
if 5.19999999999999998e-7 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6453.7%
Simplified53.7%
Taylor expanded in eps around inf
*-commutativeN/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6458.7%
Simplified58.7%
associate-*r*N/A
associate-*l*N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6473.0%
Applied egg-rr73.0%
Final simplification77.7%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (let* ((t_0 (* eps_m (* eps_m (* 0.25 (* x x)))))) (if (<= x -0.00047) t_0 (if (<= x 0.0035) 1.0 t_0))))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double t_0 = eps_m * (eps_m * (0.25 * (x * x)));
double tmp;
if (x <= -0.00047) {
tmp = t_0;
} else if (x <= 0.0035) {
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 * (0.25d0 * (x * x)))
if (x <= (-0.00047d0)) then
tmp = t_0
else if (x <= 0.0035d0) 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 * (0.25 * (x * x)));
double tmp;
if (x <= -0.00047) {
tmp = t_0;
} else if (x <= 0.0035) {
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 * (0.25 * (x * x))) tmp = 0 if x <= -0.00047: tmp = t_0 elif x <= 0.0035: tmp = 1.0 else: tmp = t_0 return tmp
eps_m = abs(eps) function code(x, eps_m) t_0 = Float64(eps_m * Float64(eps_m * Float64(0.25 * Float64(x * x)))) tmp = 0.0 if (x <= -0.00047) tmp = t_0; elseif (x <= 0.0035) 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 * (0.25 * (x * x))); tmp = 0.0; if (x <= -0.00047) tmp = t_0; elseif (x <= 0.0035) 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[(eps$95$m * N[(eps$95$m * N[(0.25 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -0.00047], t$95$0, If[LessEqual[x, 0.0035], 1.0, t$95$0]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
t_0 := eps\_m \cdot \left(eps\_m \cdot \left(0.25 \cdot \left(x \cdot x\right)\right)\right)\\
\mathbf{if}\;x \leq -0.00047:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 0.0035:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -4.69999999999999986e-4 or 0.00350000000000000007 < x Initial program 99.1%
Simplified99.1%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6468.8%
Simplified68.8%
Taylor expanded in eps around inf
*-commutativeN/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6470.3%
Simplified70.3%
if -4.69999999999999986e-4 < x < 0.00350000000000000007Initial program 55.9%
Simplified55.9%
Taylor expanded in x around 0
Simplified76.3%
Final simplification73.7%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= x 225.0) (+ 1.0 (* (* eps_m eps_m) (* x (* 0.5 x)))) (* (* x (* eps_m eps_m)) (* x 0.25))))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= 225.0) {
tmp = 1.0 + ((eps_m * eps_m) * (x * (0.5 * x)));
} else {
tmp = (x * (eps_m * eps_m)) * (x * 0.25);
}
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 <= 225.0d0) then
tmp = 1.0d0 + ((eps_m * eps_m) * (x * (0.5d0 * x)))
else
tmp = (x * (eps_m * eps_m)) * (x * 0.25d0)
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (x <= 225.0) {
tmp = 1.0 + ((eps_m * eps_m) * (x * (0.5 * x)));
} else {
tmp = (x * (eps_m * eps_m)) * (x * 0.25);
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= 225.0: tmp = 1.0 + ((eps_m * eps_m) * (x * (0.5 * x))) else: tmp = (x * (eps_m * eps_m)) * (x * 0.25) return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= 225.0) tmp = Float64(1.0 + Float64(Float64(eps_m * eps_m) * Float64(x * Float64(0.5 * x)))); else tmp = Float64(Float64(x * Float64(eps_m * eps_m)) * Float64(x * 0.25)); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (x <= 225.0) tmp = 1.0 + ((eps_m * eps_m) * (x * (0.5 * x))); else tmp = (x * (eps_m * eps_m)) * (x * 0.25); end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, 225.0], N[(1.0 + N[(N[(eps$95$m * eps$95$m), $MachinePrecision] * N[(x * N[(0.5 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(eps$95$m * eps$95$m), $MachinePrecision]), $MachinePrecision] * N[(x * 0.25), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq 225:\\
\;\;\;\;1 + \left(eps\_m \cdot eps\_m\right) \cdot \left(x \cdot \left(0.5 \cdot x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot \left(eps\_m \cdot eps\_m\right)\right) \cdot \left(x \cdot 0.25\right)\\
\end{array}
\end{array}
if x < 225Initial program 65.6%
Simplified65.6%
Taylor expanded in x around 0
Simplified52.9%
Taylor expanded in eps around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6484.3%
Simplified84.3%
Taylor expanded in x around 0
*-lowering-*.f6484.8%
Simplified84.8%
if 225 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6453.7%
Simplified53.7%
Taylor expanded in eps around inf
*-commutativeN/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6458.8%
Simplified58.8%
associate-*r*N/A
associate-*l*N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6473.6%
Applied egg-rr73.6%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (+ 1.0 (* x (* 0.5 eps_m))))
eps_m = fabs(eps);
double code(double x, double eps_m) {
return 1.0 + (x * (0.5 * eps_m));
}
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 + (x * (0.5d0 * eps_m))
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
return 1.0 + (x * (0.5 * eps_m));
}
eps_m = math.fabs(eps) def code(x, eps_m): return 1.0 + (x * (0.5 * eps_m))
eps_m = abs(eps) function code(x, eps_m) return Float64(1.0 + Float64(x * Float64(0.5 * eps_m))) end
eps_m = abs(eps); function tmp = code(x, eps_m) tmp = 1.0 + (x * (0.5 * eps_m)); end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := N[(1.0 + N[(x * N[(0.5 * eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
1 + x \cdot \left(0.5 \cdot eps\_m\right)
\end{array}
Initial program 75.0%
Simplified75.0%
Taylor expanded in eps around inf
cancel-sign-sub-invN/A
metadata-evalN/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-*r*N/A
exp-lowering-exp.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
distribute-lft-inN/A
metadata-evalN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f6499.2%
Simplified99.2%
Taylor expanded in x around 0
Simplified65.6%
Taylor expanded in eps around inf
*-commutativeN/A
*-lowering-*.f6465.9%
Simplified65.9%
Taylor expanded in x around 0
associate-*r*N/A
*-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6451.5%
Simplified51.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 75.0%
Simplified75.0%
Taylor expanded in x around 0
Simplified44.0%
herbie shell --seed 2024158
(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))