
(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 8 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 (<= t_0 -1e-318)
(+ (pow eps 5.0) (* x (* 5.0 (pow eps 4.0))))
(if (<= t_0 0.0) (* eps (* 5.0 (pow x 4.0))) t_0))))
double code(double x, double eps) {
double t_0 = pow((x + eps), 5.0) - pow(x, 5.0);
double tmp;
if (t_0 <= -1e-318) {
tmp = pow(eps, 5.0) + (x * (5.0 * pow(eps, 4.0)));
} else if (t_0 <= 0.0) {
tmp = eps * (5.0 * pow(x, 4.0));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: t_0
real(8) :: tmp
t_0 = ((x + eps) ** 5.0d0) - (x ** 5.0d0)
if (t_0 <= (-1d-318)) then
tmp = (eps ** 5.0d0) + (x * (5.0d0 * (eps ** 4.0d0)))
else if (t_0 <= 0.0d0) then
tmp = eps * (5.0d0 * (x ** 4.0d0))
else
tmp = t_0
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 <= -1e-318) {
tmp = Math.pow(eps, 5.0) + (x * (5.0 * Math.pow(eps, 4.0)));
} else if (t_0 <= 0.0) {
tmp = eps * (5.0 * Math.pow(x, 4.0));
} else {
tmp = t_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 <= -1e-318: tmp = math.pow(eps, 5.0) + (x * (5.0 * math.pow(eps, 4.0))) elif t_0 <= 0.0: tmp = eps * (5.0 * math.pow(x, 4.0)) else: tmp = t_0 return tmp
function code(x, eps) t_0 = Float64((Float64(x + eps) ^ 5.0) - (x ^ 5.0)) tmp = 0.0 if (t_0 <= -1e-318) tmp = Float64((eps ^ 5.0) + Float64(x * Float64(5.0 * (eps ^ 4.0)))); elseif (t_0 <= 0.0) tmp = Float64(eps * Float64(5.0 * (x ^ 4.0))); else tmp = t_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 <= -1e-318) tmp = (eps ^ 5.0) + (x * (5.0 * (eps ^ 4.0))); elseif (t_0 <= 0.0) tmp = eps * (5.0 * (x ^ 4.0)); else tmp = t_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, -1e-318], N[(N[Power[eps, 5.0], $MachinePrecision] + N[(x * N[(5.0 * N[Power[eps, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(eps * N[(5.0 * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(x + \varepsilon\right)}^{5} - {x}^{5}\\
\mathbf{if}\;t_0 \leq -1 \cdot 10^{-318}:\\
\;\;\;\;{\varepsilon}^{5} + x \cdot \left(5 \cdot {\varepsilon}^{4}\right)\\
\mathbf{elif}\;t_0 \leq 0:\\
\;\;\;\;\varepsilon \cdot \left(5 \cdot {x}^{4}\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if (-.f64 (pow.f64 (+.f64 x eps) 5) (pow.f64 x 5)) < -9.9999875e-319Initial program 99.9%
Taylor expanded in x around 0 100.0%
distribute-lft1-in100.0%
metadata-eval100.0%
Simplified100.0%
if -9.9999875e-319 < (-.f64 (pow.f64 (+.f64 x eps) 5) (pow.f64 x 5)) < 0.0Initial program 87.0%
Taylor expanded in x around inf 99.9%
distribute-lft1-in99.9%
metadata-eval99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in eps around 0 99.9%
associate-*r*99.9%
*-commutative99.9%
associate-*r*100.0%
Simplified100.0%
if 0.0 < (-.f64 (pow.f64 (+.f64 x eps) 5) (pow.f64 x 5)) Initial program 96.8%
Final simplification99.7%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (- (pow (+ x eps) 5.0) (pow x 5.0))))
(if (or (<= t_0 -1e-318) (not (<= t_0 0.0)))
t_0
(* eps (* 5.0 (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 <= -1e-318) || !(t_0 <= 0.0)) {
tmp = t_0;
} else {
tmp = eps * (5.0 * 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 <= (-1d-318)) .or. (.not. (t_0 <= 0.0d0))) then
tmp = t_0
else
tmp = eps * (5.0d0 * (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 <= -1e-318) || !(t_0 <= 0.0)) {
tmp = t_0;
} else {
tmp = eps * (5.0 * 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 <= -1e-318) or not (t_0 <= 0.0): tmp = t_0 else: tmp = eps * (5.0 * 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 <= -1e-318) || !(t_0 <= 0.0)) tmp = t_0; else tmp = Float64(eps * Float64(5.0 * (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 <= -1e-318) || ~((t_0 <= 0.0))) tmp = t_0; else tmp = eps * (5.0 * (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, -1e-318], N[Not[LessEqual[t$95$0, 0.0]], $MachinePrecision]], t$95$0, N[(eps * N[(5.0 * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(x + \varepsilon\right)}^{5} - {x}^{5}\\
\mathbf{if}\;t_0 \leq -1 \cdot 10^{-318} \lor \neg \left(t_0 \leq 0\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\varepsilon \cdot \left(5 \cdot {x}^{4}\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 (+.f64 x eps) 5) (pow.f64 x 5)) < -9.9999875e-319 or 0.0 < (-.f64 (pow.f64 (+.f64 x eps) 5) (pow.f64 x 5)) Initial program 98.4%
if -9.9999875e-319 < (-.f64 (pow.f64 (+.f64 x eps) 5) (pow.f64 x 5)) < 0.0Initial program 87.0%
Taylor expanded in x around inf 99.9%
distribute-lft1-in99.9%
metadata-eval99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in eps around 0 99.9%
associate-*r*99.9%
*-commutative99.9%
associate-*r*100.0%
Simplified100.0%
Final simplification99.7%
(FPCore (x eps) :precision binary64 (if (or (<= x -1.7e-49) (not (<= x 5.8e-54))) (* eps (* 5.0 (pow x 4.0))) (pow eps 5.0)))
double code(double x, double eps) {
double tmp;
if ((x <= -1.7e-49) || !(x <= 5.8e-54)) {
tmp = eps * (5.0 * 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) :: tmp
if ((x <= (-1.7d-49)) .or. (.not. (x <= 5.8d-54))) then
tmp = eps * (5.0d0 * (x ** 4.0d0))
else
tmp = eps ** 5.0d0
end if
code = tmp
end function
public static double code(double x, double eps) {
double tmp;
if ((x <= -1.7e-49) || !(x <= 5.8e-54)) {
tmp = eps * (5.0 * Math.pow(x, 4.0));
} else {
tmp = Math.pow(eps, 5.0);
}
return tmp;
}
def code(x, eps): tmp = 0 if (x <= -1.7e-49) or not (x <= 5.8e-54): tmp = eps * (5.0 * math.pow(x, 4.0)) else: tmp = math.pow(eps, 5.0) return tmp
function code(x, eps) tmp = 0.0 if ((x <= -1.7e-49) || !(x <= 5.8e-54)) tmp = Float64(eps * Float64(5.0 * (x ^ 4.0))); else tmp = eps ^ 5.0; end return tmp end
function tmp_2 = code(x, eps) tmp = 0.0; if ((x <= -1.7e-49) || ~((x <= 5.8e-54))) tmp = eps * (5.0 * (x ^ 4.0)); else tmp = eps ^ 5.0; end tmp_2 = tmp; end
code[x_, eps_] := If[Or[LessEqual[x, -1.7e-49], N[Not[LessEqual[x, 5.8e-54]], $MachinePrecision]], N[(eps * N[(5.0 * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[eps, 5.0], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.7 \cdot 10^{-49} \lor \neg \left(x \leq 5.8 \cdot 10^{-54}\right):\\
\;\;\;\;\varepsilon \cdot \left(5 \cdot {x}^{4}\right)\\
\mathbf{else}:\\
\;\;\;\;{\varepsilon}^{5}\\
\end{array}
\end{array}
if x < -1.70000000000000002e-49 or 5.80000000000000029e-54 < x Initial program 30.4%
Taylor expanded in x around inf 92.7%
distribute-lft1-in92.7%
metadata-eval92.7%
*-commutative92.7%
Simplified92.7%
Taylor expanded in eps around 0 92.6%
associate-*r*92.7%
*-commutative92.7%
associate-*r*92.9%
Simplified92.9%
if -1.70000000000000002e-49 < x < 5.80000000000000029e-54Initial program 100.0%
Taylor expanded in x around 0 99.7%
Final simplification98.6%
(FPCore (x eps) :precision binary64 (if (<= x -2.2e-49) (* 5.0 (* eps (pow x 4.0))) (if (<= x 3.7e-53) (pow eps 5.0) (* (* x x) (* (* eps 5.0) (* x x))))))
double code(double x, double eps) {
double tmp;
if (x <= -2.2e-49) {
tmp = 5.0 * (eps * pow(x, 4.0));
} else if (x <= 3.7e-53) {
tmp = pow(eps, 5.0);
} else {
tmp = (x * x) * ((eps * 5.0) * (x * x));
}
return tmp;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: tmp
if (x <= (-2.2d-49)) then
tmp = 5.0d0 * (eps * (x ** 4.0d0))
else if (x <= 3.7d-53) then
tmp = eps ** 5.0d0
else
tmp = (x * x) * ((eps * 5.0d0) * (x * x))
end if
code = tmp
end function
public static double code(double x, double eps) {
double tmp;
if (x <= -2.2e-49) {
tmp = 5.0 * (eps * Math.pow(x, 4.0));
} else if (x <= 3.7e-53) {
tmp = Math.pow(eps, 5.0);
} else {
tmp = (x * x) * ((eps * 5.0) * (x * x));
}
return tmp;
}
def code(x, eps): tmp = 0 if x <= -2.2e-49: tmp = 5.0 * (eps * math.pow(x, 4.0)) elif x <= 3.7e-53: tmp = math.pow(eps, 5.0) else: tmp = (x * x) * ((eps * 5.0) * (x * x)) return tmp
function code(x, eps) tmp = 0.0 if (x <= -2.2e-49) tmp = Float64(5.0 * Float64(eps * (x ^ 4.0))); elseif (x <= 3.7e-53) tmp = eps ^ 5.0; else tmp = Float64(Float64(x * x) * Float64(Float64(eps * 5.0) * Float64(x * x))); end return tmp end
function tmp_2 = code(x, eps) tmp = 0.0; if (x <= -2.2e-49) tmp = 5.0 * (eps * (x ^ 4.0)); elseif (x <= 3.7e-53) tmp = eps ^ 5.0; else tmp = (x * x) * ((eps * 5.0) * (x * x)); end tmp_2 = tmp; end
code[x_, eps_] := If[LessEqual[x, -2.2e-49], N[(5.0 * N[(eps * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.7e-53], N[Power[eps, 5.0], $MachinePrecision], N[(N[(x * x), $MachinePrecision] * N[(N[(eps * 5.0), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.2 \cdot 10^{-49}:\\
\;\;\;\;5 \cdot \left(\varepsilon \cdot {x}^{4}\right)\\
\mathbf{elif}\;x \leq 3.7 \cdot 10^{-53}:\\
\;\;\;\;{\varepsilon}^{5}\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot x\right) \cdot \left(\left(\varepsilon \cdot 5\right) \cdot \left(x \cdot x\right)\right)\\
\end{array}
\end{array}
if x < -2.1999999999999999e-49Initial program 27.4%
Taylor expanded in x around inf 89.8%
distribute-lft1-in89.8%
metadata-eval89.8%
associate-*l*89.7%
Simplified89.7%
if -2.1999999999999999e-49 < x < 3.69999999999999982e-53Initial program 100.0%
Taylor expanded in x around 0 99.7%
if 3.69999999999999982e-53 < x Initial program 33.5%
Taylor expanded in x around inf 95.6%
distribute-lft1-in95.6%
metadata-eval95.6%
*-commutative95.6%
Simplified95.6%
add-sqr-sqrt70.8%
sqrt-unprod53.6%
*-commutative53.6%
*-commutative53.6%
swap-sqr53.6%
pow-prod-up53.6%
metadata-eval53.6%
swap-sqr53.6%
metadata-eval53.6%
Applied egg-rr53.6%
*-commutative53.6%
sqrt-prod62.6%
sqrt-pow162.6%
metadata-eval62.6%
metadata-eval62.6%
pow-sqr62.6%
pow-prod-down62.6%
pow262.6%
associate-*r*62.5%
*-commutative62.5%
sqrt-prod62.5%
metadata-eval62.5%
sqrt-prod60.5%
add-sqr-sqrt95.6%
Applied egg-rr95.6%
Final simplification98.6%
(FPCore (x eps) :precision binary64 (if (or (<= x -2.2e-49) (not (<= x 3.7e-54))) (* (* x x) (* (* eps 5.0) (* x x))) (pow eps 5.0)))
double code(double x, double eps) {
double tmp;
if ((x <= -2.2e-49) || !(x <= 3.7e-54)) {
tmp = (x * x) * ((eps * 5.0) * (x * x));
} 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) :: tmp
if ((x <= (-2.2d-49)) .or. (.not. (x <= 3.7d-54))) then
tmp = (x * x) * ((eps * 5.0d0) * (x * x))
else
tmp = eps ** 5.0d0
end if
code = tmp
end function
public static double code(double x, double eps) {
double tmp;
if ((x <= -2.2e-49) || !(x <= 3.7e-54)) {
tmp = (x * x) * ((eps * 5.0) * (x * x));
} else {
tmp = Math.pow(eps, 5.0);
}
return tmp;
}
def code(x, eps): tmp = 0 if (x <= -2.2e-49) or not (x <= 3.7e-54): tmp = (x * x) * ((eps * 5.0) * (x * x)) else: tmp = math.pow(eps, 5.0) return tmp
function code(x, eps) tmp = 0.0 if ((x <= -2.2e-49) || !(x <= 3.7e-54)) tmp = Float64(Float64(x * x) * Float64(Float64(eps * 5.0) * Float64(x * x))); else tmp = eps ^ 5.0; end return tmp end
function tmp_2 = code(x, eps) tmp = 0.0; if ((x <= -2.2e-49) || ~((x <= 3.7e-54))) tmp = (x * x) * ((eps * 5.0) * (x * x)); else tmp = eps ^ 5.0; end tmp_2 = tmp; end
code[x_, eps_] := If[Or[LessEqual[x, -2.2e-49], N[Not[LessEqual[x, 3.7e-54]], $MachinePrecision]], N[(N[(x * x), $MachinePrecision] * N[(N[(eps * 5.0), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[eps, 5.0], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.2 \cdot 10^{-49} \lor \neg \left(x \leq 3.7 \cdot 10^{-54}\right):\\
\;\;\;\;\left(x \cdot x\right) \cdot \left(\left(\varepsilon \cdot 5\right) \cdot \left(x \cdot x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;{\varepsilon}^{5}\\
\end{array}
\end{array}
if x < -2.1999999999999999e-49 or 3.7000000000000003e-54 < x Initial program 30.4%
Taylor expanded in x around inf 92.7%
distribute-lft1-in92.7%
metadata-eval92.7%
*-commutative92.7%
Simplified92.7%
add-sqr-sqrt62.7%
sqrt-unprod41.8%
*-commutative41.8%
*-commutative41.8%
swap-sqr39.5%
pow-prod-up39.5%
metadata-eval39.5%
swap-sqr39.5%
metadata-eval39.5%
Applied egg-rr39.5%
*-commutative39.5%
sqrt-prod48.7%
sqrt-pow155.5%
metadata-eval55.5%
metadata-eval55.5%
pow-sqr55.4%
pow-prod-down55.4%
pow255.4%
associate-*r*55.4%
*-commutative55.4%
sqrt-prod55.4%
metadata-eval55.4%
sqrt-prod57.5%
add-sqr-sqrt92.4%
Applied egg-rr92.4%
if -2.1999999999999999e-49 < x < 3.7000000000000003e-54Initial program 100.0%
Taylor expanded in x around 0 99.7%
Final simplification98.6%
(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(x * x) * Float64(5.0 * Float64(eps * Float64(x * x)))) end
function tmp = code(x, eps) tmp = (x * x) * (5.0 * (eps * (x * x))); end
code[x_, eps_] := N[(N[(x * x), $MachinePrecision] * N[(5.0 * N[(eps * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot x\right) \cdot \left(5 \cdot \left(\varepsilon \cdot \left(x \cdot x\right)\right)\right)
\end{array}
Initial program 89.1%
Taylor expanded in x around inf 83.5%
distribute-lft1-in83.5%
metadata-eval83.5%
*-commutative83.5%
Simplified83.5%
add-sqr-sqrt78.8%
sqrt-unprod75.5%
*-commutative75.5%
*-commutative75.5%
swap-sqr75.2%
pow-prod-up75.2%
metadata-eval75.2%
swap-sqr75.2%
metadata-eval75.2%
Applied egg-rr75.2%
*-commutative75.2%
sqrt-prod76.6%
sqrt-pow177.7%
metadata-eval77.7%
metadata-eval77.7%
pow-sqr77.7%
pow-prod-down77.7%
pow277.7%
associate-*r*77.7%
*-commutative77.7%
sqrt-prod77.7%
metadata-eval77.7%
sqrt-prod39.5%
add-sqr-sqrt83.5%
Applied egg-rr83.5%
Taylor expanded in eps around 0 83.4%
unpow283.4%
Simplified83.4%
Final simplification83.4%
(FPCore (x eps) :precision binary64 (* (* x x) (* (* eps 5.0) (* x x))))
double code(double x, double eps) {
return (x * x) * ((eps * 5.0) * (x * x));
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
code = (x * x) * ((eps * 5.0d0) * (x * x))
end function
public static double code(double x, double eps) {
return (x * x) * ((eps * 5.0) * (x * x));
}
def code(x, eps): return (x * x) * ((eps * 5.0) * (x * x))
function code(x, eps) return Float64(Float64(x * x) * Float64(Float64(eps * 5.0) * Float64(x * x))) end
function tmp = code(x, eps) tmp = (x * x) * ((eps * 5.0) * (x * x)); end
code[x_, eps_] := N[(N[(x * x), $MachinePrecision] * N[(N[(eps * 5.0), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot x\right) \cdot \left(\left(\varepsilon \cdot 5\right) \cdot \left(x \cdot x\right)\right)
\end{array}
Initial program 89.1%
Taylor expanded in x around inf 83.5%
distribute-lft1-in83.5%
metadata-eval83.5%
*-commutative83.5%
Simplified83.5%
add-sqr-sqrt78.8%
sqrt-unprod75.5%
*-commutative75.5%
*-commutative75.5%
swap-sqr75.2%
pow-prod-up75.2%
metadata-eval75.2%
swap-sqr75.2%
metadata-eval75.2%
Applied egg-rr75.2%
*-commutative75.2%
sqrt-prod76.6%
sqrt-pow177.7%
metadata-eval77.7%
metadata-eval77.7%
pow-sqr77.7%
pow-prod-down77.7%
pow277.7%
associate-*r*77.7%
*-commutative77.7%
sqrt-prod77.7%
metadata-eval77.7%
sqrt-prod39.5%
add-sqr-sqrt83.5%
Applied egg-rr83.5%
Final simplification83.5%
(FPCore (x eps) :precision binary64 0.0)
double code(double x, double eps) {
return 0.0;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
code = 0.0d0
end function
public static double code(double x, double eps) {
return 0.0;
}
def code(x, eps): return 0.0
function code(x, eps) return 0.0 end
function tmp = code(x, eps) tmp = 0.0; end
code[x_, eps_] := 0.0
\begin{array}{l}
\\
0
\end{array}
Initial program 89.1%
sqr-pow41.7%
metadata-eval41.7%
metadata-eval41.7%
Applied egg-rr41.7%
pow-prod-down76.4%
pow276.4%
+-commutative76.4%
Applied egg-rr76.4%
Taylor expanded in x around inf 72.6%
distribute-rgt1-in72.6%
metadata-eval72.6%
mul0-lft72.6%
Simplified72.6%
Final simplification72.6%
herbie shell --seed 2023257
(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)))