
(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 (or (<= t_0 -5e-319) (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 <= -5e-319) || !(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 <= (-5d-319)) .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 <= -5e-319) || !(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 <= -5e-319) 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 <= -5e-319) || !(t_0 <= 0.0)) tmp = t_0; else tmp = Float64(Float64(eps * 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 <= -5e-319) || ~((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, -5e-319], N[Not[LessEqual[t$95$0, 0.0]], $MachinePrecision]], t$95$0, N[(N[(eps * 5.0), $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 -5 \cdot 10^{-319} \lor \neg \left(t_0 \leq 0\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\left(\varepsilon \cdot 5\right) \cdot {x}^{4}\\
\end{array}
\end{array}
if (-.f64 (pow.f64 (+.f64 x eps) 5) (pow.f64 x 5)) < -4.9999937e-319 or 0.0 < (-.f64 (pow.f64 (+.f64 x eps) 5) (pow.f64 x 5)) Initial program 95.6%
if -4.9999937e-319 < (-.f64 (pow.f64 (+.f64 x eps) 5) (pow.f64 x 5)) < 0.0Initial program 86.5%
Taylor expanded in x around inf 99.9%
distribute-lft1-in99.9%
metadata-eval99.9%
*-commutative99.9%
Simplified99.9%
Final simplification99.0%
(FPCore (x eps)
:precision binary64
(if (<= x -1.08e-32)
(* (* eps 5.0) (pow x 4.0))
(if (<= x 2.9e-38)
(pow eps 5.0)
(* eps (+ (* 5.0 (* (* x x) (* x x))) (* eps (* (pow x 3.0) 10.0)))))))
double code(double x, double eps) {
double tmp;
if (x <= -1.08e-32) {
tmp = (eps * 5.0) * pow(x, 4.0);
} else if (x <= 2.9e-38) {
tmp = pow(eps, 5.0);
} else {
tmp = eps * ((5.0 * ((x * x) * (x * x))) + (eps * (pow(x, 3.0) * 10.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.08d-32)) then
tmp = (eps * 5.0d0) * (x ** 4.0d0)
else if (x <= 2.9d-38) then
tmp = eps ** 5.0d0
else
tmp = eps * ((5.0d0 * ((x * x) * (x * x))) + (eps * ((x ** 3.0d0) * 10.0d0)))
end if
code = tmp
end function
public static double code(double x, double eps) {
double tmp;
if (x <= -1.08e-32) {
tmp = (eps * 5.0) * Math.pow(x, 4.0);
} else if (x <= 2.9e-38) {
tmp = Math.pow(eps, 5.0);
} else {
tmp = eps * ((5.0 * ((x * x) * (x * x))) + (eps * (Math.pow(x, 3.0) * 10.0)));
}
return tmp;
}
def code(x, eps): tmp = 0 if x <= -1.08e-32: tmp = (eps * 5.0) * math.pow(x, 4.0) elif x <= 2.9e-38: tmp = math.pow(eps, 5.0) else: tmp = eps * ((5.0 * ((x * x) * (x * x))) + (eps * (math.pow(x, 3.0) * 10.0))) return tmp
function code(x, eps) tmp = 0.0 if (x <= -1.08e-32) tmp = Float64(Float64(eps * 5.0) * (x ^ 4.0)); elseif (x <= 2.9e-38) tmp = eps ^ 5.0; else tmp = Float64(eps * Float64(Float64(5.0 * Float64(Float64(x * x) * Float64(x * x))) + Float64(eps * Float64((x ^ 3.0) * 10.0)))); end return tmp end
function tmp_2 = code(x, eps) tmp = 0.0; if (x <= -1.08e-32) tmp = (eps * 5.0) * (x ^ 4.0); elseif (x <= 2.9e-38) tmp = eps ^ 5.0; else tmp = eps * ((5.0 * ((x * x) * (x * x))) + (eps * ((x ^ 3.0) * 10.0))); end tmp_2 = tmp; end
code[x_, eps_] := If[LessEqual[x, -1.08e-32], N[(N[(eps * 5.0), $MachinePrecision] * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.9e-38], N[Power[eps, 5.0], $MachinePrecision], N[(eps * N[(N[(5.0 * N[(N[(x * x), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(eps * N[(N[Power[x, 3.0], $MachinePrecision] * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.08 \cdot 10^{-32}:\\
\;\;\;\;\left(\varepsilon \cdot 5\right) \cdot {x}^{4}\\
\mathbf{elif}\;x \leq 2.9 \cdot 10^{-38}:\\
\;\;\;\;{\varepsilon}^{5}\\
\mathbf{else}:\\
\;\;\;\;\varepsilon \cdot \left(5 \cdot \left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) + \varepsilon \cdot \left({x}^{3} \cdot 10\right)\right)\\
\end{array}
\end{array}
if x < -1.08e-32Initial program 22.1%
Taylor expanded in x around inf 91.3%
distribute-lft1-in91.3%
metadata-eval91.3%
*-commutative91.3%
Simplified91.3%
if -1.08e-32 < x < 2.89999999999999994e-38Initial program 99.1%
Taylor expanded in x around 0 98.8%
if 2.89999999999999994e-38 < x Initial program 29.8%
Taylor expanded in eps around 0 99.7%
+-commutative99.7%
unpow299.7%
associate-*l*99.7%
distribute-lft-out99.6%
distribute-lft1-in99.6%
metadata-eval99.6%
*-commutative99.6%
*-commutative99.6%
distribute-rgt-out99.6%
associate-*r*99.6%
Simplified99.6%
metadata-eval96.7%
metadata-eval96.7%
metadata-eval96.7%
pow-prod-up96.4%
pow-prod-down96.4%
metadata-eval96.4%
pow296.4%
Applied egg-rr99.3%
Final simplification98.1%
(FPCore (x eps) :precision binary64 (if (<= x -1.08e-32) (* (* eps 5.0) (pow x 4.0)) (if (<= x 3.5e-38) (pow eps 5.0) (* (* eps 5.0) (* x (pow x 3.0))))))
double code(double x, double eps) {
double tmp;
if (x <= -1.08e-32) {
tmp = (eps * 5.0) * pow(x, 4.0);
} else if (x <= 3.5e-38) {
tmp = pow(eps, 5.0);
} else {
tmp = (eps * 5.0) * (x * pow(x, 3.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.08d-32)) then
tmp = (eps * 5.0d0) * (x ** 4.0d0)
else if (x <= 3.5d-38) then
tmp = eps ** 5.0d0
else
tmp = (eps * 5.0d0) * (x * (x ** 3.0d0))
end if
code = tmp
end function
public static double code(double x, double eps) {
double tmp;
if (x <= -1.08e-32) {
tmp = (eps * 5.0) * Math.pow(x, 4.0);
} else if (x <= 3.5e-38) {
tmp = Math.pow(eps, 5.0);
} else {
tmp = (eps * 5.0) * (x * Math.pow(x, 3.0));
}
return tmp;
}
def code(x, eps): tmp = 0 if x <= -1.08e-32: tmp = (eps * 5.0) * math.pow(x, 4.0) elif x <= 3.5e-38: tmp = math.pow(eps, 5.0) else: tmp = (eps * 5.0) * (x * math.pow(x, 3.0)) return tmp
function code(x, eps) tmp = 0.0 if (x <= -1.08e-32) tmp = Float64(Float64(eps * 5.0) * (x ^ 4.0)); elseif (x <= 3.5e-38) tmp = eps ^ 5.0; else tmp = Float64(Float64(eps * 5.0) * Float64(x * (x ^ 3.0))); end return tmp end
function tmp_2 = code(x, eps) tmp = 0.0; if (x <= -1.08e-32) tmp = (eps * 5.0) * (x ^ 4.0); elseif (x <= 3.5e-38) tmp = eps ^ 5.0; else tmp = (eps * 5.0) * (x * (x ^ 3.0)); end tmp_2 = tmp; end
code[x_, eps_] := If[LessEqual[x, -1.08e-32], N[(N[(eps * 5.0), $MachinePrecision] * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.5e-38], N[Power[eps, 5.0], $MachinePrecision], N[(N[(eps * 5.0), $MachinePrecision] * N[(x * N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.08 \cdot 10^{-32}:\\
\;\;\;\;\left(\varepsilon \cdot 5\right) \cdot {x}^{4}\\
\mathbf{elif}\;x \leq 3.5 \cdot 10^{-38}:\\
\;\;\;\;{\varepsilon}^{5}\\
\mathbf{else}:\\
\;\;\;\;\left(\varepsilon \cdot 5\right) \cdot \left(x \cdot {x}^{3}\right)\\
\end{array}
\end{array}
if x < -1.08e-32Initial program 22.1%
Taylor expanded in x around inf 91.3%
distribute-lft1-in91.3%
metadata-eval91.3%
*-commutative91.3%
Simplified91.3%
if -1.08e-32 < x < 3.5000000000000001e-38Initial program 99.1%
Taylor expanded in x around 0 98.8%
if 3.5000000000000001e-38 < x Initial program 29.8%
Taylor expanded in x around inf 96.9%
distribute-lft1-in96.9%
metadata-eval96.9%
*-commutative96.9%
Simplified96.9%
add-sqr-sqrt95.4%
unpow-prod-down95.8%
Applied egg-rr95.8%
pow-sqr95.8%
metadata-eval95.8%
Simplified95.8%
sqrt-pow296.9%
metadata-eval96.9%
metadata-eval96.9%
metadata-eval96.9%
metadata-eval96.9%
pow-prod-up96.9%
metadata-eval96.9%
metadata-eval96.9%
pow196.9%
Applied egg-rr96.9%
Final simplification98.0%
(FPCore (x eps) :precision binary64 (if (or (<= x -1.08e-32) (not (<= x 2.5e-38))) (* 5.0 (* eps (pow x 4.0))) (pow eps 5.0)))
double code(double x, double eps) {
double tmp;
if ((x <= -1.08e-32) || !(x <= 2.5e-38)) {
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) :: tmp
if ((x <= (-1.08d-32)) .or. (.not. (x <= 2.5d-38))) 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 tmp;
if ((x <= -1.08e-32) || !(x <= 2.5e-38)) {
tmp = 5.0 * (eps * Math.pow(x, 4.0));
} else {
tmp = Math.pow(eps, 5.0);
}
return tmp;
}
def code(x, eps): tmp = 0 if (x <= -1.08e-32) or not (x <= 2.5e-38): tmp = 5.0 * (eps * math.pow(x, 4.0)) else: tmp = math.pow(eps, 5.0) return tmp
function code(x, eps) tmp = 0.0 if ((x <= -1.08e-32) || !(x <= 2.5e-38)) tmp = Float64(5.0 * Float64(eps * (x ^ 4.0))); else tmp = eps ^ 5.0; end return tmp end
function tmp_2 = code(x, eps) tmp = 0.0; if ((x <= -1.08e-32) || ~((x <= 2.5e-38))) tmp = 5.0 * (eps * (x ^ 4.0)); else tmp = eps ^ 5.0; end tmp_2 = tmp; end
code[x_, eps_] := If[Or[LessEqual[x, -1.08e-32], N[Not[LessEqual[x, 2.5e-38]], $MachinePrecision]], N[(5.0 * N[(eps * 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.08 \cdot 10^{-32} \lor \neg \left(x \leq 2.5 \cdot 10^{-38}\right):\\
\;\;\;\;5 \cdot \left(\varepsilon \cdot {x}^{4}\right)\\
\mathbf{else}:\\
\;\;\;\;{\varepsilon}^{5}\\
\end{array}
\end{array}
if x < -1.08e-32 or 2.50000000000000017e-38 < x Initial program 25.2%
Taylor expanded in x around inf 93.5%
distribute-lft1-in93.5%
metadata-eval93.5%
associate-*l*93.4%
Simplified93.4%
if -1.08e-32 < x < 2.50000000000000017e-38Initial program 99.1%
Taylor expanded in x around 0 98.8%
Final simplification98.0%
(FPCore (x eps) :precision binary64 (if (or (<= x -1.12e-32) (not (<= x 2.5e-38))) (* (* eps 5.0) (pow x 4.0)) (pow eps 5.0)))
double code(double x, double eps) {
double tmp;
if ((x <= -1.12e-32) || !(x <= 2.5e-38)) {
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.12d-32)) .or. (.not. (x <= 2.5d-38))) 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.12e-32) || !(x <= 2.5e-38)) {
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.12e-32) or not (x <= 2.5e-38): 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.12e-32) || !(x <= 2.5e-38)) tmp = Float64(Float64(eps * 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.12e-32) || ~((x <= 2.5e-38))) 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.12e-32], N[Not[LessEqual[x, 2.5e-38]], $MachinePrecision]], N[(N[(eps * 5.0), $MachinePrecision] * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision], N[Power[eps, 5.0], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.12 \cdot 10^{-32} \lor \neg \left(x \leq 2.5 \cdot 10^{-38}\right):\\
\;\;\;\;\left(\varepsilon \cdot 5\right) \cdot {x}^{4}\\
\mathbf{else}:\\
\;\;\;\;{\varepsilon}^{5}\\
\end{array}
\end{array}
if x < -1.12e-32 or 2.50000000000000017e-38 < x Initial program 25.2%
Taylor expanded in x around inf 93.5%
distribute-lft1-in93.5%
metadata-eval93.5%
*-commutative93.5%
Simplified93.5%
if -1.12e-32 < x < 2.50000000000000017e-38Initial program 99.1%
Taylor expanded in x around 0 98.8%
Final simplification98.0%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (* (* x x) (* x x))))
(if (<= x -1.08e-32)
(* (* eps 5.0) t_0)
(if (<= x 2.5e-38) (pow eps 5.0) (* 5.0 (* eps t_0))))))
double code(double x, double eps) {
double t_0 = (x * x) * (x * x);
double tmp;
if (x <= -1.08e-32) {
tmp = (eps * 5.0) * t_0;
} else if (x <= 2.5e-38) {
tmp = pow(eps, 5.0);
} else {
tmp = 5.0 * (eps * t_0);
}
return tmp;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: t_0
real(8) :: tmp
t_0 = (x * x) * (x * x)
if (x <= (-1.08d-32)) then
tmp = (eps * 5.0d0) * t_0
else if (x <= 2.5d-38) then
tmp = eps ** 5.0d0
else
tmp = 5.0d0 * (eps * t_0)
end if
code = tmp
end function
public static double code(double x, double eps) {
double t_0 = (x * x) * (x * x);
double tmp;
if (x <= -1.08e-32) {
tmp = (eps * 5.0) * t_0;
} else if (x <= 2.5e-38) {
tmp = Math.pow(eps, 5.0);
} else {
tmp = 5.0 * (eps * t_0);
}
return tmp;
}
def code(x, eps): t_0 = (x * x) * (x * x) tmp = 0 if x <= -1.08e-32: tmp = (eps * 5.0) * t_0 elif x <= 2.5e-38: tmp = math.pow(eps, 5.0) else: tmp = 5.0 * (eps * t_0) return tmp
function code(x, eps) t_0 = Float64(Float64(x * x) * Float64(x * x)) tmp = 0.0 if (x <= -1.08e-32) tmp = Float64(Float64(eps * 5.0) * t_0); elseif (x <= 2.5e-38) tmp = eps ^ 5.0; else tmp = Float64(5.0 * Float64(eps * t_0)); end return tmp end
function tmp_2 = code(x, eps) t_0 = (x * x) * (x * x); tmp = 0.0; if (x <= -1.08e-32) tmp = (eps * 5.0) * t_0; elseif (x <= 2.5e-38) tmp = eps ^ 5.0; else tmp = 5.0 * (eps * t_0); end tmp_2 = tmp; end
code[x_, eps_] := Block[{t$95$0 = N[(N[(x * x), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.08e-32], N[(N[(eps * 5.0), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[x, 2.5e-38], N[Power[eps, 5.0], $MachinePrecision], N[(5.0 * N[(eps * t$95$0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(x \cdot x\right) \cdot \left(x \cdot x\right)\\
\mathbf{if}\;x \leq -1.08 \cdot 10^{-32}:\\
\;\;\;\;\left(\varepsilon \cdot 5\right) \cdot t_0\\
\mathbf{elif}\;x \leq 2.5 \cdot 10^{-38}:\\
\;\;\;\;{\varepsilon}^{5}\\
\mathbf{else}:\\
\;\;\;\;5 \cdot \left(\varepsilon \cdot t_0\right)\\
\end{array}
\end{array}
if x < -1.08e-32Initial program 22.1%
Taylor expanded in x around inf 91.3%
distribute-lft1-in91.3%
metadata-eval91.3%
*-commutative91.3%
Simplified91.3%
metadata-eval91.1%
metadata-eval91.1%
metadata-eval91.1%
pow-prod-up90.8%
pow-prod-down90.8%
metadata-eval90.8%
pow290.8%
Applied egg-rr90.9%
if -1.08e-32 < x < 2.50000000000000017e-38Initial program 99.1%
Taylor expanded in x around 0 98.8%
if 2.50000000000000017e-38 < x Initial program 29.8%
Taylor expanded in x around inf 96.9%
distribute-lft1-in96.9%
metadata-eval96.9%
associate-*l*96.7%
Simplified96.7%
metadata-eval96.7%
metadata-eval96.7%
metadata-eval96.7%
pow-prod-up96.4%
pow-prod-down96.4%
metadata-eval96.4%
pow296.4%
Applied egg-rr96.4%
Final simplification97.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(5.0 * Float64(eps * Float64(Float64(x * x) * Float64(x * x)))) end
function tmp = code(x, eps) tmp = 5.0 * (eps * ((x * x) * (x * x))); end
code[x_, eps_] := N[(5.0 * N[(eps * N[(N[(x * x), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
5 \cdot \left(\varepsilon \cdot \left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right)\right)
\end{array}
Initial program 88.4%
Taylor expanded in x around inf 82.1%
distribute-lft1-in82.1%
metadata-eval82.1%
associate-*l*82.0%
Simplified82.0%
metadata-eval82.0%
metadata-eval82.0%
metadata-eval82.0%
pow-prod-up82.0%
pow-prod-down82.0%
metadata-eval82.0%
pow282.0%
Applied egg-rr82.0%
Final simplification82.0%
(FPCore (x eps) :precision binary64 (* (* eps 5.0) (* (* x x) (* x x))))
double code(double x, double eps) {
return (eps * 5.0) * ((x * x) * (x * x));
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
code = (eps * 5.0d0) * ((x * x) * (x * x))
end function
public static double code(double x, double eps) {
return (eps * 5.0) * ((x * x) * (x * x));
}
def code(x, eps): return (eps * 5.0) * ((x * x) * (x * x))
function code(x, eps) return Float64(Float64(eps * 5.0) * Float64(Float64(x * x) * Float64(x * x))) end
function tmp = code(x, eps) tmp = (eps * 5.0) * ((x * x) * (x * x)); end
code[x_, eps_] := N[(N[(eps * 5.0), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\varepsilon \cdot 5\right) \cdot \left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right)
\end{array}
Initial program 88.4%
Taylor expanded in x around inf 82.1%
distribute-lft1-in82.1%
metadata-eval82.1%
*-commutative82.1%
Simplified82.1%
metadata-eval82.0%
metadata-eval82.0%
metadata-eval82.0%
pow-prod-up82.0%
pow-prod-down82.0%
metadata-eval82.0%
pow282.0%
Applied egg-rr82.0%
Final simplification82.0%
herbie shell --seed 2023238
(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)))