
(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 14 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))))
(if (<= t_1 -5e-315)
(- t_0 (pow (pow x 4.0) 1.25))
(if (<= t_1 0.0) (* (* 5.0 eps) (pow x 4.0)) (pow eps 5.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 tmp;
if (t_1 <= -5e-315) {
tmp = t_0 - pow(pow(x, 4.0), 1.25);
} else if (t_1 <= 0.0) {
tmp = (5.0 * eps) * pow(x, 4.0);
} else {
tmp = pow(eps, 5.0);
}
return tmp;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (x + eps) ** 5.0d0
t_1 = t_0 - (x ** 5.0d0)
if (t_1 <= (-5d-315)) then
tmp = t_0 - ((x ** 4.0d0) ** 1.25d0)
else if (t_1 <= 0.0d0) then
tmp = (5.0d0 * eps) * (x ** 4.0d0)
else
tmp = eps ** 5.0d0
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 tmp;
if (t_1 <= -5e-315) {
tmp = t_0 - Math.pow(Math.pow(x, 4.0), 1.25);
} else if (t_1 <= 0.0) {
tmp = (5.0 * eps) * Math.pow(x, 4.0);
} else {
tmp = Math.pow(eps, 5.0);
}
return tmp;
}
def code(x, eps): t_0 = math.pow((x + eps), 5.0) t_1 = t_0 - math.pow(x, 5.0) tmp = 0 if t_1 <= -5e-315: tmp = t_0 - math.pow(math.pow(x, 4.0), 1.25) elif t_1 <= 0.0: tmp = (5.0 * eps) * math.pow(x, 4.0) else: tmp = math.pow(eps, 5.0) return tmp
function code(x, eps) t_0 = Float64(x + eps) ^ 5.0 t_1 = Float64(t_0 - (x ^ 5.0)) tmp = 0.0 if (t_1 <= -5e-315) tmp = Float64(t_0 - ((x ^ 4.0) ^ 1.25)); elseif (t_1 <= 0.0) tmp = Float64(Float64(5.0 * eps) * (x ^ 4.0)); else tmp = eps ^ 5.0; end return tmp end
function tmp_2 = code(x, eps) t_0 = (x + eps) ^ 5.0; t_1 = t_0 - (x ^ 5.0); tmp = 0.0; if (t_1 <= -5e-315) tmp = t_0 - ((x ^ 4.0) ^ 1.25); elseif (t_1 <= 0.0) tmp = (5.0 * eps) * (x ^ 4.0); else tmp = eps ^ 5.0; 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]}, If[LessEqual[t$95$1, -5e-315], N[(t$95$0 - N[Power[N[Power[x, 4.0], $MachinePrecision], 1.25], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(N[(5.0 * eps), $MachinePrecision] * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision], N[Power[eps, 5.0], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(x + \varepsilon\right)}^{5}\\
t_1 := t\_0 - {x}^{5}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{-315}:\\
\;\;\;\;t\_0 - {\left({x}^{4}\right)}^{1.25}\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\left(5 \cdot \varepsilon\right) \cdot {x}^{4}\\
\mathbf{else}:\\
\;\;\;\;{\varepsilon}^{5}\\
\end{array}
\end{array}
if (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -5.0000000023e-315Initial program 98.4%
lift-pow.f64N/A
sqr-powN/A
pow-prod-downN/A
sqr-powN/A
pow-prod-downN/A
lower-pow.f64N/A
pow2N/A
pow-prod-downN/A
pow-sqrN/A
lower-pow.f64N/A
metadata-evalN/A
metadata-evalN/A
metadata-eval98.5
Applied rewrites98.5%
if -5.0000000023e-315 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -0.0Initial program 90.1%
Taylor expanded in x around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites100.0%
Taylor expanded in x around inf
Applied rewrites100.0%
if -0.0 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) Initial program 100.0%
Taylor expanded in x around 0
lower-pow.f64100.0
Applied rewrites100.0%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (- (pow (+ x eps) 5.0) (pow x 5.0))))
(if (<= t_0 -5e-315)
t_0
(if (<= t_0 0.0) (* (* 5.0 eps) (pow x 4.0)) (pow eps 5.0)))))
double code(double x, double eps) {
double t_0 = pow((x + eps), 5.0) - pow(x, 5.0);
double tmp;
if (t_0 <= -5e-315) {
tmp = t_0;
} else if (t_0 <= 0.0) {
tmp = (5.0 * eps) * pow(x, 4.0);
} else {
tmp = pow(eps, 5.0);
}
return tmp;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: t_0
real(8) :: tmp
t_0 = ((x + eps) ** 5.0d0) - (x ** 5.0d0)
if (t_0 <= (-5d-315)) then
tmp = t_0
else if (t_0 <= 0.0d0) then
tmp = (5.0d0 * eps) * (x ** 4.0d0)
else
tmp = eps ** 5.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 <= -5e-315) {
tmp = t_0;
} else if (t_0 <= 0.0) {
tmp = (5.0 * eps) * Math.pow(x, 4.0);
} else {
tmp = Math.pow(eps, 5.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 <= -5e-315: tmp = t_0 elif t_0 <= 0.0: tmp = (5.0 * eps) * math.pow(x, 4.0) else: tmp = math.pow(eps, 5.0) return tmp
function code(x, eps) t_0 = Float64((Float64(x + eps) ^ 5.0) - (x ^ 5.0)) tmp = 0.0 if (t_0 <= -5e-315) tmp = t_0; elseif (t_0 <= 0.0) tmp = Float64(Float64(5.0 * eps) * (x ^ 4.0)); else tmp = eps ^ 5.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 <= -5e-315) tmp = t_0; elseif (t_0 <= 0.0) tmp = (5.0 * eps) * (x ^ 4.0); else tmp = eps ^ 5.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[LessEqual[t$95$0, -5e-315], t$95$0, If[LessEqual[t$95$0, 0.0], N[(N[(5.0 * eps), $MachinePrecision] * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision], N[Power[eps, 5.0], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(x + \varepsilon\right)}^{5} - {x}^{5}\\
\mathbf{if}\;t\_0 \leq -5 \cdot 10^{-315}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\left(5 \cdot \varepsilon\right) \cdot {x}^{4}\\
\mathbf{else}:\\
\;\;\;\;{\varepsilon}^{5}\\
\end{array}
\end{array}
if (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -5.0000000023e-315Initial program 98.4%
if -5.0000000023e-315 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -0.0Initial program 90.1%
Taylor expanded in x around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites100.0%
Taylor expanded in x around inf
Applied rewrites100.0%
if -0.0 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) Initial program 100.0%
Taylor expanded in x around 0
lower-pow.f64100.0
Applied rewrites100.0%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (- (pow (+ x eps) 5.0) (pow x 5.0))))
(if (<= t_0 -5e-315)
(*
(+ (- -1.0) (/ (fma 5.0 x (/ (* -10.0 (* x x)) (- eps))) eps))
(pow eps 5.0))
(if (<= t_0 0.0) (* (* 5.0 eps) (pow x 4.0)) (pow eps 5.0)))))
double code(double x, double eps) {
double t_0 = pow((x + eps), 5.0) - pow(x, 5.0);
double tmp;
if (t_0 <= -5e-315) {
tmp = (-(-1.0) + (fma(5.0, x, ((-10.0 * (x * x)) / -eps)) / eps)) * pow(eps, 5.0);
} else if (t_0 <= 0.0) {
tmp = (5.0 * eps) * pow(x, 4.0);
} else {
tmp = pow(eps, 5.0);
}
return tmp;
}
function code(x, eps) t_0 = Float64((Float64(x + eps) ^ 5.0) - (x ^ 5.0)) tmp = 0.0 if (t_0 <= -5e-315) tmp = Float64(Float64(Float64(-(-1.0)) + Float64(fma(5.0, x, Float64(Float64(-10.0 * Float64(x * x)) / Float64(-eps))) / eps)) * (eps ^ 5.0)); elseif (t_0 <= 0.0) tmp = Float64(Float64(5.0 * eps) * (x ^ 4.0)); else tmp = eps ^ 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]}, If[LessEqual[t$95$0, -5e-315], N[(N[((--1.0) + N[(N[(5.0 * x + N[(N[(-10.0 * N[(x * x), $MachinePrecision]), $MachinePrecision] / (-eps)), $MachinePrecision]), $MachinePrecision] / eps), $MachinePrecision]), $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[Power[eps, 5.0], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(x + \varepsilon\right)}^{5} - {x}^{5}\\
\mathbf{if}\;t\_0 \leq -5 \cdot 10^{-315}:\\
\;\;\;\;\left(\left(--1\right) + \frac{\mathsf{fma}\left(5, x, \frac{-10 \cdot \left(x \cdot x\right)}{-\varepsilon}\right)}{\varepsilon}\right) \cdot {\varepsilon}^{5}\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\left(5 \cdot \varepsilon\right) \cdot {x}^{4}\\
\mathbf{else}:\\
\;\;\;\;{\varepsilon}^{5}\\
\end{array}
\end{array}
if (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -5.0000000023e-315Initial program 98.4%
Taylor expanded in eps around -inf
Applied rewrites90.0%
if -5.0000000023e-315 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -0.0Initial program 90.1%
Taylor expanded in x around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites100.0%
Taylor expanded in x around inf
Applied rewrites100.0%
if -0.0 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) Initial program 100.0%
Taylor expanded in x around 0
lower-pow.f64100.0
Applied rewrites100.0%
Final simplification99.3%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (- (pow (+ x eps) 5.0) (pow x 5.0))))
(if (<= t_0 -5e-315)
(* (fma (/ x eps) 5.0 1.0) (pow eps 5.0))
(if (<= t_0 0.0) (* (* 5.0 eps) (pow x 4.0)) (pow eps 5.0)))))
double code(double x, double eps) {
double t_0 = pow((x + eps), 5.0) - pow(x, 5.0);
double tmp;
if (t_0 <= -5e-315) {
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(eps, 5.0);
}
return tmp;
}
function code(x, eps) t_0 = Float64((Float64(x + eps) ^ 5.0) - (x ^ 5.0)) tmp = 0.0 if (t_0 <= -5e-315) 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 = eps ^ 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]}, If[LessEqual[t$95$0, -5e-315], 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[Power[eps, 5.0], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(x + \varepsilon\right)}^{5} - {x}^{5}\\
\mathbf{if}\;t\_0 \leq -5 \cdot 10^{-315}:\\
\;\;\;\;\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}:\\
\;\;\;\;{\varepsilon}^{5}\\
\end{array}
\end{array}
if (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -5.0000000023e-315Initial program 98.4%
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.7
Applied rewrites88.7%
if -5.0000000023e-315 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -0.0Initial program 90.1%
Taylor expanded in x around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites100.0%
Taylor expanded in x around inf
Applied rewrites100.0%
if -0.0 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) Initial program 100.0%
Taylor expanded in x around 0
lower-pow.f64100.0
Applied rewrites100.0%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (- (pow (+ x eps) 5.0) (pow x 5.0))))
(if (or (<= t_0 -5e-315) (not (<= t_0 0.0)))
(* (* (* (* (fma x 5.0 eps) eps) eps) eps) eps)
(* (* (* (* 5.0 eps) x) x) (* 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 <= -5e-315) || !(t_0 <= 0.0)) {
tmp = (((fma(x, 5.0, eps) * eps) * eps) * eps) * eps;
} else {
tmp = (((5.0 * eps) * x) * x) * (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 <= -5e-315) || !(t_0 <= 0.0)) tmp = Float64(Float64(Float64(Float64(fma(x, 5.0, eps) * eps) * eps) * eps) * eps); else tmp = Float64(Float64(Float64(Float64(5.0 * eps) * x) * x) * 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, -5e-315], 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[(5.0 * eps), $MachinePrecision] * x), $MachinePrecision] * x), $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 -5 \cdot 10^{-315} \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(5 \cdot \varepsilon\right) \cdot x\right) \cdot x\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))) < -5.0000000023e-315 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.6
Applied rewrites94.6%
Taylor expanded in x around 0
distribute-lft1-inN/A
metadata-evalN/A
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
pow-plusN/A
*-commutativeN/A
distribute-rgt-inN/A
+-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-pow.f6494.3
Applied rewrites94.3%
Applied rewrites94.0%
Applied rewrites94.0%
if -5.0000000023e-315 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -0.0Initial program 90.1%
Taylor expanded in x around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites100.0%
Applied rewrites99.9%
Taylor expanded in x around inf
Applied rewrites99.9%
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 -5e-315)
(* (* (* (* (fma x 5.0 eps) eps) eps) eps) eps)
(if (<= t_0 0.0)
(* (* (* (* 5.0 eps) (* x x)) 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 <= -5e-315) {
tmp = (((fma(x, 5.0, eps) * eps) * eps) * eps) * eps;
} else if (t_0 <= 0.0) {
tmp = (((5.0 * eps) * (x * x)) * 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 <= -5e-315) tmp = Float64(Float64(Float64(Float64(fma(x, 5.0, eps) * eps) * eps) * eps) * eps); elseif (t_0 <= 0.0) tmp = Float64(Float64(Float64(Float64(5.0 * eps) * Float64(x * x)) * 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, -5e-315], 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[(5.0 * eps), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision] * x), $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 -5 \cdot 10^{-315}:\\
\;\;\;\;\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(5 \cdot \varepsilon\right) \cdot \left(x \cdot x\right)\right) \cdot x\right) \cdot x\\
\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))) < -5.0000000023e-315Initial program 98.4%
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.7
Applied rewrites88.7%
Taylor expanded in x around 0
distribute-lft1-inN/A
metadata-evalN/A
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
pow-plusN/A
*-commutativeN/A
distribute-rgt-inN/A
+-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-pow.f6488.5
Applied rewrites88.5%
Applied rewrites87.9%
Applied rewrites88.0%
if -5.0000000023e-315 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -0.0Initial program 90.1%
Taylor expanded in x around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites100.0%
Applied rewrites99.9%
Taylor expanded in x around inf
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 100.0%
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.f64100.0
Applied rewrites100.0%
Taylor expanded in x around 0
distribute-lft1-inN/A
metadata-evalN/A
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
pow-plusN/A
*-commutativeN/A
distribute-rgt-inN/A
+-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-pow.f6499.4
Applied rewrites99.4%
Applied rewrites99.3%
Final simplification99.1%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (- (pow (+ x eps) 5.0) (pow x 5.0))))
(if (<= t_0 -5e-315)
(* (* (* (* (fma x 5.0 eps) eps) eps) eps) eps)
(if (<= t_0 0.0)
(* (* (* (* 5.0 eps) x) x) (* 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 <= -5e-315) {
tmp = (((fma(x, 5.0, eps) * eps) * eps) * eps) * eps;
} else if (t_0 <= 0.0) {
tmp = (((5.0 * eps) * x) * x) * (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 <= -5e-315) tmp = Float64(Float64(Float64(Float64(fma(x, 5.0, eps) * eps) * eps) * eps) * eps); elseif (t_0 <= 0.0) tmp = Float64(Float64(Float64(Float64(5.0 * eps) * x) * x) * 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, -5e-315], 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[(5.0 * eps), $MachinePrecision] * x), $MachinePrecision] * x), $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 -5 \cdot 10^{-315}:\\
\;\;\;\;\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(5 \cdot \varepsilon\right) \cdot x\right) \cdot x\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))) < -5.0000000023e-315Initial program 98.4%
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.7
Applied rewrites88.7%
Taylor expanded in x around 0
distribute-lft1-inN/A
metadata-evalN/A
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
pow-plusN/A
*-commutativeN/A
distribute-rgt-inN/A
+-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-pow.f6488.5
Applied rewrites88.5%
Applied rewrites87.9%
Applied rewrites88.0%
if -5.0000000023e-315 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -0.0Initial program 90.1%
Taylor expanded in x around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites100.0%
Applied rewrites99.9%
Taylor expanded in x around inf
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 100.0%
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.f64100.0
Applied rewrites100.0%
Taylor expanded in x around 0
distribute-lft1-inN/A
metadata-evalN/A
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
pow-plusN/A
*-commutativeN/A
distribute-rgt-inN/A
+-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-pow.f6499.4
Applied rewrites99.4%
Applied rewrites99.3%
(FPCore (x eps) :precision binary64 (if (or (<= x -5e-60) (not (<= x 4e-83))) (* (fma 5.0 eps (/ (* -10.0 (* eps eps)) (- x))) (pow x 4.0)) (pow eps 5.0)))
double code(double x, double eps) {
double tmp;
if ((x <= -5e-60) || !(x <= 4e-83)) {
tmp = fma(5.0, eps, ((-10.0 * (eps * eps)) / -x)) * pow(x, 4.0);
} else {
tmp = pow(eps, 5.0);
}
return tmp;
}
function code(x, eps) tmp = 0.0 if ((x <= -5e-60) || !(x <= 4e-83)) tmp = Float64(fma(5.0, eps, Float64(Float64(-10.0 * Float64(eps * eps)) / Float64(-x))) * (x ^ 4.0)); else tmp = eps ^ 5.0; end return tmp end
code[x_, eps_] := If[Or[LessEqual[x, -5e-60], N[Not[LessEqual[x, 4e-83]], $MachinePrecision]], N[(N[(5.0 * eps + N[(N[(-10.0 * N[(eps * eps), $MachinePrecision]), $MachinePrecision] / (-x)), $MachinePrecision]), $MachinePrecision] * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision], N[Power[eps, 5.0], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5 \cdot 10^{-60} \lor \neg \left(x \leq 4 \cdot 10^{-83}\right):\\
\;\;\;\;\mathsf{fma}\left(5, \varepsilon, \frac{-10 \cdot \left(\varepsilon \cdot \varepsilon\right)}{-x}\right) \cdot {x}^{4}\\
\mathbf{else}:\\
\;\;\;\;{\varepsilon}^{5}\\
\end{array}
\end{array}
if x < -5.0000000000000001e-60 or 4.0000000000000001e-83 < x Initial program 62.0%
Taylor expanded in x around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites96.6%
if -5.0000000000000001e-60 < x < 4.0000000000000001e-83Initial program 100.0%
Taylor expanded in x around 0
lower-pow.f64100.0
Applied rewrites100.0%
Final simplification99.2%
(FPCore (x eps)
:precision binary64
(if (<= x -5.8e-60)
(* (* 5.0 eps) (pow x 4.0))
(if (<= x 4e-83)
(pow eps 5.0)
(* (* (* (* (fma (/ eps x) 10.0 5.0) eps) x) x) (* x x)))))
double code(double x, double eps) {
double tmp;
if (x <= -5.8e-60) {
tmp = (5.0 * eps) * pow(x, 4.0);
} else if (x <= 4e-83) {
tmp = pow(eps, 5.0);
} else {
tmp = (((fma((eps / x), 10.0, 5.0) * eps) * x) * x) * (x * x);
}
return tmp;
}
function code(x, eps) tmp = 0.0 if (x <= -5.8e-60) tmp = Float64(Float64(5.0 * eps) * (x ^ 4.0)); elseif (x <= 4e-83) tmp = eps ^ 5.0; else tmp = Float64(Float64(Float64(Float64(fma(Float64(eps / x), 10.0, 5.0) * eps) * x) * x) * Float64(x * x)); end return tmp end
code[x_, eps_] := If[LessEqual[x, -5.8e-60], N[(N[(5.0 * eps), $MachinePrecision] * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4e-83], N[Power[eps, 5.0], $MachinePrecision], N[(N[(N[(N[(N[(N[(eps / x), $MachinePrecision] * 10.0 + 5.0), $MachinePrecision] * eps), $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.8 \cdot 10^{-60}:\\
\;\;\;\;\left(5 \cdot \varepsilon\right) \cdot {x}^{4}\\
\mathbf{elif}\;x \leq 4 \cdot 10^{-83}:\\
\;\;\;\;{\varepsilon}^{5}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\mathsf{fma}\left(\frac{\varepsilon}{x}, 10, 5\right) \cdot \varepsilon\right) \cdot x\right) \cdot x\right) \cdot \left(x \cdot x\right)\\
\end{array}
\end{array}
if x < -5.7999999999999999e-60Initial program 49.3%
Taylor expanded in x around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites96.0%
Taylor expanded in x around inf
Applied rewrites96.0%
if -5.7999999999999999e-60 < x < 4.0000000000000001e-83Initial program 100.0%
Taylor expanded in x around 0
lower-pow.f64100.0
Applied rewrites100.0%
if 4.0000000000000001e-83 < x Initial program 70.9%
Taylor expanded in x around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites96.9%
Applied rewrites96.8%
Taylor expanded in x around inf
Applied rewrites96.9%
(FPCore (x eps)
:precision binary64
(if (<= x -5.8e-60)
(* (* (* (* x x) (* x x)) eps) 5.0)
(if (<= x 4e-83)
(pow eps 5.0)
(* (* (* (* (fma (/ eps x) 10.0 5.0) eps) x) x) (* x x)))))
double code(double x, double eps) {
double tmp;
if (x <= -5.8e-60) {
tmp = (((x * x) * (x * x)) * eps) * 5.0;
} else if (x <= 4e-83) {
tmp = pow(eps, 5.0);
} else {
tmp = (((fma((eps / x), 10.0, 5.0) * eps) * x) * x) * (x * x);
}
return tmp;
}
function code(x, eps) tmp = 0.0 if (x <= -5.8e-60) tmp = Float64(Float64(Float64(Float64(x * x) * Float64(x * x)) * eps) * 5.0); elseif (x <= 4e-83) tmp = eps ^ 5.0; else tmp = Float64(Float64(Float64(Float64(fma(Float64(eps / x), 10.0, 5.0) * eps) * x) * x) * Float64(x * x)); end return tmp end
code[x_, eps_] := If[LessEqual[x, -5.8e-60], N[(N[(N[(N[(x * x), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision] * eps), $MachinePrecision] * 5.0), $MachinePrecision], If[LessEqual[x, 4e-83], N[Power[eps, 5.0], $MachinePrecision], N[(N[(N[(N[(N[(N[(eps / x), $MachinePrecision] * 10.0 + 5.0), $MachinePrecision] * eps), $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.8 \cdot 10^{-60}:\\
\;\;\;\;\left(\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot \varepsilon\right) \cdot 5\\
\mathbf{elif}\;x \leq 4 \cdot 10^{-83}:\\
\;\;\;\;{\varepsilon}^{5}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\mathsf{fma}\left(\frac{\varepsilon}{x}, 10, 5\right) \cdot \varepsilon\right) \cdot x\right) \cdot x\right) \cdot \left(x \cdot x\right)\\
\end{array}
\end{array}
if x < -5.7999999999999999e-60Initial program 49.3%
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.f6449.4
Applied rewrites49.4%
Taylor expanded in x around inf
distribute-rgt1-inN/A
metadata-evalN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f6495.9
Applied rewrites95.9%
Applied rewrites95.8%
if -5.7999999999999999e-60 < x < 4.0000000000000001e-83Initial program 100.0%
Taylor expanded in x around 0
lower-pow.f64100.0
Applied rewrites100.0%
if 4.0000000000000001e-83 < x Initial program 70.9%
Taylor expanded in x around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites96.9%
Applied rewrites96.8%
Taylor expanded in x around inf
Applied rewrites96.9%
(FPCore (x eps)
:precision binary64
(if (<= x -5.8e-60)
(* (* (* (* x x) (* x x)) eps) 5.0)
(if (<= x 4e-83)
(* (* (* (* (fma x 5.0 eps) eps) eps) eps) eps)
(* (* (* (* (fma (/ eps x) 10.0 5.0) eps) x) x) (* x x)))))
double code(double x, double eps) {
double tmp;
if (x <= -5.8e-60) {
tmp = (((x * x) * (x * x)) * eps) * 5.0;
} else if (x <= 4e-83) {
tmp = (((fma(x, 5.0, eps) * eps) * eps) * eps) * eps;
} else {
tmp = (((fma((eps / x), 10.0, 5.0) * eps) * x) * x) * (x * x);
}
return tmp;
}
function code(x, eps) tmp = 0.0 if (x <= -5.8e-60) tmp = Float64(Float64(Float64(Float64(x * x) * Float64(x * x)) * eps) * 5.0); elseif (x <= 4e-83) tmp = Float64(Float64(Float64(Float64(fma(x, 5.0, eps) * eps) * eps) * eps) * eps); else tmp = Float64(Float64(Float64(Float64(fma(Float64(eps / x), 10.0, 5.0) * eps) * x) * x) * Float64(x * x)); end return tmp end
code[x_, eps_] := If[LessEqual[x, -5.8e-60], N[(N[(N[(N[(x * x), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision] * eps), $MachinePrecision] * 5.0), $MachinePrecision], If[LessEqual[x, 4e-83], N[(N[(N[(N[(N[(x * 5.0 + eps), $MachinePrecision] * eps), $MachinePrecision] * eps), $MachinePrecision] * eps), $MachinePrecision] * eps), $MachinePrecision], N[(N[(N[(N[(N[(N[(eps / x), $MachinePrecision] * 10.0 + 5.0), $MachinePrecision] * eps), $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.8 \cdot 10^{-60}:\\
\;\;\;\;\left(\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot \varepsilon\right) \cdot 5\\
\mathbf{elif}\;x \leq 4 \cdot 10^{-83}:\\
\;\;\;\;\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(\mathsf{fma}\left(\frac{\varepsilon}{x}, 10, 5\right) \cdot \varepsilon\right) \cdot x\right) \cdot x\right) \cdot \left(x \cdot x\right)\\
\end{array}
\end{array}
if x < -5.7999999999999999e-60Initial program 49.3%
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.f6449.4
Applied rewrites49.4%
Taylor expanded in x around inf
distribute-rgt1-inN/A
metadata-evalN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f6495.9
Applied rewrites95.9%
Applied rewrites95.8%
if -5.7999999999999999e-60 < x < 4.0000000000000001e-83Initial program 100.0%
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.f64100.0
Applied rewrites100.0%
Taylor expanded in x around 0
distribute-lft1-inN/A
metadata-evalN/A
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
pow-plusN/A
*-commutativeN/A
distribute-rgt-inN/A
+-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-pow.f6499.9
Applied rewrites99.9%
Applied rewrites99.9%
Applied rewrites99.9%
if 4.0000000000000001e-83 < x Initial program 70.9%
Taylor expanded in x around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites96.9%
Applied rewrites96.8%
Taylor expanded in x around inf
Applied rewrites96.9%
(FPCore (x eps) :precision binary64 (* (* (* (* 5.0 eps) x) x) (* x x)))
double code(double x, double eps) {
return (((5.0 * eps) * x) * x) * (x * x);
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
code = (((5.0d0 * eps) * x) * x) * (x * x)
end function
public static double code(double x, double eps) {
return (((5.0 * eps) * x) * x) * (x * x);
}
def code(x, eps): return (((5.0 * eps) * x) * x) * (x * x)
function code(x, eps) return Float64(Float64(Float64(Float64(5.0 * eps) * x) * x) * Float64(x * x)) end
function tmp = code(x, eps) tmp = (((5.0 * eps) * x) * x) * (x * x); end
code[x_, eps_] := N[(N[(N[(N[(5.0 * eps), $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(5 \cdot \varepsilon\right) \cdot x\right) \cdot x\right) \cdot \left(x \cdot x\right)
\end{array}
Initial program 91.4%
Taylor expanded in x around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites87.6%
Applied rewrites87.6%
Taylor expanded in x around inf
Applied rewrites87.5%
Applied rewrites87.5%
(FPCore (x eps) :precision binary64 (* (* (* (* x x) 5.0) eps) (* x x)))
double code(double x, double eps) {
return (((x * x) * 5.0) * eps) * (x * x);
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
code = (((x * x) * 5.0d0) * eps) * (x * x)
end function
public static double code(double x, double eps) {
return (((x * x) * 5.0) * eps) * (x * x);
}
def code(x, eps): return (((x * x) * 5.0) * eps) * (x * x)
function code(x, eps) return Float64(Float64(Float64(Float64(x * x) * 5.0) * eps) * Float64(x * x)) end
function tmp = code(x, eps) tmp = (((x * x) * 5.0) * eps) * (x * x); end
code[x_, eps_] := N[(N[(N[(N[(x * x), $MachinePrecision] * 5.0), $MachinePrecision] * eps), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x \cdot x\right) \cdot 5\right) \cdot \varepsilon\right) \cdot \left(x \cdot x\right)
\end{array}
Initial program 91.4%
Taylor expanded in x around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites87.6%
Applied rewrites87.6%
Taylor expanded in x around inf
Applied rewrites87.5%
(FPCore (x eps) :precision binary64 (* (* (* 10.0 eps) (* eps x)) (* x x)))
double code(double x, double eps) {
return ((10.0 * eps) * (eps * x)) * (x * x);
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
code = ((10.0d0 * eps) * (eps * x)) * (x * x)
end function
public static double code(double x, double eps) {
return ((10.0 * eps) * (eps * x)) * (x * x);
}
def code(x, eps): return ((10.0 * eps) * (eps * x)) * (x * x)
function code(x, eps) return Float64(Float64(Float64(10.0 * eps) * Float64(eps * x)) * Float64(x * x)) end
function tmp = code(x, eps) tmp = ((10.0 * eps) * (eps * x)) * (x * x); end
code[x_, eps_] := N[(N[(N[(10.0 * eps), $MachinePrecision] * N[(eps * x), $MachinePrecision]), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(10 \cdot \varepsilon\right) \cdot \left(\varepsilon \cdot x\right)\right) \cdot \left(x \cdot x\right)
\end{array}
Initial program 91.4%
Taylor expanded in x around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites87.6%
Applied rewrites87.6%
Taylor expanded in x around 0
Applied rewrites78.7%
herbie shell --seed 2024305
(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)))