
(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 -6.1e-52)
(* eps (fma (* x (* x (* x x))) 5.0 (* x (* eps (* x (* x 10.0))))))
(if (<= x 4.9e-54)
(- (pow (+ x eps) 5.0) (pow x 5.0))
(*
eps
(*
x
(fma
x
(fma x (* x 5.0) (* 10.0 (* eps (+ x eps))))
(* 5.0 (* eps (* eps eps)))))))))
double code(double x, double eps) {
double tmp;
if (x <= -6.1e-52) {
tmp = eps * fma((x * (x * (x * x))), 5.0, (x * (eps * (x * (x * 10.0)))));
} else if (x <= 4.9e-54) {
tmp = pow((x + eps), 5.0) - pow(x, 5.0);
} else {
tmp = eps * (x * fma(x, fma(x, (x * 5.0), (10.0 * (eps * (x + eps)))), (5.0 * (eps * (eps * eps)))));
}
return tmp;
}
function code(x, eps) tmp = 0.0 if (x <= -6.1e-52) tmp = Float64(eps * fma(Float64(x * Float64(x * Float64(x * x))), 5.0, Float64(x * Float64(eps * Float64(x * Float64(x * 10.0)))))); elseif (x <= 4.9e-54) tmp = Float64((Float64(x + eps) ^ 5.0) - (x ^ 5.0)); else tmp = Float64(eps * Float64(x * fma(x, fma(x, Float64(x * 5.0), Float64(10.0 * Float64(eps * Float64(x + eps)))), Float64(5.0 * Float64(eps * Float64(eps * eps)))))); end return tmp end
code[x_, eps_] := If[LessEqual[x, -6.1e-52], N[(eps * N[(N[(x * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 5.0 + N[(x * N[(eps * N[(x * N[(x * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.9e-54], N[(N[Power[N[(x + eps), $MachinePrecision], 5.0], $MachinePrecision] - N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision], N[(eps * N[(x * N[(x * N[(x * N[(x * 5.0), $MachinePrecision] + N[(10.0 * N[(eps * N[(x + eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(5.0 * N[(eps * N[(eps * eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.1 \cdot 10^{-52}:\\
\;\;\;\;\varepsilon \cdot \mathsf{fma}\left(x \cdot \left(x \cdot \left(x \cdot x\right)\right), 5, x \cdot \left(\varepsilon \cdot \left(x \cdot \left(x \cdot 10\right)\right)\right)\right)\\
\mathbf{elif}\;x \leq 4.9 \cdot 10^{-54}:\\
\;\;\;\;{\left(x + \varepsilon\right)}^{5} - {x}^{5}\\
\mathbf{else}:\\
\;\;\;\;\varepsilon \cdot \left(x \cdot \mathsf{fma}\left(x, \mathsf{fma}\left(x, x \cdot 5, 10 \cdot \left(\varepsilon \cdot \left(x + \varepsilon\right)\right)\right), 5 \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right)\right)\right)\\
\end{array}
\end{array}
if x < -6.0999999999999999e-52Initial program 29.9%
Taylor expanded in eps around 0
lower-*.f64N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites99.7%
Applied rewrites99.8%
if -6.0999999999999999e-52 < x < 4.90000000000000021e-54Initial program 100.0%
if 4.90000000000000021e-54 < x Initial program 29.9%
Taylor expanded in eps around 0
lower-*.f64N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites94.6%
Applied rewrites94.9%
Taylor expanded in eps around 0
Applied rewrites95.5%
Taylor expanded in x around 0
Applied rewrites95.7%
Final simplification99.5%
(FPCore (x eps)
:precision binary64
(if (<= x -3.9e-52)
(* eps (fma (* x (* x (* x x))) 5.0 (* x (* eps (* x (* x 10.0))))))
(if (<= x 4.9e-54)
(* (pow eps 5.0) (/ (fma x 5.0 eps) eps))
(*
eps
(*
x
(fma
x
(fma x (* x 5.0) (* 10.0 (* eps (+ x eps))))
(* 5.0 (* eps (* eps eps)))))))))
double code(double x, double eps) {
double tmp;
if (x <= -3.9e-52) {
tmp = eps * fma((x * (x * (x * x))), 5.0, (x * (eps * (x * (x * 10.0)))));
} else if (x <= 4.9e-54) {
tmp = pow(eps, 5.0) * (fma(x, 5.0, eps) / eps);
} else {
tmp = eps * (x * fma(x, fma(x, (x * 5.0), (10.0 * (eps * (x + eps)))), (5.0 * (eps * (eps * eps)))));
}
return tmp;
}
function code(x, eps) tmp = 0.0 if (x <= -3.9e-52) tmp = Float64(eps * fma(Float64(x * Float64(x * Float64(x * x))), 5.0, Float64(x * Float64(eps * Float64(x * Float64(x * 10.0)))))); elseif (x <= 4.9e-54) tmp = Float64((eps ^ 5.0) * Float64(fma(x, 5.0, eps) / eps)); else tmp = Float64(eps * Float64(x * fma(x, fma(x, Float64(x * 5.0), Float64(10.0 * Float64(eps * Float64(x + eps)))), Float64(5.0 * Float64(eps * Float64(eps * eps)))))); end return tmp end
code[x_, eps_] := If[LessEqual[x, -3.9e-52], N[(eps * N[(N[(x * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 5.0 + N[(x * N[(eps * N[(x * N[(x * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.9e-54], N[(N[Power[eps, 5.0], $MachinePrecision] * N[(N[(x * 5.0 + eps), $MachinePrecision] / eps), $MachinePrecision]), $MachinePrecision], N[(eps * N[(x * N[(x * N[(x * N[(x * 5.0), $MachinePrecision] + N[(10.0 * N[(eps * N[(x + eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(5.0 * N[(eps * N[(eps * eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.9 \cdot 10^{-52}:\\
\;\;\;\;\varepsilon \cdot \mathsf{fma}\left(x \cdot \left(x \cdot \left(x \cdot x\right)\right), 5, x \cdot \left(\varepsilon \cdot \left(x \cdot \left(x \cdot 10\right)\right)\right)\right)\\
\mathbf{elif}\;x \leq 4.9 \cdot 10^{-54}:\\
\;\;\;\;{\varepsilon}^{5} \cdot \frac{\mathsf{fma}\left(x, 5, \varepsilon\right)}{\varepsilon}\\
\mathbf{else}:\\
\;\;\;\;\varepsilon \cdot \left(x \cdot \mathsf{fma}\left(x, \mathsf{fma}\left(x, x \cdot 5, 10 \cdot \left(\varepsilon \cdot \left(x + \varepsilon\right)\right)\right), 5 \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right)\right)\right)\\
\end{array}
\end{array}
if x < -3.90000000000000018e-52Initial program 29.9%
Taylor expanded in eps around 0
lower-*.f64N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites99.7%
Applied rewrites99.8%
if -3.90000000000000018e-52 < x < 4.90000000000000021e-54Initial program 100.0%
Taylor expanded in eps around inf
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
distribute-lft1-inN/A
metadata-evalN/A
lower-fma.f64N/A
lower-/.f6499.7
Applied rewrites99.7%
Taylor expanded in eps around 0
Applied rewrites99.7%
if 4.90000000000000021e-54 < x Initial program 29.9%
Taylor expanded in eps around 0
lower-*.f64N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites94.6%
Applied rewrites94.9%
Taylor expanded in eps around 0
Applied rewrites95.5%
Taylor expanded in x around 0
Applied rewrites95.7%
Final simplification99.3%
(FPCore (x eps)
:precision binary64
(if (<= x -3.9e-52)
(* eps (fma (* x (* x (* x x))) 5.0 (* x (* eps (* x (* x 10.0))))))
(if (<= x 4.2e-54)
(pow eps 5.0)
(*
eps
(*
x
(fma
x
(fma x (* x 5.0) (* 10.0 (* eps (+ x eps))))
(* 5.0 (* eps (* eps eps)))))))))
double code(double x, double eps) {
double tmp;
if (x <= -3.9e-52) {
tmp = eps * fma((x * (x * (x * x))), 5.0, (x * (eps * (x * (x * 10.0)))));
} else if (x <= 4.2e-54) {
tmp = pow(eps, 5.0);
} else {
tmp = eps * (x * fma(x, fma(x, (x * 5.0), (10.0 * (eps * (x + eps)))), (5.0 * (eps * (eps * eps)))));
}
return tmp;
}
function code(x, eps) tmp = 0.0 if (x <= -3.9e-52) tmp = Float64(eps * fma(Float64(x * Float64(x * Float64(x * x))), 5.0, Float64(x * Float64(eps * Float64(x * Float64(x * 10.0)))))); elseif (x <= 4.2e-54) tmp = eps ^ 5.0; else tmp = Float64(eps * Float64(x * fma(x, fma(x, Float64(x * 5.0), Float64(10.0 * Float64(eps * Float64(x + eps)))), Float64(5.0 * Float64(eps * Float64(eps * eps)))))); end return tmp end
code[x_, eps_] := If[LessEqual[x, -3.9e-52], N[(eps * N[(N[(x * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 5.0 + N[(x * N[(eps * N[(x * N[(x * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.2e-54], N[Power[eps, 5.0], $MachinePrecision], N[(eps * N[(x * N[(x * N[(x * N[(x * 5.0), $MachinePrecision] + N[(10.0 * N[(eps * N[(x + eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(5.0 * N[(eps * N[(eps * eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.9 \cdot 10^{-52}:\\
\;\;\;\;\varepsilon \cdot \mathsf{fma}\left(x \cdot \left(x \cdot \left(x \cdot x\right)\right), 5, x \cdot \left(\varepsilon \cdot \left(x \cdot \left(x \cdot 10\right)\right)\right)\right)\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{-54}:\\
\;\;\;\;{\varepsilon}^{5}\\
\mathbf{else}:\\
\;\;\;\;\varepsilon \cdot \left(x \cdot \mathsf{fma}\left(x, \mathsf{fma}\left(x, x \cdot 5, 10 \cdot \left(\varepsilon \cdot \left(x + \varepsilon\right)\right)\right), 5 \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right)\right)\right)\\
\end{array}
\end{array}
if x < -3.90000000000000018e-52Initial program 29.9%
Taylor expanded in eps around 0
lower-*.f64N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites99.7%
Applied rewrites99.8%
if -3.90000000000000018e-52 < x < 4.2e-54Initial program 100.0%
Taylor expanded in x around 0
lower-pow.f6499.7
Applied rewrites99.7%
if 4.2e-54 < x Initial program 29.9%
Taylor expanded in eps around 0
lower-*.f64N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites94.6%
Applied rewrites94.9%
Taylor expanded in eps around 0
Applied rewrites95.5%
Taylor expanded in x around 0
Applied rewrites95.7%
Final simplification99.2%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (* eps (* eps eps))))
(if (<= x -3.9e-52)
(* eps (fma (* x (* x (* x x))) 5.0 (* x (* eps (* x (* x 10.0))))))
(if (<= x 4.9e-54)
(* (/ (fma x 5.0 eps) eps) (* (* eps eps) t_0))
(*
eps
(*
x
(fma x (fma x (* x 5.0) (* 10.0 (* eps (+ x eps)))) (* 5.0 t_0))))))))
double code(double x, double eps) {
double t_0 = eps * (eps * eps);
double tmp;
if (x <= -3.9e-52) {
tmp = eps * fma((x * (x * (x * x))), 5.0, (x * (eps * (x * (x * 10.0)))));
} else if (x <= 4.9e-54) {
tmp = (fma(x, 5.0, eps) / eps) * ((eps * eps) * t_0);
} else {
tmp = eps * (x * fma(x, fma(x, (x * 5.0), (10.0 * (eps * (x + eps)))), (5.0 * t_0)));
}
return tmp;
}
function code(x, eps) t_0 = Float64(eps * Float64(eps * eps)) tmp = 0.0 if (x <= -3.9e-52) tmp = Float64(eps * fma(Float64(x * Float64(x * Float64(x * x))), 5.0, Float64(x * Float64(eps * Float64(x * Float64(x * 10.0)))))); elseif (x <= 4.9e-54) tmp = Float64(Float64(fma(x, 5.0, eps) / eps) * Float64(Float64(eps * eps) * t_0)); else tmp = Float64(eps * Float64(x * fma(x, fma(x, Float64(x * 5.0), Float64(10.0 * Float64(eps * Float64(x + eps)))), Float64(5.0 * t_0)))); end return tmp end
code[x_, eps_] := Block[{t$95$0 = N[(eps * N[(eps * eps), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.9e-52], N[(eps * N[(N[(x * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 5.0 + N[(x * N[(eps * N[(x * N[(x * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.9e-54], N[(N[(N[(x * 5.0 + eps), $MachinePrecision] / eps), $MachinePrecision] * N[(N[(eps * eps), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], N[(eps * N[(x * N[(x * N[(x * N[(x * 5.0), $MachinePrecision] + N[(10.0 * N[(eps * N[(x + eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(5.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\\
\mathbf{if}\;x \leq -3.9 \cdot 10^{-52}:\\
\;\;\;\;\varepsilon \cdot \mathsf{fma}\left(x \cdot \left(x \cdot \left(x \cdot x\right)\right), 5, x \cdot \left(\varepsilon \cdot \left(x \cdot \left(x \cdot 10\right)\right)\right)\right)\\
\mathbf{elif}\;x \leq 4.9 \cdot 10^{-54}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, 5, \varepsilon\right)}{\varepsilon} \cdot \left(\left(\varepsilon \cdot \varepsilon\right) \cdot t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\varepsilon \cdot \left(x \cdot \mathsf{fma}\left(x, \mathsf{fma}\left(x, x \cdot 5, 10 \cdot \left(\varepsilon \cdot \left(x + \varepsilon\right)\right)\right), 5 \cdot t\_0\right)\right)\\
\end{array}
\end{array}
if x < -3.90000000000000018e-52Initial program 29.9%
Taylor expanded in eps around 0
lower-*.f64N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites99.7%
Applied rewrites99.8%
if -3.90000000000000018e-52 < x < 4.90000000000000021e-54Initial program 100.0%
Taylor expanded in eps around inf
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
distribute-lft1-inN/A
metadata-evalN/A
lower-fma.f64N/A
lower-/.f6499.7
Applied rewrites99.7%
Taylor expanded in eps around 0
Applied rewrites99.7%
Applied rewrites99.6%
if 4.90000000000000021e-54 < x Initial program 29.9%
Taylor expanded in eps around 0
lower-*.f64N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites94.6%
Applied rewrites94.9%
Taylor expanded in eps around 0
Applied rewrites95.5%
Taylor expanded in x around 0
Applied rewrites95.7%
Final simplification99.2%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (* x (* x x))))
(if (<= x -3.9e-52)
(* eps (fma (* x t_0) 5.0 (* x (* eps (* x (* x 10.0))))))
(if (<= x 4.2e-54)
(* (/ (fma x 5.0 eps) eps) (* (* eps eps) (* eps (* eps eps))))
(* eps (fma eps (* 10.0 (* (* x x) (+ x eps))) (* t_0 (* x 5.0))))))))
double code(double x, double eps) {
double t_0 = x * (x * x);
double tmp;
if (x <= -3.9e-52) {
tmp = eps * fma((x * t_0), 5.0, (x * (eps * (x * (x * 10.0)))));
} else if (x <= 4.2e-54) {
tmp = (fma(x, 5.0, eps) / eps) * ((eps * eps) * (eps * (eps * eps)));
} else {
tmp = eps * fma(eps, (10.0 * ((x * x) * (x + eps))), (t_0 * (x * 5.0)));
}
return tmp;
}
function code(x, eps) t_0 = Float64(x * Float64(x * x)) tmp = 0.0 if (x <= -3.9e-52) tmp = Float64(eps * fma(Float64(x * t_0), 5.0, Float64(x * Float64(eps * Float64(x * Float64(x * 10.0)))))); elseif (x <= 4.2e-54) tmp = Float64(Float64(fma(x, 5.0, eps) / eps) * Float64(Float64(eps * eps) * Float64(eps * Float64(eps * eps)))); else tmp = Float64(eps * fma(eps, Float64(10.0 * Float64(Float64(x * x) * Float64(x + eps))), Float64(t_0 * Float64(x * 5.0)))); end return tmp end
code[x_, eps_] := Block[{t$95$0 = N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.9e-52], N[(eps * N[(N[(x * t$95$0), $MachinePrecision] * 5.0 + N[(x * N[(eps * N[(x * N[(x * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.2e-54], N[(N[(N[(x * 5.0 + eps), $MachinePrecision] / eps), $MachinePrecision] * N[(N[(eps * eps), $MachinePrecision] * N[(eps * N[(eps * eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(eps * N[(eps * N[(10.0 * N[(N[(x * x), $MachinePrecision] * N[(x + eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(x * 5.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(x \cdot x\right)\\
\mathbf{if}\;x \leq -3.9 \cdot 10^{-52}:\\
\;\;\;\;\varepsilon \cdot \mathsf{fma}\left(x \cdot t\_0, 5, x \cdot \left(\varepsilon \cdot \left(x \cdot \left(x \cdot 10\right)\right)\right)\right)\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{-54}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, 5, \varepsilon\right)}{\varepsilon} \cdot \left(\left(\varepsilon \cdot \varepsilon\right) \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\varepsilon \cdot \mathsf{fma}\left(\varepsilon, 10 \cdot \left(\left(x \cdot x\right) \cdot \left(x + \varepsilon\right)\right), t\_0 \cdot \left(x \cdot 5\right)\right)\\
\end{array}
\end{array}
if x < -3.90000000000000018e-52Initial program 29.9%
Taylor expanded in eps around 0
lower-*.f64N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites99.7%
Applied rewrites99.8%
if -3.90000000000000018e-52 < x < 4.2e-54Initial program 100.0%
Taylor expanded in eps around inf
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
distribute-lft1-inN/A
metadata-evalN/A
lower-fma.f64N/A
lower-/.f6499.7
Applied rewrites99.7%
Taylor expanded in eps around 0
Applied rewrites99.7%
Applied rewrites99.6%
if 4.2e-54 < x Initial program 29.9%
Taylor expanded in eps around 0
lower-*.f64N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites94.6%
Applied rewrites94.9%
Taylor expanded in eps around 0
Applied rewrites95.5%
Taylor expanded in eps around 0
Applied rewrites95.3%
Final simplification99.1%
(FPCore (x eps)
:precision binary64
(let* ((t_0
(* eps (fma (* x (* x (* x x))) 5.0 (* x (* eps (* x (* x 10.0))))))))
(if (<= x -3.9e-52)
t_0
(if (<= x 4.9e-54)
(* (/ (fma x 5.0 eps) eps) (* (* eps eps) (* eps (* eps eps))))
t_0))))
double code(double x, double eps) {
double t_0 = eps * fma((x * (x * (x * x))), 5.0, (x * (eps * (x * (x * 10.0)))));
double tmp;
if (x <= -3.9e-52) {
tmp = t_0;
} else if (x <= 4.9e-54) {
tmp = (fma(x, 5.0, eps) / eps) * ((eps * eps) * (eps * (eps * eps)));
} else {
tmp = t_0;
}
return tmp;
}
function code(x, eps) t_0 = Float64(eps * fma(Float64(x * Float64(x * Float64(x * x))), 5.0, Float64(x * Float64(eps * Float64(x * Float64(x * 10.0)))))) tmp = 0.0 if (x <= -3.9e-52) tmp = t_0; elseif (x <= 4.9e-54) tmp = Float64(Float64(fma(x, 5.0, eps) / eps) * Float64(Float64(eps * eps) * Float64(eps * Float64(eps * eps)))); else tmp = t_0; end return tmp end
code[x_, eps_] := Block[{t$95$0 = N[(eps * N[(N[(x * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 5.0 + N[(x * N[(eps * N[(x * N[(x * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.9e-52], t$95$0, If[LessEqual[x, 4.9e-54], N[(N[(N[(x * 5.0 + eps), $MachinePrecision] / eps), $MachinePrecision] * N[(N[(eps * eps), $MachinePrecision] * N[(eps * N[(eps * eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \varepsilon \cdot \mathsf{fma}\left(x \cdot \left(x \cdot \left(x \cdot x\right)\right), 5, x \cdot \left(\varepsilon \cdot \left(x \cdot \left(x \cdot 10\right)\right)\right)\right)\\
\mathbf{if}\;x \leq -3.9 \cdot 10^{-52}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 4.9 \cdot 10^{-54}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, 5, \varepsilon\right)}{\varepsilon} \cdot \left(\left(\varepsilon \cdot \varepsilon\right) \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -3.90000000000000018e-52 or 4.90000000000000021e-54 < x Initial program 29.9%
Taylor expanded in eps around 0
lower-*.f64N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites96.4%
Applied rewrites96.7%
if -3.90000000000000018e-52 < x < 4.90000000000000021e-54Initial program 100.0%
Taylor expanded in eps around inf
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
distribute-lft1-inN/A
metadata-evalN/A
lower-fma.f64N/A
lower-/.f6499.7
Applied rewrites99.7%
Taylor expanded in eps around 0
Applied rewrites99.7%
Applied rewrites99.6%
Final simplification99.1%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (* x (* x x))))
(if (<= x -3.9e-52)
(* eps (* t_0 (fma 10.0 eps (* x 5.0))))
(if (<= x 4.9e-54)
(* (/ (fma x 5.0 eps) eps) (* (* eps eps) (* eps (* eps eps))))
(* t_0 (fma 10.0 (* eps eps) (* x (* eps 5.0))))))))
double code(double x, double eps) {
double t_0 = x * (x * x);
double tmp;
if (x <= -3.9e-52) {
tmp = eps * (t_0 * fma(10.0, eps, (x * 5.0)));
} else if (x <= 4.9e-54) {
tmp = (fma(x, 5.0, eps) / eps) * ((eps * eps) * (eps * (eps * eps)));
} else {
tmp = t_0 * fma(10.0, (eps * eps), (x * (eps * 5.0)));
}
return tmp;
}
function code(x, eps) t_0 = Float64(x * Float64(x * x)) tmp = 0.0 if (x <= -3.9e-52) tmp = Float64(eps * Float64(t_0 * fma(10.0, eps, Float64(x * 5.0)))); elseif (x <= 4.9e-54) tmp = Float64(Float64(fma(x, 5.0, eps) / eps) * Float64(Float64(eps * eps) * Float64(eps * Float64(eps * eps)))); else tmp = Float64(t_0 * fma(10.0, Float64(eps * eps), Float64(x * Float64(eps * 5.0)))); end return tmp end
code[x_, eps_] := Block[{t$95$0 = N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.9e-52], N[(eps * N[(t$95$0 * N[(10.0 * eps + N[(x * 5.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.9e-54], N[(N[(N[(x * 5.0 + eps), $MachinePrecision] / eps), $MachinePrecision] * N[(N[(eps * eps), $MachinePrecision] * N[(eps * N[(eps * eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(10.0 * N[(eps * eps), $MachinePrecision] + N[(x * N[(eps * 5.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(x \cdot x\right)\\
\mathbf{if}\;x \leq -3.9 \cdot 10^{-52}:\\
\;\;\;\;\varepsilon \cdot \left(t\_0 \cdot \mathsf{fma}\left(10, \varepsilon, x \cdot 5\right)\right)\\
\mathbf{elif}\;x \leq 4.9 \cdot 10^{-54}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, 5, \varepsilon\right)}{\varepsilon} \cdot \left(\left(\varepsilon \cdot \varepsilon\right) \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \mathsf{fma}\left(10, \varepsilon \cdot \varepsilon, x \cdot \left(\varepsilon \cdot 5\right)\right)\\
\end{array}
\end{array}
if x < -3.90000000000000018e-52Initial program 29.9%
Taylor expanded in eps around 0
lower-*.f64N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites99.7%
Taylor expanded in x around 0
Applied rewrites99.7%
if -3.90000000000000018e-52 < x < 4.90000000000000021e-54Initial program 100.0%
Taylor expanded in eps around inf
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
distribute-lft1-inN/A
metadata-evalN/A
lower-fma.f64N/A
lower-/.f6499.7
Applied rewrites99.7%
Taylor expanded in eps around 0
Applied rewrites99.7%
Applied rewrites99.6%
if 4.90000000000000021e-54 < x Initial program 29.9%
Taylor expanded in x around -inf
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
associate-+r+N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
distribute-rgt1-inN/A
metadata-evalN/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites94.7%
Taylor expanded in x around 0
Applied rewrites94.8%
Final simplification99.0%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (* x (* x x))))
(if (<= x -3.9e-52)
(* eps (* t_0 (fma 10.0 eps (* x 5.0))))
(if (<= x 4.9e-54)
(* eps (* eps (* eps (* eps eps))))
(* t_0 (fma 10.0 (* eps eps) (* x (* eps 5.0))))))))
double code(double x, double eps) {
double t_0 = x * (x * x);
double tmp;
if (x <= -3.9e-52) {
tmp = eps * (t_0 * fma(10.0, eps, (x * 5.0)));
} else if (x <= 4.9e-54) {
tmp = eps * (eps * (eps * (eps * eps)));
} else {
tmp = t_0 * fma(10.0, (eps * eps), (x * (eps * 5.0)));
}
return tmp;
}
function code(x, eps) t_0 = Float64(x * Float64(x * x)) tmp = 0.0 if (x <= -3.9e-52) tmp = Float64(eps * Float64(t_0 * fma(10.0, eps, Float64(x * 5.0)))); elseif (x <= 4.9e-54) tmp = Float64(eps * Float64(eps * Float64(eps * Float64(eps * eps)))); else tmp = Float64(t_0 * fma(10.0, Float64(eps * eps), Float64(x * Float64(eps * 5.0)))); end return tmp end
code[x_, eps_] := Block[{t$95$0 = N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.9e-52], N[(eps * N[(t$95$0 * N[(10.0 * eps + N[(x * 5.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.9e-54], N[(eps * N[(eps * N[(eps * N[(eps * eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(10.0 * N[(eps * eps), $MachinePrecision] + N[(x * N[(eps * 5.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(x \cdot x\right)\\
\mathbf{if}\;x \leq -3.9 \cdot 10^{-52}:\\
\;\;\;\;\varepsilon \cdot \left(t\_0 \cdot \mathsf{fma}\left(10, \varepsilon, x \cdot 5\right)\right)\\
\mathbf{elif}\;x \leq 4.9 \cdot 10^{-54}:\\
\;\;\;\;\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \mathsf{fma}\left(10, \varepsilon \cdot \varepsilon, x \cdot \left(\varepsilon \cdot 5\right)\right)\\
\end{array}
\end{array}
if x < -3.90000000000000018e-52Initial program 29.9%
Taylor expanded in eps around 0
lower-*.f64N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites99.7%
Taylor expanded in x around 0
Applied rewrites99.7%
if -3.90000000000000018e-52 < x < 4.90000000000000021e-54Initial program 100.0%
Taylor expanded in x around 0
lower-pow.f6499.7
Applied rewrites99.7%
Applied rewrites99.6%
Applied rewrites99.6%
if 4.90000000000000021e-54 < x Initial program 29.9%
Taylor expanded in x around -inf
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
associate-+r+N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
distribute-rgt1-inN/A
metadata-evalN/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites94.7%
Taylor expanded in x around 0
Applied rewrites94.8%
Final simplification99.0%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (fma 10.0 eps (* x 5.0))))
(if (<= x -3.9e-52)
(* eps (* (* x (* x x)) t_0))
(if (<= x 4.9e-54)
(* eps (* eps (* eps (* eps eps))))
(* eps (* x (* (* x x) t_0)))))))
double code(double x, double eps) {
double t_0 = fma(10.0, eps, (x * 5.0));
double tmp;
if (x <= -3.9e-52) {
tmp = eps * ((x * (x * x)) * t_0);
} else if (x <= 4.9e-54) {
tmp = eps * (eps * (eps * (eps * eps)));
} else {
tmp = eps * (x * ((x * x) * t_0));
}
return tmp;
}
function code(x, eps) t_0 = fma(10.0, eps, Float64(x * 5.0)) tmp = 0.0 if (x <= -3.9e-52) tmp = Float64(eps * Float64(Float64(x * Float64(x * x)) * t_0)); elseif (x <= 4.9e-54) tmp = Float64(eps * Float64(eps * Float64(eps * Float64(eps * eps)))); else tmp = Float64(eps * Float64(x * Float64(Float64(x * x) * t_0))); end return tmp end
code[x_, eps_] := Block[{t$95$0 = N[(10.0 * eps + N[(x * 5.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.9e-52], N[(eps * N[(N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.9e-54], N[(eps * N[(eps * N[(eps * N[(eps * eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(eps * N[(x * N[(N[(x * x), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(10, \varepsilon, x \cdot 5\right)\\
\mathbf{if}\;x \leq -3.9 \cdot 10^{-52}:\\
\;\;\;\;\varepsilon \cdot \left(\left(x \cdot \left(x \cdot x\right)\right) \cdot t\_0\right)\\
\mathbf{elif}\;x \leq 4.9 \cdot 10^{-54}:\\
\;\;\;\;\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\varepsilon \cdot \left(x \cdot \left(\left(x \cdot x\right) \cdot t\_0\right)\right)\\
\end{array}
\end{array}
if x < -3.90000000000000018e-52Initial program 29.9%
Taylor expanded in eps around 0
lower-*.f64N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites99.7%
Taylor expanded in x around 0
Applied rewrites99.7%
if -3.90000000000000018e-52 < x < 4.90000000000000021e-54Initial program 100.0%
Taylor expanded in x around 0
lower-pow.f6499.7
Applied rewrites99.7%
Applied rewrites99.6%
Applied rewrites99.6%
if 4.90000000000000021e-54 < x Initial program 29.9%
Taylor expanded in eps around 0
lower-*.f64N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites94.6%
Applied rewrites94.9%
Taylor expanded in eps around 0
Applied rewrites94.7%
Final simplification99.0%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (* x (* x x))) (t_1 (fma 10.0 eps (* x 5.0))))
(if (<= x -3.9e-52)
(* eps (* t_0 t_1))
(if (<= x 4.9e-54)
(* eps (* eps (* eps (* eps eps))))
(* t_0 (* eps t_1))))))
double code(double x, double eps) {
double t_0 = x * (x * x);
double t_1 = fma(10.0, eps, (x * 5.0));
double tmp;
if (x <= -3.9e-52) {
tmp = eps * (t_0 * t_1);
} else if (x <= 4.9e-54) {
tmp = eps * (eps * (eps * (eps * eps)));
} else {
tmp = t_0 * (eps * t_1);
}
return tmp;
}
function code(x, eps) t_0 = Float64(x * Float64(x * x)) t_1 = fma(10.0, eps, Float64(x * 5.0)) tmp = 0.0 if (x <= -3.9e-52) tmp = Float64(eps * Float64(t_0 * t_1)); elseif (x <= 4.9e-54) tmp = Float64(eps * Float64(eps * Float64(eps * Float64(eps * eps)))); else tmp = Float64(t_0 * Float64(eps * t_1)); end return tmp end
code[x_, eps_] := Block[{t$95$0 = N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(10.0 * eps + N[(x * 5.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.9e-52], N[(eps * N[(t$95$0 * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.9e-54], N[(eps * N[(eps * N[(eps * N[(eps * eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(eps * t$95$1), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(x \cdot x\right)\\
t_1 := \mathsf{fma}\left(10, \varepsilon, x \cdot 5\right)\\
\mathbf{if}\;x \leq -3.9 \cdot 10^{-52}:\\
\;\;\;\;\varepsilon \cdot \left(t\_0 \cdot t\_1\right)\\
\mathbf{elif}\;x \leq 4.9 \cdot 10^{-54}:\\
\;\;\;\;\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(\varepsilon \cdot t\_1\right)\\
\end{array}
\end{array}
if x < -3.90000000000000018e-52Initial program 29.9%
Taylor expanded in eps around 0
lower-*.f64N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites99.7%
Taylor expanded in x around 0
Applied rewrites99.7%
if -3.90000000000000018e-52 < x < 4.90000000000000021e-54Initial program 100.0%
Taylor expanded in x around 0
lower-pow.f6499.7
Applied rewrites99.7%
Applied rewrites99.6%
Applied rewrites99.6%
if 4.90000000000000021e-54 < x Initial program 29.9%
Taylor expanded in x around -inf
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
associate-+r+N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
distribute-rgt1-inN/A
metadata-evalN/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites94.7%
Applied rewrites94.7%
Taylor expanded in x around 0
Applied rewrites94.5%
Final simplification99.0%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (* (* x (* x x)) (* eps (fma 10.0 eps (* x 5.0))))))
(if (<= x -3.9e-52)
t_0
(if (<= x 4.9e-54) (* eps (* eps (* eps (* eps eps)))) t_0))))
double code(double x, double eps) {
double t_0 = (x * (x * x)) * (eps * fma(10.0, eps, (x * 5.0)));
double tmp;
if (x <= -3.9e-52) {
tmp = t_0;
} else if (x <= 4.9e-54) {
tmp = 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(10.0, eps, Float64(x * 5.0)))) tmp = 0.0 if (x <= -3.9e-52) tmp = t_0; elseif (x <= 4.9e-54) tmp = Float64(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[(10.0 * eps + N[(x * 5.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.9e-52], t$95$0, If[LessEqual[x, 4.9e-54], N[(eps * 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(10, \varepsilon, x \cdot 5\right)\right)\\
\mathbf{if}\;x \leq -3.9 \cdot 10^{-52}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 4.9 \cdot 10^{-54}:\\
\;\;\;\;\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 < -3.90000000000000018e-52 or 4.90000000000000021e-54 < x Initial program 29.9%
Taylor expanded in x around -inf
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
associate-+r+N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
distribute-rgt1-inN/A
metadata-evalN/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites96.3%
Applied rewrites96.4%
Taylor expanded in x around 0
Applied rewrites96.4%
if -3.90000000000000018e-52 < x < 4.90000000000000021e-54Initial program 100.0%
Taylor expanded in x around 0
lower-pow.f6499.7
Applied rewrites99.7%
Applied rewrites99.6%
Applied rewrites99.6%
Final simplification99.0%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (* x (* x x))))
(if (<= x -3.9e-52)
(* eps (* t_0 (* x 5.0)))
(if (<= x 4.9e-54)
(* eps (* eps (* eps (* eps eps))))
(* t_0 (* x (* eps 5.0)))))))
double code(double x, double eps) {
double t_0 = x * (x * x);
double tmp;
if (x <= -3.9e-52) {
tmp = eps * (t_0 * (x * 5.0));
} else if (x <= 4.9e-54) {
tmp = eps * (eps * (eps * (eps * eps)));
} else {
tmp = t_0 * (x * (eps * 5.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 <= (-3.9d-52)) then
tmp = eps * (t_0 * (x * 5.0d0))
else if (x <= 4.9d-54) then
tmp = eps * (eps * (eps * (eps * eps)))
else
tmp = t_0 * (x * (eps * 5.0d0))
end if
code = tmp
end function
public static double code(double x, double eps) {
double t_0 = x * (x * x);
double tmp;
if (x <= -3.9e-52) {
tmp = eps * (t_0 * (x * 5.0));
} else if (x <= 4.9e-54) {
tmp = eps * (eps * (eps * (eps * eps)));
} else {
tmp = t_0 * (x * (eps * 5.0));
}
return tmp;
}
def code(x, eps): t_0 = x * (x * x) tmp = 0 if x <= -3.9e-52: tmp = eps * (t_0 * (x * 5.0)) elif x <= 4.9e-54: tmp = eps * (eps * (eps * (eps * eps))) else: tmp = t_0 * (x * (eps * 5.0)) return tmp
function code(x, eps) t_0 = Float64(x * Float64(x * x)) tmp = 0.0 if (x <= -3.9e-52) tmp = Float64(eps * Float64(t_0 * Float64(x * 5.0))); elseif (x <= 4.9e-54) tmp = Float64(eps * Float64(eps * Float64(eps * Float64(eps * eps)))); else tmp = Float64(t_0 * Float64(x * Float64(eps * 5.0))); end return tmp end
function tmp_2 = code(x, eps) t_0 = x * (x * x); tmp = 0.0; if (x <= -3.9e-52) tmp = eps * (t_0 * (x * 5.0)); elseif (x <= 4.9e-54) tmp = eps * (eps * (eps * (eps * eps))); else tmp = t_0 * (x * (eps * 5.0)); end tmp_2 = tmp; end
code[x_, eps_] := Block[{t$95$0 = N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.9e-52], N[(eps * N[(t$95$0 * N[(x * 5.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.9e-54], N[(eps * N[(eps * N[(eps * N[(eps * eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(x * N[(eps * 5.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(x \cdot x\right)\\
\mathbf{if}\;x \leq -3.9 \cdot 10^{-52}:\\
\;\;\;\;\varepsilon \cdot \left(t\_0 \cdot \left(x \cdot 5\right)\right)\\
\mathbf{elif}\;x \leq 4.9 \cdot 10^{-54}:\\
\;\;\;\;\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(x \cdot \left(\varepsilon \cdot 5\right)\right)\\
\end{array}
\end{array}
if x < -3.90000000000000018e-52Initial program 29.9%
Taylor expanded in eps around 0
lower-*.f64N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites99.7%
Applied rewrites99.8%
Taylor expanded in x around inf
Applied rewrites96.1%
if -3.90000000000000018e-52 < x < 4.90000000000000021e-54Initial program 100.0%
Taylor expanded in x around 0
lower-pow.f6499.7
Applied rewrites99.7%
Applied rewrites99.6%
Applied rewrites99.6%
if 4.90000000000000021e-54 < x Initial program 29.9%
Taylor expanded in x around -inf
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
associate-+r+N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
distribute-rgt1-inN/A
metadata-evalN/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites94.7%
Applied rewrites94.7%
Taylor expanded in eps around 0
Applied rewrites92.5%
Applied rewrites92.7%
Final simplification98.5%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (* x (* x x))))
(if (<= x -3.9e-52)
(* eps (* t_0 (* x 5.0)))
(if (<= x 4.9e-54)
(* eps (* eps (* eps (* eps eps))))
(* (* x t_0) (* eps 5.0))))))
double code(double x, double eps) {
double t_0 = x * (x * x);
double tmp;
if (x <= -3.9e-52) {
tmp = eps * (t_0 * (x * 5.0));
} else if (x <= 4.9e-54) {
tmp = eps * (eps * (eps * (eps * eps)));
} else {
tmp = (x * t_0) * (eps * 5.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 <= (-3.9d-52)) then
tmp = eps * (t_0 * (x * 5.0d0))
else if (x <= 4.9d-54) then
tmp = eps * (eps * (eps * (eps * eps)))
else
tmp = (x * t_0) * (eps * 5.0d0)
end if
code = tmp
end function
public static double code(double x, double eps) {
double t_0 = x * (x * x);
double tmp;
if (x <= -3.9e-52) {
tmp = eps * (t_0 * (x * 5.0));
} else if (x <= 4.9e-54) {
tmp = eps * (eps * (eps * (eps * eps)));
} else {
tmp = (x * t_0) * (eps * 5.0);
}
return tmp;
}
def code(x, eps): t_0 = x * (x * x) tmp = 0 if x <= -3.9e-52: tmp = eps * (t_0 * (x * 5.0)) elif x <= 4.9e-54: tmp = eps * (eps * (eps * (eps * eps))) else: tmp = (x * t_0) * (eps * 5.0) return tmp
function code(x, eps) t_0 = Float64(x * Float64(x * x)) tmp = 0.0 if (x <= -3.9e-52) tmp = Float64(eps * Float64(t_0 * Float64(x * 5.0))); elseif (x <= 4.9e-54) tmp = Float64(eps * Float64(eps * Float64(eps * Float64(eps * eps)))); else tmp = Float64(Float64(x * t_0) * Float64(eps * 5.0)); end return tmp end
function tmp_2 = code(x, eps) t_0 = x * (x * x); tmp = 0.0; if (x <= -3.9e-52) tmp = eps * (t_0 * (x * 5.0)); elseif (x <= 4.9e-54) tmp = eps * (eps * (eps * (eps * eps))); else tmp = (x * t_0) * (eps * 5.0); end tmp_2 = tmp; end
code[x_, eps_] := Block[{t$95$0 = N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.9e-52], N[(eps * N[(t$95$0 * N[(x * 5.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.9e-54], N[(eps * N[(eps * N[(eps * N[(eps * eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * t$95$0), $MachinePrecision] * N[(eps * 5.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(x \cdot x\right)\\
\mathbf{if}\;x \leq -3.9 \cdot 10^{-52}:\\
\;\;\;\;\varepsilon \cdot \left(t\_0 \cdot \left(x \cdot 5\right)\right)\\
\mathbf{elif}\;x \leq 4.9 \cdot 10^{-54}:\\
\;\;\;\;\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot t\_0\right) \cdot \left(\varepsilon \cdot 5\right)\\
\end{array}
\end{array}
if x < -3.90000000000000018e-52Initial program 29.9%
Taylor expanded in eps around 0
lower-*.f64N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites99.7%
Applied rewrites99.8%
Taylor expanded in x around inf
Applied rewrites96.1%
if -3.90000000000000018e-52 < x < 4.90000000000000021e-54Initial program 100.0%
Taylor expanded in x around 0
lower-pow.f6499.7
Applied rewrites99.7%
Applied rewrites99.6%
Applied rewrites99.6%
if 4.90000000000000021e-54 < x Initial program 29.9%
Taylor expanded in x around -inf
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
associate-+r+N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
distribute-rgt1-inN/A
metadata-evalN/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites94.7%
Applied rewrites94.7%
Taylor expanded in eps around 0
Applied rewrites92.5%
Final simplification98.5%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (* x (* x x))))
(if (<= x -3.9e-52)
(* eps (* t_0 (* x 5.0)))
(if (<= x 4.9e-54)
(* eps (* eps (* eps (* eps eps))))
(* 5.0 (* eps (* x t_0)))))))
double code(double x, double eps) {
double t_0 = x * (x * x);
double tmp;
if (x <= -3.9e-52) {
tmp = eps * (t_0 * (x * 5.0));
} else if (x <= 4.9e-54) {
tmp = eps * (eps * (eps * (eps * eps)));
} else {
tmp = 5.0 * (eps * (x * 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 <= (-3.9d-52)) then
tmp = eps * (t_0 * (x * 5.0d0))
else if (x <= 4.9d-54) then
tmp = eps * (eps * (eps * (eps * eps)))
else
tmp = 5.0d0 * (eps * (x * 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 <= -3.9e-52) {
tmp = eps * (t_0 * (x * 5.0));
} else if (x <= 4.9e-54) {
tmp = eps * (eps * (eps * (eps * eps)));
} else {
tmp = 5.0 * (eps * (x * t_0));
}
return tmp;
}
def code(x, eps): t_0 = x * (x * x) tmp = 0 if x <= -3.9e-52: tmp = eps * (t_0 * (x * 5.0)) elif x <= 4.9e-54: tmp = eps * (eps * (eps * (eps * eps))) else: tmp = 5.0 * (eps * (x * t_0)) return tmp
function code(x, eps) t_0 = Float64(x * Float64(x * x)) tmp = 0.0 if (x <= -3.9e-52) tmp = Float64(eps * Float64(t_0 * Float64(x * 5.0))); elseif (x <= 4.9e-54) tmp = Float64(eps * Float64(eps * Float64(eps * Float64(eps * eps)))); else tmp = Float64(5.0 * Float64(eps * Float64(x * t_0))); end return tmp end
function tmp_2 = code(x, eps) t_0 = x * (x * x); tmp = 0.0; if (x <= -3.9e-52) tmp = eps * (t_0 * (x * 5.0)); elseif (x <= 4.9e-54) tmp = eps * (eps * (eps * (eps * eps))); else tmp = 5.0 * (eps * (x * t_0)); end tmp_2 = tmp; end
code[x_, eps_] := Block[{t$95$0 = N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.9e-52], N[(eps * N[(t$95$0 * N[(x * 5.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.9e-54], N[(eps * N[(eps * N[(eps * N[(eps * eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(5.0 * N[(eps * N[(x * 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 -3.9 \cdot 10^{-52}:\\
\;\;\;\;\varepsilon \cdot \left(t\_0 \cdot \left(x \cdot 5\right)\right)\\
\mathbf{elif}\;x \leq 4.9 \cdot 10^{-54}:\\
\;\;\;\;\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;5 \cdot \left(\varepsilon \cdot \left(x \cdot t\_0\right)\right)\\
\end{array}
\end{array}
if x < -3.90000000000000018e-52Initial program 29.9%
Taylor expanded in eps around 0
lower-*.f64N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites99.7%
Applied rewrites99.8%
Taylor expanded in x around inf
Applied rewrites96.1%
if -3.90000000000000018e-52 < x < 4.90000000000000021e-54Initial program 100.0%
Taylor expanded in x around 0
lower-pow.f6499.7
Applied rewrites99.7%
Applied rewrites99.6%
Applied rewrites99.6%
if 4.90000000000000021e-54 < x Initial program 29.9%
Taylor expanded in eps around 0
lower-*.f64N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites94.6%
Applied rewrites94.9%
Taylor expanded in x around inf
distribute-rgt1-inN/A
metadata-evalN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
metadata-evalN/A
pow-plusN/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6492.3
Applied rewrites92.3%
Final simplification98.5%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (* 5.0 (* eps (* x (* x (* x x)))))))
(if (<= x -3.9e-52)
t_0
(if (<= x 4.9e-54) (* 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 <= -3.9e-52) {
tmp = t_0;
} else if (x <= 4.9e-54) {
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 <= (-3.9d-52)) then
tmp = t_0
else if (x <= 4.9d-54) 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 <= -3.9e-52) {
tmp = t_0;
} else if (x <= 4.9e-54) {
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 <= -3.9e-52: tmp = t_0 elif x <= 4.9e-54: 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 <= -3.9e-52) tmp = t_0; elseif (x <= 4.9e-54) 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 <= -3.9e-52) tmp = t_0; elseif (x <= 4.9e-54) 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, -3.9e-52], t$95$0, If[LessEqual[x, 4.9e-54], 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 -3.9 \cdot 10^{-52}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 4.9 \cdot 10^{-54}:\\
\;\;\;\;\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 < -3.90000000000000018e-52 or 4.90000000000000021e-54 < x Initial program 29.9%
Taylor expanded in eps around 0
lower-*.f64N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites96.4%
Applied rewrites96.7%
Taylor expanded in x around inf
distribute-rgt1-inN/A
metadata-evalN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
metadata-evalN/A
pow-plusN/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6493.6
Applied rewrites93.6%
if -3.90000000000000018e-52 < x < 4.90000000000000021e-54Initial program 100.0%
Taylor expanded in x around 0
lower-pow.f6499.7
Applied rewrites99.7%
Applied rewrites99.6%
Applied rewrites99.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 86.6%
Taylor expanded in x around 0
lower-pow.f6485.1
Applied rewrites85.1%
Applied rewrites85.0%
Applied rewrites85.0%
Final simplification85.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(Float64(eps * eps) * Float64(eps * Float64(eps * eps))) end
function tmp = code(x, eps) tmp = (eps * eps) * (eps * (eps * eps)); end
code[x_, eps_] := N[(N[(eps * eps), $MachinePrecision] * N[(eps * N[(eps * eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\varepsilon \cdot \varepsilon\right) \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right)
\end{array}
Initial program 86.6%
Taylor expanded in x around 0
lower-pow.f6485.1
Applied rewrites85.1%
Applied rewrites85.0%
Final simplification85.0%
herbie shell --seed 2024234
(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)))