
(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 -4e-309)
t_0
(if (<= t_0 0.0)
(* (* x eps) (* x (* 5.0 (* x x))))
(* (pow eps 5.0) (+ 1.0 (/ (* x 5.0) eps)))))))
double code(double x, double eps) {
double t_0 = pow((x + eps), 5.0) - pow(x, 5.0);
double tmp;
if (t_0 <= -4e-309) {
tmp = t_0;
} else if (t_0 <= 0.0) {
tmp = (x * eps) * (x * (5.0 * (x * x)));
} else {
tmp = pow(eps, 5.0) * (1.0 + ((x * 5.0) / eps));
}
return tmp;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: t_0
real(8) :: tmp
t_0 = ((x + eps) ** 5.0d0) - (x ** 5.0d0)
if (t_0 <= (-4d-309)) then
tmp = t_0
else if (t_0 <= 0.0d0) then
tmp = (x * eps) * (x * (5.0d0 * (x * x)))
else
tmp = (eps ** 5.0d0) * (1.0d0 + ((x * 5.0d0) / eps))
end if
code = tmp
end function
public static double code(double x, double eps) {
double t_0 = Math.pow((x + eps), 5.0) - Math.pow(x, 5.0);
double tmp;
if (t_0 <= -4e-309) {
tmp = t_0;
} else if (t_0 <= 0.0) {
tmp = (x * eps) * (x * (5.0 * (x * x)));
} else {
tmp = Math.pow(eps, 5.0) * (1.0 + ((x * 5.0) / eps));
}
return tmp;
}
def code(x, eps): t_0 = math.pow((x + eps), 5.0) - math.pow(x, 5.0) tmp = 0 if t_0 <= -4e-309: tmp = t_0 elif t_0 <= 0.0: tmp = (x * eps) * (x * (5.0 * (x * x))) else: tmp = math.pow(eps, 5.0) * (1.0 + ((x * 5.0) / eps)) return tmp
function code(x, eps) t_0 = Float64((Float64(x + eps) ^ 5.0) - (x ^ 5.0)) tmp = 0.0 if (t_0 <= -4e-309) tmp = t_0; elseif (t_0 <= 0.0) tmp = Float64(Float64(x * eps) * Float64(x * Float64(5.0 * Float64(x * x)))); else tmp = Float64((eps ^ 5.0) * Float64(1.0 + Float64(Float64(x * 5.0) / eps))); end return tmp end
function tmp_2 = code(x, eps) t_0 = ((x + eps) ^ 5.0) - (x ^ 5.0); tmp = 0.0; if (t_0 <= -4e-309) tmp = t_0; elseif (t_0 <= 0.0) tmp = (x * eps) * (x * (5.0 * (x * x))); else tmp = (eps ^ 5.0) * (1.0 + ((x * 5.0) / eps)); 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, -4e-309], t$95$0, If[LessEqual[t$95$0, 0.0], N[(N[(x * eps), $MachinePrecision] * N[(x * N[(5.0 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[eps, 5.0], $MachinePrecision] * N[(1.0 + N[(N[(x * 5.0), $MachinePrecision] / eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(x + \varepsilon\right)}^{5} - {x}^{5}\\
\mathbf{if}\;t\_0 \leq -4 \cdot 10^{-309}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\left(x \cdot \varepsilon\right) \cdot \left(x \cdot \left(5 \cdot \left(x \cdot x\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;{\varepsilon}^{5} \cdot \left(1 + \frac{x \cdot 5}{\varepsilon}\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -3.9999999999999977e-309Initial program 99.6%
if -3.9999999999999977e-309 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 0.0Initial program 85.4%
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.f6499.9%
Simplified99.9%
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-sqrN/A
pow2N/A
pow2N/A
associate-*l*N/A
cube-unmultN/A
*-lowering-*.f64N/A
cube-unmultN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6499.9%
Applied egg-rr99.9%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6499.9%
Applied egg-rr99.9%
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64100.0%
Applied egg-rr100.0%
if 0.0 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) Initial program 99.9%
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-*.f64100.0%
Simplified100.0%
Final simplification99.9%
(FPCore (x eps)
:precision binary64
(if (<= x -9.4e-54)
(* (* x (* x (* x x))) (* eps 5.0))
(if (<= x 8e-62)
(* (pow eps 5.0) (+ 1.0 (/ (* x 5.0) eps)))
(* (* x eps) (* x (* 5.0 (* x x)))))))
double code(double x, double eps) {
double tmp;
if (x <= -9.4e-54) {
tmp = (x * (x * (x * x))) * (eps * 5.0);
} else if (x <= 8e-62) {
tmp = pow(eps, 5.0) * (1.0 + ((x * 5.0) / eps));
} else {
tmp = (x * eps) * (x * (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 <= (-9.4d-54)) then
tmp = (x * (x * (x * x))) * (eps * 5.0d0)
else if (x <= 8d-62) then
tmp = (eps ** 5.0d0) * (1.0d0 + ((x * 5.0d0) / eps))
else
tmp = (x * eps) * (x * (5.0d0 * (x * x)))
end if
code = tmp
end function
public static double code(double x, double eps) {
double tmp;
if (x <= -9.4e-54) {
tmp = (x * (x * (x * x))) * (eps * 5.0);
} else if (x <= 8e-62) {
tmp = Math.pow(eps, 5.0) * (1.0 + ((x * 5.0) / eps));
} else {
tmp = (x * eps) * (x * (5.0 * (x * x)));
}
return tmp;
}
def code(x, eps): tmp = 0 if x <= -9.4e-54: tmp = (x * (x * (x * x))) * (eps * 5.0) elif x <= 8e-62: tmp = math.pow(eps, 5.0) * (1.0 + ((x * 5.0) / eps)) else: tmp = (x * eps) * (x * (5.0 * (x * x))) return tmp
function code(x, eps) tmp = 0.0 if (x <= -9.4e-54) tmp = Float64(Float64(x * Float64(x * Float64(x * x))) * Float64(eps * 5.0)); elseif (x <= 8e-62) tmp = Float64((eps ^ 5.0) * Float64(1.0 + Float64(Float64(x * 5.0) / eps))); else tmp = Float64(Float64(x * eps) * Float64(x * Float64(5.0 * Float64(x * x)))); end return tmp end
function tmp_2 = code(x, eps) tmp = 0.0; if (x <= -9.4e-54) tmp = (x * (x * (x * x))) * (eps * 5.0); elseif (x <= 8e-62) tmp = (eps ^ 5.0) * (1.0 + ((x * 5.0) / eps)); else tmp = (x * eps) * (x * (5.0 * (x * x))); end tmp_2 = tmp; end
code[x_, eps_] := If[LessEqual[x, -9.4e-54], N[(N[(x * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(eps * 5.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 8e-62], N[(N[Power[eps, 5.0], $MachinePrecision] * N[(1.0 + N[(N[(x * 5.0), $MachinePrecision] / eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * eps), $MachinePrecision] * N[(x * N[(5.0 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.4 \cdot 10^{-54}:\\
\;\;\;\;\left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right) \cdot \left(\varepsilon \cdot 5\right)\\
\mathbf{elif}\;x \leq 8 \cdot 10^{-62}:\\
\;\;\;\;{\varepsilon}^{5} \cdot \left(1 + \frac{x \cdot 5}{\varepsilon}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot \varepsilon\right) \cdot \left(x \cdot \left(5 \cdot \left(x \cdot x\right)\right)\right)\\
\end{array}
\end{array}
if x < -9.4e-54Initial program 39.0%
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.f6490.4%
Simplified90.4%
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-sqrN/A
pow2N/A
pow2N/A
associate-*l*N/A
cube-unmultN/A
*-lowering-*.f64N/A
cube-unmultN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6490.7%
Applied egg-rr90.7%
if -9.4e-54 < x < 8.0000000000000003e-62Initial program 100.0%
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.8%
Simplified99.8%
if 8.0000000000000003e-62 < x Initial program 38.8%
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.f6496.6%
Simplified96.6%
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-sqrN/A
pow2N/A
pow2N/A
associate-*l*N/A
cube-unmultN/A
*-lowering-*.f64N/A
cube-unmultN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6496.7%
Applied egg-rr96.7%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6496.7%
Applied egg-rr96.7%
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6497.0%
Applied egg-rr97.0%
Final simplification98.7%
(FPCore (x eps)
:precision binary64
(if (<= x -6.8e-52)
(* (* x (* x (* x x))) (* eps 5.0))
(if (<= x 8e-62)
(* (* eps (* eps eps)) (+ (* (* x x) 10.0) (* eps (- eps (* x -5.0)))))
(* (* x eps) (* x (* 5.0 (* x x)))))))
double code(double x, double eps) {
double tmp;
if (x <= -6.8e-52) {
tmp = (x * (x * (x * x))) * (eps * 5.0);
} else if (x <= 8e-62) {
tmp = (eps * (eps * eps)) * (((x * x) * 10.0) + (eps * (eps - (x * -5.0))));
} else {
tmp = (x * eps) * (x * (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 <= (-6.8d-52)) then
tmp = (x * (x * (x * x))) * (eps * 5.0d0)
else if (x <= 8d-62) then
tmp = (eps * (eps * eps)) * (((x * x) * 10.0d0) + (eps * (eps - (x * (-5.0d0)))))
else
tmp = (x * eps) * (x * (5.0d0 * (x * x)))
end if
code = tmp
end function
public static double code(double x, double eps) {
double tmp;
if (x <= -6.8e-52) {
tmp = (x * (x * (x * x))) * (eps * 5.0);
} else if (x <= 8e-62) {
tmp = (eps * (eps * eps)) * (((x * x) * 10.0) + (eps * (eps - (x * -5.0))));
} else {
tmp = (x * eps) * (x * (5.0 * (x * x)));
}
return tmp;
}
def code(x, eps): tmp = 0 if x <= -6.8e-52: tmp = (x * (x * (x * x))) * (eps * 5.0) elif x <= 8e-62: tmp = (eps * (eps * eps)) * (((x * x) * 10.0) + (eps * (eps - (x * -5.0)))) else: tmp = (x * eps) * (x * (5.0 * (x * x))) return tmp
function code(x, eps) tmp = 0.0 if (x <= -6.8e-52) tmp = Float64(Float64(x * Float64(x * Float64(x * x))) * Float64(eps * 5.0)); elseif (x <= 8e-62) tmp = Float64(Float64(eps * Float64(eps * eps)) * Float64(Float64(Float64(x * x) * 10.0) + Float64(eps * Float64(eps - Float64(x * -5.0))))); else tmp = Float64(Float64(x * eps) * Float64(x * Float64(5.0 * Float64(x * x)))); end return tmp end
function tmp_2 = code(x, eps) tmp = 0.0; if (x <= -6.8e-52) tmp = (x * (x * (x * x))) * (eps * 5.0); elseif (x <= 8e-62) tmp = (eps * (eps * eps)) * (((x * x) * 10.0) + (eps * (eps - (x * -5.0)))); else tmp = (x * eps) * (x * (5.0 * (x * x))); end tmp_2 = tmp; end
code[x_, eps_] := If[LessEqual[x, -6.8e-52], N[(N[(x * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(eps * 5.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 8e-62], N[(N[(eps * N[(eps * eps), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(x * x), $MachinePrecision] * 10.0), $MachinePrecision] + N[(eps * N[(eps - N[(x * -5.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * eps), $MachinePrecision] * N[(x * N[(5.0 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.8 \cdot 10^{-52}:\\
\;\;\;\;\left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right) \cdot \left(\varepsilon \cdot 5\right)\\
\mathbf{elif}\;x \leq 8 \cdot 10^{-62}:\\
\;\;\;\;\left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right) \cdot \left(\left(x \cdot x\right) \cdot 10 + \varepsilon \cdot \left(\varepsilon - x \cdot -5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot \varepsilon\right) \cdot \left(x \cdot \left(5 \cdot \left(x \cdot x\right)\right)\right)\\
\end{array}
\end{array}
if x < -6.80000000000000035e-52Initial program 39.0%
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.f6490.4%
Simplified90.4%
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-sqrN/A
pow2N/A
pow2N/A
associate-*l*N/A
cube-unmultN/A
*-lowering-*.f64N/A
cube-unmultN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6490.7%
Applied egg-rr90.7%
if -6.80000000000000035e-52 < x < 8.0000000000000003e-62Initial program 100.0%
Taylor expanded in eps around -inf
associate-*r*N/A
*-commutativeN/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
distribute-lft1-inN/A
associate-*l*N/A
Simplified95.9%
Taylor expanded in x around 0
+-commutativeN/A
distribute-rgt-inN/A
associate-+r+N/A
metadata-evalN/A
pow-plusN/A
*-commutativeN/A
associate-*r*N/A
distribute-lft-inN/A
associate-*r*N/A
associate-*r*N/A
unpow2N/A
*-commutativeN/A
fma-defineN/A
metadata-evalN/A
pow-plusN/A
fma-defineN/A
Simplified99.7%
if 8.0000000000000003e-62 < x Initial program 38.8%
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.f6496.6%
Simplified96.6%
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-sqrN/A
pow2N/A
pow2N/A
associate-*l*N/A
cube-unmultN/A
*-lowering-*.f64N/A
cube-unmultN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6496.7%
Applied egg-rr96.7%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6496.7%
Applied egg-rr96.7%
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6497.0%
Applied egg-rr97.0%
Final simplification98.7%
(FPCore (x eps)
:precision binary64
(if (<= x -2.15e-52)
(* (* x (* x (* x x))) (* eps 5.0))
(if (<= x 8e-62)
(* (- eps (* x -5.0)) (* eps (* eps (* eps eps))))
(* (* x eps) (* x (* 5.0 (* x x)))))))
double code(double x, double eps) {
double tmp;
if (x <= -2.15e-52) {
tmp = (x * (x * (x * x))) * (eps * 5.0);
} else if (x <= 8e-62) {
tmp = (eps - (x * -5.0)) * (eps * (eps * (eps * eps)));
} else {
tmp = (x * eps) * (x * (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.15d-52)) then
tmp = (x * (x * (x * x))) * (eps * 5.0d0)
else if (x <= 8d-62) then
tmp = (eps - (x * (-5.0d0))) * (eps * (eps * (eps * eps)))
else
tmp = (x * eps) * (x * (5.0d0 * (x * x)))
end if
code = tmp
end function
public static double code(double x, double eps) {
double tmp;
if (x <= -2.15e-52) {
tmp = (x * (x * (x * x))) * (eps * 5.0);
} else if (x <= 8e-62) {
tmp = (eps - (x * -5.0)) * (eps * (eps * (eps * eps)));
} else {
tmp = (x * eps) * (x * (5.0 * (x * x)));
}
return tmp;
}
def code(x, eps): tmp = 0 if x <= -2.15e-52: tmp = (x * (x * (x * x))) * (eps * 5.0) elif x <= 8e-62: tmp = (eps - (x * -5.0)) * (eps * (eps * (eps * eps))) else: tmp = (x * eps) * (x * (5.0 * (x * x))) return tmp
function code(x, eps) tmp = 0.0 if (x <= -2.15e-52) tmp = Float64(Float64(x * Float64(x * Float64(x * x))) * Float64(eps * 5.0)); elseif (x <= 8e-62) tmp = Float64(Float64(eps - Float64(x * -5.0)) * Float64(eps * Float64(eps * Float64(eps * eps)))); else tmp = Float64(Float64(x * eps) * Float64(x * Float64(5.0 * Float64(x * x)))); end return tmp end
function tmp_2 = code(x, eps) tmp = 0.0; if (x <= -2.15e-52) tmp = (x * (x * (x * x))) * (eps * 5.0); elseif (x <= 8e-62) tmp = (eps - (x * -5.0)) * (eps * (eps * (eps * eps))); else tmp = (x * eps) * (x * (5.0 * (x * x))); end tmp_2 = tmp; end
code[x_, eps_] := If[LessEqual[x, -2.15e-52], N[(N[(x * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(eps * 5.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 8e-62], N[(N[(eps - N[(x * -5.0), $MachinePrecision]), $MachinePrecision] * N[(eps * N[(eps * N[(eps * eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * eps), $MachinePrecision] * N[(x * N[(5.0 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.15 \cdot 10^{-52}:\\
\;\;\;\;\left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right) \cdot \left(\varepsilon \cdot 5\right)\\
\mathbf{elif}\;x \leq 8 \cdot 10^{-62}:\\
\;\;\;\;\left(\varepsilon - x \cdot -5\right) \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot \varepsilon\right) \cdot \left(x \cdot \left(5 \cdot \left(x \cdot x\right)\right)\right)\\
\end{array}
\end{array}
if x < -2.1500000000000002e-52Initial program 39.0%
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.f6490.4%
Simplified90.4%
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-sqrN/A
pow2N/A
pow2N/A
associate-*l*N/A
cube-unmultN/A
*-lowering-*.f64N/A
cube-unmultN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6490.7%
Applied egg-rr90.7%
if -2.1500000000000002e-52 < x < 8.0000000000000003e-62Initial program 100.0%
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.8%
Simplified99.8%
Taylor expanded in eps around 0
*-lowering-*.f64N/A
metadata-evalN/A
pow-plusN/A
*-commutativeN/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
metadata-evalN/A
distribute-lft-neg-inN/A
unsub-negN/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f6499.7%
Simplified99.7%
if 8.0000000000000003e-62 < x Initial program 38.8%
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.f6496.6%
Simplified96.6%
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-sqrN/A
pow2N/A
pow2N/A
associate-*l*N/A
cube-unmultN/A
*-lowering-*.f64N/A
cube-unmultN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6496.7%
Applied egg-rr96.7%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6496.7%
Applied egg-rr96.7%
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6497.0%
Applied egg-rr97.0%
Final simplification98.6%
(FPCore (x eps)
:precision binary64
(if (<= x -3.9e-52)
(* (* x (* x (* x x))) (* eps 5.0))
(if (<= x 8e-62)
(* eps (* eps (* eps (* eps eps))))
(* (* x eps) (* x (* 5.0 (* x x)))))))
double code(double x, double eps) {
double tmp;
if (x <= -3.9e-52) {
tmp = (x * (x * (x * x))) * (eps * 5.0);
} else if (x <= 8e-62) {
tmp = eps * (eps * (eps * (eps * eps)));
} else {
tmp = (x * eps) * (x * (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 <= (-3.9d-52)) then
tmp = (x * (x * (x * x))) * (eps * 5.0d0)
else if (x <= 8d-62) then
tmp = eps * (eps * (eps * (eps * eps)))
else
tmp = (x * eps) * (x * (5.0d0 * (x * x)))
end if
code = tmp
end function
public static double code(double x, double eps) {
double tmp;
if (x <= -3.9e-52) {
tmp = (x * (x * (x * x))) * (eps * 5.0);
} else if (x <= 8e-62) {
tmp = eps * (eps * (eps * (eps * eps)));
} else {
tmp = (x * eps) * (x * (5.0 * (x * x)));
}
return tmp;
}
def code(x, eps): tmp = 0 if x <= -3.9e-52: tmp = (x * (x * (x * x))) * (eps * 5.0) elif x <= 8e-62: tmp = eps * (eps * (eps * (eps * eps))) else: tmp = (x * eps) * (x * (5.0 * (x * x))) return tmp
function code(x, eps) tmp = 0.0 if (x <= -3.9e-52) tmp = Float64(Float64(x * Float64(x * Float64(x * x))) * Float64(eps * 5.0)); elseif (x <= 8e-62) tmp = Float64(eps * Float64(eps * Float64(eps * Float64(eps * eps)))); else tmp = Float64(Float64(x * eps) * Float64(x * Float64(5.0 * Float64(x * x)))); end return tmp end
function tmp_2 = code(x, eps) tmp = 0.0; if (x <= -3.9e-52) tmp = (x * (x * (x * x))) * (eps * 5.0); elseif (x <= 8e-62) tmp = eps * (eps * (eps * (eps * eps))); else tmp = (x * eps) * (x * (5.0 * (x * x))); end tmp_2 = tmp; end
code[x_, eps_] := If[LessEqual[x, -3.9e-52], N[(N[(x * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(eps * 5.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 8e-62], N[(eps * N[(eps * N[(eps * N[(eps * eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * eps), $MachinePrecision] * N[(x * N[(5.0 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.9 \cdot 10^{-52}:\\
\;\;\;\;\left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right) \cdot \left(\varepsilon \cdot 5\right)\\
\mathbf{elif}\;x \leq 8 \cdot 10^{-62}:\\
\;\;\;\;\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot \varepsilon\right) \cdot \left(x \cdot \left(5 \cdot \left(x \cdot x\right)\right)\right)\\
\end{array}
\end{array}
if x < -3.90000000000000018e-52Initial program 39.0%
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.f6490.4%
Simplified90.4%
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-sqrN/A
pow2N/A
pow2N/A
associate-*l*N/A
cube-unmultN/A
*-lowering-*.f64N/A
cube-unmultN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6490.7%
Applied egg-rr90.7%
if -3.90000000000000018e-52 < x < 8.0000000000000003e-62Initial program 100.0%
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.8%
Simplified99.8%
Taylor expanded in eps around inf
metadata-evalN/A
pow-plusN/A
*-commutativeN/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-plusN/A
*-commutativeN/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6499.6%
Simplified99.6%
if 8.0000000000000003e-62 < x Initial program 38.8%
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.f6496.6%
Simplified96.6%
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-sqrN/A
pow2N/A
pow2N/A
associate-*l*N/A
cube-unmultN/A
*-lowering-*.f64N/A
cube-unmultN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6496.7%
Applied egg-rr96.7%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6496.7%
Applied egg-rr96.7%
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6497.0%
Applied egg-rr97.0%
Final simplification98.6%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (* (* x eps) (* x (* 5.0 (* x x))))))
(if (<= x -1.24e-51)
t_0
(if (<= x 7.8e-62) (* eps (* eps (* eps (* eps eps)))) t_0))))
double code(double x, double eps) {
double t_0 = (x * eps) * (x * (5.0 * (x * x)));
double tmp;
if (x <= -1.24e-51) {
tmp = t_0;
} else if (x <= 7.8e-62) {
tmp = eps * (eps * (eps * (eps * 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 = (x * eps) * (x * (5.0d0 * (x * x)))
if (x <= (-1.24d-51)) then
tmp = t_0
else if (x <= 7.8d-62) then
tmp = eps * (eps * (eps * (eps * eps)))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double eps) {
double t_0 = (x * eps) * (x * (5.0 * (x * x)));
double tmp;
if (x <= -1.24e-51) {
tmp = t_0;
} else if (x <= 7.8e-62) {
tmp = eps * (eps * (eps * (eps * eps)));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, eps): t_0 = (x * eps) * (x * (5.0 * (x * x))) tmp = 0 if x <= -1.24e-51: tmp = t_0 elif x <= 7.8e-62: tmp = eps * (eps * (eps * (eps * eps))) else: tmp = t_0 return tmp
function code(x, eps) t_0 = Float64(Float64(x * eps) * Float64(x * Float64(5.0 * Float64(x * x)))) tmp = 0.0 if (x <= -1.24e-51) tmp = t_0; elseif (x <= 7.8e-62) tmp = Float64(eps * Float64(eps * Float64(eps * Float64(eps * eps)))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, eps) t_0 = (x * eps) * (x * (5.0 * (x * x))); tmp = 0.0; if (x <= -1.24e-51) tmp = t_0; elseif (x <= 7.8e-62) tmp = eps * (eps * (eps * (eps * eps))); else tmp = t_0; end tmp_2 = tmp; end
code[x_, eps_] := Block[{t$95$0 = N[(N[(x * eps), $MachinePrecision] * N[(x * N[(5.0 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.24e-51], t$95$0, If[LessEqual[x, 7.8e-62], N[(eps * N[(eps * N[(eps * N[(eps * eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(x \cdot \varepsilon\right) \cdot \left(x \cdot \left(5 \cdot \left(x \cdot x\right)\right)\right)\\
\mathbf{if}\;x \leq -1.24 \cdot 10^{-51}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 7.8 \cdot 10^{-62}:\\
\;\;\;\;\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.24e-51 or 7.8000000000000007e-62 < x Initial program 38.9%
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.f6494.2%
Simplified94.2%
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-sqrN/A
pow2N/A
pow2N/A
associate-*l*N/A
cube-unmultN/A
*-lowering-*.f64N/A
cube-unmultN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6494.4%
Applied egg-rr94.4%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6494.3%
Applied egg-rr94.3%
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6494.4%
Applied egg-rr94.4%
if -1.24e-51 < x < 7.8000000000000007e-62Initial program 100.0%
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.8%
Simplified99.8%
Taylor expanded in eps around inf
metadata-evalN/A
pow-plusN/A
*-commutativeN/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-plusN/A
*-commutativeN/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6499.6%
Simplified99.6%
Final simplification98.6%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (* eps (* 5.0 (* x (* x (* x x)))))))
(if (<= x -1.32e-52)
t_0
(if (<= x 3.3e-62) (* eps (* eps (* eps (* eps eps)))) t_0))))
double code(double x, double eps) {
double t_0 = eps * (5.0 * (x * (x * (x * x))));
double tmp;
if (x <= -1.32e-52) {
tmp = t_0;
} else if (x <= 3.3e-62) {
tmp = eps * (eps * (eps * (eps * 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 * (x * (x * x))))
if (x <= (-1.32d-52)) then
tmp = t_0
else if (x <= 3.3d-62) then
tmp = eps * (eps * (eps * (eps * 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 * (x * (x * (x * x))));
double tmp;
if (x <= -1.32e-52) {
tmp = t_0;
} else if (x <= 3.3e-62) {
tmp = eps * (eps * (eps * (eps * eps)));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, eps): t_0 = eps * (5.0 * (x * (x * (x * x)))) tmp = 0 if x <= -1.32e-52: tmp = t_0 elif x <= 3.3e-62: tmp = eps * (eps * (eps * (eps * eps))) else: tmp = t_0 return tmp
function code(x, eps) t_0 = Float64(eps * Float64(5.0 * Float64(x * Float64(x * Float64(x * x))))) tmp = 0.0 if (x <= -1.32e-52) tmp = t_0; elseif (x <= 3.3e-62) tmp = Float64(eps * Float64(eps * Float64(eps * Float64(eps * eps)))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, eps) t_0 = eps * (5.0 * (x * (x * (x * x)))); tmp = 0.0; if (x <= -1.32e-52) tmp = t_0; elseif (x <= 3.3e-62) tmp = eps * (eps * (eps * (eps * eps))); else tmp = t_0; end tmp_2 = tmp; end
code[x_, eps_] := Block[{t$95$0 = N[(eps * N[(5.0 * N[(x * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.32e-52], t$95$0, If[LessEqual[x, 3.3e-62], N[(eps * N[(eps * N[(eps * N[(eps * eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \varepsilon \cdot \left(5 \cdot \left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right)\right)\\
\mathbf{if}\;x \leq -1.32 \cdot 10^{-52}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 3.3 \cdot 10^{-62}:\\
\;\;\;\;\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.32000000000000002e-52 or 3.30000000000000004e-62 < x Initial program 38.9%
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.f6494.2%
Simplified94.2%
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-sqrN/A
pow2N/A
pow2N/A
associate-*l*N/A
cube-unmultN/A
*-lowering-*.f64N/A
cube-unmultN/A
*-lowering-*.f64N/A
*-lowering-*.f6494.3%
Applied egg-rr94.3%
if -1.32000000000000002e-52 < x < 3.30000000000000004e-62Initial program 100.0%
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.8%
Simplified99.8%
Taylor expanded in eps around inf
metadata-evalN/A
pow-plusN/A
*-commutativeN/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-plusN/A
*-commutativeN/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6499.6%
Simplified99.6%
Final simplification98.5%
(FPCore (x eps) :precision binary64 (* eps (* eps (* eps (* eps eps)))))
double code(double x, double eps) {
return eps * (eps * (eps * (eps * eps)));
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
code = eps * (eps * (eps * (eps * eps)))
end function
public static double code(double x, double eps) {
return eps * (eps * (eps * (eps * eps)));
}
def code(x, eps): return eps * (eps * (eps * (eps * eps)))
function code(x, eps) return Float64(eps * Float64(eps * Float64(eps * Float64(eps * eps)))) end
function tmp = code(x, eps) tmp = eps * (eps * (eps * (eps * eps))); end
code[x_, eps_] := N[(eps * N[(eps * N[(eps * N[(eps * eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right)\right)
\end{array}
Initial program 87.8%
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-*.f6487.5%
Simplified87.5%
Taylor expanded in eps around inf
metadata-evalN/A
pow-plusN/A
*-commutativeN/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-plusN/A
*-commutativeN/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6487.1%
Simplified87.1%
herbie shell --seed 2024158
(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)))