
(FPCore (x eps) :precision binary64 (- (pow (+ x eps) 5.0) (pow x 5.0)))
double code(double x, double eps) {
return pow((x + eps), 5.0) - pow(x, 5.0);
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
code = ((x + eps) ** 5.0d0) - (x ** 5.0d0)
end function
public static double code(double x, double eps) {
return Math.pow((x + eps), 5.0) - Math.pow(x, 5.0);
}
def code(x, eps): return math.pow((x + eps), 5.0) - math.pow(x, 5.0)
function code(x, eps) return Float64((Float64(x + eps) ^ 5.0) - (x ^ 5.0)) end
function tmp = code(x, eps) tmp = ((x + eps) ^ 5.0) - (x ^ 5.0); end
code[x_, eps_] := N[(N[Power[N[(x + eps), $MachinePrecision], 5.0], $MachinePrecision] - N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(x + \varepsilon\right)}^{5} - {x}^{5}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x eps) :precision binary64 (- (pow (+ x eps) 5.0) (pow x 5.0)))
double code(double x, double eps) {
return pow((x + eps), 5.0) - pow(x, 5.0);
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
code = ((x + eps) ** 5.0d0) - (x ** 5.0d0)
end function
public static double code(double x, double eps) {
return Math.pow((x + eps), 5.0) - Math.pow(x, 5.0);
}
def code(x, eps): return math.pow((x + eps), 5.0) - math.pow(x, 5.0)
function code(x, eps) return Float64((Float64(x + eps) ^ 5.0) - (x ^ 5.0)) end
function tmp = code(x, eps) tmp = ((x + eps) ^ 5.0) - (x ^ 5.0); end
code[x_, eps_] := N[(N[Power[N[(x + eps), $MachinePrecision], 5.0], $MachinePrecision] - N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(x + \varepsilon\right)}^{5} - {x}^{5}
\end{array}
(FPCore (x eps)
:precision binary64
(if (<= x -3.1e-48)
(*
eps
(*
x
(fma
eps
(* eps (fma 5.0 eps (* x 10.0)))
(* x (* x (fma 5.0 x (* eps 10.0)))))))
(if (<= x 4.5e-51)
(- (pow (+ x eps) 5.0) (pow x 5.0))
(*
eps
(fma
eps
(fma eps (fma eps (* x 5.0) (* 10.0 (* x x))) (* 10.0 (* x (* x x))))
(* 5.0 (pow x 4.0)))))))
double code(double x, double eps) {
double tmp;
if (x <= -3.1e-48) {
tmp = eps * (x * fma(eps, (eps * fma(5.0, eps, (x * 10.0))), (x * (x * fma(5.0, x, (eps * 10.0))))));
} else if (x <= 4.5e-51) {
tmp = pow((x + eps), 5.0) - pow(x, 5.0);
} else {
tmp = eps * fma(eps, fma(eps, fma(eps, (x * 5.0), (10.0 * (x * x))), (10.0 * (x * (x * x)))), (5.0 * pow(x, 4.0)));
}
return tmp;
}
function code(x, eps) tmp = 0.0 if (x <= -3.1e-48) tmp = Float64(eps * Float64(x * fma(eps, Float64(eps * fma(5.0, eps, Float64(x * 10.0))), Float64(x * Float64(x * fma(5.0, x, Float64(eps * 10.0))))))); elseif (x <= 4.5e-51) tmp = Float64((Float64(x + eps) ^ 5.0) - (x ^ 5.0)); else tmp = Float64(eps * fma(eps, fma(eps, fma(eps, Float64(x * 5.0), Float64(10.0 * Float64(x * x))), Float64(10.0 * Float64(x * Float64(x * x)))), Float64(5.0 * (x ^ 4.0)))); end return tmp end
code[x_, eps_] := If[LessEqual[x, -3.1e-48], N[(eps * N[(x * N[(eps * N[(eps * N[(5.0 * eps + N[(x * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * N[(x * N[(5.0 * x + N[(eps * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.5e-51], N[(N[Power[N[(x + eps), $MachinePrecision], 5.0], $MachinePrecision] - N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision], N[(eps * N[(eps * N[(eps * N[(eps * N[(x * 5.0), $MachinePrecision] + N[(10.0 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(10.0 * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(5.0 * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.1 \cdot 10^{-48}:\\
\;\;\;\;\varepsilon \cdot \left(x \cdot \mathsf{fma}\left(\varepsilon, \varepsilon \cdot \mathsf{fma}\left(5, \varepsilon, x \cdot 10\right), x \cdot \left(x \cdot \mathsf{fma}\left(5, x, \varepsilon \cdot 10\right)\right)\right)\right)\\
\mathbf{elif}\;x \leq 4.5 \cdot 10^{-51}:\\
\;\;\;\;{\left(x + \varepsilon\right)}^{5} - {x}^{5}\\
\mathbf{else}:\\
\;\;\;\;\varepsilon \cdot \mathsf{fma}\left(\varepsilon, \mathsf{fma}\left(\varepsilon, \mathsf{fma}\left(\varepsilon, x \cdot 5, 10 \cdot \left(x \cdot x\right)\right), 10 \cdot \left(x \cdot \left(x \cdot x\right)\right)\right), 5 \cdot {x}^{4}\right)\\
\end{array}
\end{array}
if x < -3.10000000000000016e-48Initial program 27.0%
Taylor expanded in eps around 0
Simplified96.9%
Taylor expanded in x around 0
*-lowering-*.f64N/A
distribute-rgt-inN/A
associate-*r*N/A
associate-+r+N/A
*-commutativeN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-rgt-identityN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified96.9%
Taylor expanded in x around 0
distribute-rgt-inN/A
associate-*r*N/A
associate-+r+N/A
cube-multN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-lft-inN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified96.9%
if -3.10000000000000016e-48 < x < 4.49999999999999974e-51Initial program 99.6%
if 4.49999999999999974e-51 < x Initial program 34.9%
Taylor expanded in eps around 0
Simplified99.7%
Final simplification99.4%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (* x (* x x))))
(if (<= x -4e-49)
(*
eps
(*
x
(fma
eps
(* eps (fma 5.0 eps (* x 10.0)))
(* x (* x (fma 5.0 x (* eps 10.0)))))))
(if (<= x 1.85e-51)
(- (pow (+ x eps) 5.0) (* (* x x) t_0))
(*
eps
(fma
eps
(fma eps (fma eps (* x 5.0) (* 10.0 (* x x))) (* 10.0 t_0))
(* 5.0 (pow x 4.0))))))))
double code(double x, double eps) {
double t_0 = x * (x * x);
double tmp;
if (x <= -4e-49) {
tmp = eps * (x * fma(eps, (eps * fma(5.0, eps, (x * 10.0))), (x * (x * fma(5.0, x, (eps * 10.0))))));
} else if (x <= 1.85e-51) {
tmp = pow((x + eps), 5.0) - ((x * x) * t_0);
} else {
tmp = eps * fma(eps, fma(eps, fma(eps, (x * 5.0), (10.0 * (x * x))), (10.0 * t_0)), (5.0 * pow(x, 4.0)));
}
return tmp;
}
function code(x, eps) t_0 = Float64(x * Float64(x * x)) tmp = 0.0 if (x <= -4e-49) tmp = Float64(eps * Float64(x * fma(eps, Float64(eps * fma(5.0, eps, Float64(x * 10.0))), Float64(x * Float64(x * fma(5.0, x, Float64(eps * 10.0))))))); elseif (x <= 1.85e-51) tmp = Float64((Float64(x + eps) ^ 5.0) - Float64(Float64(x * x) * t_0)); else tmp = Float64(eps * fma(eps, fma(eps, fma(eps, Float64(x * 5.0), Float64(10.0 * Float64(x * x))), Float64(10.0 * t_0)), Float64(5.0 * (x ^ 4.0)))); end return tmp end
code[x_, eps_] := Block[{t$95$0 = N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4e-49], N[(eps * N[(x * N[(eps * N[(eps * N[(5.0 * eps + N[(x * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * N[(x * N[(5.0 * x + N[(eps * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.85e-51], N[(N[Power[N[(x + eps), $MachinePrecision], 5.0], $MachinePrecision] - N[(N[(x * x), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], N[(eps * N[(eps * N[(eps * N[(eps * N[(x * 5.0), $MachinePrecision] + N[(10.0 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(10.0 * t$95$0), $MachinePrecision]), $MachinePrecision] + N[(5.0 * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(x \cdot x\right)\\
\mathbf{if}\;x \leq -4 \cdot 10^{-49}:\\
\;\;\;\;\varepsilon \cdot \left(x \cdot \mathsf{fma}\left(\varepsilon, \varepsilon \cdot \mathsf{fma}\left(5, \varepsilon, x \cdot 10\right), x \cdot \left(x \cdot \mathsf{fma}\left(5, x, \varepsilon \cdot 10\right)\right)\right)\right)\\
\mathbf{elif}\;x \leq 1.85 \cdot 10^{-51}:\\
\;\;\;\;{\left(x + \varepsilon\right)}^{5} - \left(x \cdot x\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\varepsilon \cdot \mathsf{fma}\left(\varepsilon, \mathsf{fma}\left(\varepsilon, \mathsf{fma}\left(\varepsilon, x \cdot 5, 10 \cdot \left(x \cdot x\right)\right), 10 \cdot t\_0\right), 5 \cdot {x}^{4}\right)\\
\end{array}
\end{array}
if x < -3.99999999999999975e-49Initial program 27.0%
Taylor expanded in eps around 0
Simplified96.9%
Taylor expanded in x around 0
*-lowering-*.f64N/A
distribute-rgt-inN/A
associate-*r*N/A
associate-+r+N/A
*-commutativeN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-rgt-identityN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified96.9%
Taylor expanded in x around 0
distribute-rgt-inN/A
associate-*r*N/A
associate-+r+N/A
cube-multN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-lft-inN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified96.9%
if -3.99999999999999975e-49 < x < 1.84999999999999987e-51Initial program 99.6%
--lowering--.f64N/A
pow-lowering-pow.f64N/A
+-lowering-+.f64N/A
metadata-evalN/A
pow-prod-upN/A
pow2N/A
*-lowering-*.f64N/A
cube-multN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6499.6
Applied egg-rr99.6%
if 1.84999999999999987e-51 < x Initial program 34.9%
Taylor expanded in eps around 0
Simplified99.7%
Final simplification99.3%
(FPCore (x eps)
:precision binary64
(let* ((t_0
(*
eps
(*
x
(fma
eps
(* eps (fma 5.0 eps (* x 10.0)))
(* x (* x (fma 5.0 x (* eps 10.0)))))))))
(if (<= x -1.12e-48)
t_0
(if (<= x 1.85e-51)
(- (pow (+ x eps) 5.0) (* (* x x) (* x (* x x))))
t_0))))
double code(double x, double eps) {
double t_0 = eps * (x * fma(eps, (eps * fma(5.0, eps, (x * 10.0))), (x * (x * fma(5.0, x, (eps * 10.0))))));
double tmp;
if (x <= -1.12e-48) {
tmp = t_0;
} else if (x <= 1.85e-51) {
tmp = pow((x + eps), 5.0) - ((x * x) * (x * (x * x)));
} else {
tmp = t_0;
}
return tmp;
}
function code(x, eps) t_0 = Float64(eps * Float64(x * fma(eps, Float64(eps * fma(5.0, eps, Float64(x * 10.0))), Float64(x * Float64(x * fma(5.0, x, Float64(eps * 10.0))))))) tmp = 0.0 if (x <= -1.12e-48) tmp = t_0; elseif (x <= 1.85e-51) tmp = Float64((Float64(x + eps) ^ 5.0) - Float64(Float64(x * x) * Float64(x * Float64(x * x)))); else tmp = t_0; end return tmp end
code[x_, eps_] := Block[{t$95$0 = N[(eps * N[(x * N[(eps * N[(eps * N[(5.0 * eps + N[(x * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * N[(x * N[(5.0 * x + N[(eps * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.12e-48], t$95$0, If[LessEqual[x, 1.85e-51], N[(N[Power[N[(x + eps), $MachinePrecision], 5.0], $MachinePrecision] - N[(N[(x * x), $MachinePrecision] * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \varepsilon \cdot \left(x \cdot \mathsf{fma}\left(\varepsilon, \varepsilon \cdot \mathsf{fma}\left(5, \varepsilon, x \cdot 10\right), x \cdot \left(x \cdot \mathsf{fma}\left(5, x, \varepsilon \cdot 10\right)\right)\right)\right)\\
\mathbf{if}\;x \leq -1.12 \cdot 10^{-48}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.85 \cdot 10^{-51}:\\
\;\;\;\;{\left(x + \varepsilon\right)}^{5} - \left(x \cdot x\right) \cdot \left(x \cdot \left(x \cdot x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.11999999999999999e-48 or 1.84999999999999987e-51 < x Initial program 31.9%
Taylor expanded in eps around 0
Simplified98.7%
Taylor expanded in x around 0
*-lowering-*.f64N/A
distribute-rgt-inN/A
associate-*r*N/A
associate-+r+N/A
*-commutativeN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-rgt-identityN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified98.4%
Taylor expanded in x around 0
distribute-rgt-inN/A
associate-*r*N/A
associate-+r+N/A
cube-multN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-lft-inN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified98.5%
if -1.11999999999999999e-48 < x < 1.84999999999999987e-51Initial program 99.6%
--lowering--.f64N/A
pow-lowering-pow.f64N/A
+-lowering-+.f64N/A
metadata-evalN/A
pow-prod-upN/A
pow2N/A
*-lowering-*.f64N/A
cube-multN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6499.6
Applied egg-rr99.6%
Final simplification99.3%
(FPCore (x eps)
:precision binary64
(let* ((t_0
(*
eps
(*
x
(fma
eps
(* eps (fma 5.0 eps (* x 10.0)))
(* x (* x (fma 5.0 x (* eps 10.0))))))))
(t_1 (* eps (* eps eps))))
(if (<= x -2.5e-48)
t_0
(if (<= x 2e-51)
(* x (fma 10.0 (* x t_1) (/ (* (fma x 5.0 eps) (* eps t_1)) x)))
t_0))))
double code(double x, double eps) {
double t_0 = eps * (x * fma(eps, (eps * fma(5.0, eps, (x * 10.0))), (x * (x * fma(5.0, x, (eps * 10.0))))));
double t_1 = eps * (eps * eps);
double tmp;
if (x <= -2.5e-48) {
tmp = t_0;
} else if (x <= 2e-51) {
tmp = x * fma(10.0, (x * t_1), ((fma(x, 5.0, eps) * (eps * t_1)) / x));
} else {
tmp = t_0;
}
return tmp;
}
function code(x, eps) t_0 = Float64(eps * Float64(x * fma(eps, Float64(eps * fma(5.0, eps, Float64(x * 10.0))), Float64(x * Float64(x * fma(5.0, x, Float64(eps * 10.0))))))) t_1 = Float64(eps * Float64(eps * eps)) tmp = 0.0 if (x <= -2.5e-48) tmp = t_0; elseif (x <= 2e-51) tmp = Float64(x * fma(10.0, Float64(x * t_1), Float64(Float64(fma(x, 5.0, eps) * Float64(eps * t_1)) / x))); else tmp = t_0; end return tmp end
code[x_, eps_] := Block[{t$95$0 = N[(eps * N[(x * N[(eps * N[(eps * N[(5.0 * eps + N[(x * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * N[(x * N[(5.0 * x + N[(eps * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(eps * N[(eps * eps), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.5e-48], t$95$0, If[LessEqual[x, 2e-51], N[(x * N[(10.0 * N[(x * t$95$1), $MachinePrecision] + N[(N[(N[(x * 5.0 + eps), $MachinePrecision] * N[(eps * t$95$1), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \varepsilon \cdot \left(x \cdot \mathsf{fma}\left(\varepsilon, \varepsilon \cdot \mathsf{fma}\left(5, \varepsilon, x \cdot 10\right), x \cdot \left(x \cdot \mathsf{fma}\left(5, x, \varepsilon \cdot 10\right)\right)\right)\right)\\
t_1 := \varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\\
\mathbf{if}\;x \leq -2.5 \cdot 10^{-48}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 2 \cdot 10^{-51}:\\
\;\;\;\;x \cdot \mathsf{fma}\left(10, x \cdot t\_1, \frac{\mathsf{fma}\left(x, 5, \varepsilon\right) \cdot \left(\varepsilon \cdot t\_1\right)}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -2.4999999999999999e-48 or 2e-51 < x Initial program 31.9%
Taylor expanded in eps around 0
Simplified98.7%
Taylor expanded in x around 0
*-lowering-*.f64N/A
distribute-rgt-inN/A
associate-*r*N/A
associate-+r+N/A
*-commutativeN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-rgt-identityN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified98.4%
Taylor expanded in x around 0
distribute-rgt-inN/A
associate-*r*N/A
associate-+r+N/A
cube-multN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-lft-inN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified98.5%
if -2.4999999999999999e-48 < x < 2e-51Initial program 99.6%
Taylor expanded in eps around -inf
associate-*r*N/A
*-commutativeN/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
distribute-lft1-inN/A
associate-*l*N/A
Simplified96.0%
Taylor expanded in x around -inf
Simplified99.4%
Final simplification99.2%
(FPCore (x eps)
:precision binary64
(let* ((t_0
(*
eps
(*
x
(fma
eps
(* eps (fma 5.0 eps (* x 10.0)))
(* x (* x (fma 5.0 x (* eps 10.0)))))))))
(if (<= x -4e-49)
t_0
(if (<= x 2.25e-51)
(* (* eps eps) (* eps (fma x (fma 10.0 x (* eps 5.0)) (* eps eps))))
t_0))))
double code(double x, double eps) {
double t_0 = eps * (x * fma(eps, (eps * fma(5.0, eps, (x * 10.0))), (x * (x * fma(5.0, x, (eps * 10.0))))));
double tmp;
if (x <= -4e-49) {
tmp = t_0;
} else if (x <= 2.25e-51) {
tmp = (eps * eps) * (eps * fma(x, fma(10.0, x, (eps * 5.0)), (eps * eps)));
} else {
tmp = t_0;
}
return tmp;
}
function code(x, eps) t_0 = Float64(eps * Float64(x * fma(eps, Float64(eps * fma(5.0, eps, Float64(x * 10.0))), Float64(x * Float64(x * fma(5.0, x, Float64(eps * 10.0))))))) tmp = 0.0 if (x <= -4e-49) tmp = t_0; elseif (x <= 2.25e-51) tmp = Float64(Float64(eps * eps) * Float64(eps * fma(x, fma(10.0, x, Float64(eps * 5.0)), Float64(eps * eps)))); else tmp = t_0; end return tmp end
code[x_, eps_] := Block[{t$95$0 = N[(eps * N[(x * N[(eps * N[(eps * N[(5.0 * eps + N[(x * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * N[(x * N[(5.0 * x + N[(eps * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4e-49], t$95$0, If[LessEqual[x, 2.25e-51], N[(N[(eps * eps), $MachinePrecision] * N[(eps * N[(x * N[(10.0 * x + N[(eps * 5.0), $MachinePrecision]), $MachinePrecision] + N[(eps * eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \varepsilon \cdot \left(x \cdot \mathsf{fma}\left(\varepsilon, \varepsilon \cdot \mathsf{fma}\left(5, \varepsilon, x \cdot 10\right), x \cdot \left(x \cdot \mathsf{fma}\left(5, x, \varepsilon \cdot 10\right)\right)\right)\right)\\
\mathbf{if}\;x \leq -4 \cdot 10^{-49}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 2.25 \cdot 10^{-51}:\\
\;\;\;\;\left(\varepsilon \cdot \varepsilon\right) \cdot \left(\varepsilon \cdot \mathsf{fma}\left(x, \mathsf{fma}\left(10, x, \varepsilon \cdot 5\right), \varepsilon \cdot \varepsilon\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -3.99999999999999975e-49 or 2.24999999999999987e-51 < x Initial program 31.9%
Taylor expanded in eps around 0
Simplified98.7%
Taylor expanded in x around 0
*-lowering-*.f64N/A
distribute-rgt-inN/A
associate-*r*N/A
associate-+r+N/A
*-commutativeN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-rgt-identityN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified98.4%
Taylor expanded in x around 0
distribute-rgt-inN/A
associate-*r*N/A
associate-+r+N/A
cube-multN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-lft-inN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified98.5%
if -3.99999999999999975e-49 < x < 2.24999999999999987e-51Initial program 99.6%
Taylor expanded in eps around -inf
associate-*r*N/A
*-commutativeN/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
distribute-lft1-inN/A
associate-*l*N/A
Simplified96.0%
Taylor expanded in x around 0
Simplified99.4%
Final simplification99.2%
(FPCore (x eps)
:precision binary64
(let* ((t_0
(*
eps
(*
x
(fma
eps
(* x (* eps 10.0))
(* x (* x (fma 5.0 x (* eps 10.0)))))))))
(if (<= x -2e-47)
t_0
(if (<= x 4.4e-57)
(* (* eps (* eps eps)) (fma eps eps (* x (fma 5.0 eps (* x 10.0)))))
t_0))))
double code(double x, double eps) {
double t_0 = eps * (x * fma(eps, (x * (eps * 10.0)), (x * (x * fma(5.0, x, (eps * 10.0))))));
double tmp;
if (x <= -2e-47) {
tmp = t_0;
} else if (x <= 4.4e-57) {
tmp = (eps * (eps * eps)) * fma(eps, eps, (x * fma(5.0, eps, (x * 10.0))));
} else {
tmp = t_0;
}
return tmp;
}
function code(x, eps) t_0 = Float64(eps * Float64(x * fma(eps, Float64(x * Float64(eps * 10.0)), Float64(x * Float64(x * fma(5.0, x, Float64(eps * 10.0))))))) tmp = 0.0 if (x <= -2e-47) tmp = t_0; elseif (x <= 4.4e-57) tmp = Float64(Float64(eps * Float64(eps * eps)) * fma(eps, eps, Float64(x * fma(5.0, eps, Float64(x * 10.0))))); else tmp = t_0; end return tmp end
code[x_, eps_] := Block[{t$95$0 = N[(eps * N[(x * N[(eps * N[(x * N[(eps * 10.0), $MachinePrecision]), $MachinePrecision] + N[(x * N[(x * N[(5.0 * x + N[(eps * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2e-47], t$95$0, If[LessEqual[x, 4.4e-57], N[(N[(eps * N[(eps * eps), $MachinePrecision]), $MachinePrecision] * N[(eps * eps + N[(x * N[(5.0 * eps + N[(x * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \varepsilon \cdot \left(x \cdot \mathsf{fma}\left(\varepsilon, x \cdot \left(\varepsilon \cdot 10\right), x \cdot \left(x \cdot \mathsf{fma}\left(5, x, \varepsilon \cdot 10\right)\right)\right)\right)\\
\mathbf{if}\;x \leq -2 \cdot 10^{-47}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 4.4 \cdot 10^{-57}:\\
\;\;\;\;\left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right) \cdot \mathsf{fma}\left(\varepsilon, \varepsilon, x \cdot \mathsf{fma}\left(5, \varepsilon, x \cdot 10\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.9999999999999999e-47 or 4.39999999999999997e-57 < x Initial program 33.9%
Taylor expanded in eps around 0
Simplified97.2%
Taylor expanded in x around 0
*-lowering-*.f64N/A
distribute-rgt-inN/A
associate-*r*N/A
associate-+r+N/A
*-commutativeN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-rgt-identityN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified97.0%
Taylor expanded in x around 0
distribute-rgt-inN/A
associate-*r*N/A
associate-+r+N/A
cube-multN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-lft-inN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified97.1%
Taylor expanded in eps around 0
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6496.7
Simplified96.7%
if -1.9999999999999999e-47 < x < 4.39999999999999997e-57Initial program 100.0%
Taylor expanded in eps around -inf
associate-*r*N/A
*-commutativeN/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
distribute-lft1-inN/A
associate-*l*N/A
Simplified96.4%
Taylor expanded in x around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-+r+N/A
+-commutativeN/A
metadata-evalN/A
pow-plusN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
Simplified44.2%
Taylor expanded in x around 0
Simplified99.9%
Final simplification99.1%
(FPCore (x eps)
:precision binary64
(if (<= x -1.7e-48)
(* eps (fma (* x (* x (* x x))) 5.0 (* eps (* x (* x (* x 10.0))))))
(if (<= x 9e-58)
(* (* eps (* eps eps)) (fma eps eps (* x (fma 5.0 eps (* x 10.0)))))
(* eps (* (* x x) (fma 10.0 (* eps (+ x eps)) (* 5.0 (* x x))))))))
double code(double x, double eps) {
double tmp;
if (x <= -1.7e-48) {
tmp = eps * fma((x * (x * (x * x))), 5.0, (eps * (x * (x * (x * 10.0)))));
} else if (x <= 9e-58) {
tmp = (eps * (eps * eps)) * fma(eps, eps, (x * fma(5.0, eps, (x * 10.0))));
} else {
tmp = eps * ((x * x) * fma(10.0, (eps * (x + eps)), (5.0 * (x * x))));
}
return tmp;
}
function code(x, eps) tmp = 0.0 if (x <= -1.7e-48) tmp = Float64(eps * fma(Float64(x * Float64(x * Float64(x * x))), 5.0, Float64(eps * Float64(x * Float64(x * Float64(x * 10.0)))))); elseif (x <= 9e-58) tmp = Float64(Float64(eps * Float64(eps * eps)) * fma(eps, eps, Float64(x * fma(5.0, eps, Float64(x * 10.0))))); else tmp = Float64(eps * Float64(Float64(x * x) * fma(10.0, Float64(eps * Float64(x + eps)), Float64(5.0 * Float64(x * x))))); end return tmp end
code[x_, eps_] := If[LessEqual[x, -1.7e-48], N[(eps * N[(N[(x * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 5.0 + N[(eps * N[(x * N[(x * N[(x * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 9e-58], N[(N[(eps * N[(eps * eps), $MachinePrecision]), $MachinePrecision] * N[(eps * eps + N[(x * N[(5.0 * eps + N[(x * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(eps * N[(N[(x * x), $MachinePrecision] * N[(10.0 * N[(eps * N[(x + eps), $MachinePrecision]), $MachinePrecision] + N[(5.0 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.7 \cdot 10^{-48}:\\
\;\;\;\;\varepsilon \cdot \mathsf{fma}\left(x \cdot \left(x \cdot \left(x \cdot x\right)\right), 5, \varepsilon \cdot \left(x \cdot \left(x \cdot \left(x \cdot 10\right)\right)\right)\right)\\
\mathbf{elif}\;x \leq 9 \cdot 10^{-58}:\\
\;\;\;\;\left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right) \cdot \mathsf{fma}\left(\varepsilon, \varepsilon, x \cdot \mathsf{fma}\left(5, \varepsilon, x \cdot 10\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\varepsilon \cdot \left(\left(x \cdot x\right) \cdot \mathsf{fma}\left(10, \varepsilon \cdot \left(x + \varepsilon\right), 5 \cdot \left(x \cdot x\right)\right)\right)\\
\end{array}
\end{array}
if x < -1.70000000000000014e-48Initial program 27.0%
Taylor expanded in eps around 0
*-lowering-*.f64N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified96.2%
*-commutativeN/A
*-lowering-*.f64N/A
accelerator-lowering-fma.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-sqrN/A
pow2N/A
pow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6496.2
Applied egg-rr96.2%
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6496.3
Applied egg-rr96.3%
if -1.70000000000000014e-48 < x < 9.0000000000000006e-58Initial program 100.0%
Taylor expanded in eps around -inf
associate-*r*N/A
*-commutativeN/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
distribute-lft1-inN/A
associate-*l*N/A
Simplified96.4%
Taylor expanded in x around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-+r+N/A
+-commutativeN/A
metadata-evalN/A
pow-plusN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
Simplified44.2%
Taylor expanded in x around 0
Simplified99.9%
if 9.0000000000000006e-58 < x Initial program 37.8%
Taylor expanded in eps around 0
Simplified97.4%
Taylor expanded in x around 0
*-lowering-*.f64N/A
distribute-rgt-inN/A
associate-*r*N/A
associate-+r+N/A
*-commutativeN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-rgt-identityN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified97.0%
Taylor expanded in eps around 0
Simplified96.8%
Final simplification99.0%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (* eps (* (* x x) (fma 10.0 (* eps (+ x eps)) (* 5.0 (* x x)))))))
(if (<= x -1.95e-47)
t_0
(if (<= x 6e-57)
(* (* eps (* eps eps)) (fma eps eps (* x (fma 5.0 eps (* x 10.0)))))
t_0))))
double code(double x, double eps) {
double t_0 = eps * ((x * x) * fma(10.0, (eps * (x + eps)), (5.0 * (x * x))));
double tmp;
if (x <= -1.95e-47) {
tmp = t_0;
} else if (x <= 6e-57) {
tmp = (eps * (eps * eps)) * fma(eps, eps, (x * fma(5.0, eps, (x * 10.0))));
} else {
tmp = t_0;
}
return tmp;
}
function code(x, eps) t_0 = Float64(eps * Float64(Float64(x * x) * fma(10.0, Float64(eps * Float64(x + eps)), Float64(5.0 * Float64(x * x))))) tmp = 0.0 if (x <= -1.95e-47) tmp = t_0; elseif (x <= 6e-57) tmp = Float64(Float64(eps * Float64(eps * eps)) * fma(eps, eps, Float64(x * fma(5.0, eps, Float64(x * 10.0))))); else tmp = t_0; end return tmp end
code[x_, eps_] := Block[{t$95$0 = N[(eps * N[(N[(x * x), $MachinePrecision] * N[(10.0 * N[(eps * N[(x + eps), $MachinePrecision]), $MachinePrecision] + N[(5.0 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.95e-47], t$95$0, If[LessEqual[x, 6e-57], N[(N[(eps * N[(eps * eps), $MachinePrecision]), $MachinePrecision] * N[(eps * eps + N[(x * N[(5.0 * eps + N[(x * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \varepsilon \cdot \left(\left(x \cdot x\right) \cdot \mathsf{fma}\left(10, \varepsilon \cdot \left(x + \varepsilon\right), 5 \cdot \left(x \cdot x\right)\right)\right)\\
\mathbf{if}\;x \leq -1.95 \cdot 10^{-47}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 6 \cdot 10^{-57}:\\
\;\;\;\;\left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right) \cdot \mathsf{fma}\left(\varepsilon, \varepsilon, x \cdot \mathsf{fma}\left(5, \varepsilon, x \cdot 10\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.94999999999999989e-47 or 6.00000000000000001e-57 < x Initial program 33.9%
Taylor expanded in eps around 0
Simplified97.2%
Taylor expanded in x around 0
*-lowering-*.f64N/A
distribute-rgt-inN/A
associate-*r*N/A
associate-+r+N/A
*-commutativeN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-rgt-identityN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified97.0%
Taylor expanded in eps around 0
Simplified96.6%
if -1.94999999999999989e-47 < x < 6.00000000000000001e-57Initial program 100.0%
Taylor expanded in eps around -inf
associate-*r*N/A
*-commutativeN/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
distribute-lft1-inN/A
associate-*l*N/A
Simplified96.4%
Taylor expanded in x around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-+r+N/A
+-commutativeN/A
metadata-evalN/A
pow-plusN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
Simplified44.2%
Taylor expanded in x around 0
Simplified99.9%
Final simplification99.0%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (* (* x (* x x)) (* eps (fma 5.0 x (* eps 10.0))))))
(if (<= x -1.1e-46)
t_0
(if (<= x 2.05e-51)
(* (* eps eps) (* eps (fma x (fma 10.0 x (* eps 5.0)) (* eps eps))))
t_0))))
double code(double x, double eps) {
double t_0 = (x * (x * x)) * (eps * fma(5.0, x, (eps * 10.0)));
double tmp;
if (x <= -1.1e-46) {
tmp = t_0;
} else if (x <= 2.05e-51) {
tmp = (eps * eps) * (eps * fma(x, fma(10.0, x, (eps * 5.0)), (eps * eps)));
} else {
tmp = t_0;
}
return tmp;
}
function code(x, eps) t_0 = Float64(Float64(x * Float64(x * x)) * Float64(eps * fma(5.0, x, Float64(eps * 10.0)))) tmp = 0.0 if (x <= -1.1e-46) tmp = t_0; elseif (x <= 2.05e-51) tmp = Float64(Float64(eps * eps) * Float64(eps * fma(x, fma(10.0, x, Float64(eps * 5.0)), Float64(eps * eps)))); else tmp = t_0; end return tmp end
code[x_, eps_] := Block[{t$95$0 = N[(N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision] * N[(eps * N[(5.0 * x + N[(eps * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.1e-46], t$95$0, If[LessEqual[x, 2.05e-51], N[(N[(eps * eps), $MachinePrecision] * N[(eps * N[(x * N[(10.0 * x + N[(eps * 5.0), $MachinePrecision]), $MachinePrecision] + N[(eps * eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(x \cdot \left(x \cdot x\right)\right) \cdot \left(\varepsilon \cdot \mathsf{fma}\left(5, x, \varepsilon \cdot 10\right)\right)\\
\mathbf{if}\;x \leq -1.1 \cdot 10^{-46}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 2.05 \cdot 10^{-51}:\\
\;\;\;\;\left(\varepsilon \cdot \varepsilon\right) \cdot \left(\varepsilon \cdot \mathsf{fma}\left(x, \mathsf{fma}\left(10, x, \varepsilon \cdot 5\right), \varepsilon \cdot \varepsilon\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.1e-46 or 2.04999999999999987e-51 < x Initial program 31.9%
Taylor expanded in eps around 0
*-lowering-*.f64N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified97.7%
*-commutativeN/A
*-lowering-*.f64N/A
accelerator-lowering-fma.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-sqrN/A
pow2N/A
pow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6497.7
Applied egg-rr97.7%
Taylor expanded in x around 0
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
distribute-lft-outN/A
*-lowering-*.f64N/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f6497.6
Simplified97.6%
if -1.1e-46 < x < 2.04999999999999987e-51Initial program 99.6%
Taylor expanded in eps around -inf
associate-*r*N/A
*-commutativeN/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
distribute-lft1-inN/A
associate-*l*N/A
Simplified96.0%
Taylor expanded in x around 0
Simplified99.4%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (* (* x (* x x)) (* eps (fma 5.0 x (* eps 10.0))))))
(if (<= x -1.4e-46)
t_0
(if (<= x 2.5e-50) (* (fma x 5.0 eps) (* eps (* eps (* eps eps)))) t_0))))
double code(double x, double eps) {
double t_0 = (x * (x * x)) * (eps * fma(5.0, x, (eps * 10.0)));
double tmp;
if (x <= -1.4e-46) {
tmp = t_0;
} else if (x <= 2.5e-50) {
tmp = fma(x, 5.0, eps) * (eps * (eps * (eps * eps)));
} else {
tmp = t_0;
}
return tmp;
}
function code(x, eps) t_0 = Float64(Float64(x * Float64(x * x)) * Float64(eps * fma(5.0, x, Float64(eps * 10.0)))) tmp = 0.0 if (x <= -1.4e-46) tmp = t_0; elseif (x <= 2.5e-50) tmp = Float64(fma(x, 5.0, eps) * Float64(eps * Float64(eps * Float64(eps * eps)))); else tmp = t_0; end return tmp end
code[x_, eps_] := Block[{t$95$0 = N[(N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision] * N[(eps * N[(5.0 * x + N[(eps * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.4e-46], t$95$0, If[LessEqual[x, 2.5e-50], N[(N[(x * 5.0 + eps), $MachinePrecision] * N[(eps * N[(eps * N[(eps * eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(x \cdot \left(x \cdot x\right)\right) \cdot \left(\varepsilon \cdot \mathsf{fma}\left(5, x, \varepsilon \cdot 10\right)\right)\\
\mathbf{if}\;x \leq -1.4 \cdot 10^{-46}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 2.5 \cdot 10^{-50}:\\
\;\;\;\;\mathsf{fma}\left(x, 5, \varepsilon\right) \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.3999999999999999e-46 or 2.49999999999999984e-50 < x Initial program 31.9%
Taylor expanded in eps around 0
*-lowering-*.f64N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified97.7%
*-commutativeN/A
*-lowering-*.f64N/A
accelerator-lowering-fma.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-sqrN/A
pow2N/A
pow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6497.7
Applied egg-rr97.7%
Taylor expanded in x around 0
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
distribute-lft-outN/A
*-lowering-*.f64N/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f6497.6
Simplified97.6%
if -1.3999999999999999e-46 < x < 2.49999999999999984e-50Initial program 99.6%
Taylor expanded in eps around inf
*-lowering-*.f64N/A
pow-lowering-pow.f64N/A
+-commutativeN/A
distribute-lft1-inN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6499.4
Simplified99.4%
Taylor expanded in eps around 0
*-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
metadata-evalN/A
pow-plusN/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6499.3
Simplified99.3%
Final simplification98.9%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (* x (* x (* x x)))))
(if (<= x -1.25e-48)
(* 5.0 (* eps t_0))
(if (<= x 2.6e-50)
(* (fma x 5.0 eps) (* eps (* eps (* eps eps))))
(* eps (* 5.0 t_0))))))
double code(double x, double eps) {
double t_0 = x * (x * (x * x));
double tmp;
if (x <= -1.25e-48) {
tmp = 5.0 * (eps * t_0);
} else if (x <= 2.6e-50) {
tmp = fma(x, 5.0, eps) * (eps * (eps * (eps * eps)));
} else {
tmp = eps * (5.0 * t_0);
}
return tmp;
}
function code(x, eps) t_0 = Float64(x * Float64(x * Float64(x * x))) tmp = 0.0 if (x <= -1.25e-48) tmp = Float64(5.0 * Float64(eps * t_0)); elseif (x <= 2.6e-50) tmp = Float64(fma(x, 5.0, eps) * Float64(eps * Float64(eps * Float64(eps * eps)))); else tmp = Float64(eps * Float64(5.0 * t_0)); end return tmp end
code[x_, eps_] := Block[{t$95$0 = N[(x * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.25e-48], N[(5.0 * N[(eps * t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.6e-50], N[(N[(x * 5.0 + eps), $MachinePrecision] * N[(eps * N[(eps * N[(eps * eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(eps * N[(5.0 * t$95$0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(x \cdot \left(x \cdot x\right)\right)\\
\mathbf{if}\;x \leq -1.25 \cdot 10^{-48}:\\
\;\;\;\;5 \cdot \left(\varepsilon \cdot t\_0\right)\\
\mathbf{elif}\;x \leq 2.6 \cdot 10^{-50}:\\
\;\;\;\;\mathsf{fma}\left(x, 5, \varepsilon\right) \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\varepsilon \cdot \left(5 \cdot t\_0\right)\\
\end{array}
\end{array}
if x < -1.25e-48Initial program 27.0%
Taylor expanded in eps around 0
*-lowering-*.f64N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified96.2%
*-commutativeN/A
*-lowering-*.f64N/A
accelerator-lowering-fma.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-sqrN/A
pow2N/A
pow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6496.2
Applied egg-rr96.2%
Taylor expanded in eps around 0
*-lowering-*.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-plusN/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6496.2
Simplified96.2%
if -1.25e-48 < x < 2.6000000000000001e-50Initial program 99.6%
Taylor expanded in eps around inf
*-lowering-*.f64N/A
pow-lowering-pow.f64N/A
+-commutativeN/A
distribute-lft1-inN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6499.4
Simplified99.4%
Taylor expanded in eps around 0
*-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
metadata-evalN/A
pow-plusN/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6499.3
Simplified99.3%
if 2.6000000000000001e-50 < x Initial program 34.9%
Taylor expanded in eps around 0
*-lowering-*.f64N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified98.7%
*-commutativeN/A
*-lowering-*.f64N/A
accelerator-lowering-fma.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-sqrN/A
pow2N/A
pow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6498.6
Applied egg-rr98.6%
Taylor expanded in eps around 0
*-lowering-*.f64N/A
metadata-evalN/A
pow-plusN/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6496.4
Simplified96.4%
Final simplification98.6%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (* x (* x (* x x)))))
(if (<= x -1e-47)
(* 5.0 (* eps t_0))
(if (<= x 6.8e-51)
(* (* eps (* eps eps)) (* eps (fma 5.0 x eps)))
(* eps (* 5.0 t_0))))))
double code(double x, double eps) {
double t_0 = x * (x * (x * x));
double tmp;
if (x <= -1e-47) {
tmp = 5.0 * (eps * t_0);
} else if (x <= 6.8e-51) {
tmp = (eps * (eps * eps)) * (eps * fma(5.0, x, eps));
} else {
tmp = eps * (5.0 * t_0);
}
return tmp;
}
function code(x, eps) t_0 = Float64(x * Float64(x * Float64(x * x))) tmp = 0.0 if (x <= -1e-47) tmp = Float64(5.0 * Float64(eps * t_0)); elseif (x <= 6.8e-51) tmp = Float64(Float64(eps * Float64(eps * eps)) * Float64(eps * fma(5.0, x, eps))); else tmp = Float64(eps * Float64(5.0 * t_0)); end return tmp end
code[x_, eps_] := Block[{t$95$0 = N[(x * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1e-47], N[(5.0 * N[(eps * t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 6.8e-51], N[(N[(eps * N[(eps * eps), $MachinePrecision]), $MachinePrecision] * N[(eps * N[(5.0 * x + eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(eps * N[(5.0 * t$95$0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(x \cdot \left(x \cdot x\right)\right)\\
\mathbf{if}\;x \leq -1 \cdot 10^{-47}:\\
\;\;\;\;5 \cdot \left(\varepsilon \cdot t\_0\right)\\
\mathbf{elif}\;x \leq 6.8 \cdot 10^{-51}:\\
\;\;\;\;\left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right) \cdot \left(\varepsilon \cdot \mathsf{fma}\left(5, x, \varepsilon\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\varepsilon \cdot \left(5 \cdot t\_0\right)\\
\end{array}
\end{array}
if x < -9.9999999999999997e-48Initial program 27.0%
Taylor expanded in eps around 0
*-lowering-*.f64N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified96.2%
*-commutativeN/A
*-lowering-*.f64N/A
accelerator-lowering-fma.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-sqrN/A
pow2N/A
pow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6496.2
Applied egg-rr96.2%
Taylor expanded in eps around 0
*-lowering-*.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-plusN/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6496.2
Simplified96.2%
if -9.9999999999999997e-48 < x < 6.80000000000000005e-51Initial program 99.6%
Taylor expanded in eps around -inf
associate-*r*N/A
*-commutativeN/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
distribute-lft1-inN/A
associate-*l*N/A
Simplified96.0%
Taylor expanded in x around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-+r+N/A
+-commutativeN/A
metadata-evalN/A
pow-plusN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
Simplified44.6%
Taylor expanded in x around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
pow-plusN/A
distribute-lft-inN/A
+-commutativeN/A
metadata-evalN/A
pow-plusN/A
associate-*r*N/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f6499.3
Simplified99.3%
if 6.80000000000000005e-51 < x Initial program 34.9%
Taylor expanded in eps around 0
*-lowering-*.f64N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified98.7%
*-commutativeN/A
*-lowering-*.f64N/A
accelerator-lowering-fma.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-sqrN/A
pow2N/A
pow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6498.6
Applied egg-rr98.6%
Taylor expanded in eps around 0
*-lowering-*.f64N/A
metadata-evalN/A
pow-plusN/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6496.4
Simplified96.4%
Final simplification98.6%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (* x (* x (* x x)))))
(if (<= x -1.75e-47)
(* 5.0 (* eps t_0))
(if (<= x 4.7e-57)
(* eps (* eps (* eps (* eps eps))))
(* eps (* 5.0 t_0))))))
double code(double x, double eps) {
double t_0 = x * (x * (x * x));
double tmp;
if (x <= -1.75e-47) {
tmp = 5.0 * (eps * t_0);
} else if (x <= 4.7e-57) {
tmp = eps * (eps * (eps * (eps * eps)));
} else {
tmp = eps * (5.0 * t_0);
}
return tmp;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: t_0
real(8) :: tmp
t_0 = x * (x * (x * x))
if (x <= (-1.75d-47)) then
tmp = 5.0d0 * (eps * t_0)
else if (x <= 4.7d-57) then
tmp = eps * (eps * (eps * (eps * eps)))
else
tmp = eps * (5.0d0 * t_0)
end if
code = tmp
end function
public static double code(double x, double eps) {
double t_0 = x * (x * (x * x));
double tmp;
if (x <= -1.75e-47) {
tmp = 5.0 * (eps * t_0);
} else if (x <= 4.7e-57) {
tmp = eps * (eps * (eps * (eps * eps)));
} else {
tmp = eps * (5.0 * t_0);
}
return tmp;
}
def code(x, eps): t_0 = x * (x * (x * x)) tmp = 0 if x <= -1.75e-47: tmp = 5.0 * (eps * t_0) elif x <= 4.7e-57: tmp = eps * (eps * (eps * (eps * eps))) else: tmp = eps * (5.0 * t_0) return tmp
function code(x, eps) t_0 = Float64(x * Float64(x * Float64(x * x))) tmp = 0.0 if (x <= -1.75e-47) tmp = Float64(5.0 * Float64(eps * t_0)); elseif (x <= 4.7e-57) tmp = Float64(eps * Float64(eps * Float64(eps * Float64(eps * eps)))); else tmp = Float64(eps * Float64(5.0 * t_0)); end return tmp end
function tmp_2 = code(x, eps) t_0 = x * (x * (x * x)); tmp = 0.0; if (x <= -1.75e-47) tmp = 5.0 * (eps * t_0); elseif (x <= 4.7e-57) tmp = eps * (eps * (eps * (eps * eps))); else tmp = eps * (5.0 * t_0); end tmp_2 = tmp; end
code[x_, eps_] := Block[{t$95$0 = N[(x * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.75e-47], N[(5.0 * N[(eps * t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.7e-57], N[(eps * N[(eps * N[(eps * N[(eps * eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(eps * N[(5.0 * t$95$0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(x \cdot \left(x \cdot x\right)\right)\\
\mathbf{if}\;x \leq -1.75 \cdot 10^{-47}:\\
\;\;\;\;5 \cdot \left(\varepsilon \cdot t\_0\right)\\
\mathbf{elif}\;x \leq 4.7 \cdot 10^{-57}:\\
\;\;\;\;\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\varepsilon \cdot \left(5 \cdot t\_0\right)\\
\end{array}
\end{array}
if x < -1.7499999999999999e-47Initial program 27.0%
Taylor expanded in eps around 0
*-lowering-*.f64N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified96.2%
*-commutativeN/A
*-lowering-*.f64N/A
accelerator-lowering-fma.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-sqrN/A
pow2N/A
pow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6496.2
Applied egg-rr96.2%
Taylor expanded in eps around 0
*-lowering-*.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-plusN/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6496.2
Simplified96.2%
if -1.7499999999999999e-47 < x < 4.6999999999999998e-57Initial program 100.0%
Taylor expanded in x around 0
pow-lowering-pow.f6499.6
Simplified99.6%
Taylor expanded in eps around 0
metadata-evalN/A
pow-plusN/A
*-commutativeN/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-plusN/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6499.6
Simplified99.6%
if 4.6999999999999998e-57 < x Initial program 37.8%
Taylor expanded in eps around 0
*-lowering-*.f64N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified96.4%
*-commutativeN/A
*-lowering-*.f64N/A
accelerator-lowering-fma.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-sqrN/A
pow2N/A
pow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6496.3
Applied egg-rr96.3%
Taylor expanded in eps around 0
*-lowering-*.f64N/A
metadata-evalN/A
pow-plusN/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6494.3
Simplified94.3%
Final simplification98.4%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (* x (* x x))))
(if (<= x -4.2e-49)
(* 5.0 (* eps (* x t_0)))
(if (<= x 2.6e-58)
(* eps (* eps (* eps (* eps eps))))
(* eps (* x (* 5.0 t_0)))))))
double code(double x, double eps) {
double t_0 = x * (x * x);
double tmp;
if (x <= -4.2e-49) {
tmp = 5.0 * (eps * (x * t_0));
} else if (x <= 2.6e-58) {
tmp = eps * (eps * (eps * (eps * eps)));
} else {
tmp = eps * (x * (5.0 * t_0));
}
return tmp;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: t_0
real(8) :: tmp
t_0 = x * (x * x)
if (x <= (-4.2d-49)) then
tmp = 5.0d0 * (eps * (x * t_0))
else if (x <= 2.6d-58) then
tmp = eps * (eps * (eps * (eps * eps)))
else
tmp = eps * (x * (5.0d0 * t_0))
end if
code = tmp
end function
public static double code(double x, double eps) {
double t_0 = x * (x * x);
double tmp;
if (x <= -4.2e-49) {
tmp = 5.0 * (eps * (x * t_0));
} else if (x <= 2.6e-58) {
tmp = eps * (eps * (eps * (eps * eps)));
} else {
tmp = eps * (x * (5.0 * t_0));
}
return tmp;
}
def code(x, eps): t_0 = x * (x * x) tmp = 0 if x <= -4.2e-49: tmp = 5.0 * (eps * (x * t_0)) elif x <= 2.6e-58: tmp = eps * (eps * (eps * (eps * eps))) else: tmp = eps * (x * (5.0 * t_0)) return tmp
function code(x, eps) t_0 = Float64(x * Float64(x * x)) tmp = 0.0 if (x <= -4.2e-49) tmp = Float64(5.0 * Float64(eps * Float64(x * t_0))); elseif (x <= 2.6e-58) tmp = Float64(eps * Float64(eps * Float64(eps * Float64(eps * eps)))); else tmp = Float64(eps * Float64(x * Float64(5.0 * t_0))); end return tmp end
function tmp_2 = code(x, eps) t_0 = x * (x * x); tmp = 0.0; if (x <= -4.2e-49) tmp = 5.0 * (eps * (x * t_0)); elseif (x <= 2.6e-58) tmp = eps * (eps * (eps * (eps * eps))); else tmp = eps * (x * (5.0 * t_0)); end tmp_2 = tmp; end
code[x_, eps_] := Block[{t$95$0 = N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.2e-49], N[(5.0 * N[(eps * N[(x * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.6e-58], N[(eps * N[(eps * N[(eps * N[(eps * eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(eps * N[(x * N[(5.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(x \cdot x\right)\\
\mathbf{if}\;x \leq -4.2 \cdot 10^{-49}:\\
\;\;\;\;5 \cdot \left(\varepsilon \cdot \left(x \cdot t\_0\right)\right)\\
\mathbf{elif}\;x \leq 2.6 \cdot 10^{-58}:\\
\;\;\;\;\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\varepsilon \cdot \left(x \cdot \left(5 \cdot t\_0\right)\right)\\
\end{array}
\end{array}
if x < -4.1999999999999998e-49Initial program 27.0%
Taylor expanded in eps around 0
*-lowering-*.f64N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified96.2%
*-commutativeN/A
*-lowering-*.f64N/A
accelerator-lowering-fma.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-sqrN/A
pow2N/A
pow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6496.2
Applied egg-rr96.2%
Taylor expanded in eps around 0
*-lowering-*.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-plusN/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6496.2
Simplified96.2%
if -4.1999999999999998e-49 < x < 2.60000000000000007e-58Initial program 100.0%
Taylor expanded in x around 0
pow-lowering-pow.f6499.6
Simplified99.6%
Taylor expanded in eps around 0
metadata-evalN/A
pow-plusN/A
*-commutativeN/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-plusN/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6499.6
Simplified99.6%
if 2.60000000000000007e-58 < x Initial program 37.8%
Taylor expanded in eps around 0
Simplified97.4%
Taylor expanded in x around 0
*-lowering-*.f64N/A
distribute-rgt-inN/A
associate-*r*N/A
associate-+r+N/A
*-commutativeN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-rgt-identityN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified97.0%
Taylor expanded in x around inf
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6494.3
Simplified94.3%
Final simplification98.4%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (* 5.0 (* eps (* x (* x (* x x)))))))
(if (<= x -1.7e-47)
t_0
(if (<= x 6e-57) (* eps (* eps (* eps (* eps eps)))) t_0))))
double code(double x, double eps) {
double t_0 = 5.0 * (eps * (x * (x * (x * x))));
double tmp;
if (x <= -1.7e-47) {
tmp = t_0;
} else if (x <= 6e-57) {
tmp = eps * (eps * (eps * (eps * eps)));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: t_0
real(8) :: tmp
t_0 = 5.0d0 * (eps * (x * (x * (x * x))))
if (x <= (-1.7d-47)) then
tmp = t_0
else if (x <= 6d-57) then
tmp = eps * (eps * (eps * (eps * eps)))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double eps) {
double t_0 = 5.0 * (eps * (x * (x * (x * x))));
double tmp;
if (x <= -1.7e-47) {
tmp = t_0;
} else if (x <= 6e-57) {
tmp = eps * (eps * (eps * (eps * eps)));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, eps): t_0 = 5.0 * (eps * (x * (x * (x * x)))) tmp = 0 if x <= -1.7e-47: tmp = t_0 elif x <= 6e-57: tmp = eps * (eps * (eps * (eps * eps))) else: tmp = t_0 return tmp
function code(x, eps) t_0 = Float64(5.0 * Float64(eps * Float64(x * Float64(x * Float64(x * x))))) tmp = 0.0 if (x <= -1.7e-47) tmp = t_0; elseif (x <= 6e-57) tmp = Float64(eps * Float64(eps * Float64(eps * Float64(eps * eps)))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, eps) t_0 = 5.0 * (eps * (x * (x * (x * x)))); tmp = 0.0; if (x <= -1.7e-47) tmp = t_0; elseif (x <= 6e-57) tmp = eps * (eps * (eps * (eps * eps))); else tmp = t_0; end tmp_2 = tmp; end
code[x_, eps_] := Block[{t$95$0 = N[(5.0 * N[(eps * N[(x * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.7e-47], t$95$0, If[LessEqual[x, 6e-57], N[(eps * N[(eps * N[(eps * N[(eps * eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 5 \cdot \left(\varepsilon \cdot \left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right)\right)\\
\mathbf{if}\;x \leq -1.7 \cdot 10^{-47}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 6 \cdot 10^{-57}:\\
\;\;\;\;\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.7000000000000001e-47 or 6.00000000000000001e-57 < x Initial program 33.9%
Taylor expanded in eps around 0
*-lowering-*.f64N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified96.3%
*-commutativeN/A
*-lowering-*.f64N/A
accelerator-lowering-fma.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-sqrN/A
pow2N/A
pow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6496.3
Applied egg-rr96.3%
Taylor expanded in eps around 0
*-lowering-*.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-plusN/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6494.8
Simplified94.8%
if -1.7000000000000001e-47 < x < 6.00000000000000001e-57Initial program 100.0%
Taylor expanded in x around 0
pow-lowering-pow.f6499.6
Simplified99.6%
Taylor expanded in eps around 0
metadata-evalN/A
pow-plusN/A
*-commutativeN/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-plusN/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6499.6
Simplified99.6%
Final simplification98.4%
(FPCore (x eps) :precision binary64 (* eps (* eps (* eps (* eps eps)))))
double code(double x, double eps) {
return eps * (eps * (eps * (eps * eps)));
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
code = eps * (eps * (eps * (eps * eps)))
end function
public static double code(double x, double eps) {
return eps * (eps * (eps * (eps * eps)));
}
def code(x, eps): return eps * (eps * (eps * (eps * eps)))
function code(x, eps) return Float64(eps * Float64(eps * Float64(eps * Float64(eps * eps)))) end
function tmp = code(x, eps) tmp = eps * (eps * (eps * (eps * eps))); end
code[x_, eps_] := N[(eps * N[(eps * N[(eps * N[(eps * eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right)\right)
\end{array}
Initial program 83.4%
Taylor expanded in x around 0
pow-lowering-pow.f6482.0
Simplified82.0%
Taylor expanded in eps around 0
metadata-evalN/A
pow-plusN/A
*-commutativeN/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-plusN/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6482.0
Simplified82.0%
Final simplification82.0%
(FPCore (x eps) :precision binary64 (* eps (* (* eps eps) (* eps eps))))
double code(double x, double eps) {
return eps * ((eps * eps) * (eps * eps));
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
code = eps * ((eps * eps) * (eps * eps))
end function
public static double code(double x, double eps) {
return eps * ((eps * eps) * (eps * eps));
}
def code(x, eps): return eps * ((eps * eps) * (eps * eps))
function code(x, eps) return Float64(eps * Float64(Float64(eps * eps) * Float64(eps * eps))) end
function tmp = code(x, eps) tmp = eps * ((eps * eps) * (eps * eps)); end
code[x_, eps_] := N[(eps * N[(N[(eps * eps), $MachinePrecision] * N[(eps * eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\varepsilon \cdot \left(\left(\varepsilon \cdot \varepsilon\right) \cdot \left(\varepsilon \cdot \varepsilon\right)\right)
\end{array}
Initial program 83.4%
Taylor expanded in x around 0
pow-lowering-pow.f6482.0
Simplified82.0%
Taylor expanded in eps around 0
metadata-evalN/A
pow-plusN/A
*-commutativeN/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-plusN/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6482.0
Simplified82.0%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6481.9
Applied egg-rr81.9%
herbie shell --seed 2024195
(FPCore (x eps)
:name "ENA, Section 1.4, Exercise 4b, n=5"
:precision binary64
:pre (and (and (<= -1000000000.0 x) (<= x 1000000000.0)) (and (<= -1.0 eps) (<= eps 1.0)))
(- (pow (+ x eps) 5.0) (pow x 5.0)))