
(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 (<= t_0 -5e-324)
t_0
(if (<= t_0 0.0)
(*
eps
(+
(* 5.0 (pow x 4.0))
(*
eps
(+
(* (* x (* x x)) 10.0)
(* eps (+ (* (* x x) 10.0) (* eps (* x 5.0))))))))
(- (pow (* x (+ 1.0 (/ eps x))) 5.0) (pow x 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-324) {
tmp = t_0;
} else if (t_0 <= 0.0) {
tmp = eps * ((5.0 * pow(x, 4.0)) + (eps * (((x * (x * x)) * 10.0) + (eps * (((x * x) * 10.0) + (eps * (x * 5.0)))))));
} else {
tmp = pow((x * (1.0 + (eps / x))), 5.0) - pow(x, 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-324)) then
tmp = t_0
else if (t_0 <= 0.0d0) then
tmp = eps * ((5.0d0 * (x ** 4.0d0)) + (eps * (((x * (x * x)) * 10.0d0) + (eps * (((x * x) * 10.0d0) + (eps * (x * 5.0d0)))))))
else
tmp = ((x * (1.0d0 + (eps / x))) ** 5.0d0) - (x ** 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-324) {
tmp = t_0;
} else if (t_0 <= 0.0) {
tmp = eps * ((5.0 * Math.pow(x, 4.0)) + (eps * (((x * (x * x)) * 10.0) + (eps * (((x * x) * 10.0) + (eps * (x * 5.0)))))));
} else {
tmp = Math.pow((x * (1.0 + (eps / x))), 5.0) - Math.pow(x, 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-324: tmp = t_0 elif t_0 <= 0.0: tmp = eps * ((5.0 * math.pow(x, 4.0)) + (eps * (((x * (x * x)) * 10.0) + (eps * (((x * x) * 10.0) + (eps * (x * 5.0))))))) else: tmp = math.pow((x * (1.0 + (eps / x))), 5.0) - math.pow(x, 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-324) tmp = t_0; elseif (t_0 <= 0.0) tmp = Float64(eps * Float64(Float64(5.0 * (x ^ 4.0)) + Float64(eps * Float64(Float64(Float64(x * Float64(x * x)) * 10.0) + Float64(eps * Float64(Float64(Float64(x * x) * 10.0) + Float64(eps * Float64(x * 5.0)))))))); else tmp = Float64((Float64(x * Float64(1.0 + Float64(eps / x))) ^ 5.0) - (x ^ 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-324) tmp = t_0; elseif (t_0 <= 0.0) tmp = eps * ((5.0 * (x ^ 4.0)) + (eps * (((x * (x * x)) * 10.0) + (eps * (((x * x) * 10.0) + (eps * (x * 5.0))))))); else tmp = ((x * (1.0 + (eps / x))) ^ 5.0) - (x ^ 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-324], t$95$0, If[LessEqual[t$95$0, 0.0], N[(eps * N[(N[(5.0 * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision] + N[(eps * N[(N[(N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision] * 10.0), $MachinePrecision] + N[(eps * N[(N[(N[(x * x), $MachinePrecision] * 10.0), $MachinePrecision] + N[(eps * N[(x * 5.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(x * N[(1.0 + N[(eps / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 5.0], $MachinePrecision] - N[Power[x, 5.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^{-324}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\varepsilon \cdot \left(5 \cdot {x}^{4} + \varepsilon \cdot \left(\left(x \cdot \left(x \cdot x\right)\right) \cdot 10 + \varepsilon \cdot \left(\left(x \cdot x\right) \cdot 10 + \varepsilon \cdot \left(x \cdot 5\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;{\left(x \cdot \left(1 + \frac{\varepsilon}{x}\right)\right)}^{5} - {x}^{5}\\
\end{array}
\end{array}
if (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -4.94066e-324Initial program 96.7%
if -4.94066e-324 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 0.0Initial program 84.6%
Taylor expanded in eps around 0
Simplified100.0%
if 0.0 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) Initial program 99.6%
Taylor expanded in x around inf
*-lowering-*.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f6499.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (- (pow (+ x eps) 5.0) (pow x 5.0))))
(if (<= t_0 -5e-324)
t_0
(if (<= t_0 0.0)
(*
eps
(+
(* 5.0 (pow x 4.0))
(*
eps
(+
(* (* x (* x x)) 10.0)
(* eps (+ (* (* x x) 10.0) (* eps (* x 5.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 <= -5e-324) {
tmp = t_0;
} else if (t_0 <= 0.0) {
tmp = eps * ((5.0 * pow(x, 4.0)) + (eps * (((x * (x * x)) * 10.0) + (eps * (((x * x) * 10.0) + (eps * (x * 5.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 <= (-5d-324)) then
tmp = t_0
else if (t_0 <= 0.0d0) then
tmp = eps * ((5.0d0 * (x ** 4.0d0)) + (eps * (((x * (x * x)) * 10.0d0) + (eps * (((x * x) * 10.0d0) + (eps * (x * 5.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 <= -5e-324) {
tmp = t_0;
} else if (t_0 <= 0.0) {
tmp = eps * ((5.0 * Math.pow(x, 4.0)) + (eps * (((x * (x * x)) * 10.0) + (eps * (((x * x) * 10.0) + (eps * (x * 5.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 <= -5e-324: tmp = t_0 elif t_0 <= 0.0: tmp = eps * ((5.0 * math.pow(x, 4.0)) + (eps * (((x * (x * x)) * 10.0) + (eps * (((x * x) * 10.0) + (eps * (x * 5.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 <= -5e-324) tmp = t_0; elseif (t_0 <= 0.0) tmp = Float64(eps * Float64(Float64(5.0 * (x ^ 4.0)) + Float64(eps * Float64(Float64(Float64(x * Float64(x * x)) * 10.0) + Float64(eps * Float64(Float64(Float64(x * x) * 10.0) + Float64(eps * Float64(x * 5.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 <= -5e-324) tmp = t_0; elseif (t_0 <= 0.0) tmp = eps * ((5.0 * (x ^ 4.0)) + (eps * (((x * (x * x)) * 10.0) + (eps * (((x * x) * 10.0) + (eps * (x * 5.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, -5e-324], t$95$0, If[LessEqual[t$95$0, 0.0], N[(eps * N[(N[(5.0 * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision] + N[(eps * N[(N[(N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision] * 10.0), $MachinePrecision] + N[(eps * N[(N[(N[(x * x), $MachinePrecision] * 10.0), $MachinePrecision] + N[(eps * N[(x * 5.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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 -5 \cdot 10^{-324}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\varepsilon \cdot \left(5 \cdot {x}^{4} + \varepsilon \cdot \left(\left(x \cdot \left(x \cdot x\right)\right) \cdot 10 + \varepsilon \cdot \left(\left(x \cdot x\right) \cdot 10 + \varepsilon \cdot \left(x \cdot 5\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -4.94066e-324 or 0.0 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) Initial program 97.8%
if -4.94066e-324 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 0.0Initial program 84.6%
Taylor expanded in eps around 0
Simplified100.0%
Final simplification99.6%
(FPCore (x eps)
:precision binary64
(let* ((t_0
(*
eps
(+
(* 5.0 (pow x 4.0))
(*
eps
(+
(* (* x (* x x)) 10.0)
(* eps (+ (* (* x x) 10.0) (* eps (* x 5.0))))))))))
(if (<= x -1.1e-42)
t_0
(if (<= x 1.25e-47) (* (pow eps 5.0) (+ 1.0 (/ (* x 5.0) eps))) t_0))))
double code(double x, double eps) {
double t_0 = eps * ((5.0 * pow(x, 4.0)) + (eps * (((x * (x * x)) * 10.0) + (eps * (((x * x) * 10.0) + (eps * (x * 5.0)))))));
double tmp;
if (x <= -1.1e-42) {
tmp = t_0;
} else if (x <= 1.25e-47) {
tmp = pow(eps, 5.0) * (1.0 + ((x * 5.0) / eps));
} 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 = eps * ((5.0d0 * (x ** 4.0d0)) + (eps * (((x * (x * x)) * 10.0d0) + (eps * (((x * x) * 10.0d0) + (eps * (x * 5.0d0)))))))
if (x <= (-1.1d-42)) then
tmp = t_0
else if (x <= 1.25d-47) then
tmp = (eps ** 5.0d0) * (1.0d0 + ((x * 5.0d0) / eps))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double eps) {
double t_0 = eps * ((5.0 * Math.pow(x, 4.0)) + (eps * (((x * (x * x)) * 10.0) + (eps * (((x * x) * 10.0) + (eps * (x * 5.0)))))));
double tmp;
if (x <= -1.1e-42) {
tmp = t_0;
} else if (x <= 1.25e-47) {
tmp = Math.pow(eps, 5.0) * (1.0 + ((x * 5.0) / eps));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, eps): t_0 = eps * ((5.0 * math.pow(x, 4.0)) + (eps * (((x * (x * x)) * 10.0) + (eps * (((x * x) * 10.0) + (eps * (x * 5.0))))))) tmp = 0 if x <= -1.1e-42: tmp = t_0 elif x <= 1.25e-47: tmp = math.pow(eps, 5.0) * (1.0 + ((x * 5.0) / eps)) else: tmp = t_0 return tmp
function code(x, eps) t_0 = Float64(eps * Float64(Float64(5.0 * (x ^ 4.0)) + Float64(eps * Float64(Float64(Float64(x * Float64(x * x)) * 10.0) + Float64(eps * Float64(Float64(Float64(x * x) * 10.0) + Float64(eps * Float64(x * 5.0)))))))) tmp = 0.0 if (x <= -1.1e-42) tmp = t_0; elseif (x <= 1.25e-47) tmp = Float64((eps ^ 5.0) * Float64(1.0 + Float64(Float64(x * 5.0) / eps))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, eps) t_0 = eps * ((5.0 * (x ^ 4.0)) + (eps * (((x * (x * x)) * 10.0) + (eps * (((x * x) * 10.0) + (eps * (x * 5.0))))))); tmp = 0.0; if (x <= -1.1e-42) tmp = t_0; elseif (x <= 1.25e-47) tmp = (eps ^ 5.0) * (1.0 + ((x * 5.0) / eps)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, eps_] := Block[{t$95$0 = N[(eps * N[(N[(5.0 * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision] + N[(eps * N[(N[(N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision] * 10.0), $MachinePrecision] + N[(eps * N[(N[(N[(x * x), $MachinePrecision] * 10.0), $MachinePrecision] + N[(eps * N[(x * 5.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.1e-42], t$95$0, If[LessEqual[x, 1.25e-47], N[(N[Power[eps, 5.0], $MachinePrecision] * N[(1.0 + N[(N[(x * 5.0), $MachinePrecision] / eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \varepsilon \cdot \left(5 \cdot {x}^{4} + \varepsilon \cdot \left(\left(x \cdot \left(x \cdot x\right)\right) \cdot 10 + \varepsilon \cdot \left(\left(x \cdot x\right) \cdot 10 + \varepsilon \cdot \left(x \cdot 5\right)\right)\right)\right)\\
\mathbf{if}\;x \leq -1.1 \cdot 10^{-42}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.25 \cdot 10^{-47}:\\
\;\;\;\;{\varepsilon}^{5} \cdot \left(1 + \frac{x \cdot 5}{\varepsilon}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.10000000000000003e-42 or 1.25000000000000003e-47 < x Initial program 25.5%
Taylor expanded in eps around 0
Simplified97.8%
if -1.10000000000000003e-42 < x < 1.25000000000000003e-47Initial program 99.6%
Taylor expanded in eps around inf
*-lowering-*.f64N/A
pow-lowering-pow.f64N/A
distribute-lft1-inN/A
metadata-evalN/A
associate-*r/N/A
metadata-evalN/A
distribute-rgt1-inN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
distribute-rgt1-inN/A
metadata-evalN/A
*-lowering-*.f6499.1%
Simplified99.1%
Final simplification98.9%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (* eps (* 5.0 (pow x 4.0)))))
(if (<= x -1.36e-43)
t_0
(if (<= x 1.25e-47) (* (pow eps 5.0) (+ 1.0 (/ (* x 5.0) eps))) t_0))))
double code(double x, double eps) {
double t_0 = eps * (5.0 * pow(x, 4.0));
double tmp;
if (x <= -1.36e-43) {
tmp = t_0;
} else if (x <= 1.25e-47) {
tmp = pow(eps, 5.0) * (1.0 + ((x * 5.0) / eps));
} 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 = eps * (5.0d0 * (x ** 4.0d0))
if (x <= (-1.36d-43)) then
tmp = t_0
else if (x <= 1.25d-47) then
tmp = (eps ** 5.0d0) * (1.0d0 + ((x * 5.0d0) / eps))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double eps) {
double t_0 = eps * (5.0 * Math.pow(x, 4.0));
double tmp;
if (x <= -1.36e-43) {
tmp = t_0;
} else if (x <= 1.25e-47) {
tmp = Math.pow(eps, 5.0) * (1.0 + ((x * 5.0) / eps));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, eps): t_0 = eps * (5.0 * math.pow(x, 4.0)) tmp = 0 if x <= -1.36e-43: tmp = t_0 elif x <= 1.25e-47: tmp = math.pow(eps, 5.0) * (1.0 + ((x * 5.0) / eps)) else: tmp = t_0 return tmp
function code(x, eps) t_0 = Float64(eps * Float64(5.0 * (x ^ 4.0))) tmp = 0.0 if (x <= -1.36e-43) tmp = t_0; elseif (x <= 1.25e-47) tmp = Float64((eps ^ 5.0) * Float64(1.0 + Float64(Float64(x * 5.0) / eps))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, eps) t_0 = eps * (5.0 * (x ^ 4.0)); tmp = 0.0; if (x <= -1.36e-43) tmp = t_0; elseif (x <= 1.25e-47) tmp = (eps ^ 5.0) * (1.0 + ((x * 5.0) / eps)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, eps_] := Block[{t$95$0 = N[(eps * N[(5.0 * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.36e-43], t$95$0, If[LessEqual[x, 1.25e-47], N[(N[Power[eps, 5.0], $MachinePrecision] * N[(1.0 + N[(N[(x * 5.0), $MachinePrecision] / eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \varepsilon \cdot \left(5 \cdot {x}^{4}\right)\\
\mathbf{if}\;x \leq -1.36 \cdot 10^{-43}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.25 \cdot 10^{-47}:\\
\;\;\;\;{\varepsilon}^{5} \cdot \left(1 + \frac{x \cdot 5}{\varepsilon}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.36000000000000007e-43 or 1.25000000000000003e-47 < x Initial program 25.5%
Taylor expanded in x around inf
distribute-lft-inN/A
associate-*r*N/A
*-commutativeN/A
+-commutativeN/A
distribute-rgt-inN/A
*-lowering-*.f64N/A
distribute-lft1-inN/A
metadata-evalN/A
*-lowering-*.f64N/A
pow-lowering-pow.f6497.6%
Simplified97.6%
if -1.36000000000000007e-43 < x < 1.25000000000000003e-47Initial program 99.6%
Taylor expanded in eps around inf
*-lowering-*.f64N/A
pow-lowering-pow.f64N/A
distribute-lft1-inN/A
metadata-evalN/A
associate-*r/N/A
metadata-evalN/A
distribute-rgt1-inN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
distribute-rgt1-inN/A
metadata-evalN/A
*-lowering-*.f6499.1%
Simplified99.1%
Final simplification98.9%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (* eps (* 5.0 (pow x 4.0)))))
(if (<= x -1.75e-43)
t_0
(if (<= x 1.3e-47) (* (pow eps 4.0) (+ eps (* x 5.0))) t_0))))
double code(double x, double eps) {
double t_0 = eps * (5.0 * pow(x, 4.0));
double tmp;
if (x <= -1.75e-43) {
tmp = t_0;
} else if (x <= 1.3e-47) {
tmp = pow(eps, 4.0) * (eps + (x * 5.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 = eps * (5.0d0 * (x ** 4.0d0))
if (x <= (-1.75d-43)) then
tmp = t_0
else if (x <= 1.3d-47) then
tmp = (eps ** 4.0d0) * (eps + (x * 5.0d0))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double eps) {
double t_0 = eps * (5.0 * Math.pow(x, 4.0));
double tmp;
if (x <= -1.75e-43) {
tmp = t_0;
} else if (x <= 1.3e-47) {
tmp = Math.pow(eps, 4.0) * (eps + (x * 5.0));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, eps): t_0 = eps * (5.0 * math.pow(x, 4.0)) tmp = 0 if x <= -1.75e-43: tmp = t_0 elif x <= 1.3e-47: tmp = math.pow(eps, 4.0) * (eps + (x * 5.0)) else: tmp = t_0 return tmp
function code(x, eps) t_0 = Float64(eps * Float64(5.0 * (x ^ 4.0))) tmp = 0.0 if (x <= -1.75e-43) tmp = t_0; elseif (x <= 1.3e-47) tmp = Float64((eps ^ 4.0) * Float64(eps + Float64(x * 5.0))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, eps) t_0 = eps * (5.0 * (x ^ 4.0)); tmp = 0.0; if (x <= -1.75e-43) tmp = t_0; elseif (x <= 1.3e-47) tmp = (eps ^ 4.0) * (eps + (x * 5.0)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, eps_] := Block[{t$95$0 = N[(eps * N[(5.0 * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.75e-43], t$95$0, If[LessEqual[x, 1.3e-47], N[(N[Power[eps, 4.0], $MachinePrecision] * N[(eps + N[(x * 5.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \varepsilon \cdot \left(5 \cdot {x}^{4}\right)\\
\mathbf{if}\;x \leq -1.75 \cdot 10^{-43}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{-47}:\\
\;\;\;\;{\varepsilon}^{4} \cdot \left(\varepsilon + x \cdot 5\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.74999999999999999e-43 or 1.3e-47 < x Initial program 25.5%
Taylor expanded in x around inf
distribute-lft-inN/A
associate-*r*N/A
*-commutativeN/A
+-commutativeN/A
distribute-rgt-inN/A
*-lowering-*.f64N/A
distribute-lft1-inN/A
metadata-evalN/A
*-lowering-*.f64N/A
pow-lowering-pow.f6497.6%
Simplified97.6%
if -1.74999999999999999e-43 < x < 1.3e-47Initial program 99.6%
Taylor expanded in eps around inf
*-lowering-*.f64N/A
pow-lowering-pow.f64N/A
distribute-lft1-inN/A
metadata-evalN/A
associate-*r/N/A
metadata-evalN/A
distribute-rgt1-inN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
distribute-rgt1-inN/A
metadata-evalN/A
*-lowering-*.f6499.1%
Simplified99.1%
Taylor expanded in eps around 0
*-lowering-*.f64N/A
pow-lowering-pow.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f6499.0%
Simplified99.0%
Final simplification98.8%
(FPCore (x eps) :precision binary64 (let* ((t_0 (* eps (* 5.0 (pow x 4.0))))) (if (<= x -1.55e-43) t_0 (if (<= x 1.45e-47) (pow eps 5.0) t_0))))
double code(double x, double eps) {
double t_0 = eps * (5.0 * pow(x, 4.0));
double tmp;
if (x <= -1.55e-43) {
tmp = t_0;
} else if (x <= 1.45e-47) {
tmp = pow(eps, 5.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 = eps * (5.0d0 * (x ** 4.0d0))
if (x <= (-1.55d-43)) then
tmp = t_0
else if (x <= 1.45d-47) then
tmp = eps ** 5.0d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double eps) {
double t_0 = eps * (5.0 * Math.pow(x, 4.0));
double tmp;
if (x <= -1.55e-43) {
tmp = t_0;
} else if (x <= 1.45e-47) {
tmp = Math.pow(eps, 5.0);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, eps): t_0 = eps * (5.0 * math.pow(x, 4.0)) tmp = 0 if x <= -1.55e-43: tmp = t_0 elif x <= 1.45e-47: tmp = math.pow(eps, 5.0) else: tmp = t_0 return tmp
function code(x, eps) t_0 = Float64(eps * Float64(5.0 * (x ^ 4.0))) tmp = 0.0 if (x <= -1.55e-43) tmp = t_0; elseif (x <= 1.45e-47) tmp = eps ^ 5.0; else tmp = t_0; end return tmp end
function tmp_2 = code(x, eps) t_0 = eps * (5.0 * (x ^ 4.0)); tmp = 0.0; if (x <= -1.55e-43) tmp = t_0; elseif (x <= 1.45e-47) tmp = eps ^ 5.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, eps_] := Block[{t$95$0 = N[(eps * N[(5.0 * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.55e-43], t$95$0, If[LessEqual[x, 1.45e-47], N[Power[eps, 5.0], $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \varepsilon \cdot \left(5 \cdot {x}^{4}\right)\\
\mathbf{if}\;x \leq -1.55 \cdot 10^{-43}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.45 \cdot 10^{-47}:\\
\;\;\;\;{\varepsilon}^{5}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.55e-43 or 1.45e-47 < x Initial program 25.5%
Taylor expanded in x around inf
distribute-lft-inN/A
associate-*r*N/A
*-commutativeN/A
+-commutativeN/A
distribute-rgt-inN/A
*-lowering-*.f64N/A
distribute-lft1-inN/A
metadata-evalN/A
*-lowering-*.f64N/A
pow-lowering-pow.f6497.6%
Simplified97.6%
if -1.55e-43 < x < 1.45e-47Initial program 99.6%
Taylor expanded in x around 0
pow-lowering-pow.f6498.9%
Simplified98.9%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (* 5.0 (* x x))))
(if (<= x -3.7e-43)
(*
eps
(*
x
(+
(* 5.0 (* eps (* eps eps)))
(* x (+ t_0 (* 10.0 (* eps (+ x eps))))))))
(if (<= x 1.65e-47)
(pow eps 5.0)
(+
(* (* eps eps) (* (* x (* x x)) (+ 10.0 (/ (* eps 10.0) x))))
(* eps (* (* x x) t_0)))))))
double code(double x, double eps) {
double t_0 = 5.0 * (x * x);
double tmp;
if (x <= -3.7e-43) {
tmp = eps * (x * ((5.0 * (eps * (eps * eps))) + (x * (t_0 + (10.0 * (eps * (x + eps)))))));
} else if (x <= 1.65e-47) {
tmp = pow(eps, 5.0);
} else {
tmp = ((eps * eps) * ((x * (x * x)) * (10.0 + ((eps * 10.0) / x)))) + (eps * ((x * x) * 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 = 5.0d0 * (x * x)
if (x <= (-3.7d-43)) then
tmp = eps * (x * ((5.0d0 * (eps * (eps * eps))) + (x * (t_0 + (10.0d0 * (eps * (x + eps)))))))
else if (x <= 1.65d-47) then
tmp = eps ** 5.0d0
else
tmp = ((eps * eps) * ((x * (x * x)) * (10.0d0 + ((eps * 10.0d0) / x)))) + (eps * ((x * x) * t_0))
end if
code = tmp
end function
public static double code(double x, double eps) {
double t_0 = 5.0 * (x * x);
double tmp;
if (x <= -3.7e-43) {
tmp = eps * (x * ((5.0 * (eps * (eps * eps))) + (x * (t_0 + (10.0 * (eps * (x + eps)))))));
} else if (x <= 1.65e-47) {
tmp = Math.pow(eps, 5.0);
} else {
tmp = ((eps * eps) * ((x * (x * x)) * (10.0 + ((eps * 10.0) / x)))) + (eps * ((x * x) * t_0));
}
return tmp;
}
def code(x, eps): t_0 = 5.0 * (x * x) tmp = 0 if x <= -3.7e-43: tmp = eps * (x * ((5.0 * (eps * (eps * eps))) + (x * (t_0 + (10.0 * (eps * (x + eps))))))) elif x <= 1.65e-47: tmp = math.pow(eps, 5.0) else: tmp = ((eps * eps) * ((x * (x * x)) * (10.0 + ((eps * 10.0) / x)))) + (eps * ((x * x) * t_0)) return tmp
function code(x, eps) t_0 = Float64(5.0 * Float64(x * x)) tmp = 0.0 if (x <= -3.7e-43) tmp = Float64(eps * Float64(x * Float64(Float64(5.0 * Float64(eps * Float64(eps * eps))) + Float64(x * Float64(t_0 + Float64(10.0 * Float64(eps * Float64(x + eps)))))))); elseif (x <= 1.65e-47) tmp = eps ^ 5.0; else tmp = Float64(Float64(Float64(eps * eps) * Float64(Float64(x * Float64(x * x)) * Float64(10.0 + Float64(Float64(eps * 10.0) / x)))) + Float64(eps * Float64(Float64(x * x) * t_0))); end return tmp end
function tmp_2 = code(x, eps) t_0 = 5.0 * (x * x); tmp = 0.0; if (x <= -3.7e-43) tmp = eps * (x * ((5.0 * (eps * (eps * eps))) + (x * (t_0 + (10.0 * (eps * (x + eps))))))); elseif (x <= 1.65e-47) tmp = eps ^ 5.0; else tmp = ((eps * eps) * ((x * (x * x)) * (10.0 + ((eps * 10.0) / x)))) + (eps * ((x * x) * t_0)); end tmp_2 = tmp; end
code[x_, eps_] := Block[{t$95$0 = N[(5.0 * N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.7e-43], N[(eps * N[(x * N[(N[(5.0 * N[(eps * N[(eps * eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * N[(t$95$0 + N[(10.0 * N[(eps * N[(x + eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.65e-47], N[Power[eps, 5.0], $MachinePrecision], N[(N[(N[(eps * eps), $MachinePrecision] * N[(N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision] * N[(10.0 + N[(N[(eps * 10.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(eps * N[(N[(x * x), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 5 \cdot \left(x \cdot x\right)\\
\mathbf{if}\;x \leq -3.7 \cdot 10^{-43}:\\
\;\;\;\;\varepsilon \cdot \left(x \cdot \left(5 \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right) + x \cdot \left(t\_0 + 10 \cdot \left(\varepsilon \cdot \left(x + \varepsilon\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x \leq 1.65 \cdot 10^{-47}:\\
\;\;\;\;{\varepsilon}^{5}\\
\mathbf{else}:\\
\;\;\;\;\left(\varepsilon \cdot \varepsilon\right) \cdot \left(\left(x \cdot \left(x \cdot x\right)\right) \cdot \left(10 + \frac{\varepsilon \cdot 10}{x}\right)\right) + \varepsilon \cdot \left(\left(x \cdot x\right) \cdot t\_0\right)\\
\end{array}
\end{array}
if x < -3.7e-43Initial program 17.1%
Taylor expanded in eps around 0
Simplified95.8%
Taylor expanded in x around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
associate-+l+N/A
*-commutativeN/A
+-lowering-+.f64N/A
Simplified95.6%
if -3.7e-43 < x < 1.65000000000000002e-47Initial program 99.6%
Taylor expanded in x around 0
pow-lowering-pow.f6498.9%
Simplified98.9%
if 1.65000000000000002e-47 < x Initial program 34.4%
Taylor expanded in eps around 0
Simplified99.9%
+-commutativeN/A
distribute-lft-inN/A
*-commutativeN/A
+-lowering-+.f64N/A
Applied egg-rr99.6%
Taylor expanded in x around inf
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6499.6%
Simplified99.6%
Final simplification98.7%
(FPCore (x eps) :precision binary64 (+ (* eps (* (* x x) (* 5.0 (* x x)))) (* (* eps eps) (+ (* (* x (* x x)) 10.0) (* eps (* x (* x (+ 10.0 (/ (* eps 5.0) x)))))))))
double code(double x, double eps) {
return (eps * ((x * x) * (5.0 * (x * x)))) + ((eps * eps) * (((x * (x * x)) * 10.0) + (eps * (x * (x * (10.0 + ((eps * 5.0) / x)))))));
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
code = (eps * ((x * x) * (5.0d0 * (x * x)))) + ((eps * eps) * (((x * (x * x)) * 10.0d0) + (eps * (x * (x * (10.0d0 + ((eps * 5.0d0) / x)))))))
end function
public static double code(double x, double eps) {
return (eps * ((x * x) * (5.0 * (x * x)))) + ((eps * eps) * (((x * (x * x)) * 10.0) + (eps * (x * (x * (10.0 + ((eps * 5.0) / x)))))));
}
def code(x, eps): return (eps * ((x * x) * (5.0 * (x * x)))) + ((eps * eps) * (((x * (x * x)) * 10.0) + (eps * (x * (x * (10.0 + ((eps * 5.0) / x)))))))
function code(x, eps) return Float64(Float64(eps * Float64(Float64(x * x) * Float64(5.0 * Float64(x * x)))) + Float64(Float64(eps * eps) * Float64(Float64(Float64(x * Float64(x * x)) * 10.0) + Float64(eps * Float64(x * Float64(x * Float64(10.0 + Float64(Float64(eps * 5.0) / x)))))))) end
function tmp = code(x, eps) tmp = (eps * ((x * x) * (5.0 * (x * x)))) + ((eps * eps) * (((x * (x * x)) * 10.0) + (eps * (x * (x * (10.0 + ((eps * 5.0) / x))))))); end
code[x_, eps_] := N[(N[(eps * N[(N[(x * x), $MachinePrecision] * N[(5.0 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(eps * eps), $MachinePrecision] * N[(N[(N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision] * 10.0), $MachinePrecision] + N[(eps * N[(x * N[(x * N[(10.0 + N[(N[(eps * 5.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\varepsilon \cdot \left(\left(x \cdot x\right) \cdot \left(5 \cdot \left(x \cdot x\right)\right)\right) + \left(\varepsilon \cdot \varepsilon\right) \cdot \left(\left(x \cdot \left(x \cdot x\right)\right) \cdot 10 + \varepsilon \cdot \left(x \cdot \left(x \cdot \left(10 + \frac{\varepsilon \cdot 5}{x}\right)\right)\right)\right)
\end{array}
Initial program 86.5%
Taylor expanded in eps around 0
Simplified86.8%
+-commutativeN/A
distribute-lft-inN/A
*-commutativeN/A
+-lowering-+.f64N/A
Applied egg-rr86.7%
Taylor expanded in x around inf
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f6486.7%
Simplified86.7%
Final simplification86.7%
(FPCore (x eps) :precision binary64 (+ (* (* eps eps) (* (* x (* x x)) (+ 10.0 (/ (* eps 10.0) x)))) (* eps (* (* x x) (* 5.0 (* x x))))))
double code(double x, double eps) {
return ((eps * eps) * ((x * (x * x)) * (10.0 + ((eps * 10.0) / x)))) + (eps * ((x * x) * (5.0 * (x * x))));
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
code = ((eps * eps) * ((x * (x * x)) * (10.0d0 + ((eps * 10.0d0) / x)))) + (eps * ((x * x) * (5.0d0 * (x * x))))
end function
public static double code(double x, double eps) {
return ((eps * eps) * ((x * (x * x)) * (10.0 + ((eps * 10.0) / x)))) + (eps * ((x * x) * (5.0 * (x * x))));
}
def code(x, eps): return ((eps * eps) * ((x * (x * x)) * (10.0 + ((eps * 10.0) / x)))) + (eps * ((x * x) * (5.0 * (x * x))))
function code(x, eps) return Float64(Float64(Float64(eps * eps) * Float64(Float64(x * Float64(x * x)) * Float64(10.0 + Float64(Float64(eps * 10.0) / x)))) + Float64(eps * Float64(Float64(x * x) * Float64(5.0 * Float64(x * x))))) end
function tmp = code(x, eps) tmp = ((eps * eps) * ((x * (x * x)) * (10.0 + ((eps * 10.0) / x)))) + (eps * ((x * x) * (5.0 * (x * x)))); end
code[x_, eps_] := N[(N[(N[(eps * eps), $MachinePrecision] * N[(N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision] * N[(10.0 + N[(N[(eps * 10.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(eps * N[(N[(x * x), $MachinePrecision] * N[(5.0 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\varepsilon \cdot \varepsilon\right) \cdot \left(\left(x \cdot \left(x \cdot x\right)\right) \cdot \left(10 + \frac{\varepsilon \cdot 10}{x}\right)\right) + \varepsilon \cdot \left(\left(x \cdot x\right) \cdot \left(5 \cdot \left(x \cdot x\right)\right)\right)
\end{array}
Initial program 86.5%
Taylor expanded in eps around 0
Simplified86.8%
+-commutativeN/A
distribute-lft-inN/A
*-commutativeN/A
+-lowering-+.f64N/A
Applied egg-rr86.7%
Taylor expanded in x around inf
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6486.7%
Simplified86.7%
Final simplification86.7%
(FPCore (x eps)
:precision binary64
(*
eps
(*
x
(+
(* 5.0 (* eps (* eps eps)))
(* x (+ (* 5.0 (* x x)) (* 10.0 (* eps (+ x eps)))))))))
double code(double x, double eps) {
return eps * (x * ((5.0 * (eps * (eps * eps))) + (x * ((5.0 * (x * x)) + (10.0 * (eps * (x + eps)))))));
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
code = eps * (x * ((5.0d0 * (eps * (eps * eps))) + (x * ((5.0d0 * (x * x)) + (10.0d0 * (eps * (x + eps)))))))
end function
public static double code(double x, double eps) {
return eps * (x * ((5.0 * (eps * (eps * eps))) + (x * ((5.0 * (x * x)) + (10.0 * (eps * (x + eps)))))));
}
def code(x, eps): return eps * (x * ((5.0 * (eps * (eps * eps))) + (x * ((5.0 * (x * x)) + (10.0 * (eps * (x + eps)))))))
function code(x, eps) return Float64(eps * Float64(x * Float64(Float64(5.0 * Float64(eps * Float64(eps * eps))) + Float64(x * Float64(Float64(5.0 * Float64(x * x)) + Float64(10.0 * Float64(eps * Float64(x + eps)))))))) end
function tmp = code(x, eps) tmp = eps * (x * ((5.0 * (eps * (eps * eps))) + (x * ((5.0 * (x * x)) + (10.0 * (eps * (x + eps))))))); end
code[x_, eps_] := N[(eps * N[(x * N[(N[(5.0 * N[(eps * N[(eps * eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[(5.0 * N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(10.0 * N[(eps * N[(x + eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\varepsilon \cdot \left(x \cdot \left(5 \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right) + x \cdot \left(5 \cdot \left(x \cdot x\right) + 10 \cdot \left(\varepsilon \cdot \left(x + \varepsilon\right)\right)\right)\right)\right)
\end{array}
Initial program 86.5%
Taylor expanded in eps around 0
Simplified86.8%
Taylor expanded in x around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
associate-+l+N/A
*-commutativeN/A
+-lowering-+.f64N/A
Simplified86.7%
Final simplification86.7%
(FPCore (x eps) :precision binary64 (* eps (* x (* x (+ (* 5.0 (* x x)) (* eps (* 10.0 (+ x eps))))))))
double code(double x, double eps) {
return eps * (x * (x * ((5.0 * (x * x)) + (eps * (10.0 * (x + eps))))));
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
code = eps * (x * (x * ((5.0d0 * (x * x)) + (eps * (10.0d0 * (x + eps))))))
end function
public static double code(double x, double eps) {
return eps * (x * (x * ((5.0 * (x * x)) + (eps * (10.0 * (x + eps))))));
}
def code(x, eps): return eps * (x * (x * ((5.0 * (x * x)) + (eps * (10.0 * (x + eps))))))
function code(x, eps) return Float64(eps * Float64(x * Float64(x * Float64(Float64(5.0 * Float64(x * x)) + Float64(eps * Float64(10.0 * Float64(x + eps))))))) end
function tmp = code(x, eps) tmp = eps * (x * (x * ((5.0 * (x * x)) + (eps * (10.0 * (x + eps)))))); end
code[x_, eps_] := N[(eps * N[(x * N[(x * N[(N[(5.0 * N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(eps * N[(10.0 * N[(x + eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\varepsilon \cdot \left(x \cdot \left(x \cdot \left(5 \cdot \left(x \cdot x\right) + \varepsilon \cdot \left(10 \cdot \left(x + \varepsilon\right)\right)\right)\right)\right)
\end{array}
Initial program 86.5%
Taylor expanded in eps around 0
Simplified86.8%
Taylor expanded in x around -inf
*-lowering-*.f64N/A
metadata-evalN/A
pow-plusN/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
Simplified78.4%
Taylor expanded in x around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
associate-+l+N/A
+-lowering-+.f64N/A
Simplified86.7%
Taylor expanded in eps around 0
Simplified86.7%
Final simplification86.7%
(FPCore (x eps) :precision binary64 (* x (* 5.0 (* x (* x (* x eps))))))
double code(double x, double eps) {
return x * (5.0 * (x * (x * (x * eps))));
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
code = x * (5.0d0 * (x * (x * (x * eps))))
end function
public static double code(double x, double eps) {
return x * (5.0 * (x * (x * (x * eps))));
}
def code(x, eps): return x * (5.0 * (x * (x * (x * eps))))
function code(x, eps) return Float64(x * Float64(5.0 * Float64(x * Float64(x * Float64(x * eps))))) end
function tmp = code(x, eps) tmp = x * (5.0 * (x * (x * (x * eps)))); end
code[x_, eps_] := N[(x * N[(5.0 * N[(x * N[(x * N[(x * eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(5 \cdot \left(x \cdot \left(x \cdot \left(x \cdot \varepsilon\right)\right)\right)\right)
\end{array}
Initial program 86.5%
Taylor expanded in eps around 0
Simplified86.8%
Taylor expanded in eps around 0
*-lowering-*.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-plusN/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6486.6%
Simplified86.6%
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6486.6%
Applied egg-rr86.6%
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6486.7%
Applied egg-rr86.7%
Final simplification86.7%
(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(eps * Float64(5.0 * Float64(x * Float64(x * Float64(x * x))))) end
function tmp = code(x, eps) tmp = eps * (5.0 * (x * (x * (x * x)))); end
code[x_, eps_] := N[(eps * N[(5.0 * N[(x * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\varepsilon \cdot \left(5 \cdot \left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right)\right)
\end{array}
Initial program 86.5%
Taylor expanded in eps around 0
Simplified86.8%
Taylor expanded in x around inf
*-lowering-*.f64N/A
metadata-evalN/A
pow-plusN/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6486.6%
Simplified86.6%
Final simplification86.6%
(FPCore (x eps) :precision binary64 (* 5.0 (* (* x (* x x)) (* x eps))))
double code(double x, double eps) {
return 5.0 * ((x * (x * x)) * (x * eps));
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
code = 5.0d0 * ((x * (x * x)) * (x * eps))
end function
public static double code(double x, double eps) {
return 5.0 * ((x * (x * x)) * (x * eps));
}
def code(x, eps): return 5.0 * ((x * (x * x)) * (x * eps))
function code(x, eps) return Float64(5.0 * Float64(Float64(x * Float64(x * x)) * Float64(x * eps))) end
function tmp = code(x, eps) tmp = 5.0 * ((x * (x * x)) * (x * eps)); end
code[x_, eps_] := N[(5.0 * N[(N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision] * N[(x * eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
5 \cdot \left(\left(x \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot \varepsilon\right)\right)
\end{array}
Initial program 86.5%
Taylor expanded in eps around 0
Simplified86.8%
Taylor expanded in eps around 0
*-lowering-*.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-plusN/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6486.6%
Simplified86.6%
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6486.6%
Applied egg-rr86.6%
(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(x * Float64(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[(x * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
5 \cdot \left(\varepsilon \cdot \left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right)\right)
\end{array}
Initial program 86.5%
Taylor expanded in eps around 0
Simplified86.8%
Taylor expanded in eps around 0
*-lowering-*.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-plusN/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6486.6%
Simplified86.6%
Final simplification86.6%
herbie shell --seed 2024161
(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)))