
(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 15 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) (pow x 5.0))))
(if (or (<= t_0 -4e-322) (not (<= t_0 0.0)))
t_0
(* (* 5.0 eps) (pow x 4.0)))))
double code(double x, double eps) {
double t_0 = pow((x + eps), 5.0) - pow(x, 5.0);
double tmp;
if ((t_0 <= -4e-322) || !(t_0 <= 0.0)) {
tmp = t_0;
} else {
tmp = (5.0 * eps) * pow(x, 4.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 + eps) ** 5.0d0) - (x ** 5.0d0)
if ((t_0 <= (-4d-322)) .or. (.not. (t_0 <= 0.0d0))) then
tmp = t_0
else
tmp = (5.0d0 * eps) * (x ** 4.0d0)
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 tmp;
if ((t_0 <= -4e-322) || !(t_0 <= 0.0)) {
tmp = t_0;
} else {
tmp = (5.0 * eps) * Math.pow(x, 4.0);
}
return tmp;
}
def code(x, eps): t_0 = math.pow((x + eps), 5.0) - math.pow(x, 5.0) tmp = 0 if (t_0 <= -4e-322) or not (t_0 <= 0.0): tmp = t_0 else: tmp = (5.0 * eps) * math.pow(x, 4.0) return tmp
function code(x, eps) t_0 = Float64((Float64(x + eps) ^ 5.0) - (x ^ 5.0)) tmp = 0.0 if ((t_0 <= -4e-322) || !(t_0 <= 0.0)) tmp = t_0; else tmp = Float64(Float64(5.0 * eps) * (x ^ 4.0)); end return tmp end
function tmp_2 = code(x, eps) t_0 = ((x + eps) ^ 5.0) - (x ^ 5.0); tmp = 0.0; if ((t_0 <= -4e-322) || ~((t_0 <= 0.0))) tmp = t_0; else tmp = (5.0 * eps) * (x ^ 4.0); 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]}, If[Or[LessEqual[t$95$0, -4e-322], N[Not[LessEqual[t$95$0, 0.0]], $MachinePrecision]], t$95$0, N[(N[(5.0 * eps), $MachinePrecision] * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(x + \varepsilon\right)}^{5} - {x}^{5}\\
\mathbf{if}\;t\_0 \leq -4 \cdot 10^{-322} \lor \neg \left(t\_0 \leq 0\right):\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\left(5 \cdot \varepsilon\right) \cdot {x}^{4}\\
\end{array}
\end{array}
if (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -4.00193e-322 or 0.0 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) Initial program 99.2%
if -4.00193e-322 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 0.0Initial program 86.5%
Taylor expanded in x around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites99.9%
Taylor expanded in x around inf
Applied rewrites99.9%
Final simplification99.8%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (- (pow (+ x eps) 5.0) (pow x 5.0))))
(if (<= t_0 -4e-322)
(* (fma (/ x eps) 5.0 1.0) (pow eps 5.0))
(if (<= t_0 0.0)
(* (* 5.0 eps) (pow x 4.0))
(*
(*
(pow (pow (fma (fma x 5.0 eps) eps (* (* 10.0 x) x)) -1.0) -1.0)
(* eps eps))
eps)))))
double code(double x, double eps) {
double t_0 = pow((x + eps), 5.0) - pow(x, 5.0);
double tmp;
if (t_0 <= -4e-322) {
tmp = fma((x / eps), 5.0, 1.0) * pow(eps, 5.0);
} else if (t_0 <= 0.0) {
tmp = (5.0 * eps) * pow(x, 4.0);
} else {
tmp = (pow(pow(fma(fma(x, 5.0, eps), eps, ((10.0 * x) * x)), -1.0), -1.0) * (eps * eps)) * eps;
}
return tmp;
}
function code(x, eps) t_0 = Float64((Float64(x + eps) ^ 5.0) - (x ^ 5.0)) tmp = 0.0 if (t_0 <= -4e-322) tmp = Float64(fma(Float64(x / eps), 5.0, 1.0) * (eps ^ 5.0)); elseif (t_0 <= 0.0) tmp = Float64(Float64(5.0 * eps) * (x ^ 4.0)); else tmp = Float64(Float64(((fma(fma(x, 5.0, eps), eps, Float64(Float64(10.0 * x) * x)) ^ -1.0) ^ -1.0) * Float64(eps * eps)) * 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, -4e-322], N[(N[(N[(x / eps), $MachinePrecision] * 5.0 + 1.0), $MachinePrecision] * N[Power[eps, 5.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(N[(5.0 * eps), $MachinePrecision] * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision], N[(N[(N[Power[N[Power[N[(N[(x * 5.0 + eps), $MachinePrecision] * eps + N[(N[(10.0 * x), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision], -1.0], $MachinePrecision] * N[(eps * eps), $MachinePrecision]), $MachinePrecision] * eps), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(x + \varepsilon\right)}^{5} - {x}^{5}\\
\mathbf{if}\;t\_0 \leq -4 \cdot 10^{-322}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{\varepsilon}, 5, 1\right) \cdot {\varepsilon}^{5}\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\left(5 \cdot \varepsilon\right) \cdot {x}^{4}\\
\mathbf{else}:\\
\;\;\;\;\left({\left({\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 5, \varepsilon\right), \varepsilon, \left(10 \cdot x\right) \cdot x\right)\right)}^{-1}\right)}^{-1} \cdot \left(\varepsilon \cdot \varepsilon\right)\right) \cdot \varepsilon\\
\end{array}
\end{array}
if (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -4.00193e-322Initial program 99.6%
Taylor expanded in eps around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
distribute-lft1-inN/A
metadata-evalN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-pow.f6496.3
Applied rewrites96.3%
if -4.00193e-322 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 0.0Initial program 86.5%
Taylor expanded in x around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites99.9%
Taylor expanded in x around inf
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 98.9%
Taylor expanded in eps around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
distribute-lft1-inN/A
metadata-evalN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-pow.f6493.1
Applied rewrites93.1%
Taylor expanded in x around 0
Applied rewrites93.5%
Applied rewrites93.2%
Applied rewrites93.2%
Final simplification99.0%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (- (pow (+ x eps) 5.0) (pow x 5.0))))
(if (<= t_0 -4e-322)
(* (fma 5.0 x eps) (* (pow eps 3.0) eps))
(if (<= t_0 0.0)
(* (* 5.0 eps) (pow x 4.0))
(*
(*
(pow (pow (fma (fma x 5.0 eps) eps (* (* 10.0 x) x)) -1.0) -1.0)
(* eps eps))
eps)))))
double code(double x, double eps) {
double t_0 = pow((x + eps), 5.0) - pow(x, 5.0);
double tmp;
if (t_0 <= -4e-322) {
tmp = fma(5.0, x, eps) * (pow(eps, 3.0) * eps);
} else if (t_0 <= 0.0) {
tmp = (5.0 * eps) * pow(x, 4.0);
} else {
tmp = (pow(pow(fma(fma(x, 5.0, eps), eps, ((10.0 * x) * x)), -1.0), -1.0) * (eps * eps)) * eps;
}
return tmp;
}
function code(x, eps) t_0 = Float64((Float64(x + eps) ^ 5.0) - (x ^ 5.0)) tmp = 0.0 if (t_0 <= -4e-322) tmp = Float64(fma(5.0, x, eps) * Float64((eps ^ 3.0) * eps)); elseif (t_0 <= 0.0) tmp = Float64(Float64(5.0 * eps) * (x ^ 4.0)); else tmp = Float64(Float64(((fma(fma(x, 5.0, eps), eps, Float64(Float64(10.0 * x) * x)) ^ -1.0) ^ -1.0) * Float64(eps * eps)) * 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, -4e-322], N[(N[(5.0 * x + eps), $MachinePrecision] * N[(N[Power[eps, 3.0], $MachinePrecision] * eps), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(N[(5.0 * eps), $MachinePrecision] * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision], N[(N[(N[Power[N[Power[N[(N[(x * 5.0 + eps), $MachinePrecision] * eps + N[(N[(10.0 * x), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision], -1.0], $MachinePrecision] * N[(eps * eps), $MachinePrecision]), $MachinePrecision] * eps), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(x + \varepsilon\right)}^{5} - {x}^{5}\\
\mathbf{if}\;t\_0 \leq -4 \cdot 10^{-322}:\\
\;\;\;\;\mathsf{fma}\left(5, x, \varepsilon\right) \cdot \left({\varepsilon}^{3} \cdot \varepsilon\right)\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\left(5 \cdot \varepsilon\right) \cdot {x}^{4}\\
\mathbf{else}:\\
\;\;\;\;\left({\left({\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 5, \varepsilon\right), \varepsilon, \left(10 \cdot x\right) \cdot x\right)\right)}^{-1}\right)}^{-1} \cdot \left(\varepsilon \cdot \varepsilon\right)\right) \cdot \varepsilon\\
\end{array}
\end{array}
if (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -4.00193e-322Initial program 99.6%
Taylor expanded in eps around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
distribute-lft1-inN/A
metadata-evalN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-pow.f6496.3
Applied rewrites96.3%
Taylor expanded in x around 0
+-commutativeN/A
metadata-evalN/A
pow-plusN/A
*-commutativeN/A
distribute-lft1-inN/A
metadata-evalN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-pow.f6495.9
Applied rewrites95.9%
Applied rewrites96.2%
if -4.00193e-322 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 0.0Initial program 86.5%
Taylor expanded in x around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites99.9%
Taylor expanded in x around inf
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 98.9%
Taylor expanded in eps around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
distribute-lft1-inN/A
metadata-evalN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-pow.f6493.1
Applied rewrites93.1%
Taylor expanded in x around 0
Applied rewrites93.5%
Applied rewrites93.2%
Applied rewrites93.2%
Final simplification99.0%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (- (pow (+ x eps) 5.0) (pow x 5.0))))
(if (<= t_0 -4e-322)
(* (* (* (* (fma x 5.0 eps) eps) eps) eps) eps)
(if (<= t_0 0.0)
(* (* 5.0 eps) (pow x 4.0))
(*
(*
(pow (pow (fma (fma x 5.0 eps) eps (* (* 10.0 x) x)) -1.0) -1.0)
(* eps eps))
eps)))))
double code(double x, double eps) {
double t_0 = pow((x + eps), 5.0) - pow(x, 5.0);
double tmp;
if (t_0 <= -4e-322) {
tmp = (((fma(x, 5.0, eps) * eps) * eps) * eps) * eps;
} else if (t_0 <= 0.0) {
tmp = (5.0 * eps) * pow(x, 4.0);
} else {
tmp = (pow(pow(fma(fma(x, 5.0, eps), eps, ((10.0 * x) * x)), -1.0), -1.0) * (eps * eps)) * eps;
}
return tmp;
}
function code(x, eps) t_0 = Float64((Float64(x + eps) ^ 5.0) - (x ^ 5.0)) tmp = 0.0 if (t_0 <= -4e-322) tmp = Float64(Float64(Float64(Float64(fma(x, 5.0, eps) * eps) * eps) * eps) * eps); elseif (t_0 <= 0.0) tmp = Float64(Float64(5.0 * eps) * (x ^ 4.0)); else tmp = Float64(Float64(((fma(fma(x, 5.0, eps), eps, Float64(Float64(10.0 * x) * x)) ^ -1.0) ^ -1.0) * Float64(eps * eps)) * 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, -4e-322], N[(N[(N[(N[(N[(x * 5.0 + eps), $MachinePrecision] * eps), $MachinePrecision] * eps), $MachinePrecision] * eps), $MachinePrecision] * eps), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(N[(5.0 * eps), $MachinePrecision] * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision], N[(N[(N[Power[N[Power[N[(N[(x * 5.0 + eps), $MachinePrecision] * eps + N[(N[(10.0 * x), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision], -1.0], $MachinePrecision] * N[(eps * eps), $MachinePrecision]), $MachinePrecision] * eps), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(x + \varepsilon\right)}^{5} - {x}^{5}\\
\mathbf{if}\;t\_0 \leq -4 \cdot 10^{-322}:\\
\;\;\;\;\left(\left(\left(\mathsf{fma}\left(x, 5, \varepsilon\right) \cdot \varepsilon\right) \cdot \varepsilon\right) \cdot \varepsilon\right) \cdot \varepsilon\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\left(5 \cdot \varepsilon\right) \cdot {x}^{4}\\
\mathbf{else}:\\
\;\;\;\;\left({\left({\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 5, \varepsilon\right), \varepsilon, \left(10 \cdot x\right) \cdot x\right)\right)}^{-1}\right)}^{-1} \cdot \left(\varepsilon \cdot \varepsilon\right)\right) \cdot \varepsilon\\
\end{array}
\end{array}
if (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -4.00193e-322Initial program 99.6%
Taylor expanded in eps around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
distribute-lft1-inN/A
metadata-evalN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-pow.f6496.3
Applied rewrites96.3%
Taylor expanded in x around 0
+-commutativeN/A
metadata-evalN/A
pow-plusN/A
*-commutativeN/A
distribute-lft1-inN/A
metadata-evalN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-pow.f6495.9
Applied rewrites95.9%
Applied rewrites95.8%
Applied rewrites96.0%
if -4.00193e-322 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 0.0Initial program 86.5%
Taylor expanded in x around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites99.9%
Taylor expanded in x around inf
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 98.9%
Taylor expanded in eps around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
distribute-lft1-inN/A
metadata-evalN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-pow.f6493.1
Applied rewrites93.1%
Taylor expanded in x around 0
Applied rewrites93.5%
Applied rewrites93.2%
Applied rewrites93.2%
Final simplification99.0%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (- (pow (+ x eps) 5.0) (pow x 5.0))))
(if (<= t_0 -4e-322)
(* (* (* (* (fma x 5.0 eps) eps) eps) eps) eps)
(if (<= t_0 0.0)
(* (* (* (fma (* x x) 5.0 (* (* 10.0 eps) (+ eps x))) x) x) eps)
(*
(*
(pow (pow (fma (fma x 5.0 eps) eps (* (* 10.0 x) x)) -1.0) -1.0)
(* eps eps))
eps)))))
double code(double x, double eps) {
double t_0 = pow((x + eps), 5.0) - pow(x, 5.0);
double tmp;
if (t_0 <= -4e-322) {
tmp = (((fma(x, 5.0, eps) * eps) * eps) * eps) * eps;
} else if (t_0 <= 0.0) {
tmp = ((fma((x * x), 5.0, ((10.0 * eps) * (eps + x))) * x) * x) * eps;
} else {
tmp = (pow(pow(fma(fma(x, 5.0, eps), eps, ((10.0 * x) * x)), -1.0), -1.0) * (eps * eps)) * eps;
}
return tmp;
}
function code(x, eps) t_0 = Float64((Float64(x + eps) ^ 5.0) - (x ^ 5.0)) tmp = 0.0 if (t_0 <= -4e-322) tmp = Float64(Float64(Float64(Float64(fma(x, 5.0, eps) * eps) * eps) * eps) * eps); elseif (t_0 <= 0.0) tmp = Float64(Float64(Float64(fma(Float64(x * x), 5.0, Float64(Float64(10.0 * eps) * Float64(eps + x))) * x) * x) * eps); else tmp = Float64(Float64(((fma(fma(x, 5.0, eps), eps, Float64(Float64(10.0 * x) * x)) ^ -1.0) ^ -1.0) * Float64(eps * eps)) * 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, -4e-322], N[(N[(N[(N[(N[(x * 5.0 + eps), $MachinePrecision] * eps), $MachinePrecision] * eps), $MachinePrecision] * eps), $MachinePrecision] * eps), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(N[(N[(N[(N[(x * x), $MachinePrecision] * 5.0 + N[(N[(10.0 * eps), $MachinePrecision] * N[(eps + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision] * eps), $MachinePrecision], N[(N[(N[Power[N[Power[N[(N[(x * 5.0 + eps), $MachinePrecision] * eps + N[(N[(10.0 * x), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision], -1.0], $MachinePrecision] * N[(eps * eps), $MachinePrecision]), $MachinePrecision] * eps), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(x + \varepsilon\right)}^{5} - {x}^{5}\\
\mathbf{if}\;t\_0 \leq -4 \cdot 10^{-322}:\\
\;\;\;\;\left(\left(\left(\mathsf{fma}\left(x, 5, \varepsilon\right) \cdot \varepsilon\right) \cdot \varepsilon\right) \cdot \varepsilon\right) \cdot \varepsilon\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\left(\left(\mathsf{fma}\left(x \cdot x, 5, \left(10 \cdot \varepsilon\right) \cdot \left(\varepsilon + x\right)\right) \cdot x\right) \cdot x\right) \cdot \varepsilon\\
\mathbf{else}:\\
\;\;\;\;\left({\left({\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 5, \varepsilon\right), \varepsilon, \left(10 \cdot x\right) \cdot x\right)\right)}^{-1}\right)}^{-1} \cdot \left(\varepsilon \cdot \varepsilon\right)\right) \cdot \varepsilon\\
\end{array}
\end{array}
if (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -4.00193e-322Initial program 99.6%
Taylor expanded in eps around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
distribute-lft1-inN/A
metadata-evalN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-pow.f6496.3
Applied rewrites96.3%
Taylor expanded in x around 0
+-commutativeN/A
metadata-evalN/A
pow-plusN/A
*-commutativeN/A
distribute-lft1-inN/A
metadata-evalN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-pow.f6495.9
Applied rewrites95.9%
Applied rewrites95.8%
Applied rewrites96.0%
if -4.00193e-322 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 0.0Initial program 86.5%
Taylor expanded in eps around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
distribute-lft1-inN/A
metadata-evalN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-pow.f6486.5
Applied rewrites86.5%
Taylor expanded in eps around 0
Applied rewrites99.9%
Taylor expanded in x around 0
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 98.9%
Taylor expanded in eps around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
distribute-lft1-inN/A
metadata-evalN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-pow.f6493.1
Applied rewrites93.1%
Taylor expanded in x around 0
Applied rewrites93.5%
Applied rewrites93.2%
Applied rewrites93.2%
Final simplification99.0%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (- (pow (+ x eps) 5.0) (pow x 5.0))))
(if (or (<= t_0 -4e-322) (not (<= t_0 0.0)))
(* (+ (/ (* (fma 10.0 (/ x eps) 5.0) x) eps) 1.0) (pow eps 5.0))
(* (* 5.0 eps) (pow x 4.0)))))
double code(double x, double eps) {
double t_0 = pow((x + eps), 5.0) - pow(x, 5.0);
double tmp;
if ((t_0 <= -4e-322) || !(t_0 <= 0.0)) {
tmp = (((fma(10.0, (x / eps), 5.0) * x) / eps) + 1.0) * pow(eps, 5.0);
} else {
tmp = (5.0 * eps) * pow(x, 4.0);
}
return tmp;
}
function code(x, eps) t_0 = Float64((Float64(x + eps) ^ 5.0) - (x ^ 5.0)) tmp = 0.0 if ((t_0 <= -4e-322) || !(t_0 <= 0.0)) tmp = Float64(Float64(Float64(Float64(fma(10.0, Float64(x / eps), 5.0) * x) / eps) + 1.0) * (eps ^ 5.0)); else tmp = Float64(Float64(5.0 * eps) * (x ^ 4.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]}, If[Or[LessEqual[t$95$0, -4e-322], N[Not[LessEqual[t$95$0, 0.0]], $MachinePrecision]], N[(N[(N[(N[(N[(10.0 * N[(x / eps), $MachinePrecision] + 5.0), $MachinePrecision] * x), $MachinePrecision] / eps), $MachinePrecision] + 1.0), $MachinePrecision] * N[Power[eps, 5.0], $MachinePrecision]), $MachinePrecision], N[(N[(5.0 * eps), $MachinePrecision] * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(x + \varepsilon\right)}^{5} - {x}^{5}\\
\mathbf{if}\;t\_0 \leq -4 \cdot 10^{-322} \lor \neg \left(t\_0 \leq 0\right):\\
\;\;\;\;\left(\frac{\mathsf{fma}\left(10, \frac{x}{\varepsilon}, 5\right) \cdot x}{\varepsilon} + 1\right) \cdot {\varepsilon}^{5}\\
\mathbf{else}:\\
\;\;\;\;\left(5 \cdot \varepsilon\right) \cdot {x}^{4}\\
\end{array}
\end{array}
if (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -4.00193e-322 or 0.0 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) Initial program 99.2%
Taylor expanded in eps around -inf
associate-*r*N/A
*-commutativeN/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
distribute-lft1-inN/A
associate-*l*N/A
Applied rewrites95.1%
Taylor expanded in x around 0
Applied rewrites95.1%
if -4.00193e-322 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 0.0Initial program 86.5%
Taylor expanded in x around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites99.9%
Taylor expanded in x around inf
Applied rewrites99.9%
Final simplification99.1%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (- (pow (+ x eps) 5.0) (pow x 5.0))))
(if (<= t_0 -4e-322)
(* (fma (/ x eps) 5.0 1.0) (pow eps 5.0))
(if (<= t_0 0.0)
(* (* 5.0 eps) (pow x 4.0))
(* (fma (fma 5.0 x eps) eps (* (* 10.0 x) x)) (pow eps 3.0))))))
double code(double x, double eps) {
double t_0 = pow((x + eps), 5.0) - pow(x, 5.0);
double tmp;
if (t_0 <= -4e-322) {
tmp = fma((x / eps), 5.0, 1.0) * pow(eps, 5.0);
} else if (t_0 <= 0.0) {
tmp = (5.0 * eps) * pow(x, 4.0);
} else {
tmp = fma(fma(5.0, x, eps), eps, ((10.0 * x) * x)) * pow(eps, 3.0);
}
return tmp;
}
function code(x, eps) t_0 = Float64((Float64(x + eps) ^ 5.0) - (x ^ 5.0)) tmp = 0.0 if (t_0 <= -4e-322) tmp = Float64(fma(Float64(x / eps), 5.0, 1.0) * (eps ^ 5.0)); elseif (t_0 <= 0.0) tmp = Float64(Float64(5.0 * eps) * (x ^ 4.0)); else tmp = Float64(fma(fma(5.0, x, eps), eps, Float64(Float64(10.0 * x) * x)) * (eps ^ 3.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]}, If[LessEqual[t$95$0, -4e-322], N[(N[(N[(x / eps), $MachinePrecision] * 5.0 + 1.0), $MachinePrecision] * N[Power[eps, 5.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(N[(5.0 * eps), $MachinePrecision] * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision], N[(N[(N[(5.0 * x + eps), $MachinePrecision] * eps + N[(N[(10.0 * x), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] * N[Power[eps, 3.0], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(x + \varepsilon\right)}^{5} - {x}^{5}\\
\mathbf{if}\;t\_0 \leq -4 \cdot 10^{-322}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{\varepsilon}, 5, 1\right) \cdot {\varepsilon}^{5}\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\left(5 \cdot \varepsilon\right) \cdot {x}^{4}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(5, x, \varepsilon\right), \varepsilon, \left(10 \cdot x\right) \cdot x\right) \cdot {\varepsilon}^{3}\\
\end{array}
\end{array}
if (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -4.00193e-322Initial program 99.6%
Taylor expanded in eps around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
distribute-lft1-inN/A
metadata-evalN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-pow.f6496.3
Applied rewrites96.3%
if -4.00193e-322 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 0.0Initial program 86.5%
Taylor expanded in x around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites99.9%
Taylor expanded in x around inf
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 98.9%
Taylor expanded in eps around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
distribute-lft1-inN/A
metadata-evalN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-pow.f6493.1
Applied rewrites93.1%
Taylor expanded in x around 0
Applied rewrites93.5%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (- (pow (+ x eps) 5.0) (pow x 5.0))))
(if (<= t_0 -4e-322)
(* (* (* (* (fma x 5.0 eps) eps) eps) eps) eps)
(if (<= t_0 0.0)
(* (* (* (fma (* x x) 5.0 (* (* 10.0 eps) (+ eps x))) x) x) eps)
(* (* (fma (fma 5.0 x eps) eps (* (* 10.0 x) x)) (* eps eps)) eps)))))
double code(double x, double eps) {
double t_0 = pow((x + eps), 5.0) - pow(x, 5.0);
double tmp;
if (t_0 <= -4e-322) {
tmp = (((fma(x, 5.0, eps) * eps) * eps) * eps) * eps;
} else if (t_0 <= 0.0) {
tmp = ((fma((x * x), 5.0, ((10.0 * eps) * (eps + x))) * x) * x) * eps;
} else {
tmp = (fma(fma(5.0, x, eps), eps, ((10.0 * x) * x)) * (eps * eps)) * eps;
}
return tmp;
}
function code(x, eps) t_0 = Float64((Float64(x + eps) ^ 5.0) - (x ^ 5.0)) tmp = 0.0 if (t_0 <= -4e-322) tmp = Float64(Float64(Float64(Float64(fma(x, 5.0, eps) * eps) * eps) * eps) * eps); elseif (t_0 <= 0.0) tmp = Float64(Float64(Float64(fma(Float64(x * x), 5.0, Float64(Float64(10.0 * eps) * Float64(eps + x))) * x) * x) * eps); else tmp = Float64(Float64(fma(fma(5.0, x, eps), eps, Float64(Float64(10.0 * x) * x)) * Float64(eps * eps)) * 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, -4e-322], N[(N[(N[(N[(N[(x * 5.0 + eps), $MachinePrecision] * eps), $MachinePrecision] * eps), $MachinePrecision] * eps), $MachinePrecision] * eps), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(N[(N[(N[(N[(x * x), $MachinePrecision] * 5.0 + N[(N[(10.0 * eps), $MachinePrecision] * N[(eps + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision] * eps), $MachinePrecision], N[(N[(N[(N[(5.0 * x + eps), $MachinePrecision] * eps + N[(N[(10.0 * x), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] * N[(eps * eps), $MachinePrecision]), $MachinePrecision] * eps), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(x + \varepsilon\right)}^{5} - {x}^{5}\\
\mathbf{if}\;t\_0 \leq -4 \cdot 10^{-322}:\\
\;\;\;\;\left(\left(\left(\mathsf{fma}\left(x, 5, \varepsilon\right) \cdot \varepsilon\right) \cdot \varepsilon\right) \cdot \varepsilon\right) \cdot \varepsilon\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\left(\left(\mathsf{fma}\left(x \cdot x, 5, \left(10 \cdot \varepsilon\right) \cdot \left(\varepsilon + x\right)\right) \cdot x\right) \cdot x\right) \cdot \varepsilon\\
\mathbf{else}:\\
\;\;\;\;\left(\mathsf{fma}\left(\mathsf{fma}\left(5, x, \varepsilon\right), \varepsilon, \left(10 \cdot x\right) \cdot x\right) \cdot \left(\varepsilon \cdot \varepsilon\right)\right) \cdot \varepsilon\\
\end{array}
\end{array}
if (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -4.00193e-322Initial program 99.6%
Taylor expanded in eps around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
distribute-lft1-inN/A
metadata-evalN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-pow.f6496.3
Applied rewrites96.3%
Taylor expanded in x around 0
+-commutativeN/A
metadata-evalN/A
pow-plusN/A
*-commutativeN/A
distribute-lft1-inN/A
metadata-evalN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-pow.f6495.9
Applied rewrites95.9%
Applied rewrites95.8%
Applied rewrites96.0%
if -4.00193e-322 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 0.0Initial program 86.5%
Taylor expanded in eps around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
distribute-lft1-inN/A
metadata-evalN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-pow.f6486.5
Applied rewrites86.5%
Taylor expanded in eps around 0
Applied rewrites99.9%
Taylor expanded in x around 0
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 98.9%
Taylor expanded in eps around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
distribute-lft1-inN/A
metadata-evalN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-pow.f6493.1
Applied rewrites93.1%
Taylor expanded in x around 0
Applied rewrites93.5%
Applied rewrites93.2%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (- (pow (+ x eps) 5.0) (pow x 5.0))))
(if (<= t_0 -4e-322)
(* (* (* (* (fma x 5.0 eps) eps) eps) eps) eps)
(if (<= t_0 0.0)
(* (* eps (fma (* x x) 5.0 (* (* 10.0 eps) (+ eps x)))) (* x x))
(* (* (fma (fma 5.0 x eps) eps (* (* 10.0 x) x)) (* eps eps)) eps)))))
double code(double x, double eps) {
double t_0 = pow((x + eps), 5.0) - pow(x, 5.0);
double tmp;
if (t_0 <= -4e-322) {
tmp = (((fma(x, 5.0, eps) * eps) * eps) * eps) * eps;
} else if (t_0 <= 0.0) {
tmp = (eps * fma((x * x), 5.0, ((10.0 * eps) * (eps + x)))) * (x * x);
} else {
tmp = (fma(fma(5.0, x, eps), eps, ((10.0 * x) * x)) * (eps * eps)) * eps;
}
return tmp;
}
function code(x, eps) t_0 = Float64((Float64(x + eps) ^ 5.0) - (x ^ 5.0)) tmp = 0.0 if (t_0 <= -4e-322) tmp = Float64(Float64(Float64(Float64(fma(x, 5.0, eps) * eps) * eps) * eps) * eps); elseif (t_0 <= 0.0) tmp = Float64(Float64(eps * fma(Float64(x * x), 5.0, Float64(Float64(10.0 * eps) * Float64(eps + x)))) * Float64(x * x)); else tmp = Float64(Float64(fma(fma(5.0, x, eps), eps, Float64(Float64(10.0 * x) * x)) * Float64(eps * eps)) * 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, -4e-322], N[(N[(N[(N[(N[(x * 5.0 + eps), $MachinePrecision] * eps), $MachinePrecision] * eps), $MachinePrecision] * eps), $MachinePrecision] * eps), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(N[(eps * N[(N[(x * x), $MachinePrecision] * 5.0 + N[(N[(10.0 * eps), $MachinePrecision] * N[(eps + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(5.0 * x + eps), $MachinePrecision] * eps + N[(N[(10.0 * x), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] * N[(eps * eps), $MachinePrecision]), $MachinePrecision] * eps), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(x + \varepsilon\right)}^{5} - {x}^{5}\\
\mathbf{if}\;t\_0 \leq -4 \cdot 10^{-322}:\\
\;\;\;\;\left(\left(\left(\mathsf{fma}\left(x, 5, \varepsilon\right) \cdot \varepsilon\right) \cdot \varepsilon\right) \cdot \varepsilon\right) \cdot \varepsilon\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\left(\varepsilon \cdot \mathsf{fma}\left(x \cdot x, 5, \left(10 \cdot \varepsilon\right) \cdot \left(\varepsilon + x\right)\right)\right) \cdot \left(x \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\mathsf{fma}\left(\mathsf{fma}\left(5, x, \varepsilon\right), \varepsilon, \left(10 \cdot x\right) \cdot x\right) \cdot \left(\varepsilon \cdot \varepsilon\right)\right) \cdot \varepsilon\\
\end{array}
\end{array}
if (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -4.00193e-322Initial program 99.6%
Taylor expanded in eps around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
distribute-lft1-inN/A
metadata-evalN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-pow.f6496.3
Applied rewrites96.3%
Taylor expanded in x around 0
+-commutativeN/A
metadata-evalN/A
pow-plusN/A
*-commutativeN/A
distribute-lft1-inN/A
metadata-evalN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-pow.f6495.9
Applied rewrites95.9%
Applied rewrites95.8%
Applied rewrites96.0%
if -4.00193e-322 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 0.0Initial program 86.5%
Taylor expanded in eps around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
distribute-lft1-inN/A
metadata-evalN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-pow.f6486.5
Applied rewrites86.5%
Taylor expanded in eps around 0
Applied rewrites99.9%
Taylor expanded in x around 0
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 98.9%
Taylor expanded in eps around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
distribute-lft1-inN/A
metadata-evalN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-pow.f6493.1
Applied rewrites93.1%
Taylor expanded in x around 0
Applied rewrites93.5%
Applied rewrites93.2%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (- (pow (+ x eps) 5.0) (pow x 5.0))))
(if (<= t_0 -4e-322)
(* (* (* (* (fma x 5.0 eps) eps) eps) eps) eps)
(if (<= t_0 0.0)
(* (* (* (* x x) 5.0) eps) (* x x))
(* (* (fma (fma 5.0 x eps) eps (* (* 10.0 x) x)) (* eps eps)) eps)))))
double code(double x, double eps) {
double t_0 = pow((x + eps), 5.0) - pow(x, 5.0);
double tmp;
if (t_0 <= -4e-322) {
tmp = (((fma(x, 5.0, eps) * eps) * eps) * eps) * eps;
} else if (t_0 <= 0.0) {
tmp = (((x * x) * 5.0) * eps) * (x * x);
} else {
tmp = (fma(fma(5.0, x, eps), eps, ((10.0 * x) * x)) * (eps * eps)) * eps;
}
return tmp;
}
function code(x, eps) t_0 = Float64((Float64(x + eps) ^ 5.0) - (x ^ 5.0)) tmp = 0.0 if (t_0 <= -4e-322) tmp = Float64(Float64(Float64(Float64(fma(x, 5.0, eps) * eps) * eps) * eps) * eps); elseif (t_0 <= 0.0) tmp = Float64(Float64(Float64(Float64(x * x) * 5.0) * eps) * Float64(x * x)); else tmp = Float64(Float64(fma(fma(5.0, x, eps), eps, Float64(Float64(10.0 * x) * x)) * Float64(eps * eps)) * 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, -4e-322], N[(N[(N[(N[(N[(x * 5.0 + eps), $MachinePrecision] * eps), $MachinePrecision] * eps), $MachinePrecision] * eps), $MachinePrecision] * eps), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(N[(N[(N[(x * x), $MachinePrecision] * 5.0), $MachinePrecision] * eps), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(5.0 * x + eps), $MachinePrecision] * eps + N[(N[(10.0 * x), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] * N[(eps * eps), $MachinePrecision]), $MachinePrecision] * eps), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(x + \varepsilon\right)}^{5} - {x}^{5}\\
\mathbf{if}\;t\_0 \leq -4 \cdot 10^{-322}:\\
\;\;\;\;\left(\left(\left(\mathsf{fma}\left(x, 5, \varepsilon\right) \cdot \varepsilon\right) \cdot \varepsilon\right) \cdot \varepsilon\right) \cdot \varepsilon\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\left(\left(\left(x \cdot x\right) \cdot 5\right) \cdot \varepsilon\right) \cdot \left(x \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\mathsf{fma}\left(\mathsf{fma}\left(5, x, \varepsilon\right), \varepsilon, \left(10 \cdot x\right) \cdot x\right) \cdot \left(\varepsilon \cdot \varepsilon\right)\right) \cdot \varepsilon\\
\end{array}
\end{array}
if (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -4.00193e-322Initial program 99.6%
Taylor expanded in eps around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
distribute-lft1-inN/A
metadata-evalN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-pow.f6496.3
Applied rewrites96.3%
Taylor expanded in x around 0
+-commutativeN/A
metadata-evalN/A
pow-plusN/A
*-commutativeN/A
distribute-lft1-inN/A
metadata-evalN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-pow.f6495.9
Applied rewrites95.9%
Applied rewrites95.8%
Applied rewrites96.0%
if -4.00193e-322 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 0.0Initial program 86.5%
Taylor expanded in x around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites99.9%
Applied rewrites99.8%
Taylor expanded in x around inf
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 98.9%
Taylor expanded in eps around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
distribute-lft1-inN/A
metadata-evalN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-pow.f6493.1
Applied rewrites93.1%
Taylor expanded in x around 0
Applied rewrites93.5%
Applied rewrites93.2%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (- (pow (+ x eps) 5.0) (pow x 5.0))))
(if (or (<= t_0 -4e-322) (not (<= t_0 0.0)))
(* (* (* (* (fma x 5.0 eps) eps) eps) eps) eps)
(* (* (* (* x x) 5.0) eps) (* x x)))))
double code(double x, double eps) {
double t_0 = pow((x + eps), 5.0) - pow(x, 5.0);
double tmp;
if ((t_0 <= -4e-322) || !(t_0 <= 0.0)) {
tmp = (((fma(x, 5.0, eps) * eps) * eps) * eps) * eps;
} else {
tmp = (((x * x) * 5.0) * eps) * (x * x);
}
return tmp;
}
function code(x, eps) t_0 = Float64((Float64(x + eps) ^ 5.0) - (x ^ 5.0)) tmp = 0.0 if ((t_0 <= -4e-322) || !(t_0 <= 0.0)) tmp = Float64(Float64(Float64(Float64(fma(x, 5.0, eps) * eps) * eps) * eps) * eps); else tmp = Float64(Float64(Float64(Float64(x * x) * 5.0) * eps) * Float64(x * x)); 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[Or[LessEqual[t$95$0, -4e-322], N[Not[LessEqual[t$95$0, 0.0]], $MachinePrecision]], N[(N[(N[(N[(N[(x * 5.0 + eps), $MachinePrecision] * eps), $MachinePrecision] * eps), $MachinePrecision] * eps), $MachinePrecision] * eps), $MachinePrecision], N[(N[(N[(N[(x * x), $MachinePrecision] * 5.0), $MachinePrecision] * eps), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(x + \varepsilon\right)}^{5} - {x}^{5}\\
\mathbf{if}\;t\_0 \leq -4 \cdot 10^{-322} \lor \neg \left(t\_0 \leq 0\right):\\
\;\;\;\;\left(\left(\left(\mathsf{fma}\left(x, 5, \varepsilon\right) \cdot \varepsilon\right) \cdot \varepsilon\right) \cdot \varepsilon\right) \cdot \varepsilon\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(x \cdot x\right) \cdot 5\right) \cdot \varepsilon\right) \cdot \left(x \cdot x\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -4.00193e-322 or 0.0 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) Initial program 99.2%
Taylor expanded in eps around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
distribute-lft1-inN/A
metadata-evalN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-pow.f6494.8
Applied rewrites94.8%
Taylor expanded in x around 0
+-commutativeN/A
metadata-evalN/A
pow-plusN/A
*-commutativeN/A
distribute-lft1-inN/A
metadata-evalN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-pow.f6494.3
Applied rewrites94.3%
Applied rewrites94.2%
Applied rewrites94.3%
if -4.00193e-322 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 0.0Initial program 86.5%
Taylor expanded in x around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites99.9%
Applied rewrites99.8%
Taylor expanded in x around inf
Applied rewrites99.9%
Final simplification98.9%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (- (pow (+ x eps) 5.0) (pow x 5.0))))
(if (<= t_0 -4e-322)
(* (* (* (* (fma x 5.0 eps) eps) eps) eps) eps)
(if (<= t_0 0.0)
(* (* (* (* x x) 5.0) eps) (* x x))
(* (fma 5.0 x eps) (* (* eps eps) (* eps eps)))))))
double code(double x, double eps) {
double t_0 = pow((x + eps), 5.0) - pow(x, 5.0);
double tmp;
if (t_0 <= -4e-322) {
tmp = (((fma(x, 5.0, eps) * eps) * eps) * eps) * eps;
} else if (t_0 <= 0.0) {
tmp = (((x * x) * 5.0) * eps) * (x * x);
} else {
tmp = fma(5.0, x, eps) * ((eps * eps) * (eps * eps));
}
return tmp;
}
function code(x, eps) t_0 = Float64((Float64(x + eps) ^ 5.0) - (x ^ 5.0)) tmp = 0.0 if (t_0 <= -4e-322) tmp = Float64(Float64(Float64(Float64(fma(x, 5.0, eps) * eps) * eps) * eps) * eps); elseif (t_0 <= 0.0) tmp = Float64(Float64(Float64(Float64(x * x) * 5.0) * eps) * Float64(x * x)); else tmp = Float64(fma(5.0, x, eps) * Float64(Float64(eps * eps) * Float64(eps * 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, -4e-322], N[(N[(N[(N[(N[(x * 5.0 + eps), $MachinePrecision] * eps), $MachinePrecision] * eps), $MachinePrecision] * eps), $MachinePrecision] * eps), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(N[(N[(N[(x * x), $MachinePrecision] * 5.0), $MachinePrecision] * eps), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision], N[(N[(5.0 * x + eps), $MachinePrecision] * N[(N[(eps * eps), $MachinePrecision] * N[(eps * eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(x + \varepsilon\right)}^{5} - {x}^{5}\\
\mathbf{if}\;t\_0 \leq -4 \cdot 10^{-322}:\\
\;\;\;\;\left(\left(\left(\mathsf{fma}\left(x, 5, \varepsilon\right) \cdot \varepsilon\right) \cdot \varepsilon\right) \cdot \varepsilon\right) \cdot \varepsilon\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\left(\left(\left(x \cdot x\right) \cdot 5\right) \cdot \varepsilon\right) \cdot \left(x \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(5, x, \varepsilon\right) \cdot \left(\left(\varepsilon \cdot \varepsilon\right) \cdot \left(\varepsilon \cdot \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))) < -4.00193e-322Initial program 99.6%
Taylor expanded in eps around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
distribute-lft1-inN/A
metadata-evalN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-pow.f6496.3
Applied rewrites96.3%
Taylor expanded in x around 0
+-commutativeN/A
metadata-evalN/A
pow-plusN/A
*-commutativeN/A
distribute-lft1-inN/A
metadata-evalN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-pow.f6495.9
Applied rewrites95.9%
Applied rewrites95.8%
Applied rewrites96.0%
if -4.00193e-322 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 0.0Initial program 86.5%
Taylor expanded in x around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites99.9%
Applied rewrites99.8%
Taylor expanded in x around inf
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 98.9%
Taylor expanded in eps around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
distribute-lft1-inN/A
metadata-evalN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-pow.f6493.1
Applied rewrites93.1%
Taylor expanded in x around 0
+-commutativeN/A
metadata-evalN/A
pow-plusN/A
*-commutativeN/A
distribute-lft1-inN/A
metadata-evalN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-pow.f6492.5
Applied rewrites92.5%
Applied rewrites92.5%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (- (pow (+ x eps) 5.0) (pow x 5.0))))
(if (<= t_0 -4e-322)
(* (* (* (* (fma x 5.0 eps) eps) eps) eps) eps)
(if (<= t_0 0.0)
(* (* (* (* x x) 5.0) eps) (* x x))
(* (* (fma 5.0 x eps) (* eps eps)) (* eps eps))))))
double code(double x, double eps) {
double t_0 = pow((x + eps), 5.0) - pow(x, 5.0);
double tmp;
if (t_0 <= -4e-322) {
tmp = (((fma(x, 5.0, eps) * eps) * eps) * eps) * eps;
} else if (t_0 <= 0.0) {
tmp = (((x * x) * 5.0) * eps) * (x * x);
} else {
tmp = (fma(5.0, x, eps) * (eps * eps)) * (eps * eps);
}
return tmp;
}
function code(x, eps) t_0 = Float64((Float64(x + eps) ^ 5.0) - (x ^ 5.0)) tmp = 0.0 if (t_0 <= -4e-322) tmp = Float64(Float64(Float64(Float64(fma(x, 5.0, eps) * eps) * eps) * eps) * eps); elseif (t_0 <= 0.0) tmp = Float64(Float64(Float64(Float64(x * x) * 5.0) * eps) * Float64(x * x)); else tmp = Float64(Float64(fma(5.0, x, eps) * Float64(eps * eps)) * Float64(eps * 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, -4e-322], N[(N[(N[(N[(N[(x * 5.0 + eps), $MachinePrecision] * eps), $MachinePrecision] * eps), $MachinePrecision] * eps), $MachinePrecision] * eps), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(N[(N[(N[(x * x), $MachinePrecision] * 5.0), $MachinePrecision] * eps), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(5.0 * x + eps), $MachinePrecision] * N[(eps * eps), $MachinePrecision]), $MachinePrecision] * N[(eps * eps), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(x + \varepsilon\right)}^{5} - {x}^{5}\\
\mathbf{if}\;t\_0 \leq -4 \cdot 10^{-322}:\\
\;\;\;\;\left(\left(\left(\mathsf{fma}\left(x, 5, \varepsilon\right) \cdot \varepsilon\right) \cdot \varepsilon\right) \cdot \varepsilon\right) \cdot \varepsilon\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\left(\left(\left(x \cdot x\right) \cdot 5\right) \cdot \varepsilon\right) \cdot \left(x \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\mathsf{fma}\left(5, x, \varepsilon\right) \cdot \left(\varepsilon \cdot \varepsilon\right)\right) \cdot \left(\varepsilon \cdot \varepsilon\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -4.00193e-322Initial program 99.6%
Taylor expanded in eps around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
distribute-lft1-inN/A
metadata-evalN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-pow.f6496.3
Applied rewrites96.3%
Taylor expanded in x around 0
+-commutativeN/A
metadata-evalN/A
pow-plusN/A
*-commutativeN/A
distribute-lft1-inN/A
metadata-evalN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-pow.f6495.9
Applied rewrites95.9%
Applied rewrites95.8%
Applied rewrites96.0%
if -4.00193e-322 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 0.0Initial program 86.5%
Taylor expanded in x around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites99.9%
Applied rewrites99.8%
Taylor expanded in x around inf
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 98.9%
Taylor expanded in eps around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
distribute-lft1-inN/A
metadata-evalN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-pow.f6493.1
Applied rewrites93.1%
Taylor expanded in x around 0
+-commutativeN/A
metadata-evalN/A
pow-plusN/A
*-commutativeN/A
distribute-lft1-inN/A
metadata-evalN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-pow.f6492.5
Applied rewrites92.5%
Applied rewrites92.4%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (- (pow (+ x eps) 5.0) (pow x 5.0))))
(if (or (<= t_0 -4e-322) (not (<= t_0 0.0)))
(* (* (* eps eps) (* eps eps)) eps)
(* (* (* (* x x) 5.0) eps) (* x x)))))
double code(double x, double eps) {
double t_0 = pow((x + eps), 5.0) - pow(x, 5.0);
double tmp;
if ((t_0 <= -4e-322) || !(t_0 <= 0.0)) {
tmp = ((eps * eps) * (eps * eps)) * eps;
} else {
tmp = (((x * x) * 5.0) * eps) * (x * x);
}
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 + eps) ** 5.0d0) - (x ** 5.0d0)
if ((t_0 <= (-4d-322)) .or. (.not. (t_0 <= 0.0d0))) then
tmp = ((eps * eps) * (eps * eps)) * eps
else
tmp = (((x * x) * 5.0d0) * eps) * (x * x)
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 tmp;
if ((t_0 <= -4e-322) || !(t_0 <= 0.0)) {
tmp = ((eps * eps) * (eps * eps)) * eps;
} else {
tmp = (((x * x) * 5.0) * eps) * (x * x);
}
return tmp;
}
def code(x, eps): t_0 = math.pow((x + eps), 5.0) - math.pow(x, 5.0) tmp = 0 if (t_0 <= -4e-322) or not (t_0 <= 0.0): tmp = ((eps * eps) * (eps * eps)) * eps else: tmp = (((x * x) * 5.0) * eps) * (x * x) return tmp
function code(x, eps) t_0 = Float64((Float64(x + eps) ^ 5.0) - (x ^ 5.0)) tmp = 0.0 if ((t_0 <= -4e-322) || !(t_0 <= 0.0)) tmp = Float64(Float64(Float64(eps * eps) * Float64(eps * eps)) * eps); else tmp = Float64(Float64(Float64(Float64(x * x) * 5.0) * eps) * Float64(x * x)); end return tmp end
function tmp_2 = code(x, eps) t_0 = ((x + eps) ^ 5.0) - (x ^ 5.0); tmp = 0.0; if ((t_0 <= -4e-322) || ~((t_0 <= 0.0))) tmp = ((eps * eps) * (eps * eps)) * eps; else tmp = (((x * x) * 5.0) * eps) * (x * x); 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]}, If[Or[LessEqual[t$95$0, -4e-322], N[Not[LessEqual[t$95$0, 0.0]], $MachinePrecision]], N[(N[(N[(eps * eps), $MachinePrecision] * N[(eps * eps), $MachinePrecision]), $MachinePrecision] * eps), $MachinePrecision], N[(N[(N[(N[(x * x), $MachinePrecision] * 5.0), $MachinePrecision] * eps), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(x + \varepsilon\right)}^{5} - {x}^{5}\\
\mathbf{if}\;t\_0 \leq -4 \cdot 10^{-322} \lor \neg \left(t\_0 \leq 0\right):\\
\;\;\;\;\left(\left(\varepsilon \cdot \varepsilon\right) \cdot \left(\varepsilon \cdot \varepsilon\right)\right) \cdot \varepsilon\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(x \cdot x\right) \cdot 5\right) \cdot \varepsilon\right) \cdot \left(x \cdot x\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -4.00193e-322 or 0.0 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) Initial program 99.2%
Taylor expanded in eps around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
distribute-lft1-inN/A
metadata-evalN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-pow.f6494.8
Applied rewrites94.8%
Taylor expanded in x around 0
Applied rewrites94.8%
Applied rewrites94.6%
Taylor expanded in x around 0
Applied rewrites93.5%
if -4.00193e-322 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 0.0Initial program 86.5%
Taylor expanded in x around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites99.9%
Applied rewrites99.8%
Taylor expanded in x around inf
Applied rewrites99.9%
Final simplification98.7%
(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(Float64(eps * eps) * Float64(eps * eps)) * eps) end
function tmp = code(x, eps) tmp = ((eps * eps) * (eps * eps)) * eps; end
code[x_, eps_] := N[(N[(N[(eps * eps), $MachinePrecision] * N[(eps * eps), $MachinePrecision]), $MachinePrecision] * eps), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\varepsilon \cdot \varepsilon\right) \cdot \left(\varepsilon \cdot \varepsilon\right)\right) \cdot \varepsilon
\end{array}
Initial program 88.8%
Taylor expanded in eps around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
distribute-lft1-inN/A
metadata-evalN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-pow.f6488.0
Applied rewrites88.0%
Taylor expanded in x around 0
Applied rewrites88.1%
Applied rewrites88.0%
Taylor expanded in x around 0
Applied rewrites87.8%
herbie shell --seed 2024318
(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)))