
(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 19 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
(let* ((t_0 (pow (+ x eps) 5.0))
(t_1 (- t_0 (pow x 5.0)))
(t_2 (* x (* x x))))
(if (<= t_1 -2e-305)
(- t_0 (* (* x x) t_2))
(if (<= t_1 0.0)
(* (pow x 4.0) (- (* eps 5.0) (/ (* (* eps eps) -10.0) x)))
(fma t_2 (* x (- x)) t_0)))))
double code(double x, double eps) {
double t_0 = pow((x + eps), 5.0);
double t_1 = t_0 - pow(x, 5.0);
double t_2 = x * (x * x);
double tmp;
if (t_1 <= -2e-305) {
tmp = t_0 - ((x * x) * t_2);
} else if (t_1 <= 0.0) {
tmp = pow(x, 4.0) * ((eps * 5.0) - (((eps * eps) * -10.0) / x));
} else {
tmp = fma(t_2, (x * -x), t_0);
}
return tmp;
}
function code(x, eps) t_0 = Float64(x + eps) ^ 5.0 t_1 = Float64(t_0 - (x ^ 5.0)) t_2 = Float64(x * Float64(x * x)) tmp = 0.0 if (t_1 <= -2e-305) tmp = Float64(t_0 - Float64(Float64(x * x) * t_2)); elseif (t_1 <= 0.0) tmp = Float64((x ^ 4.0) * Float64(Float64(eps * 5.0) - Float64(Float64(Float64(eps * eps) * -10.0) / x))); else tmp = fma(t_2, Float64(x * Float64(-x)), t_0); end return tmp end
code[x_, eps_] := Block[{t$95$0 = N[Power[N[(x + eps), $MachinePrecision], 5.0], $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 - N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e-305], N[(t$95$0 - N[(N[(x * x), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(N[Power[x, 4.0], $MachinePrecision] * N[(N[(eps * 5.0), $MachinePrecision] - N[(N[(N[(eps * eps), $MachinePrecision] * -10.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[(x * (-x)), $MachinePrecision] + t$95$0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(x + \varepsilon\right)}^{5}\\
t_1 := t\_0 - {x}^{5}\\
t_2 := x \cdot \left(x \cdot x\right)\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-305}:\\
\;\;\;\;t\_0 - \left(x \cdot x\right) \cdot t\_2\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;{x}^{4} \cdot \left(\varepsilon \cdot 5 - \frac{\left(\varepsilon \cdot \varepsilon\right) \cdot -10}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_2, x \cdot \left(-x\right), t\_0\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -1.99999999999999999e-305Initial program 97.5%
lift-+.f64N/A
lift-pow.f64N/A
lift-pow.f64N/A
lift--.f6497.5
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
pow2N/A
lower-*.f64N/A
cube-multN/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6497.5
Applied rewrites97.5%
if -1.99999999999999999e-305 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 0.0Initial program 83.1%
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 rewrites99.9%
if 0.0 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) Initial program 96.8%
lift-+.f64N/A
lift-pow.f64N/A
lift-pow.f64N/A
lift--.f6496.8
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
pow2N/A
lower-*.f64N/A
cube-multN/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6496.8
Applied rewrites96.8%
lift-+.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
lower-neg.f6496.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6496.9
Applied rewrites96.9%
Final simplification99.4%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (pow (+ x eps) 5.0))
(t_1 (- t_0 (pow x 5.0)))
(t_2 (* x (* x x))))
(if (<= t_1 -2e-305)
(- t_0 (* (* x x) t_2))
(if (<= t_1 0.0) (* (pow x 4.0) (* eps 5.0)) (fma t_2 (* x (- x)) t_0)))))
double code(double x, double eps) {
double t_0 = pow((x + eps), 5.0);
double t_1 = t_0 - pow(x, 5.0);
double t_2 = x * (x * x);
double tmp;
if (t_1 <= -2e-305) {
tmp = t_0 - ((x * x) * t_2);
} else if (t_1 <= 0.0) {
tmp = pow(x, 4.0) * (eps * 5.0);
} else {
tmp = fma(t_2, (x * -x), t_0);
}
return tmp;
}
function code(x, eps) t_0 = Float64(x + eps) ^ 5.0 t_1 = Float64(t_0 - (x ^ 5.0)) t_2 = Float64(x * Float64(x * x)) tmp = 0.0 if (t_1 <= -2e-305) tmp = Float64(t_0 - Float64(Float64(x * x) * t_2)); elseif (t_1 <= 0.0) tmp = Float64((x ^ 4.0) * Float64(eps * 5.0)); else tmp = fma(t_2, Float64(x * Float64(-x)), t_0); end return tmp end
code[x_, eps_] := Block[{t$95$0 = N[Power[N[(x + eps), $MachinePrecision], 5.0], $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 - N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e-305], N[(t$95$0 - N[(N[(x * x), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(N[Power[x, 4.0], $MachinePrecision] * N[(eps * 5.0), $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[(x * (-x)), $MachinePrecision] + t$95$0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(x + \varepsilon\right)}^{5}\\
t_1 := t\_0 - {x}^{5}\\
t_2 := x \cdot \left(x \cdot x\right)\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-305}:\\
\;\;\;\;t\_0 - \left(x \cdot x\right) \cdot t\_2\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;{x}^{4} \cdot \left(\varepsilon \cdot 5\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_2, x \cdot \left(-x\right), t\_0\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -1.99999999999999999e-305Initial program 97.5%
lift-+.f64N/A
lift-pow.f64N/A
lift-pow.f64N/A
lift--.f6497.5
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
pow2N/A
lower-*.f64N/A
cube-multN/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6497.5
Applied rewrites97.5%
if -1.99999999999999999e-305 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 0.0Initial program 83.1%
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 rewrites99.9%
Taylor expanded in eps around 0
lower-*.f6499.9
Applied rewrites99.9%
if 0.0 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) Initial program 96.8%
lift-+.f64N/A
lift-pow.f64N/A
lift-pow.f64N/A
lift--.f6496.8
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
pow2N/A
lower-*.f64N/A
cube-multN/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6496.8
Applied rewrites96.8%
lift-+.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
lower-neg.f6496.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6496.9
Applied rewrites96.9%
Final simplification99.4%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (pow (+ x eps) 5.0))
(t_1 (- t_0 (pow x 5.0)))
(t_2 (- t_0 (* (* x x) (* x (* x x))))))
(if (<= t_1 -2e-305)
t_2
(if (<= t_1 0.0) (* (pow x 4.0) (* eps 5.0)) t_2))))
double code(double x, double eps) {
double t_0 = pow((x + eps), 5.0);
double t_1 = t_0 - pow(x, 5.0);
double t_2 = t_0 - ((x * x) * (x * (x * x)));
double tmp;
if (t_1 <= -2e-305) {
tmp = t_2;
} else if (t_1 <= 0.0) {
tmp = pow(x, 4.0) * (eps * 5.0);
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = (x + eps) ** 5.0d0
t_1 = t_0 - (x ** 5.0d0)
t_2 = t_0 - ((x * x) * (x * (x * x)))
if (t_1 <= (-2d-305)) then
tmp = t_2
else if (t_1 <= 0.0d0) then
tmp = (x ** 4.0d0) * (eps * 5.0d0)
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double eps) {
double t_0 = Math.pow((x + eps), 5.0);
double t_1 = t_0 - Math.pow(x, 5.0);
double t_2 = t_0 - ((x * x) * (x * (x * x)));
double tmp;
if (t_1 <= -2e-305) {
tmp = t_2;
} else if (t_1 <= 0.0) {
tmp = Math.pow(x, 4.0) * (eps * 5.0);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, eps): t_0 = math.pow((x + eps), 5.0) t_1 = t_0 - math.pow(x, 5.0) t_2 = t_0 - ((x * x) * (x * (x * x))) tmp = 0 if t_1 <= -2e-305: tmp = t_2 elif t_1 <= 0.0: tmp = math.pow(x, 4.0) * (eps * 5.0) else: tmp = t_2 return tmp
function code(x, eps) t_0 = Float64(x + eps) ^ 5.0 t_1 = Float64(t_0 - (x ^ 5.0)) t_2 = Float64(t_0 - Float64(Float64(x * x) * Float64(x * Float64(x * x)))) tmp = 0.0 if (t_1 <= -2e-305) tmp = t_2; elseif (t_1 <= 0.0) tmp = Float64((x ^ 4.0) * Float64(eps * 5.0)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, eps) t_0 = (x + eps) ^ 5.0; t_1 = t_0 - (x ^ 5.0); t_2 = t_0 - ((x * x) * (x * (x * x))); tmp = 0.0; if (t_1 <= -2e-305) tmp = t_2; elseif (t_1 <= 0.0) tmp = (x ^ 4.0) * (eps * 5.0); else tmp = t_2; end tmp_2 = tmp; end
code[x_, eps_] := Block[{t$95$0 = N[Power[N[(x + eps), $MachinePrecision], 5.0], $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 - N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 - N[(N[(x * x), $MachinePrecision] * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e-305], t$95$2, If[LessEqual[t$95$1, 0.0], N[(N[Power[x, 4.0], $MachinePrecision] * N[(eps * 5.0), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(x + \varepsilon\right)}^{5}\\
t_1 := t\_0 - {x}^{5}\\
t_2 := t\_0 - \left(x \cdot x\right) \cdot \left(x \cdot \left(x \cdot x\right)\right)\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-305}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;{x}^{4} \cdot \left(\varepsilon \cdot 5\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -1.99999999999999999e-305 or 0.0 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) Initial program 97.2%
lift-+.f64N/A
lift-pow.f64N/A
lift-pow.f64N/A
lift--.f6497.2
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
pow2N/A
lower-*.f64N/A
cube-multN/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6497.2
Applied rewrites97.2%
if -1.99999999999999999e-305 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 0.0Initial program 83.1%
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 rewrites99.9%
Taylor expanded in eps around 0
lower-*.f6499.9
Applied rewrites99.9%
Final simplification99.4%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (- (pow (+ x eps) 5.0) (pow x 5.0)))
(t_1 (* (pow eps 5.0) (fma 5.0 (/ x eps) 1.0))))
(if (<= t_0 -2e-305)
t_1
(if (<= t_0 0.0) (* (pow x 4.0) (* eps 5.0)) t_1))))
double code(double x, double eps) {
double t_0 = pow((x + eps), 5.0) - pow(x, 5.0);
double t_1 = pow(eps, 5.0) * fma(5.0, (x / eps), 1.0);
double tmp;
if (t_0 <= -2e-305) {
tmp = t_1;
} else if (t_0 <= 0.0) {
tmp = pow(x, 4.0) * (eps * 5.0);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, eps) t_0 = Float64((Float64(x + eps) ^ 5.0) - (x ^ 5.0)) t_1 = Float64((eps ^ 5.0) * fma(5.0, Float64(x / eps), 1.0)) tmp = 0.0 if (t_0 <= -2e-305) tmp = t_1; elseif (t_0 <= 0.0) tmp = Float64((x ^ 4.0) * Float64(eps * 5.0)); else tmp = t_1; end return tmp end
code[x_, eps_] := Block[{t$95$0 = N[(N[Power[N[(x + eps), $MachinePrecision], 5.0], $MachinePrecision] - N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[eps, 5.0], $MachinePrecision] * N[(5.0 * N[(x / eps), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e-305], t$95$1, If[LessEqual[t$95$0, 0.0], N[(N[Power[x, 4.0], $MachinePrecision] * N[(eps * 5.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(x + \varepsilon\right)}^{5} - {x}^{5}\\
t_1 := {\varepsilon}^{5} \cdot \mathsf{fma}\left(5, \frac{x}{\varepsilon}, 1\right)\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{-305}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;{x}^{4} \cdot \left(\varepsilon \cdot 5\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -1.99999999999999999e-305 or 0.0 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) Initial program 97.2%
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-/.f6493.8
Applied rewrites93.8%
if -1.99999999999999999e-305 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 0.0Initial program 83.1%
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 rewrites99.9%
Taylor expanded in eps around 0
lower-*.f6499.9
Applied rewrites99.9%
Final simplification98.7%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (- (pow (+ x eps) 5.0) (pow x 5.0))))
(if (<= t_0 -2e-305)
(pow eps 5.0)
(if (<= t_0 0.0)
(* (pow x 4.0) (* eps 5.0))
(* (pow eps 4.0) (fma 5.0 x eps))))))
double code(double x, double eps) {
double t_0 = pow((x + eps), 5.0) - pow(x, 5.0);
double tmp;
if (t_0 <= -2e-305) {
tmp = pow(eps, 5.0);
} else if (t_0 <= 0.0) {
tmp = pow(x, 4.0) * (eps * 5.0);
} else {
tmp = pow(eps, 4.0) * fma(5.0, x, eps);
}
return tmp;
}
function code(x, eps) t_0 = Float64((Float64(x + eps) ^ 5.0) - (x ^ 5.0)) tmp = 0.0 if (t_0 <= -2e-305) tmp = eps ^ 5.0; elseif (t_0 <= 0.0) tmp = Float64((x ^ 4.0) * Float64(eps * 5.0)); else tmp = Float64((eps ^ 4.0) * fma(5.0, x, eps)); end return tmp end
code[x_, eps_] := Block[{t$95$0 = N[(N[Power[N[(x + eps), $MachinePrecision], 5.0], $MachinePrecision] - N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e-305], N[Power[eps, 5.0], $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(N[Power[x, 4.0], $MachinePrecision] * N[(eps * 5.0), $MachinePrecision]), $MachinePrecision], N[(N[Power[eps, 4.0], $MachinePrecision] * N[(5.0 * x + eps), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(x + \varepsilon\right)}^{5} - {x}^{5}\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{-305}:\\
\;\;\;\;{\varepsilon}^{5}\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;{x}^{4} \cdot \left(\varepsilon \cdot 5\right)\\
\mathbf{else}:\\
\;\;\;\;{\varepsilon}^{4} \cdot \mathsf{fma}\left(5, x, \varepsilon\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -1.99999999999999999e-305Initial program 97.5%
Taylor expanded in x around 0
lower-pow.f6496.7
Applied rewrites96.7%
if -1.99999999999999999e-305 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 0.0Initial program 83.1%
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 rewrites99.9%
Taylor expanded in eps around 0
lower-*.f6499.9
Applied rewrites99.9%
if 0.0 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) Initial program 96.8%
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-/.f6490.4
Applied rewrites90.4%
Taylor expanded in eps around 0
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
lower-fma.f6490.2
Applied rewrites90.2%
Final simplification98.7%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (- (pow (+ x eps) 5.0) (pow x 5.0)))
(t_1 (* eps (* eps (* eps eps)))))
(if (<= t_0 -2e-305)
(pow eps 5.0)
(if (<= t_0 0.0)
(* (pow x 4.0) (* eps 5.0))
(fma t_1 eps (* t_1 (* x 5.0)))))))
double code(double x, double eps) {
double t_0 = pow((x + eps), 5.0) - pow(x, 5.0);
double t_1 = eps * (eps * (eps * eps));
double tmp;
if (t_0 <= -2e-305) {
tmp = pow(eps, 5.0);
} else if (t_0 <= 0.0) {
tmp = pow(x, 4.0) * (eps * 5.0);
} else {
tmp = fma(t_1, eps, (t_1 * (x * 5.0)));
}
return tmp;
}
function code(x, eps) t_0 = Float64((Float64(x + eps) ^ 5.0) - (x ^ 5.0)) t_1 = Float64(eps * Float64(eps * Float64(eps * eps))) tmp = 0.0 if (t_0 <= -2e-305) tmp = eps ^ 5.0; elseif (t_0 <= 0.0) tmp = Float64((x ^ 4.0) * Float64(eps * 5.0)); else tmp = fma(t_1, eps, Float64(t_1 * Float64(x * 5.0))); end return tmp end
code[x_, eps_] := Block[{t$95$0 = N[(N[Power[N[(x + eps), $MachinePrecision], 5.0], $MachinePrecision] - N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(eps * N[(eps * N[(eps * eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e-305], N[Power[eps, 5.0], $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(N[Power[x, 4.0], $MachinePrecision] * N[(eps * 5.0), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * eps + N[(t$95$1 * N[(x * 5.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(x + \varepsilon\right)}^{5} - {x}^{5}\\
t_1 := \varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right)\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{-305}:\\
\;\;\;\;{\varepsilon}^{5}\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;{x}^{4} \cdot \left(\varepsilon \cdot 5\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, \varepsilon, t\_1 \cdot \left(x \cdot 5\right)\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -1.99999999999999999e-305Initial program 97.5%
Taylor expanded in x around 0
lower-pow.f6496.7
Applied rewrites96.7%
if -1.99999999999999999e-305 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 0.0Initial program 83.1%
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 rewrites99.9%
Taylor expanded in eps around 0
lower-*.f6499.9
Applied rewrites99.9%
if 0.0 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) Initial program 96.8%
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-/.f6490.4
Applied rewrites90.4%
Taylor expanded in eps around 0
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
lower-fma.f6490.2
Applied rewrites90.2%
lift-pow.f64N/A
distribute-rgt-inN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
pow2N/A
pow2N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
pow2N/A
pow2N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lower-*.f64N/A
lower-*.f6490.0
Applied rewrites90.0%
Final simplification98.6%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (- (pow (+ x eps) 5.0) (pow x 5.0)))
(t_1 (* eps (* eps (* eps eps)))))
(if (<= t_0 -2e-305)
(pow eps 5.0)
(if (<= t_0 0.0)
(* (fma eps 5.0 (* 10.0 (/ (* eps eps) x))) (* x (* x (* x x))))
(fma t_1 eps (* t_1 (* x 5.0)))))))
double code(double x, double eps) {
double t_0 = pow((x + eps), 5.0) - pow(x, 5.0);
double t_1 = eps * (eps * (eps * eps));
double tmp;
if (t_0 <= -2e-305) {
tmp = pow(eps, 5.0);
} else if (t_0 <= 0.0) {
tmp = fma(eps, 5.0, (10.0 * ((eps * eps) / x))) * (x * (x * (x * x)));
} else {
tmp = fma(t_1, eps, (t_1 * (x * 5.0)));
}
return tmp;
}
function code(x, eps) t_0 = Float64((Float64(x + eps) ^ 5.0) - (x ^ 5.0)) t_1 = Float64(eps * Float64(eps * Float64(eps * eps))) tmp = 0.0 if (t_0 <= -2e-305) tmp = eps ^ 5.0; elseif (t_0 <= 0.0) tmp = Float64(fma(eps, 5.0, Float64(10.0 * Float64(Float64(eps * eps) / x))) * Float64(x * Float64(x * Float64(x * x)))); else tmp = fma(t_1, eps, Float64(t_1 * Float64(x * 5.0))); end return tmp end
code[x_, eps_] := Block[{t$95$0 = N[(N[Power[N[(x + eps), $MachinePrecision], 5.0], $MachinePrecision] - N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(eps * N[(eps * N[(eps * eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e-305], N[Power[eps, 5.0], $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(N[(eps * 5.0 + N[(10.0 * N[(N[(eps * eps), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * eps + N[(t$95$1 * N[(x * 5.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(x + \varepsilon\right)}^{5} - {x}^{5}\\
t_1 := \varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right)\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{-305}:\\
\;\;\;\;{\varepsilon}^{5}\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\mathsf{fma}\left(\varepsilon, 5, 10 \cdot \frac{\varepsilon \cdot \varepsilon}{x}\right) \cdot \left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, \varepsilon, t\_1 \cdot \left(x \cdot 5\right)\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -1.99999999999999999e-305Initial program 97.5%
Taylor expanded in x around 0
lower-pow.f6496.7
Applied rewrites96.7%
if -1.99999999999999999e-305 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 0.0Initial program 83.1%
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 rewrites99.9%
lift-pow.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f6499.9
Applied rewrites99.9%
if 0.0 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) Initial program 96.8%
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-/.f6490.4
Applied rewrites90.4%
Taylor expanded in eps around 0
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
lower-fma.f6490.2
Applied rewrites90.2%
lift-pow.f64N/A
distribute-rgt-inN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
pow2N/A
pow2N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
pow2N/A
pow2N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lower-*.f64N/A
lower-*.f6490.0
Applied rewrites90.0%
Final simplification98.6%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (fma eps eps (* x (* x 25.0))))
(t_1 (- (pow (+ x eps) 5.0) (pow x 5.0)))
(t_2 (* eps (* eps eps)))
(t_3 (* eps t_2)))
(if (<= t_1 -2e-305)
(* (/ (* t_2 t_0) t_0) (/ eps (/ 1.0 (fma 5.0 x eps))))
(if (<= t_1 0.0)
(* (fma eps 5.0 (* 10.0 (/ (* eps eps) x))) (* x (* x (* x x))))
(fma t_3 eps (* t_3 (* x 5.0)))))))
double code(double x, double eps) {
double t_0 = fma(eps, eps, (x * (x * 25.0)));
double t_1 = pow((x + eps), 5.0) - pow(x, 5.0);
double t_2 = eps * (eps * eps);
double t_3 = eps * t_2;
double tmp;
if (t_1 <= -2e-305) {
tmp = ((t_2 * t_0) / t_0) * (eps / (1.0 / fma(5.0, x, eps)));
} else if (t_1 <= 0.0) {
tmp = fma(eps, 5.0, (10.0 * ((eps * eps) / x))) * (x * (x * (x * x)));
} else {
tmp = fma(t_3, eps, (t_3 * (x * 5.0)));
}
return tmp;
}
function code(x, eps) t_0 = fma(eps, eps, Float64(x * Float64(x * 25.0))) t_1 = Float64((Float64(x + eps) ^ 5.0) - (x ^ 5.0)) t_2 = Float64(eps * Float64(eps * eps)) t_3 = Float64(eps * t_2) tmp = 0.0 if (t_1 <= -2e-305) tmp = Float64(Float64(Float64(t_2 * t_0) / t_0) * Float64(eps / Float64(1.0 / fma(5.0, x, eps)))); elseif (t_1 <= 0.0) tmp = Float64(fma(eps, 5.0, Float64(10.0 * Float64(Float64(eps * eps) / x))) * Float64(x * Float64(x * Float64(x * x)))); else tmp = fma(t_3, eps, Float64(t_3 * Float64(x * 5.0))); end return tmp end
code[x_, eps_] := Block[{t$95$0 = N[(eps * eps + N[(x * N[(x * 25.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[N[(x + eps), $MachinePrecision], 5.0], $MachinePrecision] - N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(eps * N[(eps * eps), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(eps * t$95$2), $MachinePrecision]}, If[LessEqual[t$95$1, -2e-305], N[(N[(N[(t$95$2 * t$95$0), $MachinePrecision] / t$95$0), $MachinePrecision] * N[(eps / N[(1.0 / N[(5.0 * x + eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(N[(eps * 5.0 + N[(10.0 * N[(N[(eps * eps), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$3 * eps + N[(t$95$3 * N[(x * 5.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(\varepsilon, \varepsilon, x \cdot \left(x \cdot 25\right)\right)\\
t_1 := {\left(x + \varepsilon\right)}^{5} - {x}^{5}\\
t_2 := \varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\\
t_3 := \varepsilon \cdot t\_2\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-305}:\\
\;\;\;\;\frac{t\_2 \cdot t\_0}{t\_0} \cdot \frac{\varepsilon}{\frac{1}{\mathsf{fma}\left(5, x, \varepsilon\right)}}\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\mathsf{fma}\left(\varepsilon, 5, 10 \cdot \frac{\varepsilon \cdot \varepsilon}{x}\right) \cdot \left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_3, \varepsilon, t\_3 \cdot \left(x \cdot 5\right)\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -1.99999999999999999e-305Initial program 97.5%
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-/.f6496.7
Applied rewrites96.7%
Taylor expanded in eps around 0
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
lower-fma.f6496.4
Applied rewrites96.4%
lift-pow.f64N/A
distribute-rgt-inN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
pow2N/A
pow2N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
pow2N/A
pow2N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lower-*.f64N/A
lower-*.f6495.9
Applied rewrites95.9%
Applied rewrites96.0%
if -1.99999999999999999e-305 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 0.0Initial program 83.1%
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 rewrites99.9%
lift-pow.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f6499.9
Applied rewrites99.9%
if 0.0 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) Initial program 96.8%
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-/.f6490.4
Applied rewrites90.4%
Taylor expanded in eps around 0
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
lower-fma.f6490.2
Applied rewrites90.2%
lift-pow.f64N/A
distribute-rgt-inN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
pow2N/A
pow2N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
pow2N/A
pow2N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lower-*.f64N/A
lower-*.f6490.0
Applied rewrites90.0%
Final simplification98.5%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (- (pow (+ x eps) 5.0) (pow x 5.0)))
(t_1 (* eps (* eps (* eps eps)))))
(if (<= t_0 -2e-305)
(* (fma 5.0 x eps) t_1)
(if (<= t_0 0.0)
(* (fma eps 5.0 (* 10.0 (/ (* eps eps) x))) (* x (* x (* x x))))
(fma t_1 eps (* t_1 (* x 5.0)))))))
double code(double x, double eps) {
double t_0 = pow((x + eps), 5.0) - pow(x, 5.0);
double t_1 = eps * (eps * (eps * eps));
double tmp;
if (t_0 <= -2e-305) {
tmp = fma(5.0, x, eps) * t_1;
} else if (t_0 <= 0.0) {
tmp = fma(eps, 5.0, (10.0 * ((eps * eps) / x))) * (x * (x * (x * x)));
} else {
tmp = fma(t_1, eps, (t_1 * (x * 5.0)));
}
return tmp;
}
function code(x, eps) t_0 = Float64((Float64(x + eps) ^ 5.0) - (x ^ 5.0)) t_1 = Float64(eps * Float64(eps * Float64(eps * eps))) tmp = 0.0 if (t_0 <= -2e-305) tmp = Float64(fma(5.0, x, eps) * t_1); elseif (t_0 <= 0.0) tmp = Float64(fma(eps, 5.0, Float64(10.0 * Float64(Float64(eps * eps) / x))) * Float64(x * Float64(x * Float64(x * x)))); else tmp = fma(t_1, eps, Float64(t_1 * Float64(x * 5.0))); end return tmp end
code[x_, eps_] := Block[{t$95$0 = N[(N[Power[N[(x + eps), $MachinePrecision], 5.0], $MachinePrecision] - N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(eps * N[(eps * N[(eps * eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e-305], N[(N[(5.0 * x + eps), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(N[(eps * 5.0 + N[(10.0 * N[(N[(eps * eps), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * eps + N[(t$95$1 * N[(x * 5.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(x + \varepsilon\right)}^{5} - {x}^{5}\\
t_1 := \varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right)\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{-305}:\\
\;\;\;\;\mathsf{fma}\left(5, x, \varepsilon\right) \cdot t\_1\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\mathsf{fma}\left(\varepsilon, 5, 10 \cdot \frac{\varepsilon \cdot \varepsilon}{x}\right) \cdot \left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, \varepsilon, t\_1 \cdot \left(x \cdot 5\right)\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -1.99999999999999999e-305Initial program 97.5%
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-/.f6496.7
Applied rewrites96.7%
Taylor expanded in eps around 0
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
lower-fma.f6496.4
Applied rewrites96.4%
lift-pow.f64N/A
lift-fma.f64N/A
*-commutativeN/A
lower-*.f6496.4
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
pow2N/A
pow2N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lower-*.f6495.9
Applied rewrites95.9%
if -1.99999999999999999e-305 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 0.0Initial program 83.1%
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 rewrites99.9%
lift-pow.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f6499.9
Applied rewrites99.9%
if 0.0 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) Initial program 96.8%
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-/.f6490.4
Applied rewrites90.4%
Taylor expanded in eps around 0
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
lower-fma.f6490.2
Applied rewrites90.2%
lift-pow.f64N/A
distribute-rgt-inN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
pow2N/A
pow2N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
pow2N/A
pow2N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lower-*.f64N/A
lower-*.f6490.0
Applied rewrites90.0%
Final simplification98.5%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (- (pow (+ x eps) 5.0) (pow x 5.0)))
(t_1 (* eps (* eps (* eps eps)))))
(if (<= t_0 -2e-305)
(* (fma 5.0 x eps) t_1)
(if (<= t_0 0.0)
(* (fma eps 10.0 (* x 5.0)) (* eps (* x (* x x))))
(fma t_1 eps (* t_1 (* x 5.0)))))))
double code(double x, double eps) {
double t_0 = pow((x + eps), 5.0) - pow(x, 5.0);
double t_1 = eps * (eps * (eps * eps));
double tmp;
if (t_0 <= -2e-305) {
tmp = fma(5.0, x, eps) * t_1;
} else if (t_0 <= 0.0) {
tmp = fma(eps, 10.0, (x * 5.0)) * (eps * (x * (x * x)));
} else {
tmp = fma(t_1, eps, (t_1 * (x * 5.0)));
}
return tmp;
}
function code(x, eps) t_0 = Float64((Float64(x + eps) ^ 5.0) - (x ^ 5.0)) t_1 = Float64(eps * Float64(eps * Float64(eps * eps))) tmp = 0.0 if (t_0 <= -2e-305) tmp = Float64(fma(5.0, x, eps) * t_1); elseif (t_0 <= 0.0) tmp = Float64(fma(eps, 10.0, Float64(x * 5.0)) * Float64(eps * Float64(x * Float64(x * x)))); else tmp = fma(t_1, eps, Float64(t_1 * Float64(x * 5.0))); end return tmp end
code[x_, eps_] := Block[{t$95$0 = N[(N[Power[N[(x + eps), $MachinePrecision], 5.0], $MachinePrecision] - N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(eps * N[(eps * N[(eps * eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e-305], N[(N[(5.0 * x + eps), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(N[(eps * 10.0 + N[(x * 5.0), $MachinePrecision]), $MachinePrecision] * N[(eps * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * eps + N[(t$95$1 * N[(x * 5.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(x + \varepsilon\right)}^{5} - {x}^{5}\\
t_1 := \varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right)\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{-305}:\\
\;\;\;\;\mathsf{fma}\left(5, x, \varepsilon\right) \cdot t\_1\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\mathsf{fma}\left(\varepsilon, 10, x \cdot 5\right) \cdot \left(\varepsilon \cdot \left(x \cdot \left(x \cdot x\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, \varepsilon, t\_1 \cdot \left(x \cdot 5\right)\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -1.99999999999999999e-305Initial program 97.5%
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-/.f6496.7
Applied rewrites96.7%
Taylor expanded in eps around 0
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
lower-fma.f6496.4
Applied rewrites96.4%
lift-pow.f64N/A
lift-fma.f64N/A
*-commutativeN/A
lower-*.f6496.4
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
pow2N/A
pow2N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lower-*.f6495.9
Applied rewrites95.9%
if -1.99999999999999999e-305 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 0.0Initial program 83.1%
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 rewrites99.9%
Taylor expanded in x around 0
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
unpow2N/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6499.9
Applied rewrites99.9%
Applied rewrites99.9%
if 0.0 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) Initial program 96.8%
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-/.f6490.4
Applied rewrites90.4%
Taylor expanded in eps around 0
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
lower-fma.f6490.2
Applied rewrites90.2%
lift-pow.f64N/A
distribute-rgt-inN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
pow2N/A
pow2N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
pow2N/A
pow2N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lower-*.f64N/A
lower-*.f6490.0
Applied rewrites90.0%
Final simplification98.5%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (- (pow (+ x eps) 5.0) (pow x 5.0)))
(t_1 (* (fma 5.0 x eps) (* eps (* eps (* eps eps))))))
(if (<= t_0 -2e-305)
t_1
(if (<= t_0 0.0)
(* (fma eps 10.0 (* x 5.0)) (* eps (* x (* x x))))
t_1))))
double code(double x, double eps) {
double t_0 = pow((x + eps), 5.0) - pow(x, 5.0);
double t_1 = fma(5.0, x, eps) * (eps * (eps * (eps * eps)));
double tmp;
if (t_0 <= -2e-305) {
tmp = t_1;
} else if (t_0 <= 0.0) {
tmp = fma(eps, 10.0, (x * 5.0)) * (eps * (x * (x * x)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, eps) t_0 = Float64((Float64(x + eps) ^ 5.0) - (x ^ 5.0)) t_1 = Float64(fma(5.0, x, eps) * Float64(eps * Float64(eps * Float64(eps * eps)))) tmp = 0.0 if (t_0 <= -2e-305) tmp = t_1; elseif (t_0 <= 0.0) tmp = Float64(fma(eps, 10.0, Float64(x * 5.0)) * Float64(eps * Float64(x * Float64(x * x)))); else tmp = t_1; end return tmp end
code[x_, eps_] := Block[{t$95$0 = N[(N[Power[N[(x + eps), $MachinePrecision], 5.0], $MachinePrecision] - N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(5.0 * x + eps), $MachinePrecision] * N[(eps * N[(eps * N[(eps * eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e-305], t$95$1, If[LessEqual[t$95$0, 0.0], N[(N[(eps * 10.0 + N[(x * 5.0), $MachinePrecision]), $MachinePrecision] * N[(eps * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(x + \varepsilon\right)}^{5} - {x}^{5}\\
t_1 := \mathsf{fma}\left(5, x, \varepsilon\right) \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right)\right)\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{-305}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\mathsf{fma}\left(\varepsilon, 10, x \cdot 5\right) \cdot \left(\varepsilon \cdot \left(x \cdot \left(x \cdot x\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -1.99999999999999999e-305 or 0.0 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) Initial program 97.2%
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-/.f6493.8
Applied rewrites93.8%
Taylor expanded in eps around 0
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
lower-fma.f6493.5
Applied rewrites93.5%
lift-pow.f64N/A
lift-fma.f64N/A
*-commutativeN/A
lower-*.f6493.5
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
pow2N/A
pow2N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lower-*.f6493.2
Applied rewrites93.2%
if -1.99999999999999999e-305 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 0.0Initial program 83.1%
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 rewrites99.9%
Taylor expanded in x around 0
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
unpow2N/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6499.9
Applied rewrites99.9%
Applied rewrites99.9%
Final simplification98.5%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (- (pow (+ x eps) 5.0) (pow x 5.0)))
(t_1 (* (fma 5.0 x eps) (* eps (* eps (* eps eps))))))
(if (<= t_0 -2e-305)
t_1
(if (<= t_0 0.0)
(* (* x (* x x)) (* eps (fma 5.0 x (* eps 10.0))))
t_1))))
double code(double x, double eps) {
double t_0 = pow((x + eps), 5.0) - pow(x, 5.0);
double t_1 = fma(5.0, x, eps) * (eps * (eps * (eps * eps)));
double tmp;
if (t_0 <= -2e-305) {
tmp = t_1;
} else if (t_0 <= 0.0) {
tmp = (x * (x * x)) * (eps * fma(5.0, x, (eps * 10.0)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, eps) t_0 = Float64((Float64(x + eps) ^ 5.0) - (x ^ 5.0)) t_1 = Float64(fma(5.0, x, eps) * Float64(eps * Float64(eps * Float64(eps * eps)))) tmp = 0.0 if (t_0 <= -2e-305) tmp = t_1; elseif (t_0 <= 0.0) tmp = Float64(Float64(x * Float64(x * x)) * Float64(eps * fma(5.0, x, Float64(eps * 10.0)))); else tmp = t_1; end return tmp end
code[x_, eps_] := Block[{t$95$0 = N[(N[Power[N[(x + eps), $MachinePrecision], 5.0], $MachinePrecision] - N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(5.0 * x + eps), $MachinePrecision] * N[(eps * N[(eps * N[(eps * eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e-305], t$95$1, If[LessEqual[t$95$0, 0.0], N[(N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision] * N[(eps * N[(5.0 * x + N[(eps * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(x + \varepsilon\right)}^{5} - {x}^{5}\\
t_1 := \mathsf{fma}\left(5, x, \varepsilon\right) \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right)\right)\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{-305}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 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{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -1.99999999999999999e-305 or 0.0 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) Initial program 97.2%
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-/.f6493.8
Applied rewrites93.8%
Taylor expanded in eps around 0
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
lower-fma.f6493.5
Applied rewrites93.5%
lift-pow.f64N/A
lift-fma.f64N/A
*-commutativeN/A
lower-*.f6493.5
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
pow2N/A
pow2N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lower-*.f6493.2
Applied rewrites93.2%
if -1.99999999999999999e-305 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 0.0Initial program 83.1%
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 rewrites99.9%
Taylor expanded in x around 0
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
unpow2N/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6499.9
Applied rewrites99.9%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (- (pow (+ x eps) 5.0) (pow x 5.0)))
(t_1 (* (fma 5.0 x eps) (* eps (* eps (* eps eps))))))
(if (<= t_0 -2e-305)
t_1
(if (<= t_0 0.0) (* (* x (* x x)) (* eps (* x 5.0))) t_1))))
double code(double x, double eps) {
double t_0 = pow((x + eps), 5.0) - pow(x, 5.0);
double t_1 = fma(5.0, x, eps) * (eps * (eps * (eps * eps)));
double tmp;
if (t_0 <= -2e-305) {
tmp = t_1;
} else if (t_0 <= 0.0) {
tmp = (x * (x * x)) * (eps * (x * 5.0));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, eps) t_0 = Float64((Float64(x + eps) ^ 5.0) - (x ^ 5.0)) t_1 = Float64(fma(5.0, x, eps) * Float64(eps * Float64(eps * Float64(eps * eps)))) tmp = 0.0 if (t_0 <= -2e-305) tmp = t_1; elseif (t_0 <= 0.0) tmp = Float64(Float64(x * Float64(x * x)) * Float64(eps * Float64(x * 5.0))); else tmp = t_1; end return tmp end
code[x_, eps_] := Block[{t$95$0 = N[(N[Power[N[(x + eps), $MachinePrecision], 5.0], $MachinePrecision] - N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(5.0 * x + eps), $MachinePrecision] * N[(eps * N[(eps * N[(eps * eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e-305], t$95$1, If[LessEqual[t$95$0, 0.0], N[(N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision] * N[(eps * N[(x * 5.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(x + \varepsilon\right)}^{5} - {x}^{5}\\
t_1 := \mathsf{fma}\left(5, x, \varepsilon\right) \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right)\right)\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{-305}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\left(x \cdot \left(x \cdot x\right)\right) \cdot \left(\varepsilon \cdot \left(x \cdot 5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -1.99999999999999999e-305 or 0.0 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) Initial program 97.2%
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-/.f6493.8
Applied rewrites93.8%
Taylor expanded in eps around 0
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
lower-fma.f6493.5
Applied rewrites93.5%
lift-pow.f64N/A
lift-fma.f64N/A
*-commutativeN/A
lower-*.f6493.5
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
pow2N/A
pow2N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lower-*.f6493.2
Applied rewrites93.2%
if -1.99999999999999999e-305 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 0.0Initial program 83.1%
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 rewrites99.9%
Taylor expanded in x around 0
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
unpow2N/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6499.9
Applied rewrites99.9%
Taylor expanded in x around inf
lower-*.f6499.9
Applied rewrites99.9%
Final simplification98.5%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (- (pow (+ x eps) 5.0) (pow x 5.0))))
(if (<= t_0 -2e-305)
(* eps (* eps (* eps (* eps eps))))
(if (<= t_0 0.0)
(* (* x (* x x)) (* eps (* x 5.0)))
(* (* eps eps) (* (* eps eps) (fma 5.0 x eps)))))))
double code(double x, double eps) {
double t_0 = pow((x + eps), 5.0) - pow(x, 5.0);
double tmp;
if (t_0 <= -2e-305) {
tmp = eps * (eps * (eps * (eps * eps)));
} else if (t_0 <= 0.0) {
tmp = (x * (x * x)) * (eps * (x * 5.0));
} else {
tmp = (eps * eps) * ((eps * eps) * fma(5.0, x, eps));
}
return tmp;
}
function code(x, eps) t_0 = Float64((Float64(x + eps) ^ 5.0) - (x ^ 5.0)) tmp = 0.0 if (t_0 <= -2e-305) tmp = Float64(eps * Float64(eps * Float64(eps * Float64(eps * eps)))); elseif (t_0 <= 0.0) tmp = Float64(Float64(x * Float64(x * x)) * Float64(eps * Float64(x * 5.0))); else tmp = Float64(Float64(eps * eps) * Float64(Float64(eps * eps) * fma(5.0, x, eps))); end return tmp end
code[x_, eps_] := Block[{t$95$0 = N[(N[Power[N[(x + eps), $MachinePrecision], 5.0], $MachinePrecision] - N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e-305], N[(eps * N[(eps * N[(eps * N[(eps * eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision] * N[(eps * N[(x * 5.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(eps * eps), $MachinePrecision] * N[(N[(eps * eps), $MachinePrecision] * N[(5.0 * x + eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(x + \varepsilon\right)}^{5} - {x}^{5}\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{-305}:\\
\;\;\;\;\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right)\right)\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\left(x \cdot \left(x \cdot x\right)\right) \cdot \left(\varepsilon \cdot \left(x \cdot 5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\varepsilon \cdot \varepsilon\right) \cdot \left(\left(\varepsilon \cdot \varepsilon\right) \cdot \mathsf{fma}\left(5, x, \varepsilon\right)\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -1.99999999999999999e-305Initial program 97.5%
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-/.f6496.7
Applied rewrites96.7%
Taylor expanded in eps around 0
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
lower-fma.f6496.4
Applied rewrites96.4%
lift-pow.f64N/A
distribute-rgt-inN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
pow2N/A
pow2N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
pow2N/A
pow2N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lower-*.f64N/A
lower-*.f6495.9
Applied rewrites95.9%
Taylor expanded in eps around inf
metadata-evalN/A
pow-plusN/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
pow-plusN/A
*-commutativeN/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6495.9
Applied rewrites95.9%
if -1.99999999999999999e-305 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 0.0Initial program 83.1%
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 rewrites99.9%
Taylor expanded in x around 0
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
unpow2N/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6499.9
Applied rewrites99.9%
Taylor expanded in x around inf
lower-*.f6499.9
Applied rewrites99.9%
if 0.0 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) Initial program 96.8%
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-/.f6490.4
Applied rewrites90.4%
Taylor expanded in eps around 0
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
lower-fma.f6490.2
Applied rewrites90.2%
lift-pow.f64N/A
lift-fma.f64N/A
*-commutativeN/A
lift-pow.f64N/A
metadata-evalN/A
pow-powN/A
pow2N/A
lift-*.f64N/A
pow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6489.6
Applied rewrites89.6%
Final simplification98.5%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (- (pow (+ x eps) 5.0) (pow x 5.0))) (t_1 (* eps (* eps eps))))
(if (<= t_0 -2e-305)
(* eps (* eps t_1))
(if (<= t_0 0.0)
(* (* x (* x x)) (* eps (* x 5.0)))
(* t_1 (* eps (fma 5.0 x eps)))))))
double code(double x, double eps) {
double t_0 = pow((x + eps), 5.0) - pow(x, 5.0);
double t_1 = eps * (eps * eps);
double tmp;
if (t_0 <= -2e-305) {
tmp = eps * (eps * t_1);
} else if (t_0 <= 0.0) {
tmp = (x * (x * x)) * (eps * (x * 5.0));
} else {
tmp = t_1 * (eps * fma(5.0, x, eps));
}
return tmp;
}
function code(x, eps) t_0 = Float64((Float64(x + eps) ^ 5.0) - (x ^ 5.0)) t_1 = Float64(eps * Float64(eps * eps)) tmp = 0.0 if (t_0 <= -2e-305) tmp = Float64(eps * Float64(eps * t_1)); elseif (t_0 <= 0.0) tmp = Float64(Float64(x * Float64(x * x)) * Float64(eps * Float64(x * 5.0))); else tmp = Float64(t_1 * Float64(eps * fma(5.0, x, eps))); end return tmp end
code[x_, eps_] := Block[{t$95$0 = N[(N[Power[N[(x + eps), $MachinePrecision], 5.0], $MachinePrecision] - N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(eps * N[(eps * eps), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e-305], N[(eps * N[(eps * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision] * N[(eps * N[(x * 5.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(eps * N[(5.0 * x + eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(x + \varepsilon\right)}^{5} - {x}^{5}\\
t_1 := \varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{-305}:\\
\;\;\;\;\varepsilon \cdot \left(\varepsilon \cdot t\_1\right)\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\left(x \cdot \left(x \cdot x\right)\right) \cdot \left(\varepsilon \cdot \left(x \cdot 5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(\varepsilon \cdot \mathsf{fma}\left(5, x, \varepsilon\right)\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -1.99999999999999999e-305Initial program 97.5%
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-/.f6496.7
Applied rewrites96.7%
Taylor expanded in eps around 0
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
lower-fma.f6496.4
Applied rewrites96.4%
lift-pow.f64N/A
distribute-rgt-inN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
pow2N/A
pow2N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
pow2N/A
pow2N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lower-*.f64N/A
lower-*.f6495.9
Applied rewrites95.9%
Taylor expanded in eps around inf
metadata-evalN/A
pow-plusN/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
pow-plusN/A
*-commutativeN/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6495.9
Applied rewrites95.9%
if -1.99999999999999999e-305 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 0.0Initial program 83.1%
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 rewrites99.9%
Taylor expanded in x around 0
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
unpow2N/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6499.9
Applied rewrites99.9%
Taylor expanded in x around inf
lower-*.f6499.9
Applied rewrites99.9%
if 0.0 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) Initial program 96.8%
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-/.f6490.4
Applied rewrites90.4%
Taylor expanded in eps around 0
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
lower-fma.f6490.2
Applied rewrites90.2%
lift-pow.f64N/A
distribute-rgt-inN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
pow2N/A
pow2N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
pow2N/A
pow2N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lower-*.f64N/A
lower-*.f6490.0
Applied rewrites90.0%
Applied rewrites89.5%
Final simplification98.5%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (- (pow (+ x eps) 5.0) (pow x 5.0)))
(t_1 (* eps (* eps (* eps (* eps eps))))))
(if (<= t_0 -2e-305)
t_1
(if (<= t_0 0.0) (* (* x (* x x)) (* eps (* x 5.0))) t_1))))
double code(double x, double eps) {
double t_0 = pow((x + eps), 5.0) - pow(x, 5.0);
double t_1 = eps * (eps * (eps * (eps * eps)));
double tmp;
if (t_0 <= -2e-305) {
tmp = t_1;
} else if (t_0 <= 0.0) {
tmp = (x * (x * x)) * (eps * (x * 5.0));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = ((x + eps) ** 5.0d0) - (x ** 5.0d0)
t_1 = eps * (eps * (eps * (eps * eps)))
if (t_0 <= (-2d-305)) then
tmp = t_1
else if (t_0 <= 0.0d0) then
tmp = (x * (x * x)) * (eps * (x * 5.0d0))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double eps) {
double t_0 = Math.pow((x + eps), 5.0) - Math.pow(x, 5.0);
double t_1 = eps * (eps * (eps * (eps * eps)));
double tmp;
if (t_0 <= -2e-305) {
tmp = t_1;
} else if (t_0 <= 0.0) {
tmp = (x * (x * x)) * (eps * (x * 5.0));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, eps): t_0 = math.pow((x + eps), 5.0) - math.pow(x, 5.0) t_1 = eps * (eps * (eps * (eps * eps))) tmp = 0 if t_0 <= -2e-305: tmp = t_1 elif t_0 <= 0.0: tmp = (x * (x * x)) * (eps * (x * 5.0)) else: tmp = t_1 return tmp
function code(x, eps) t_0 = Float64((Float64(x + eps) ^ 5.0) - (x ^ 5.0)) t_1 = Float64(eps * Float64(eps * Float64(eps * Float64(eps * eps)))) tmp = 0.0 if (t_0 <= -2e-305) tmp = t_1; elseif (t_0 <= 0.0) tmp = Float64(Float64(x * Float64(x * x)) * Float64(eps * Float64(x * 5.0))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, eps) t_0 = ((x + eps) ^ 5.0) - (x ^ 5.0); t_1 = eps * (eps * (eps * (eps * eps))); tmp = 0.0; if (t_0 <= -2e-305) tmp = t_1; elseif (t_0 <= 0.0) tmp = (x * (x * x)) * (eps * (x * 5.0)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, eps_] := Block[{t$95$0 = N[(N[Power[N[(x + eps), $MachinePrecision], 5.0], $MachinePrecision] - N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(eps * N[(eps * N[(eps * N[(eps * eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e-305], t$95$1, If[LessEqual[t$95$0, 0.0], N[(N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision] * N[(eps * N[(x * 5.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(x + \varepsilon\right)}^{5} - {x}^{5}\\
t_1 := \varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right)\right)\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{-305}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\left(x \cdot \left(x \cdot x\right)\right) \cdot \left(\varepsilon \cdot \left(x \cdot 5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -1.99999999999999999e-305 or 0.0 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) Initial program 97.2%
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-/.f6493.8
Applied rewrites93.8%
Taylor expanded in eps around 0
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
lower-fma.f6493.5
Applied rewrites93.5%
lift-pow.f64N/A
distribute-rgt-inN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
pow2N/A
pow2N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
pow2N/A
pow2N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lower-*.f64N/A
lower-*.f6493.2
Applied rewrites93.2%
Taylor expanded in eps around inf
metadata-evalN/A
pow-plusN/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
pow-plusN/A
*-commutativeN/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6492.3
Applied rewrites92.3%
if -1.99999999999999999e-305 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 0.0Initial program 83.1%
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 rewrites99.9%
Taylor expanded in x around 0
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
unpow2N/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6499.9
Applied rewrites99.9%
Taylor expanded in x around inf
lower-*.f6499.9
Applied rewrites99.9%
Final simplification98.3%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (- (pow (+ x eps) 5.0) (pow x 5.0)))
(t_1 (* eps (* eps (* eps (* eps eps))))))
(if (<= t_0 -2e-305)
t_1
(if (<= t_0 0.0) (* (* x (* x x)) (* 5.0 (* x eps))) t_1))))
double code(double x, double eps) {
double t_0 = pow((x + eps), 5.0) - pow(x, 5.0);
double t_1 = eps * (eps * (eps * (eps * eps)));
double tmp;
if (t_0 <= -2e-305) {
tmp = t_1;
} else if (t_0 <= 0.0) {
tmp = (x * (x * x)) * (5.0 * (x * eps));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = ((x + eps) ** 5.0d0) - (x ** 5.0d0)
t_1 = eps * (eps * (eps * (eps * eps)))
if (t_0 <= (-2d-305)) then
tmp = t_1
else if (t_0 <= 0.0d0) then
tmp = (x * (x * x)) * (5.0d0 * (x * eps))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double eps) {
double t_0 = Math.pow((x + eps), 5.0) - Math.pow(x, 5.0);
double t_1 = eps * (eps * (eps * (eps * eps)));
double tmp;
if (t_0 <= -2e-305) {
tmp = t_1;
} else if (t_0 <= 0.0) {
tmp = (x * (x * x)) * (5.0 * (x * eps));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, eps): t_0 = math.pow((x + eps), 5.0) - math.pow(x, 5.0) t_1 = eps * (eps * (eps * (eps * eps))) tmp = 0 if t_0 <= -2e-305: tmp = t_1 elif t_0 <= 0.0: tmp = (x * (x * x)) * (5.0 * (x * eps)) else: tmp = t_1 return tmp
function code(x, eps) t_0 = Float64((Float64(x + eps) ^ 5.0) - (x ^ 5.0)) t_1 = Float64(eps * Float64(eps * Float64(eps * Float64(eps * eps)))) tmp = 0.0 if (t_0 <= -2e-305) tmp = t_1; elseif (t_0 <= 0.0) tmp = Float64(Float64(x * Float64(x * x)) * Float64(5.0 * Float64(x * eps))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, eps) t_0 = ((x + eps) ^ 5.0) - (x ^ 5.0); t_1 = eps * (eps * (eps * (eps * eps))); tmp = 0.0; if (t_0 <= -2e-305) tmp = t_1; elseif (t_0 <= 0.0) tmp = (x * (x * x)) * (5.0 * (x * eps)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, eps_] := Block[{t$95$0 = N[(N[Power[N[(x + eps), $MachinePrecision], 5.0], $MachinePrecision] - N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(eps * N[(eps * N[(eps * N[(eps * eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e-305], t$95$1, If[LessEqual[t$95$0, 0.0], N[(N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision] * N[(5.0 * N[(x * eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(x + \varepsilon\right)}^{5} - {x}^{5}\\
t_1 := \varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right)\right)\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{-305}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\left(x \cdot \left(x \cdot x\right)\right) \cdot \left(5 \cdot \left(x \cdot \varepsilon\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -1.99999999999999999e-305 or 0.0 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) Initial program 97.2%
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-/.f6493.8
Applied rewrites93.8%
Taylor expanded in eps around 0
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
lower-fma.f6493.5
Applied rewrites93.5%
lift-pow.f64N/A
distribute-rgt-inN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
pow2N/A
pow2N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
pow2N/A
pow2N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lower-*.f64N/A
lower-*.f6493.2
Applied rewrites93.2%
Taylor expanded in eps around inf
metadata-evalN/A
pow-plusN/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
pow-plusN/A
*-commutativeN/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6492.3
Applied rewrites92.3%
if -1.99999999999999999e-305 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 0.0Initial program 83.1%
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 rewrites99.9%
Taylor expanded in x around 0
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
unpow2N/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6499.9
Applied rewrites99.9%
Taylor expanded in eps around 0
lower-*.f64N/A
lower-*.f6499.9
Applied rewrites99.9%
Final simplification98.3%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (- (pow (+ x eps) 5.0) (pow x 5.0)))
(t_1 (* eps (* eps (* eps (* eps eps))))))
(if (<= t_0 -2e-305)
t_1
(if (<= t_0 0.0) (* eps (* 5.0 (* x (* x (* x x))))) t_1))))
double code(double x, double eps) {
double t_0 = pow((x + eps), 5.0) - pow(x, 5.0);
double t_1 = eps * (eps * (eps * (eps * eps)));
double tmp;
if (t_0 <= -2e-305) {
tmp = t_1;
} else if (t_0 <= 0.0) {
tmp = eps * (5.0 * (x * (x * (x * x))));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = ((x + eps) ** 5.0d0) - (x ** 5.0d0)
t_1 = eps * (eps * (eps * (eps * eps)))
if (t_0 <= (-2d-305)) then
tmp = t_1
else if (t_0 <= 0.0d0) then
tmp = eps * (5.0d0 * (x * (x * (x * x))))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double eps) {
double t_0 = Math.pow((x + eps), 5.0) - Math.pow(x, 5.0);
double t_1 = eps * (eps * (eps * (eps * eps)));
double tmp;
if (t_0 <= -2e-305) {
tmp = t_1;
} else if (t_0 <= 0.0) {
tmp = eps * (5.0 * (x * (x * (x * x))));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, eps): t_0 = math.pow((x + eps), 5.0) - math.pow(x, 5.0) t_1 = eps * (eps * (eps * (eps * eps))) tmp = 0 if t_0 <= -2e-305: tmp = t_1 elif t_0 <= 0.0: tmp = eps * (5.0 * (x * (x * (x * x)))) else: tmp = t_1 return tmp
function code(x, eps) t_0 = Float64((Float64(x + eps) ^ 5.0) - (x ^ 5.0)) t_1 = Float64(eps * Float64(eps * Float64(eps * Float64(eps * eps)))) tmp = 0.0 if (t_0 <= -2e-305) tmp = t_1; elseif (t_0 <= 0.0) tmp = Float64(eps * Float64(5.0 * Float64(x * Float64(x * Float64(x * x))))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, eps) t_0 = ((x + eps) ^ 5.0) - (x ^ 5.0); t_1 = eps * (eps * (eps * (eps * eps))); tmp = 0.0; if (t_0 <= -2e-305) tmp = t_1; elseif (t_0 <= 0.0) tmp = eps * (5.0 * (x * (x * (x * x)))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, eps_] := Block[{t$95$0 = N[(N[Power[N[(x + eps), $MachinePrecision], 5.0], $MachinePrecision] - N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(eps * N[(eps * N[(eps * N[(eps * eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e-305], t$95$1, If[LessEqual[t$95$0, 0.0], N[(eps * N[(5.0 * N[(x * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(x + \varepsilon\right)}^{5} - {x}^{5}\\
t_1 := \varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right)\right)\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{-305}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\varepsilon \cdot \left(5 \cdot \left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -1.99999999999999999e-305 or 0.0 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) Initial program 97.2%
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-/.f6493.8
Applied rewrites93.8%
Taylor expanded in eps around 0
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
lower-fma.f6493.5
Applied rewrites93.5%
lift-pow.f64N/A
distribute-rgt-inN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
pow2N/A
pow2N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
pow2N/A
pow2N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lower-*.f64N/A
lower-*.f6493.2
Applied rewrites93.2%
Taylor expanded in eps around inf
metadata-evalN/A
pow-plusN/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
pow-plusN/A
*-commutativeN/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6492.3
Applied rewrites92.3%
if -1.99999999999999999e-305 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 0.0Initial program 83.1%
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 rewrites99.9%
Taylor expanded in x around 0
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
unpow2N/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6499.9
Applied rewrites99.9%
Taylor expanded in x around inf
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
metadata-evalN/A
pow-plusN/A
*-commutativeN/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6499.9
Applied rewrites99.9%
(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 85.9%
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-/.f6485.2
Applied rewrites85.2%
Taylor expanded in eps around 0
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
lower-fma.f6485.2
Applied rewrites85.2%
lift-pow.f64N/A
distribute-rgt-inN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
pow2N/A
pow2N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
pow2N/A
pow2N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lower-*.f64N/A
lower-*.f6485.1
Applied rewrites85.1%
Taylor expanded in eps around inf
metadata-evalN/A
pow-plusN/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
pow-plusN/A
*-commutativeN/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6485.0
Applied rewrites85.0%
herbie shell --seed 2024214
(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)))