
(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 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x eps) :precision binary64 (- (pow (+ x eps) 5.0) (pow x 5.0)))
double code(double x, double eps) {
return pow((x + eps), 5.0) - pow(x, 5.0);
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
code = ((x + eps) ** 5.0d0) - (x ** 5.0d0)
end function
public static double code(double x, double eps) {
return Math.pow((x + eps), 5.0) - Math.pow(x, 5.0);
}
def code(x, eps): return math.pow((x + eps), 5.0) - math.pow(x, 5.0)
function code(x, eps) return Float64((Float64(x + eps) ^ 5.0) - (x ^ 5.0)) end
function tmp = code(x, eps) tmp = ((x + eps) ^ 5.0) - (x ^ 5.0); end
code[x_, eps_] := N[(N[Power[N[(x + eps), $MachinePrecision], 5.0], $MachinePrecision] - N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(x + \varepsilon\right)}^{5} - {x}^{5}
\end{array}
(FPCore (x eps)
:precision binary64
(let* ((t_0 (pow (+ x eps) 5.0)) (t_1 (- t_0 (pow x 5.0))))
(if (<= t_1 -2e-318)
t_1
(if (<= t_1 0.0)
(* eps (* 5.0 (pow x 4.0)))
(if (<= t_1 1e-262)
(* (pow x 3.0) (+ (* 5.0 (* x eps)) (* 10.0 (pow eps 2.0))))
(if (<= t_1 5e-193)
(* (pow eps 4.0) (* x (+ 5.0 (/ eps x))))
(if (<= t_1 1e-145)
t_1
(if (<= t_1 5e-108)
(/ (- (pow (+ x eps) 10.0) (pow x 10.0)) (+ t_0 (pow x 5.0)))
(if (<= t_1 5e-19)
(* (pow eps 4.0) (+ eps (* x 5.0)))
(* (pow x 4.0) (* eps (+ 5.0 (* 10.0 (/ eps x))))))))))))))
double code(double x, double eps) {
double t_0 = pow((x + eps), 5.0);
double t_1 = t_0 - pow(x, 5.0);
double tmp;
if (t_1 <= -2e-318) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = eps * (5.0 * pow(x, 4.0));
} else if (t_1 <= 1e-262) {
tmp = pow(x, 3.0) * ((5.0 * (x * eps)) + (10.0 * pow(eps, 2.0)));
} else if (t_1 <= 5e-193) {
tmp = pow(eps, 4.0) * (x * (5.0 + (eps / x)));
} else if (t_1 <= 1e-145) {
tmp = t_1;
} else if (t_1 <= 5e-108) {
tmp = (pow((x + eps), 10.0) - pow(x, 10.0)) / (t_0 + pow(x, 5.0));
} else if (t_1 <= 5e-19) {
tmp = pow(eps, 4.0) * (eps + (x * 5.0));
} else {
tmp = pow(x, 4.0) * (eps * (5.0 + (10.0 * (eps / x))));
}
return tmp;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (x + eps) ** 5.0d0
t_1 = t_0 - (x ** 5.0d0)
if (t_1 <= (-2d-318)) then
tmp = t_1
else if (t_1 <= 0.0d0) then
tmp = eps * (5.0d0 * (x ** 4.0d0))
else if (t_1 <= 1d-262) then
tmp = (x ** 3.0d0) * ((5.0d0 * (x * eps)) + (10.0d0 * (eps ** 2.0d0)))
else if (t_1 <= 5d-193) then
tmp = (eps ** 4.0d0) * (x * (5.0d0 + (eps / x)))
else if (t_1 <= 1d-145) then
tmp = t_1
else if (t_1 <= 5d-108) then
tmp = (((x + eps) ** 10.0d0) - (x ** 10.0d0)) / (t_0 + (x ** 5.0d0))
else if (t_1 <= 5d-19) then
tmp = (eps ** 4.0d0) * (eps + (x * 5.0d0))
else
tmp = (x ** 4.0d0) * (eps * (5.0d0 + (10.0d0 * (eps / x))))
end if
code = tmp
end function
public static double code(double x, double eps) {
double t_0 = Math.pow((x + eps), 5.0);
double t_1 = t_0 - Math.pow(x, 5.0);
double tmp;
if (t_1 <= -2e-318) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = eps * (5.0 * Math.pow(x, 4.0));
} else if (t_1 <= 1e-262) {
tmp = Math.pow(x, 3.0) * ((5.0 * (x * eps)) + (10.0 * Math.pow(eps, 2.0)));
} else if (t_1 <= 5e-193) {
tmp = Math.pow(eps, 4.0) * (x * (5.0 + (eps / x)));
} else if (t_1 <= 1e-145) {
tmp = t_1;
} else if (t_1 <= 5e-108) {
tmp = (Math.pow((x + eps), 10.0) - Math.pow(x, 10.0)) / (t_0 + Math.pow(x, 5.0));
} else if (t_1 <= 5e-19) {
tmp = Math.pow(eps, 4.0) * (eps + (x * 5.0));
} else {
tmp = Math.pow(x, 4.0) * (eps * (5.0 + (10.0 * (eps / x))));
}
return tmp;
}
def code(x, eps): t_0 = math.pow((x + eps), 5.0) t_1 = t_0 - math.pow(x, 5.0) tmp = 0 if t_1 <= -2e-318: tmp = t_1 elif t_1 <= 0.0: tmp = eps * (5.0 * math.pow(x, 4.0)) elif t_1 <= 1e-262: tmp = math.pow(x, 3.0) * ((5.0 * (x * eps)) + (10.0 * math.pow(eps, 2.0))) elif t_1 <= 5e-193: tmp = math.pow(eps, 4.0) * (x * (5.0 + (eps / x))) elif t_1 <= 1e-145: tmp = t_1 elif t_1 <= 5e-108: tmp = (math.pow((x + eps), 10.0) - math.pow(x, 10.0)) / (t_0 + math.pow(x, 5.0)) elif t_1 <= 5e-19: tmp = math.pow(eps, 4.0) * (eps + (x * 5.0)) else: tmp = math.pow(x, 4.0) * (eps * (5.0 + (10.0 * (eps / x)))) return tmp
function code(x, eps) t_0 = Float64(x + eps) ^ 5.0 t_1 = Float64(t_0 - (x ^ 5.0)) tmp = 0.0 if (t_1 <= -2e-318) tmp = t_1; elseif (t_1 <= 0.0) tmp = Float64(eps * Float64(5.0 * (x ^ 4.0))); elseif (t_1 <= 1e-262) tmp = Float64((x ^ 3.0) * Float64(Float64(5.0 * Float64(x * eps)) + Float64(10.0 * (eps ^ 2.0)))); elseif (t_1 <= 5e-193) tmp = Float64((eps ^ 4.0) * Float64(x * Float64(5.0 + Float64(eps / x)))); elseif (t_1 <= 1e-145) tmp = t_1; elseif (t_1 <= 5e-108) tmp = Float64(Float64((Float64(x + eps) ^ 10.0) - (x ^ 10.0)) / Float64(t_0 + (x ^ 5.0))); elseif (t_1 <= 5e-19) tmp = Float64((eps ^ 4.0) * Float64(eps + Float64(x * 5.0))); else tmp = Float64((x ^ 4.0) * Float64(eps * Float64(5.0 + Float64(10.0 * Float64(eps / x))))); end return tmp end
function tmp_2 = code(x, eps) t_0 = (x + eps) ^ 5.0; t_1 = t_0 - (x ^ 5.0); tmp = 0.0; if (t_1 <= -2e-318) tmp = t_1; elseif (t_1 <= 0.0) tmp = eps * (5.0 * (x ^ 4.0)); elseif (t_1 <= 1e-262) tmp = (x ^ 3.0) * ((5.0 * (x * eps)) + (10.0 * (eps ^ 2.0))); elseif (t_1 <= 5e-193) tmp = (eps ^ 4.0) * (x * (5.0 + (eps / x))); elseif (t_1 <= 1e-145) tmp = t_1; elseif (t_1 <= 5e-108) tmp = (((x + eps) ^ 10.0) - (x ^ 10.0)) / (t_0 + (x ^ 5.0)); elseif (t_1 <= 5e-19) tmp = (eps ^ 4.0) * (eps + (x * 5.0)); else tmp = (x ^ 4.0) * (eps * (5.0 + (10.0 * (eps / x)))); end tmp_2 = tmp; end
code[x_, eps_] := Block[{t$95$0 = N[Power[N[(x + eps), $MachinePrecision], 5.0], $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 - N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e-318], t$95$1, If[LessEqual[t$95$1, 0.0], N[(eps * N[(5.0 * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e-262], N[(N[Power[x, 3.0], $MachinePrecision] * N[(N[(5.0 * N[(x * eps), $MachinePrecision]), $MachinePrecision] + N[(10.0 * N[Power[eps, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e-193], N[(N[Power[eps, 4.0], $MachinePrecision] * N[(x * N[(5.0 + N[(eps / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e-145], t$95$1, If[LessEqual[t$95$1, 5e-108], N[(N[(N[Power[N[(x + eps), $MachinePrecision], 10.0], $MachinePrecision] - N[Power[x, 10.0], $MachinePrecision]), $MachinePrecision] / N[(t$95$0 + N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e-19], N[(N[Power[eps, 4.0], $MachinePrecision] * N[(eps + N[(x * 5.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[x, 4.0], $MachinePrecision] * N[(eps * N[(5.0 + N[(10.0 * N[(eps / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(x + \varepsilon\right)}^{5}\\
t_1 := t\_0 - {x}^{5}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-318}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\varepsilon \cdot \left(5 \cdot {x}^{4}\right)\\
\mathbf{elif}\;t\_1 \leq 10^{-262}:\\
\;\;\;\;{x}^{3} \cdot \left(5 \cdot \left(x \cdot \varepsilon\right) + 10 \cdot {\varepsilon}^{2}\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-193}:\\
\;\;\;\;{\varepsilon}^{4} \cdot \left(x \cdot \left(5 + \frac{\varepsilon}{x}\right)\right)\\
\mathbf{elif}\;t\_1 \leq 10^{-145}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-108}:\\
\;\;\;\;\frac{{\left(x + \varepsilon\right)}^{10} - {x}^{10}}{t\_0 + {x}^{5}}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-19}:\\
\;\;\;\;{\varepsilon}^{4} \cdot \left(\varepsilon + x \cdot 5\right)\\
\mathbf{else}:\\
\;\;\;\;{x}^{4} \cdot \left(\varepsilon \cdot \left(5 + 10 \cdot \frac{\varepsilon}{x}\right)\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -2.0000024e-318 or 5.0000000000000005e-193 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 9.99999999999999915e-146Initial program 99.8%
if -2.0000024e-318 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 0.0Initial program 88.7%
Taylor expanded in x around inf 99.9%
*-commutative99.9%
distribute-rgt1-in99.9%
metadata-eval99.9%
*-commutative99.9%
associate-*r*99.9%
Simplified99.9%
if 0.0 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 1.00000000000000001e-262Initial program 43.9%
Taylor expanded in x around -inf 98.4%
+-commutative98.4%
associate-+r+98.4%
mul-1-neg98.4%
unsub-neg98.4%
distribute-rgt1-in98.4%
metadata-eval98.4%
*-commutative98.4%
Simplified98.4%
Taylor expanded in x around 0 100.0%
if 1.00000000000000001e-262 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 5.0000000000000005e-193Initial program 99.2%
Taylor expanded in x around 0 100.0%
fma-define100.0%
distribute-lft1-in100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in eps around 0 99.2%
Taylor expanded in x around inf 100.0%
if 9.99999999999999915e-146 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 5e-108Initial program 99.2%
flip--100.0%
pow-prod-up100.0%
metadata-eval100.0%
pow-prod-up100.0%
metadata-eval100.0%
Applied egg-rr100.0%
if 5e-108 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 5.0000000000000004e-19Initial program 99.8%
Taylor expanded in x around 0 100.0%
fma-define100.0%
distribute-lft1-in100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in eps around 0 100.0%
if 5.0000000000000004e-19 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) Initial program 42.3%
Taylor expanded in x around -inf 100.0%
+-commutative100.0%
associate-+r+100.0%
mul-1-neg100.0%
unsub-neg100.0%
distribute-rgt1-in100.0%
metadata-eval100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in eps around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification99.9%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (- (pow (+ x eps) 5.0) (pow x 5.0))))
(if (<= t_0 -2e-318)
t_0
(if (<= t_0 0.0)
(* eps (* 5.0 (pow x 4.0)))
(if (<= t_0 1e-262)
(* (pow x 3.0) (+ (* 5.0 (* x eps)) (* 10.0 (pow eps 2.0))))
(if (<= t_0 5e-193)
(* (pow eps 4.0) (* x (+ 5.0 (/ eps x))))
(if (<= t_0 5e-108)
t_0
(if (<= t_0 5e-19)
(* (pow eps 4.0) (+ eps (* x 5.0)))
(* (pow x 4.0) (* eps (+ 5.0 (* 10.0 (/ eps x)))))))))))))
double code(double x, double eps) {
double t_0 = pow((x + eps), 5.0) - pow(x, 5.0);
double tmp;
if (t_0 <= -2e-318) {
tmp = t_0;
} else if (t_0 <= 0.0) {
tmp = eps * (5.0 * pow(x, 4.0));
} else if (t_0 <= 1e-262) {
tmp = pow(x, 3.0) * ((5.0 * (x * eps)) + (10.0 * pow(eps, 2.0)));
} else if (t_0 <= 5e-193) {
tmp = pow(eps, 4.0) * (x * (5.0 + (eps / x)));
} else if (t_0 <= 5e-108) {
tmp = t_0;
} else if (t_0 <= 5e-19) {
tmp = pow(eps, 4.0) * (eps + (x * 5.0));
} else {
tmp = pow(x, 4.0) * (eps * (5.0 + (10.0 * (eps / x))));
}
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 <= (-2d-318)) then
tmp = t_0
else if (t_0 <= 0.0d0) then
tmp = eps * (5.0d0 * (x ** 4.0d0))
else if (t_0 <= 1d-262) then
tmp = (x ** 3.0d0) * ((5.0d0 * (x * eps)) + (10.0d0 * (eps ** 2.0d0)))
else if (t_0 <= 5d-193) then
tmp = (eps ** 4.0d0) * (x * (5.0d0 + (eps / x)))
else if (t_0 <= 5d-108) then
tmp = t_0
else if (t_0 <= 5d-19) then
tmp = (eps ** 4.0d0) * (eps + (x * 5.0d0))
else
tmp = (x ** 4.0d0) * (eps * (5.0d0 + (10.0d0 * (eps / x))))
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 <= -2e-318) {
tmp = t_0;
} else if (t_0 <= 0.0) {
tmp = eps * (5.0 * Math.pow(x, 4.0));
} else if (t_0 <= 1e-262) {
tmp = Math.pow(x, 3.0) * ((5.0 * (x * eps)) + (10.0 * Math.pow(eps, 2.0)));
} else if (t_0 <= 5e-193) {
tmp = Math.pow(eps, 4.0) * (x * (5.0 + (eps / x)));
} else if (t_0 <= 5e-108) {
tmp = t_0;
} else if (t_0 <= 5e-19) {
tmp = Math.pow(eps, 4.0) * (eps + (x * 5.0));
} else {
tmp = Math.pow(x, 4.0) * (eps * (5.0 + (10.0 * (eps / x))));
}
return tmp;
}
def code(x, eps): t_0 = math.pow((x + eps), 5.0) - math.pow(x, 5.0) tmp = 0 if t_0 <= -2e-318: tmp = t_0 elif t_0 <= 0.0: tmp = eps * (5.0 * math.pow(x, 4.0)) elif t_0 <= 1e-262: tmp = math.pow(x, 3.0) * ((5.0 * (x * eps)) + (10.0 * math.pow(eps, 2.0))) elif t_0 <= 5e-193: tmp = math.pow(eps, 4.0) * (x * (5.0 + (eps / x))) elif t_0 <= 5e-108: tmp = t_0 elif t_0 <= 5e-19: tmp = math.pow(eps, 4.0) * (eps + (x * 5.0)) else: tmp = math.pow(x, 4.0) * (eps * (5.0 + (10.0 * (eps / x)))) return tmp
function code(x, eps) t_0 = Float64((Float64(x + eps) ^ 5.0) - (x ^ 5.0)) tmp = 0.0 if (t_0 <= -2e-318) tmp = t_0; elseif (t_0 <= 0.0) tmp = Float64(eps * Float64(5.0 * (x ^ 4.0))); elseif (t_0 <= 1e-262) tmp = Float64((x ^ 3.0) * Float64(Float64(5.0 * Float64(x * eps)) + Float64(10.0 * (eps ^ 2.0)))); elseif (t_0 <= 5e-193) tmp = Float64((eps ^ 4.0) * Float64(x * Float64(5.0 + Float64(eps / x)))); elseif (t_0 <= 5e-108) tmp = t_0; elseif (t_0 <= 5e-19) tmp = Float64((eps ^ 4.0) * Float64(eps + Float64(x * 5.0))); else tmp = Float64((x ^ 4.0) * Float64(eps * Float64(5.0 + Float64(10.0 * Float64(eps / x))))); 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 <= -2e-318) tmp = t_0; elseif (t_0 <= 0.0) tmp = eps * (5.0 * (x ^ 4.0)); elseif (t_0 <= 1e-262) tmp = (x ^ 3.0) * ((5.0 * (x * eps)) + (10.0 * (eps ^ 2.0))); elseif (t_0 <= 5e-193) tmp = (eps ^ 4.0) * (x * (5.0 + (eps / x))); elseif (t_0 <= 5e-108) tmp = t_0; elseif (t_0 <= 5e-19) tmp = (eps ^ 4.0) * (eps + (x * 5.0)); else tmp = (x ^ 4.0) * (eps * (5.0 + (10.0 * (eps / x)))); 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, -2e-318], t$95$0, If[LessEqual[t$95$0, 0.0], N[(eps * N[(5.0 * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e-262], N[(N[Power[x, 3.0], $MachinePrecision] * N[(N[(5.0 * N[(x * eps), $MachinePrecision]), $MachinePrecision] + N[(10.0 * N[Power[eps, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e-193], N[(N[Power[eps, 4.0], $MachinePrecision] * N[(x * N[(5.0 + N[(eps / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e-108], t$95$0, If[LessEqual[t$95$0, 5e-19], N[(N[Power[eps, 4.0], $MachinePrecision] * N[(eps + N[(x * 5.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[x, 4.0], $MachinePrecision] * N[(eps * N[(5.0 + N[(10.0 * N[(eps / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(x + \varepsilon\right)}^{5} - {x}^{5}\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{-318}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\varepsilon \cdot \left(5 \cdot {x}^{4}\right)\\
\mathbf{elif}\;t\_0 \leq 10^{-262}:\\
\;\;\;\;{x}^{3} \cdot \left(5 \cdot \left(x \cdot \varepsilon\right) + 10 \cdot {\varepsilon}^{2}\right)\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-193}:\\
\;\;\;\;{\varepsilon}^{4} \cdot \left(x \cdot \left(5 + \frac{\varepsilon}{x}\right)\right)\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-108}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-19}:\\
\;\;\;\;{\varepsilon}^{4} \cdot \left(\varepsilon + x \cdot 5\right)\\
\mathbf{else}:\\
\;\;\;\;{x}^{4} \cdot \left(\varepsilon \cdot \left(5 + 10 \cdot \frac{\varepsilon}{x}\right)\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -2.0000024e-318 or 5.0000000000000005e-193 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 5e-108Initial program 99.8%
if -2.0000024e-318 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 0.0Initial program 88.7%
Taylor expanded in x around inf 99.9%
*-commutative99.9%
distribute-rgt1-in99.9%
metadata-eval99.9%
*-commutative99.9%
associate-*r*99.9%
Simplified99.9%
if 0.0 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 1.00000000000000001e-262Initial program 43.9%
Taylor expanded in x around -inf 98.4%
+-commutative98.4%
associate-+r+98.4%
mul-1-neg98.4%
unsub-neg98.4%
distribute-rgt1-in98.4%
metadata-eval98.4%
*-commutative98.4%
Simplified98.4%
Taylor expanded in x around 0 100.0%
if 1.00000000000000001e-262 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 5.0000000000000005e-193Initial program 99.2%
Taylor expanded in x around 0 100.0%
fma-define100.0%
distribute-lft1-in100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in eps around 0 99.2%
Taylor expanded in x around inf 100.0%
if 5e-108 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 5.0000000000000004e-19Initial program 99.8%
Taylor expanded in x around 0 100.0%
fma-define100.0%
distribute-lft1-in100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in eps around 0 100.0%
if 5.0000000000000004e-19 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) Initial program 42.3%
Taylor expanded in x around -inf 100.0%
+-commutative100.0%
associate-+r+100.0%
mul-1-neg100.0%
unsub-neg100.0%
distribute-rgt1-in100.0%
metadata-eval100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in eps around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification99.9%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (- (pow (+ x eps) 5.0) (pow x 5.0)))
(t_1 (* (pow x 4.0) (* eps (+ 5.0 (* 10.0 (/ eps x)))))))
(if (<= t_0 -2e-318)
t_0
(if (<= t_0 1e-262)
t_1
(if (<= t_0 5e-193)
(* (pow eps 4.0) (* x (+ 5.0 (/ eps x))))
(if (<= t_0 5e-108)
t_0
(if (<= t_0 5e-19) (* (pow eps 4.0) (+ eps (* x 5.0))) t_1)))))))
double code(double x, double eps) {
double t_0 = pow((x + eps), 5.0) - pow(x, 5.0);
double t_1 = pow(x, 4.0) * (eps * (5.0 + (10.0 * (eps / x))));
double tmp;
if (t_0 <= -2e-318) {
tmp = t_0;
} else if (t_0 <= 1e-262) {
tmp = t_1;
} else if (t_0 <= 5e-193) {
tmp = pow(eps, 4.0) * (x * (5.0 + (eps / x)));
} else if (t_0 <= 5e-108) {
tmp = t_0;
} else if (t_0 <= 5e-19) {
tmp = pow(eps, 4.0) * (eps + (x * 5.0));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = ((x + eps) ** 5.0d0) - (x ** 5.0d0)
t_1 = (x ** 4.0d0) * (eps * (5.0d0 + (10.0d0 * (eps / x))))
if (t_0 <= (-2d-318)) then
tmp = t_0
else if (t_0 <= 1d-262) then
tmp = t_1
else if (t_0 <= 5d-193) then
tmp = (eps ** 4.0d0) * (x * (5.0d0 + (eps / x)))
else if (t_0 <= 5d-108) then
tmp = t_0
else if (t_0 <= 5d-19) then
tmp = (eps ** 4.0d0) * (eps + (x * 5.0d0))
else
tmp = t_1
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 t_1 = Math.pow(x, 4.0) * (eps * (5.0 + (10.0 * (eps / x))));
double tmp;
if (t_0 <= -2e-318) {
tmp = t_0;
} else if (t_0 <= 1e-262) {
tmp = t_1;
} else if (t_0 <= 5e-193) {
tmp = Math.pow(eps, 4.0) * (x * (5.0 + (eps / x)));
} else if (t_0 <= 5e-108) {
tmp = t_0;
} else if (t_0 <= 5e-19) {
tmp = Math.pow(eps, 4.0) * (eps + (x * 5.0));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, eps): t_0 = math.pow((x + eps), 5.0) - math.pow(x, 5.0) t_1 = math.pow(x, 4.0) * (eps * (5.0 + (10.0 * (eps / x)))) tmp = 0 if t_0 <= -2e-318: tmp = t_0 elif t_0 <= 1e-262: tmp = t_1 elif t_0 <= 5e-193: tmp = math.pow(eps, 4.0) * (x * (5.0 + (eps / x))) elif t_0 <= 5e-108: tmp = t_0 elif t_0 <= 5e-19: tmp = math.pow(eps, 4.0) * (eps + (x * 5.0)) else: tmp = t_1 return tmp
function code(x, eps) t_0 = Float64((Float64(x + eps) ^ 5.0) - (x ^ 5.0)) t_1 = Float64((x ^ 4.0) * Float64(eps * Float64(5.0 + Float64(10.0 * Float64(eps / x))))) tmp = 0.0 if (t_0 <= -2e-318) tmp = t_0; elseif (t_0 <= 1e-262) tmp = t_1; elseif (t_0 <= 5e-193) tmp = Float64((eps ^ 4.0) * Float64(x * Float64(5.0 + Float64(eps / x)))); elseif (t_0 <= 5e-108) tmp = t_0; elseif (t_0 <= 5e-19) tmp = Float64((eps ^ 4.0) * Float64(eps + Float64(x * 5.0))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, eps) t_0 = ((x + eps) ^ 5.0) - (x ^ 5.0); t_1 = (x ^ 4.0) * (eps * (5.0 + (10.0 * (eps / x)))); tmp = 0.0; if (t_0 <= -2e-318) tmp = t_0; elseif (t_0 <= 1e-262) tmp = t_1; elseif (t_0 <= 5e-193) tmp = (eps ^ 4.0) * (x * (5.0 + (eps / x))); elseif (t_0 <= 5e-108) tmp = t_0; elseif (t_0 <= 5e-19) tmp = (eps ^ 4.0) * (eps + (x * 5.0)); else tmp = t_1; 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]}, Block[{t$95$1 = N[(N[Power[x, 4.0], $MachinePrecision] * N[(eps * N[(5.0 + N[(10.0 * N[(eps / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e-318], t$95$0, If[LessEqual[t$95$0, 1e-262], t$95$1, If[LessEqual[t$95$0, 5e-193], N[(N[Power[eps, 4.0], $MachinePrecision] * N[(x * N[(5.0 + N[(eps / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e-108], t$95$0, If[LessEqual[t$95$0, 5e-19], N[(N[Power[eps, 4.0], $MachinePrecision] * N[(eps + N[(x * 5.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(x + \varepsilon\right)}^{5} - {x}^{5}\\
t_1 := {x}^{4} \cdot \left(\varepsilon \cdot \left(5 + 10 \cdot \frac{\varepsilon}{x}\right)\right)\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{-318}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_0 \leq 10^{-262}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-193}:\\
\;\;\;\;{\varepsilon}^{4} \cdot \left(x \cdot \left(5 + \frac{\varepsilon}{x}\right)\right)\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-108}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-19}:\\
\;\;\;\;{\varepsilon}^{4} \cdot \left(\varepsilon + x \cdot 5\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -2.0000024e-318 or 5.0000000000000005e-193 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 5e-108Initial program 99.8%
if -2.0000024e-318 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 1.00000000000000001e-262 or 5.0000000000000004e-19 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) Initial program 88.3%
Taylor expanded in x around -inf 99.9%
+-commutative99.9%
associate-+r+99.9%
mul-1-neg99.9%
unsub-neg99.9%
distribute-rgt1-in99.9%
metadata-eval99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in eps around 0 99.9%
*-commutative99.9%
Simplified99.9%
if 1.00000000000000001e-262 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 5.0000000000000005e-193Initial program 99.2%
Taylor expanded in x around 0 100.0%
fma-define100.0%
distribute-lft1-in100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in eps around 0 99.2%
Taylor expanded in x around inf 100.0%
if 5e-108 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 5.0000000000000004e-19Initial program 99.8%
Taylor expanded in x around 0 100.0%
fma-define100.0%
distribute-lft1-in100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in eps around 0 100.0%
Final simplification99.9%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (* (pow eps 4.0) (+ eps (* x 5.0))))
(t_1 (* 5.0 (* eps (pow x 4.0))))
(t_2 (* eps (* 5.0 (pow x 4.0))))
(t_3 (* (pow eps 4.0) (* x (+ 5.0 (/ eps x))))))
(if (<= x -4.8e-52)
(* (pow x 4.0) (* eps (+ 5.0 (* 10.0 (/ eps x)))))
(if (<= x -4e-78)
t_0
(if (<= x 1e-270)
(pow eps 5.0)
(if (<= x 1.5e-55)
t_3
(if (<= x 3e-45)
(* (pow eps 5.0) (+ 1.0 (* 5.0 (/ x eps))))
(if (<= x 1.22e-26)
t_2
(if (<= x 1.45e-23)
t_3
(if (<= x 1.15e-18)
t_1
(if (<= x 1.16e-18)
t_0
(if (<= x 5e-7)
t_2
(if (<= x 12000000.0)
(* eps (cbrt (* 125.0 (pow x 12.0))))
t_1)))))))))))))
double code(double x, double eps) {
double t_0 = pow(eps, 4.0) * (eps + (x * 5.0));
double t_1 = 5.0 * (eps * pow(x, 4.0));
double t_2 = eps * (5.0 * pow(x, 4.0));
double t_3 = pow(eps, 4.0) * (x * (5.0 + (eps / x)));
double tmp;
if (x <= -4.8e-52) {
tmp = pow(x, 4.0) * (eps * (5.0 + (10.0 * (eps / x))));
} else if (x <= -4e-78) {
tmp = t_0;
} else if (x <= 1e-270) {
tmp = pow(eps, 5.0);
} else if (x <= 1.5e-55) {
tmp = t_3;
} else if (x <= 3e-45) {
tmp = pow(eps, 5.0) * (1.0 + (5.0 * (x / eps)));
} else if (x <= 1.22e-26) {
tmp = t_2;
} else if (x <= 1.45e-23) {
tmp = t_3;
} else if (x <= 1.15e-18) {
tmp = t_1;
} else if (x <= 1.16e-18) {
tmp = t_0;
} else if (x <= 5e-7) {
tmp = t_2;
} else if (x <= 12000000.0) {
tmp = eps * cbrt((125.0 * pow(x, 12.0)));
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double eps) {
double t_0 = Math.pow(eps, 4.0) * (eps + (x * 5.0));
double t_1 = 5.0 * (eps * Math.pow(x, 4.0));
double t_2 = eps * (5.0 * Math.pow(x, 4.0));
double t_3 = Math.pow(eps, 4.0) * (x * (5.0 + (eps / x)));
double tmp;
if (x <= -4.8e-52) {
tmp = Math.pow(x, 4.0) * (eps * (5.0 + (10.0 * (eps / x))));
} else if (x <= -4e-78) {
tmp = t_0;
} else if (x <= 1e-270) {
tmp = Math.pow(eps, 5.0);
} else if (x <= 1.5e-55) {
tmp = t_3;
} else if (x <= 3e-45) {
tmp = Math.pow(eps, 5.0) * (1.0 + (5.0 * (x / eps)));
} else if (x <= 1.22e-26) {
tmp = t_2;
} else if (x <= 1.45e-23) {
tmp = t_3;
} else if (x <= 1.15e-18) {
tmp = t_1;
} else if (x <= 1.16e-18) {
tmp = t_0;
} else if (x <= 5e-7) {
tmp = t_2;
} else if (x <= 12000000.0) {
tmp = eps * Math.cbrt((125.0 * Math.pow(x, 12.0)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, eps) t_0 = Float64((eps ^ 4.0) * Float64(eps + Float64(x * 5.0))) t_1 = Float64(5.0 * Float64(eps * (x ^ 4.0))) t_2 = Float64(eps * Float64(5.0 * (x ^ 4.0))) t_3 = Float64((eps ^ 4.0) * Float64(x * Float64(5.0 + Float64(eps / x)))) tmp = 0.0 if (x <= -4.8e-52) tmp = Float64((x ^ 4.0) * Float64(eps * Float64(5.0 + Float64(10.0 * Float64(eps / x))))); elseif (x <= -4e-78) tmp = t_0; elseif (x <= 1e-270) tmp = eps ^ 5.0; elseif (x <= 1.5e-55) tmp = t_3; elseif (x <= 3e-45) tmp = Float64((eps ^ 5.0) * Float64(1.0 + Float64(5.0 * Float64(x / eps)))); elseif (x <= 1.22e-26) tmp = t_2; elseif (x <= 1.45e-23) tmp = t_3; elseif (x <= 1.15e-18) tmp = t_1; elseif (x <= 1.16e-18) tmp = t_0; elseif (x <= 5e-7) tmp = t_2; elseif (x <= 12000000.0) tmp = Float64(eps * cbrt(Float64(125.0 * (x ^ 12.0)))); else tmp = t_1; end return tmp end
code[x_, eps_] := Block[{t$95$0 = N[(N[Power[eps, 4.0], $MachinePrecision] * N[(eps + N[(x * 5.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(5.0 * N[(eps * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(eps * N[(5.0 * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Power[eps, 4.0], $MachinePrecision] * N[(x * N[(5.0 + N[(eps / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.8e-52], N[(N[Power[x, 4.0], $MachinePrecision] * N[(eps * N[(5.0 + N[(10.0 * N[(eps / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -4e-78], t$95$0, If[LessEqual[x, 1e-270], N[Power[eps, 5.0], $MachinePrecision], If[LessEqual[x, 1.5e-55], t$95$3, If[LessEqual[x, 3e-45], N[(N[Power[eps, 5.0], $MachinePrecision] * N[(1.0 + N[(5.0 * N[(x / eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.22e-26], t$95$2, If[LessEqual[x, 1.45e-23], t$95$3, If[LessEqual[x, 1.15e-18], t$95$1, If[LessEqual[x, 1.16e-18], t$95$0, If[LessEqual[x, 5e-7], t$95$2, If[LessEqual[x, 12000000.0], N[(eps * N[Power[N[(125.0 * N[Power[x, 12.0], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\varepsilon}^{4} \cdot \left(\varepsilon + x \cdot 5\right)\\
t_1 := 5 \cdot \left(\varepsilon \cdot {x}^{4}\right)\\
t_2 := \varepsilon \cdot \left(5 \cdot {x}^{4}\right)\\
t_3 := {\varepsilon}^{4} \cdot \left(x \cdot \left(5 + \frac{\varepsilon}{x}\right)\right)\\
\mathbf{if}\;x \leq -4.8 \cdot 10^{-52}:\\
\;\;\;\;{x}^{4} \cdot \left(\varepsilon \cdot \left(5 + 10 \cdot \frac{\varepsilon}{x}\right)\right)\\
\mathbf{elif}\;x \leq -4 \cdot 10^{-78}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 10^{-270}:\\
\;\;\;\;{\varepsilon}^{5}\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{-55}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \leq 3 \cdot 10^{-45}:\\
\;\;\;\;{\varepsilon}^{5} \cdot \left(1 + 5 \cdot \frac{x}{\varepsilon}\right)\\
\mathbf{elif}\;x \leq 1.22 \cdot 10^{-26}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 1.45 \cdot 10^{-23}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \leq 1.15 \cdot 10^{-18}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.16 \cdot 10^{-18}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 5 \cdot 10^{-7}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 12000000:\\
\;\;\;\;\varepsilon \cdot \sqrt[3]{125 \cdot {x}^{12}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -4.8000000000000003e-52Initial program 46.2%
Taylor expanded in x around -inf 95.1%
+-commutative95.1%
associate-+r+95.1%
mul-1-neg95.1%
unsub-neg95.1%
distribute-rgt1-in95.1%
metadata-eval95.1%
*-commutative95.1%
Simplified95.1%
Taylor expanded in eps around 0 95.1%
*-commutative95.1%
Simplified95.1%
if -4.8000000000000003e-52 < x < -4e-78 or 1.15e-18 < x < 1.16e-18Initial program 99.8%
Taylor expanded in x around 0 97.2%
fma-define97.2%
distribute-lft1-in97.2%
metadata-eval97.2%
Simplified97.2%
Taylor expanded in eps around 0 97.2%
if -4e-78 < x < 1e-270Initial program 100.0%
Taylor expanded in x around 0 100.0%
if 1e-270 < x < 1.50000000000000008e-55 or 1.22e-26 < x < 1.4500000000000001e-23Initial program 100.0%
Taylor expanded in x around 0 99.2%
fma-define99.2%
distribute-lft1-in99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in eps around 0 99.2%
Taylor expanded in x around inf 99.2%
if 1.50000000000000008e-55 < x < 3.00000000000000011e-45Initial program 99.6%
Taylor expanded in eps around inf 100.0%
distribute-lft1-in100.0%
metadata-eval100.0%
Simplified100.0%
if 3.00000000000000011e-45 < x < 1.22e-26 or 1.16e-18 < x < 4.99999999999999977e-7Initial program 35.9%
Taylor expanded in x around inf 99.6%
*-commutative99.6%
distribute-rgt1-in99.6%
metadata-eval99.6%
*-commutative99.6%
associate-*r*100.0%
Simplified100.0%
if 1.4500000000000001e-23 < x < 1.15e-18 or 1.2e7 < x Initial program 20.4%
Taylor expanded in x around inf 99.7%
*-commutative99.7%
distribute-rgt1-in99.7%
metadata-eval99.7%
*-commutative99.7%
associate-*r*99.7%
Simplified99.7%
Taylor expanded in eps around 0 100.0%
if 4.99999999999999977e-7 < x < 1.2e7Initial program 6.0%
Taylor expanded in x around inf 99.2%
*-commutative99.2%
distribute-rgt1-in99.2%
metadata-eval99.2%
*-commutative99.2%
associate-*r*98.8%
Simplified98.8%
add-sqr-sqrt99.0%
sqrt-unprod98.8%
*-commutative98.8%
*-commutative98.8%
swap-sqr98.8%
pow-prod-up99.6%
metadata-eval99.6%
metadata-eval99.6%
Applied egg-rr99.6%
add-cbrt-cube99.6%
add-sqr-sqrt99.2%
pow199.2%
pow1/299.2%
pow-prod-up99.2%
metadata-eval99.2%
Applied egg-rr99.2%
Taylor expanded in x around 0 100.0%
Final simplification99.2%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (* (pow eps 4.0) (+ eps (* x 5.0))))
(t_1 (* eps (* 5.0 (pow x 4.0))))
(t_2 (* (pow eps 4.0) (* x (+ 5.0 (/ eps x))))))
(if (<= x -1.12e-51)
(* (pow x 4.0) (* eps (+ 5.0 (* 10.0 (/ eps x)))))
(if (<= x -4e-78)
t_0
(if (<= x 4e-268)
(pow eps 5.0)
(if (<= x 1e-55)
t_2
(if (<= x 2.15e-45)
(* (pow eps 5.0) (+ 1.0 (* 5.0 (/ x eps))))
(if (<= x 1.22e-26)
t_1
(if (<= x 1.45e-23)
t_2
(if (<= x 1.15e-18)
(* 5.0 (* eps (pow x 4.0)))
(if (<= x 1.16e-18)
t_0
(if (<= x 8e-8)
t_1
(* (pow x 4.0) (* eps 5.0))))))))))))))
double code(double x, double eps) {
double t_0 = pow(eps, 4.0) * (eps + (x * 5.0));
double t_1 = eps * (5.0 * pow(x, 4.0));
double t_2 = pow(eps, 4.0) * (x * (5.0 + (eps / x)));
double tmp;
if (x <= -1.12e-51) {
tmp = pow(x, 4.0) * (eps * (5.0 + (10.0 * (eps / x))));
} else if (x <= -4e-78) {
tmp = t_0;
} else if (x <= 4e-268) {
tmp = pow(eps, 5.0);
} else if (x <= 1e-55) {
tmp = t_2;
} else if (x <= 2.15e-45) {
tmp = pow(eps, 5.0) * (1.0 + (5.0 * (x / eps)));
} else if (x <= 1.22e-26) {
tmp = t_1;
} else if (x <= 1.45e-23) {
tmp = t_2;
} else if (x <= 1.15e-18) {
tmp = 5.0 * (eps * pow(x, 4.0));
} else if (x <= 1.16e-18) {
tmp = t_0;
} else if (x <= 8e-8) {
tmp = t_1;
} else {
tmp = pow(x, 4.0) * (eps * 5.0);
}
return tmp;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = (eps ** 4.0d0) * (eps + (x * 5.0d0))
t_1 = eps * (5.0d0 * (x ** 4.0d0))
t_2 = (eps ** 4.0d0) * (x * (5.0d0 + (eps / x)))
if (x <= (-1.12d-51)) then
tmp = (x ** 4.0d0) * (eps * (5.0d0 + (10.0d0 * (eps / x))))
else if (x <= (-4d-78)) then
tmp = t_0
else if (x <= 4d-268) then
tmp = eps ** 5.0d0
else if (x <= 1d-55) then
tmp = t_2
else if (x <= 2.15d-45) then
tmp = (eps ** 5.0d0) * (1.0d0 + (5.0d0 * (x / eps)))
else if (x <= 1.22d-26) then
tmp = t_1
else if (x <= 1.45d-23) then
tmp = t_2
else if (x <= 1.15d-18) then
tmp = 5.0d0 * (eps * (x ** 4.0d0))
else if (x <= 1.16d-18) then
tmp = t_0
else if (x <= 8d-8) then
tmp = t_1
else
tmp = (x ** 4.0d0) * (eps * 5.0d0)
end if
code = tmp
end function
public static double code(double x, double eps) {
double t_0 = Math.pow(eps, 4.0) * (eps + (x * 5.0));
double t_1 = eps * (5.0 * Math.pow(x, 4.0));
double t_2 = Math.pow(eps, 4.0) * (x * (5.0 + (eps / x)));
double tmp;
if (x <= -1.12e-51) {
tmp = Math.pow(x, 4.0) * (eps * (5.0 + (10.0 * (eps / x))));
} else if (x <= -4e-78) {
tmp = t_0;
} else if (x <= 4e-268) {
tmp = Math.pow(eps, 5.0);
} else if (x <= 1e-55) {
tmp = t_2;
} else if (x <= 2.15e-45) {
tmp = Math.pow(eps, 5.0) * (1.0 + (5.0 * (x / eps)));
} else if (x <= 1.22e-26) {
tmp = t_1;
} else if (x <= 1.45e-23) {
tmp = t_2;
} else if (x <= 1.15e-18) {
tmp = 5.0 * (eps * Math.pow(x, 4.0));
} else if (x <= 1.16e-18) {
tmp = t_0;
} else if (x <= 8e-8) {
tmp = t_1;
} else {
tmp = Math.pow(x, 4.0) * (eps * 5.0);
}
return tmp;
}
def code(x, eps): t_0 = math.pow(eps, 4.0) * (eps + (x * 5.0)) t_1 = eps * (5.0 * math.pow(x, 4.0)) t_2 = math.pow(eps, 4.0) * (x * (5.0 + (eps / x))) tmp = 0 if x <= -1.12e-51: tmp = math.pow(x, 4.0) * (eps * (5.0 + (10.0 * (eps / x)))) elif x <= -4e-78: tmp = t_0 elif x <= 4e-268: tmp = math.pow(eps, 5.0) elif x <= 1e-55: tmp = t_2 elif x <= 2.15e-45: tmp = math.pow(eps, 5.0) * (1.0 + (5.0 * (x / eps))) elif x <= 1.22e-26: tmp = t_1 elif x <= 1.45e-23: tmp = t_2 elif x <= 1.15e-18: tmp = 5.0 * (eps * math.pow(x, 4.0)) elif x <= 1.16e-18: tmp = t_0 elif x <= 8e-8: tmp = t_1 else: tmp = math.pow(x, 4.0) * (eps * 5.0) return tmp
function code(x, eps) t_0 = Float64((eps ^ 4.0) * Float64(eps + Float64(x * 5.0))) t_1 = Float64(eps * Float64(5.0 * (x ^ 4.0))) t_2 = Float64((eps ^ 4.0) * Float64(x * Float64(5.0 + Float64(eps / x)))) tmp = 0.0 if (x <= -1.12e-51) tmp = Float64((x ^ 4.0) * Float64(eps * Float64(5.0 + Float64(10.0 * Float64(eps / x))))); elseif (x <= -4e-78) tmp = t_0; elseif (x <= 4e-268) tmp = eps ^ 5.0; elseif (x <= 1e-55) tmp = t_2; elseif (x <= 2.15e-45) tmp = Float64((eps ^ 5.0) * Float64(1.0 + Float64(5.0 * Float64(x / eps)))); elseif (x <= 1.22e-26) tmp = t_1; elseif (x <= 1.45e-23) tmp = t_2; elseif (x <= 1.15e-18) tmp = Float64(5.0 * Float64(eps * (x ^ 4.0))); elseif (x <= 1.16e-18) tmp = t_0; elseif (x <= 8e-8) tmp = t_1; else tmp = Float64((x ^ 4.0) * Float64(eps * 5.0)); end return tmp end
function tmp_2 = code(x, eps) t_0 = (eps ^ 4.0) * (eps + (x * 5.0)); t_1 = eps * (5.0 * (x ^ 4.0)); t_2 = (eps ^ 4.0) * (x * (5.0 + (eps / x))); tmp = 0.0; if (x <= -1.12e-51) tmp = (x ^ 4.0) * (eps * (5.0 + (10.0 * (eps / x)))); elseif (x <= -4e-78) tmp = t_0; elseif (x <= 4e-268) tmp = eps ^ 5.0; elseif (x <= 1e-55) tmp = t_2; elseif (x <= 2.15e-45) tmp = (eps ^ 5.0) * (1.0 + (5.0 * (x / eps))); elseif (x <= 1.22e-26) tmp = t_1; elseif (x <= 1.45e-23) tmp = t_2; elseif (x <= 1.15e-18) tmp = 5.0 * (eps * (x ^ 4.0)); elseif (x <= 1.16e-18) tmp = t_0; elseif (x <= 8e-8) tmp = t_1; else tmp = (x ^ 4.0) * (eps * 5.0); end tmp_2 = tmp; end
code[x_, eps_] := Block[{t$95$0 = N[(N[Power[eps, 4.0], $MachinePrecision] * N[(eps + N[(x * 5.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(eps * N[(5.0 * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Power[eps, 4.0], $MachinePrecision] * N[(x * N[(5.0 + N[(eps / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.12e-51], N[(N[Power[x, 4.0], $MachinePrecision] * N[(eps * N[(5.0 + N[(10.0 * N[(eps / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -4e-78], t$95$0, If[LessEqual[x, 4e-268], N[Power[eps, 5.0], $MachinePrecision], If[LessEqual[x, 1e-55], t$95$2, If[LessEqual[x, 2.15e-45], N[(N[Power[eps, 5.0], $MachinePrecision] * N[(1.0 + N[(5.0 * N[(x / eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.22e-26], t$95$1, If[LessEqual[x, 1.45e-23], t$95$2, If[LessEqual[x, 1.15e-18], N[(5.0 * N[(eps * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.16e-18], t$95$0, If[LessEqual[x, 8e-8], t$95$1, N[(N[Power[x, 4.0], $MachinePrecision] * N[(eps * 5.0), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\varepsilon}^{4} \cdot \left(\varepsilon + x \cdot 5\right)\\
t_1 := \varepsilon \cdot \left(5 \cdot {x}^{4}\right)\\
t_2 := {\varepsilon}^{4} \cdot \left(x \cdot \left(5 + \frac{\varepsilon}{x}\right)\right)\\
\mathbf{if}\;x \leq -1.12 \cdot 10^{-51}:\\
\;\;\;\;{x}^{4} \cdot \left(\varepsilon \cdot \left(5 + 10 \cdot \frac{\varepsilon}{x}\right)\right)\\
\mathbf{elif}\;x \leq -4 \cdot 10^{-78}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 4 \cdot 10^{-268}:\\
\;\;\;\;{\varepsilon}^{5}\\
\mathbf{elif}\;x \leq 10^{-55}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 2.15 \cdot 10^{-45}:\\
\;\;\;\;{\varepsilon}^{5} \cdot \left(1 + 5 \cdot \frac{x}{\varepsilon}\right)\\
\mathbf{elif}\;x \leq 1.22 \cdot 10^{-26}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.45 \cdot 10^{-23}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 1.15 \cdot 10^{-18}:\\
\;\;\;\;5 \cdot \left(\varepsilon \cdot {x}^{4}\right)\\
\mathbf{elif}\;x \leq 1.16 \cdot 10^{-18}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 8 \cdot 10^{-8}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;{x}^{4} \cdot \left(\varepsilon \cdot 5\right)\\
\end{array}
\end{array}
if x < -1.11999999999999998e-51Initial program 46.2%
Taylor expanded in x around -inf 95.1%
+-commutative95.1%
associate-+r+95.1%
mul-1-neg95.1%
unsub-neg95.1%
distribute-rgt1-in95.1%
metadata-eval95.1%
*-commutative95.1%
Simplified95.1%
Taylor expanded in eps around 0 95.1%
*-commutative95.1%
Simplified95.1%
if -1.11999999999999998e-51 < x < -4e-78 or 1.15e-18 < x < 1.16e-18Initial program 99.8%
Taylor expanded in x around 0 97.2%
fma-define97.2%
distribute-lft1-in97.2%
metadata-eval97.2%
Simplified97.2%
Taylor expanded in eps around 0 97.2%
if -4e-78 < x < 3.99999999999999983e-268Initial program 100.0%
Taylor expanded in x around 0 100.0%
if 3.99999999999999983e-268 < x < 9.99999999999999995e-56 or 1.22e-26 < x < 1.4500000000000001e-23Initial program 100.0%
Taylor expanded in x around 0 99.2%
fma-define99.2%
distribute-lft1-in99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in eps around 0 99.2%
Taylor expanded in x around inf 99.2%
if 9.99999999999999995e-56 < x < 2.1499999999999999e-45Initial program 99.6%
Taylor expanded in eps around inf 100.0%
distribute-lft1-in100.0%
metadata-eval100.0%
Simplified100.0%
if 2.1499999999999999e-45 < x < 1.22e-26 or 1.16e-18 < x < 8.0000000000000002e-8Initial program 35.9%
Taylor expanded in x around inf 99.6%
*-commutative99.6%
distribute-rgt1-in99.6%
metadata-eval99.6%
*-commutative99.6%
associate-*r*100.0%
Simplified100.0%
if 1.4500000000000001e-23 < x < 1.15e-18Initial program 28.5%
Taylor expanded in x around inf 99.6%
*-commutative99.6%
distribute-rgt1-in99.6%
metadata-eval99.6%
*-commutative99.6%
associate-*r*100.0%
Simplified100.0%
Taylor expanded in eps around 0 100.0%
if 8.0000000000000002e-8 < x Initial program 5.4%
Taylor expanded in x around inf 99.5%
distribute-rgt1-in99.5%
metadata-eval99.5%
Simplified99.5%
Final simplification99.1%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (* (pow x 4.0) (* eps 5.0)))
(t_1 (* eps (* 5.0 (pow x 4.0))))
(t_2 (* (pow eps 4.0) (* x (+ 5.0 (/ eps x)))))
(t_3 (* (pow eps 4.0) (+ eps (* x 5.0)))))
(if (<= x -1.5e-52)
t_0
(if (<= x -4e-78)
t_3
(if (<= x 1e-270)
(pow eps 5.0)
(if (<= x 1e-55)
t_2
(if (<= x 1.35e-45)
(* (pow eps 5.0) (+ 1.0 (* 5.0 (/ x eps))))
(if (<= x 1.22e-26)
t_1
(if (<= x 1.45e-23)
t_2
(if (<= x 1.15e-18)
(* 5.0 (* eps (pow x 4.0)))
(if (<= x 1.16e-18) t_3 (if (<= x 3e-9) t_1 t_0))))))))))))
double code(double x, double eps) {
double t_0 = pow(x, 4.0) * (eps * 5.0);
double t_1 = eps * (5.0 * pow(x, 4.0));
double t_2 = pow(eps, 4.0) * (x * (5.0 + (eps / x)));
double t_3 = pow(eps, 4.0) * (eps + (x * 5.0));
double tmp;
if (x <= -1.5e-52) {
tmp = t_0;
} else if (x <= -4e-78) {
tmp = t_3;
} else if (x <= 1e-270) {
tmp = pow(eps, 5.0);
} else if (x <= 1e-55) {
tmp = t_2;
} else if (x <= 1.35e-45) {
tmp = pow(eps, 5.0) * (1.0 + (5.0 * (x / eps)));
} else if (x <= 1.22e-26) {
tmp = t_1;
} else if (x <= 1.45e-23) {
tmp = t_2;
} else if (x <= 1.15e-18) {
tmp = 5.0 * (eps * pow(x, 4.0));
} else if (x <= 1.16e-18) {
tmp = t_3;
} else if (x <= 3e-9) {
tmp = t_1;
} 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) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = (x ** 4.0d0) * (eps * 5.0d0)
t_1 = eps * (5.0d0 * (x ** 4.0d0))
t_2 = (eps ** 4.0d0) * (x * (5.0d0 + (eps / x)))
t_3 = (eps ** 4.0d0) * (eps + (x * 5.0d0))
if (x <= (-1.5d-52)) then
tmp = t_0
else if (x <= (-4d-78)) then
tmp = t_3
else if (x <= 1d-270) then
tmp = eps ** 5.0d0
else if (x <= 1d-55) then
tmp = t_2
else if (x <= 1.35d-45) then
tmp = (eps ** 5.0d0) * (1.0d0 + (5.0d0 * (x / eps)))
else if (x <= 1.22d-26) then
tmp = t_1
else if (x <= 1.45d-23) then
tmp = t_2
else if (x <= 1.15d-18) then
tmp = 5.0d0 * (eps * (x ** 4.0d0))
else if (x <= 1.16d-18) then
tmp = t_3
else if (x <= 3d-9) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double eps) {
double t_0 = Math.pow(x, 4.0) * (eps * 5.0);
double t_1 = eps * (5.0 * Math.pow(x, 4.0));
double t_2 = Math.pow(eps, 4.0) * (x * (5.0 + (eps / x)));
double t_3 = Math.pow(eps, 4.0) * (eps + (x * 5.0));
double tmp;
if (x <= -1.5e-52) {
tmp = t_0;
} else if (x <= -4e-78) {
tmp = t_3;
} else if (x <= 1e-270) {
tmp = Math.pow(eps, 5.0);
} else if (x <= 1e-55) {
tmp = t_2;
} else if (x <= 1.35e-45) {
tmp = Math.pow(eps, 5.0) * (1.0 + (5.0 * (x / eps)));
} else if (x <= 1.22e-26) {
tmp = t_1;
} else if (x <= 1.45e-23) {
tmp = t_2;
} else if (x <= 1.15e-18) {
tmp = 5.0 * (eps * Math.pow(x, 4.0));
} else if (x <= 1.16e-18) {
tmp = t_3;
} else if (x <= 3e-9) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, eps): t_0 = math.pow(x, 4.0) * (eps * 5.0) t_1 = eps * (5.0 * math.pow(x, 4.0)) t_2 = math.pow(eps, 4.0) * (x * (5.0 + (eps / x))) t_3 = math.pow(eps, 4.0) * (eps + (x * 5.0)) tmp = 0 if x <= -1.5e-52: tmp = t_0 elif x <= -4e-78: tmp = t_3 elif x <= 1e-270: tmp = math.pow(eps, 5.0) elif x <= 1e-55: tmp = t_2 elif x <= 1.35e-45: tmp = math.pow(eps, 5.0) * (1.0 + (5.0 * (x / eps))) elif x <= 1.22e-26: tmp = t_1 elif x <= 1.45e-23: tmp = t_2 elif x <= 1.15e-18: tmp = 5.0 * (eps * math.pow(x, 4.0)) elif x <= 1.16e-18: tmp = t_3 elif x <= 3e-9: tmp = t_1 else: tmp = t_0 return tmp
function code(x, eps) t_0 = Float64((x ^ 4.0) * Float64(eps * 5.0)) t_1 = Float64(eps * Float64(5.0 * (x ^ 4.0))) t_2 = Float64((eps ^ 4.0) * Float64(x * Float64(5.0 + Float64(eps / x)))) t_3 = Float64((eps ^ 4.0) * Float64(eps + Float64(x * 5.0))) tmp = 0.0 if (x <= -1.5e-52) tmp = t_0; elseif (x <= -4e-78) tmp = t_3; elseif (x <= 1e-270) tmp = eps ^ 5.0; elseif (x <= 1e-55) tmp = t_2; elseif (x <= 1.35e-45) tmp = Float64((eps ^ 5.0) * Float64(1.0 + Float64(5.0 * Float64(x / eps)))); elseif (x <= 1.22e-26) tmp = t_1; elseif (x <= 1.45e-23) tmp = t_2; elseif (x <= 1.15e-18) tmp = Float64(5.0 * Float64(eps * (x ^ 4.0))); elseif (x <= 1.16e-18) tmp = t_3; elseif (x <= 3e-9) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(x, eps) t_0 = (x ^ 4.0) * (eps * 5.0); t_1 = eps * (5.0 * (x ^ 4.0)); t_2 = (eps ^ 4.0) * (x * (5.0 + (eps / x))); t_3 = (eps ^ 4.0) * (eps + (x * 5.0)); tmp = 0.0; if (x <= -1.5e-52) tmp = t_0; elseif (x <= -4e-78) tmp = t_3; elseif (x <= 1e-270) tmp = eps ^ 5.0; elseif (x <= 1e-55) tmp = t_2; elseif (x <= 1.35e-45) tmp = (eps ^ 5.0) * (1.0 + (5.0 * (x / eps))); elseif (x <= 1.22e-26) tmp = t_1; elseif (x <= 1.45e-23) tmp = t_2; elseif (x <= 1.15e-18) tmp = 5.0 * (eps * (x ^ 4.0)); elseif (x <= 1.16e-18) tmp = t_3; elseif (x <= 3e-9) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[x_, eps_] := Block[{t$95$0 = N[(N[Power[x, 4.0], $MachinePrecision] * N[(eps * 5.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(eps * N[(5.0 * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Power[eps, 4.0], $MachinePrecision] * N[(x * N[(5.0 + N[(eps / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Power[eps, 4.0], $MachinePrecision] * N[(eps + N[(x * 5.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.5e-52], t$95$0, If[LessEqual[x, -4e-78], t$95$3, If[LessEqual[x, 1e-270], N[Power[eps, 5.0], $MachinePrecision], If[LessEqual[x, 1e-55], t$95$2, If[LessEqual[x, 1.35e-45], N[(N[Power[eps, 5.0], $MachinePrecision] * N[(1.0 + N[(5.0 * N[(x / eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.22e-26], t$95$1, If[LessEqual[x, 1.45e-23], t$95$2, If[LessEqual[x, 1.15e-18], N[(5.0 * N[(eps * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.16e-18], t$95$3, If[LessEqual[x, 3e-9], t$95$1, t$95$0]]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{4} \cdot \left(\varepsilon \cdot 5\right)\\
t_1 := \varepsilon \cdot \left(5 \cdot {x}^{4}\right)\\
t_2 := {\varepsilon}^{4} \cdot \left(x \cdot \left(5 + \frac{\varepsilon}{x}\right)\right)\\
t_3 := {\varepsilon}^{4} \cdot \left(\varepsilon + x \cdot 5\right)\\
\mathbf{if}\;x \leq -1.5 \cdot 10^{-52}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -4 \cdot 10^{-78}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \leq 10^{-270}:\\
\;\;\;\;{\varepsilon}^{5}\\
\mathbf{elif}\;x \leq 10^{-55}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{-45}:\\
\;\;\;\;{\varepsilon}^{5} \cdot \left(1 + 5 \cdot \frac{x}{\varepsilon}\right)\\
\mathbf{elif}\;x \leq 1.22 \cdot 10^{-26}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.45 \cdot 10^{-23}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 1.15 \cdot 10^{-18}:\\
\;\;\;\;5 \cdot \left(\varepsilon \cdot {x}^{4}\right)\\
\mathbf{elif}\;x \leq 1.16 \cdot 10^{-18}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \leq 3 \cdot 10^{-9}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.5e-52 or 2.99999999999999998e-9 < x Initial program 37.1%
Taylor expanded in x around inf 94.8%
distribute-rgt1-in94.8%
metadata-eval94.8%
Simplified94.8%
if -1.5e-52 < x < -4e-78 or 1.15e-18 < x < 1.16e-18Initial program 99.8%
Taylor expanded in x around 0 97.2%
fma-define97.2%
distribute-lft1-in97.2%
metadata-eval97.2%
Simplified97.2%
Taylor expanded in eps around 0 97.2%
if -4e-78 < x < 1e-270Initial program 100.0%
Taylor expanded in x around 0 100.0%
if 1e-270 < x < 9.99999999999999995e-56 or 1.22e-26 < x < 1.4500000000000001e-23Initial program 100.0%
Taylor expanded in x around 0 99.2%
fma-define99.2%
distribute-lft1-in99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in eps around 0 99.2%
Taylor expanded in x around inf 99.2%
if 9.99999999999999995e-56 < x < 1.34999999999999992e-45Initial program 99.6%
Taylor expanded in eps around inf 100.0%
distribute-lft1-in100.0%
metadata-eval100.0%
Simplified100.0%
if 1.34999999999999992e-45 < x < 1.22e-26 or 1.16e-18 < x < 2.99999999999999998e-9Initial program 35.9%
Taylor expanded in x around inf 99.6%
*-commutative99.6%
distribute-rgt1-in99.6%
metadata-eval99.6%
*-commutative99.6%
associate-*r*100.0%
Simplified100.0%
if 1.4500000000000001e-23 < x < 1.15e-18Initial program 28.5%
Taylor expanded in x around inf 99.6%
*-commutative99.6%
distribute-rgt1-in99.6%
metadata-eval99.6%
*-commutative99.6%
associate-*r*100.0%
Simplified100.0%
Taylor expanded in eps around 0 100.0%
Final simplification99.0%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (* eps (* 5.0 (pow x 4.0))))
(t_1 (* (pow x 4.0) (* eps 5.0)))
(t_2 (* (pow eps 4.0) (* x (+ 5.0 (/ eps x)))))
(t_3 (* (pow eps 4.0) (+ eps (* x 5.0)))))
(if (<= x -1.6e-52)
t_1
(if (<= x -4e-78)
t_3
(if (<= x 4e-268)
(pow eps 5.0)
(if (<= x 1e-55)
t_2
(if (<= x 6.8e-45)
t_3
(if (<= x 1.22e-26)
t_0
(if (<= x 1.45e-23)
t_2
(if (<= x 1.15e-18)
(* 5.0 (* eps (pow x 4.0)))
(if (<= x 1.16e-18)
t_3
(if (<= x 3.05e-9) t_0 t_1))))))))))))
double code(double x, double eps) {
double t_0 = eps * (5.0 * pow(x, 4.0));
double t_1 = pow(x, 4.0) * (eps * 5.0);
double t_2 = pow(eps, 4.0) * (x * (5.0 + (eps / x)));
double t_3 = pow(eps, 4.0) * (eps + (x * 5.0));
double tmp;
if (x <= -1.6e-52) {
tmp = t_1;
} else if (x <= -4e-78) {
tmp = t_3;
} else if (x <= 4e-268) {
tmp = pow(eps, 5.0);
} else if (x <= 1e-55) {
tmp = t_2;
} else if (x <= 6.8e-45) {
tmp = t_3;
} else if (x <= 1.22e-26) {
tmp = t_0;
} else if (x <= 1.45e-23) {
tmp = t_2;
} else if (x <= 1.15e-18) {
tmp = 5.0 * (eps * pow(x, 4.0));
} else if (x <= 1.16e-18) {
tmp = t_3;
} else if (x <= 3.05e-9) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = eps * (5.0d0 * (x ** 4.0d0))
t_1 = (x ** 4.0d0) * (eps * 5.0d0)
t_2 = (eps ** 4.0d0) * (x * (5.0d0 + (eps / x)))
t_3 = (eps ** 4.0d0) * (eps + (x * 5.0d0))
if (x <= (-1.6d-52)) then
tmp = t_1
else if (x <= (-4d-78)) then
tmp = t_3
else if (x <= 4d-268) then
tmp = eps ** 5.0d0
else if (x <= 1d-55) then
tmp = t_2
else if (x <= 6.8d-45) then
tmp = t_3
else if (x <= 1.22d-26) then
tmp = t_0
else if (x <= 1.45d-23) then
tmp = t_2
else if (x <= 1.15d-18) then
tmp = 5.0d0 * (eps * (x ** 4.0d0))
else if (x <= 1.16d-18) then
tmp = t_3
else if (x <= 3.05d-9) then
tmp = t_0
else
tmp = t_1
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 t_1 = Math.pow(x, 4.0) * (eps * 5.0);
double t_2 = Math.pow(eps, 4.0) * (x * (5.0 + (eps / x)));
double t_3 = Math.pow(eps, 4.0) * (eps + (x * 5.0));
double tmp;
if (x <= -1.6e-52) {
tmp = t_1;
} else if (x <= -4e-78) {
tmp = t_3;
} else if (x <= 4e-268) {
tmp = Math.pow(eps, 5.0);
} else if (x <= 1e-55) {
tmp = t_2;
} else if (x <= 6.8e-45) {
tmp = t_3;
} else if (x <= 1.22e-26) {
tmp = t_0;
} else if (x <= 1.45e-23) {
tmp = t_2;
} else if (x <= 1.15e-18) {
tmp = 5.0 * (eps * Math.pow(x, 4.0));
} else if (x <= 1.16e-18) {
tmp = t_3;
} else if (x <= 3.05e-9) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, eps): t_0 = eps * (5.0 * math.pow(x, 4.0)) t_1 = math.pow(x, 4.0) * (eps * 5.0) t_2 = math.pow(eps, 4.0) * (x * (5.0 + (eps / x))) t_3 = math.pow(eps, 4.0) * (eps + (x * 5.0)) tmp = 0 if x <= -1.6e-52: tmp = t_1 elif x <= -4e-78: tmp = t_3 elif x <= 4e-268: tmp = math.pow(eps, 5.0) elif x <= 1e-55: tmp = t_2 elif x <= 6.8e-45: tmp = t_3 elif x <= 1.22e-26: tmp = t_0 elif x <= 1.45e-23: tmp = t_2 elif x <= 1.15e-18: tmp = 5.0 * (eps * math.pow(x, 4.0)) elif x <= 1.16e-18: tmp = t_3 elif x <= 3.05e-9: tmp = t_0 else: tmp = t_1 return tmp
function code(x, eps) t_0 = Float64(eps * Float64(5.0 * (x ^ 4.0))) t_1 = Float64((x ^ 4.0) * Float64(eps * 5.0)) t_2 = Float64((eps ^ 4.0) * Float64(x * Float64(5.0 + Float64(eps / x)))) t_3 = Float64((eps ^ 4.0) * Float64(eps + Float64(x * 5.0))) tmp = 0.0 if (x <= -1.6e-52) tmp = t_1; elseif (x <= -4e-78) tmp = t_3; elseif (x <= 4e-268) tmp = eps ^ 5.0; elseif (x <= 1e-55) tmp = t_2; elseif (x <= 6.8e-45) tmp = t_3; elseif (x <= 1.22e-26) tmp = t_0; elseif (x <= 1.45e-23) tmp = t_2; elseif (x <= 1.15e-18) tmp = Float64(5.0 * Float64(eps * (x ^ 4.0))); elseif (x <= 1.16e-18) tmp = t_3; elseif (x <= 3.05e-9) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, eps) t_0 = eps * (5.0 * (x ^ 4.0)); t_1 = (x ^ 4.0) * (eps * 5.0); t_2 = (eps ^ 4.0) * (x * (5.0 + (eps / x))); t_3 = (eps ^ 4.0) * (eps + (x * 5.0)); tmp = 0.0; if (x <= -1.6e-52) tmp = t_1; elseif (x <= -4e-78) tmp = t_3; elseif (x <= 4e-268) tmp = eps ^ 5.0; elseif (x <= 1e-55) tmp = t_2; elseif (x <= 6.8e-45) tmp = t_3; elseif (x <= 1.22e-26) tmp = t_0; elseif (x <= 1.45e-23) tmp = t_2; elseif (x <= 1.15e-18) tmp = 5.0 * (eps * (x ^ 4.0)); elseif (x <= 1.16e-18) tmp = t_3; elseif (x <= 3.05e-9) tmp = t_0; else tmp = t_1; 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]}, Block[{t$95$1 = N[(N[Power[x, 4.0], $MachinePrecision] * N[(eps * 5.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Power[eps, 4.0], $MachinePrecision] * N[(x * N[(5.0 + N[(eps / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Power[eps, 4.0], $MachinePrecision] * N[(eps + N[(x * 5.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.6e-52], t$95$1, If[LessEqual[x, -4e-78], t$95$3, If[LessEqual[x, 4e-268], N[Power[eps, 5.0], $MachinePrecision], If[LessEqual[x, 1e-55], t$95$2, If[LessEqual[x, 6.8e-45], t$95$3, If[LessEqual[x, 1.22e-26], t$95$0, If[LessEqual[x, 1.45e-23], t$95$2, If[LessEqual[x, 1.15e-18], N[(5.0 * N[(eps * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.16e-18], t$95$3, If[LessEqual[x, 3.05e-9], t$95$0, t$95$1]]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \varepsilon \cdot \left(5 \cdot {x}^{4}\right)\\
t_1 := {x}^{4} \cdot \left(\varepsilon \cdot 5\right)\\
t_2 := {\varepsilon}^{4} \cdot \left(x \cdot \left(5 + \frac{\varepsilon}{x}\right)\right)\\
t_3 := {\varepsilon}^{4} \cdot \left(\varepsilon + x \cdot 5\right)\\
\mathbf{if}\;x \leq -1.6 \cdot 10^{-52}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -4 \cdot 10^{-78}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \leq 4 \cdot 10^{-268}:\\
\;\;\;\;{\varepsilon}^{5}\\
\mathbf{elif}\;x \leq 10^{-55}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 6.8 \cdot 10^{-45}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \leq 1.22 \cdot 10^{-26}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.45 \cdot 10^{-23}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 1.15 \cdot 10^{-18}:\\
\;\;\;\;5 \cdot \left(\varepsilon \cdot {x}^{4}\right)\\
\mathbf{elif}\;x \leq 1.16 \cdot 10^{-18}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \leq 3.05 \cdot 10^{-9}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.60000000000000005e-52 or 3.05e-9 < x Initial program 37.1%
Taylor expanded in x around inf 94.8%
distribute-rgt1-in94.8%
metadata-eval94.8%
Simplified94.8%
if -1.60000000000000005e-52 < x < -4e-78 or 9.99999999999999995e-56 < x < 6.80000000000000008e-45 or 1.15e-18 < x < 1.16e-18Initial program 99.8%
Taylor expanded in x around 0 97.8%
fma-define97.8%
distribute-lft1-in97.8%
metadata-eval97.8%
Simplified97.8%
Taylor expanded in eps around 0 97.8%
if -4e-78 < x < 3.99999999999999983e-268Initial program 100.0%
Taylor expanded in x around 0 100.0%
if 3.99999999999999983e-268 < x < 9.99999999999999995e-56 or 1.22e-26 < x < 1.4500000000000001e-23Initial program 100.0%
Taylor expanded in x around 0 99.2%
fma-define99.2%
distribute-lft1-in99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in eps around 0 99.2%
Taylor expanded in x around inf 99.2%
if 6.80000000000000008e-45 < x < 1.22e-26 or 1.16e-18 < x < 3.05e-9Initial program 35.9%
Taylor expanded in x around inf 99.6%
*-commutative99.6%
distribute-rgt1-in99.6%
metadata-eval99.6%
*-commutative99.6%
associate-*r*100.0%
Simplified100.0%
if 1.4500000000000001e-23 < x < 1.15e-18Initial program 28.5%
Taylor expanded in x around inf 99.6%
*-commutative99.6%
distribute-rgt1-in99.6%
metadata-eval99.6%
*-commutative99.6%
associate-*r*100.0%
Simplified100.0%
Taylor expanded in eps around 0 100.0%
Final simplification99.0%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (* (pow x 4.0) (* eps 5.0)))
(t_1 (* eps (* 5.0 (pow x 4.0))))
(t_2 (* (pow eps 4.0) (+ eps (* x 5.0)))))
(if (<= x -1.2e-51)
t_0
(if (<= x -4e-78)
t_2
(if (<= x 1e-270)
(pow eps 5.0)
(if (<= x 1.65e-45)
t_2
(if (<= x 1.22e-26)
t_1
(if (<= x 1.45e-23)
t_2
(if (<= x 1.15e-18)
(* 5.0 (* eps (pow x 4.0)))
(if (<= x 1.16e-18) t_2 (if (<= x 1.05e-7) t_1 t_0)))))))))))
double code(double x, double eps) {
double t_0 = pow(x, 4.0) * (eps * 5.0);
double t_1 = eps * (5.0 * pow(x, 4.0));
double t_2 = pow(eps, 4.0) * (eps + (x * 5.0));
double tmp;
if (x <= -1.2e-51) {
tmp = t_0;
} else if (x <= -4e-78) {
tmp = t_2;
} else if (x <= 1e-270) {
tmp = pow(eps, 5.0);
} else if (x <= 1.65e-45) {
tmp = t_2;
} else if (x <= 1.22e-26) {
tmp = t_1;
} else if (x <= 1.45e-23) {
tmp = t_2;
} else if (x <= 1.15e-18) {
tmp = 5.0 * (eps * pow(x, 4.0));
} else if (x <= 1.16e-18) {
tmp = t_2;
} else if (x <= 1.05e-7) {
tmp = t_1;
} 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = (x ** 4.0d0) * (eps * 5.0d0)
t_1 = eps * (5.0d0 * (x ** 4.0d0))
t_2 = (eps ** 4.0d0) * (eps + (x * 5.0d0))
if (x <= (-1.2d-51)) then
tmp = t_0
else if (x <= (-4d-78)) then
tmp = t_2
else if (x <= 1d-270) then
tmp = eps ** 5.0d0
else if (x <= 1.65d-45) then
tmp = t_2
else if (x <= 1.22d-26) then
tmp = t_1
else if (x <= 1.45d-23) then
tmp = t_2
else if (x <= 1.15d-18) then
tmp = 5.0d0 * (eps * (x ** 4.0d0))
else if (x <= 1.16d-18) then
tmp = t_2
else if (x <= 1.05d-7) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double eps) {
double t_0 = Math.pow(x, 4.0) * (eps * 5.0);
double t_1 = eps * (5.0 * Math.pow(x, 4.0));
double t_2 = Math.pow(eps, 4.0) * (eps + (x * 5.0));
double tmp;
if (x <= -1.2e-51) {
tmp = t_0;
} else if (x <= -4e-78) {
tmp = t_2;
} else if (x <= 1e-270) {
tmp = Math.pow(eps, 5.0);
} else if (x <= 1.65e-45) {
tmp = t_2;
} else if (x <= 1.22e-26) {
tmp = t_1;
} else if (x <= 1.45e-23) {
tmp = t_2;
} else if (x <= 1.15e-18) {
tmp = 5.0 * (eps * Math.pow(x, 4.0));
} else if (x <= 1.16e-18) {
tmp = t_2;
} else if (x <= 1.05e-7) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, eps): t_0 = math.pow(x, 4.0) * (eps * 5.0) t_1 = eps * (5.0 * math.pow(x, 4.0)) t_2 = math.pow(eps, 4.0) * (eps + (x * 5.0)) tmp = 0 if x <= -1.2e-51: tmp = t_0 elif x <= -4e-78: tmp = t_2 elif x <= 1e-270: tmp = math.pow(eps, 5.0) elif x <= 1.65e-45: tmp = t_2 elif x <= 1.22e-26: tmp = t_1 elif x <= 1.45e-23: tmp = t_2 elif x <= 1.15e-18: tmp = 5.0 * (eps * math.pow(x, 4.0)) elif x <= 1.16e-18: tmp = t_2 elif x <= 1.05e-7: tmp = t_1 else: tmp = t_0 return tmp
function code(x, eps) t_0 = Float64((x ^ 4.0) * Float64(eps * 5.0)) t_1 = Float64(eps * Float64(5.0 * (x ^ 4.0))) t_2 = Float64((eps ^ 4.0) * Float64(eps + Float64(x * 5.0))) tmp = 0.0 if (x <= -1.2e-51) tmp = t_0; elseif (x <= -4e-78) tmp = t_2; elseif (x <= 1e-270) tmp = eps ^ 5.0; elseif (x <= 1.65e-45) tmp = t_2; elseif (x <= 1.22e-26) tmp = t_1; elseif (x <= 1.45e-23) tmp = t_2; elseif (x <= 1.15e-18) tmp = Float64(5.0 * Float64(eps * (x ^ 4.0))); elseif (x <= 1.16e-18) tmp = t_2; elseif (x <= 1.05e-7) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(x, eps) t_0 = (x ^ 4.0) * (eps * 5.0); t_1 = eps * (5.0 * (x ^ 4.0)); t_2 = (eps ^ 4.0) * (eps + (x * 5.0)); tmp = 0.0; if (x <= -1.2e-51) tmp = t_0; elseif (x <= -4e-78) tmp = t_2; elseif (x <= 1e-270) tmp = eps ^ 5.0; elseif (x <= 1.65e-45) tmp = t_2; elseif (x <= 1.22e-26) tmp = t_1; elseif (x <= 1.45e-23) tmp = t_2; elseif (x <= 1.15e-18) tmp = 5.0 * (eps * (x ^ 4.0)); elseif (x <= 1.16e-18) tmp = t_2; elseif (x <= 1.05e-7) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[x_, eps_] := Block[{t$95$0 = N[(N[Power[x, 4.0], $MachinePrecision] * N[(eps * 5.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(eps * N[(5.0 * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Power[eps, 4.0], $MachinePrecision] * N[(eps + N[(x * 5.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.2e-51], t$95$0, If[LessEqual[x, -4e-78], t$95$2, If[LessEqual[x, 1e-270], N[Power[eps, 5.0], $MachinePrecision], If[LessEqual[x, 1.65e-45], t$95$2, If[LessEqual[x, 1.22e-26], t$95$1, If[LessEqual[x, 1.45e-23], t$95$2, If[LessEqual[x, 1.15e-18], N[(5.0 * N[(eps * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.16e-18], t$95$2, If[LessEqual[x, 1.05e-7], t$95$1, t$95$0]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{4} \cdot \left(\varepsilon \cdot 5\right)\\
t_1 := \varepsilon \cdot \left(5 \cdot {x}^{4}\right)\\
t_2 := {\varepsilon}^{4} \cdot \left(\varepsilon + x \cdot 5\right)\\
\mathbf{if}\;x \leq -1.2 \cdot 10^{-51}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -4 \cdot 10^{-78}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 10^{-270}:\\
\;\;\;\;{\varepsilon}^{5}\\
\mathbf{elif}\;x \leq 1.65 \cdot 10^{-45}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 1.22 \cdot 10^{-26}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.45 \cdot 10^{-23}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 1.15 \cdot 10^{-18}:\\
\;\;\;\;5 \cdot \left(\varepsilon \cdot {x}^{4}\right)\\
\mathbf{elif}\;x \leq 1.16 \cdot 10^{-18}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 1.05 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.2e-51 or 1.05e-7 < x Initial program 37.1%
Taylor expanded in x around inf 94.8%
distribute-rgt1-in94.8%
metadata-eval94.8%
Simplified94.8%
if -1.2e-51 < x < -4e-78 or 1e-270 < x < 1.65e-45 or 1.22e-26 < x < 1.4500000000000001e-23 or 1.15e-18 < x < 1.16e-18Initial program 99.9%
Taylor expanded in x around 0 99.0%
fma-define99.0%
distribute-lft1-in99.0%
metadata-eval99.0%
Simplified99.0%
Taylor expanded in eps around 0 99.0%
if -4e-78 < x < 1e-270Initial program 100.0%
Taylor expanded in x around 0 100.0%
if 1.65e-45 < x < 1.22e-26 or 1.16e-18 < x < 1.05e-7Initial program 35.9%
Taylor expanded in x around inf 99.6%
*-commutative99.6%
distribute-rgt1-in99.6%
metadata-eval99.6%
*-commutative99.6%
associate-*r*100.0%
Simplified100.0%
if 1.4500000000000001e-23 < x < 1.15e-18Initial program 28.5%
Taylor expanded in x around inf 99.6%
*-commutative99.6%
distribute-rgt1-in99.6%
metadata-eval99.6%
*-commutative99.6%
associate-*r*100.0%
Simplified100.0%
Taylor expanded in eps around 0 100.0%
Final simplification99.0%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (* eps (* 5.0 (pow x 4.0)))) (t_1 (* (pow x 4.0) (* eps 5.0))))
(if (<= x -9e-53)
t_1
(if (<= x 6.8e-45)
(pow eps 5.0)
(if (<= x 1.22e-26)
t_0
(if (<= x 1.45e-23)
(pow eps 5.0)
(if (<= x 1.15e-18)
(* 5.0 (* eps (pow x 4.0)))
(if (<= x 1.16e-18)
(pow eps 5.0)
(if (<= x 5e-10) t_0 t_1)))))))))
double code(double x, double eps) {
double t_0 = eps * (5.0 * pow(x, 4.0));
double t_1 = pow(x, 4.0) * (eps * 5.0);
double tmp;
if (x <= -9e-53) {
tmp = t_1;
} else if (x <= 6.8e-45) {
tmp = pow(eps, 5.0);
} else if (x <= 1.22e-26) {
tmp = t_0;
} else if (x <= 1.45e-23) {
tmp = pow(eps, 5.0);
} else if (x <= 1.15e-18) {
tmp = 5.0 * (eps * pow(x, 4.0));
} else if (x <= 1.16e-18) {
tmp = pow(eps, 5.0);
} else if (x <= 5e-10) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = eps * (5.0d0 * (x ** 4.0d0))
t_1 = (x ** 4.0d0) * (eps * 5.0d0)
if (x <= (-9d-53)) then
tmp = t_1
else if (x <= 6.8d-45) then
tmp = eps ** 5.0d0
else if (x <= 1.22d-26) then
tmp = t_0
else if (x <= 1.45d-23) then
tmp = eps ** 5.0d0
else if (x <= 1.15d-18) then
tmp = 5.0d0 * (eps * (x ** 4.0d0))
else if (x <= 1.16d-18) then
tmp = eps ** 5.0d0
else if (x <= 5d-10) then
tmp = t_0
else
tmp = t_1
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 t_1 = Math.pow(x, 4.0) * (eps * 5.0);
double tmp;
if (x <= -9e-53) {
tmp = t_1;
} else if (x <= 6.8e-45) {
tmp = Math.pow(eps, 5.0);
} else if (x <= 1.22e-26) {
tmp = t_0;
} else if (x <= 1.45e-23) {
tmp = Math.pow(eps, 5.0);
} else if (x <= 1.15e-18) {
tmp = 5.0 * (eps * Math.pow(x, 4.0));
} else if (x <= 1.16e-18) {
tmp = Math.pow(eps, 5.0);
} else if (x <= 5e-10) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, eps): t_0 = eps * (5.0 * math.pow(x, 4.0)) t_1 = math.pow(x, 4.0) * (eps * 5.0) tmp = 0 if x <= -9e-53: tmp = t_1 elif x <= 6.8e-45: tmp = math.pow(eps, 5.0) elif x <= 1.22e-26: tmp = t_0 elif x <= 1.45e-23: tmp = math.pow(eps, 5.0) elif x <= 1.15e-18: tmp = 5.0 * (eps * math.pow(x, 4.0)) elif x <= 1.16e-18: tmp = math.pow(eps, 5.0) elif x <= 5e-10: tmp = t_0 else: tmp = t_1 return tmp
function code(x, eps) t_0 = Float64(eps * Float64(5.0 * (x ^ 4.0))) t_1 = Float64((x ^ 4.0) * Float64(eps * 5.0)) tmp = 0.0 if (x <= -9e-53) tmp = t_1; elseif (x <= 6.8e-45) tmp = eps ^ 5.0; elseif (x <= 1.22e-26) tmp = t_0; elseif (x <= 1.45e-23) tmp = eps ^ 5.0; elseif (x <= 1.15e-18) tmp = Float64(5.0 * Float64(eps * (x ^ 4.0))); elseif (x <= 1.16e-18) tmp = eps ^ 5.0; elseif (x <= 5e-10) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, eps) t_0 = eps * (5.0 * (x ^ 4.0)); t_1 = (x ^ 4.0) * (eps * 5.0); tmp = 0.0; if (x <= -9e-53) tmp = t_1; elseif (x <= 6.8e-45) tmp = eps ^ 5.0; elseif (x <= 1.22e-26) tmp = t_0; elseif (x <= 1.45e-23) tmp = eps ^ 5.0; elseif (x <= 1.15e-18) tmp = 5.0 * (eps * (x ^ 4.0)); elseif (x <= 1.16e-18) tmp = eps ^ 5.0; elseif (x <= 5e-10) tmp = t_0; else tmp = t_1; 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]}, Block[{t$95$1 = N[(N[Power[x, 4.0], $MachinePrecision] * N[(eps * 5.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -9e-53], t$95$1, If[LessEqual[x, 6.8e-45], N[Power[eps, 5.0], $MachinePrecision], If[LessEqual[x, 1.22e-26], t$95$0, If[LessEqual[x, 1.45e-23], N[Power[eps, 5.0], $MachinePrecision], If[LessEqual[x, 1.15e-18], N[(5.0 * N[(eps * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.16e-18], N[Power[eps, 5.0], $MachinePrecision], If[LessEqual[x, 5e-10], t$95$0, t$95$1]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \varepsilon \cdot \left(5 \cdot {x}^{4}\right)\\
t_1 := {x}^{4} \cdot \left(\varepsilon \cdot 5\right)\\
\mathbf{if}\;x \leq -9 \cdot 10^{-53}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 6.8 \cdot 10^{-45}:\\
\;\;\;\;{\varepsilon}^{5}\\
\mathbf{elif}\;x \leq 1.22 \cdot 10^{-26}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.45 \cdot 10^{-23}:\\
\;\;\;\;{\varepsilon}^{5}\\
\mathbf{elif}\;x \leq 1.15 \cdot 10^{-18}:\\
\;\;\;\;5 \cdot \left(\varepsilon \cdot {x}^{4}\right)\\
\mathbf{elif}\;x \leq 1.16 \cdot 10^{-18}:\\
\;\;\;\;{\varepsilon}^{5}\\
\mathbf{elif}\;x \leq 5 \cdot 10^{-10}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -8.9999999999999997e-53 or 5.00000000000000031e-10 < x Initial program 37.1%
Taylor expanded in x around inf 94.8%
distribute-rgt1-in94.8%
metadata-eval94.8%
Simplified94.8%
if -8.9999999999999997e-53 < x < 6.80000000000000008e-45 or 1.22e-26 < x < 1.4500000000000001e-23 or 1.15e-18 < x < 1.16e-18Initial program 100.0%
Taylor expanded in x around 0 99.0%
if 6.80000000000000008e-45 < x < 1.22e-26 or 1.16e-18 < x < 5.00000000000000031e-10Initial program 35.9%
Taylor expanded in x around inf 99.6%
*-commutative99.6%
distribute-rgt1-in99.6%
metadata-eval99.6%
*-commutative99.6%
associate-*r*100.0%
Simplified100.0%
if 1.4500000000000001e-23 < x < 1.15e-18Initial program 28.5%
Taylor expanded in x around inf 99.6%
*-commutative99.6%
distribute-rgt1-in99.6%
metadata-eval99.6%
*-commutative99.6%
associate-*r*100.0%
Simplified100.0%
Taylor expanded in eps around 0 100.0%
Final simplification98.6%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (* eps (* 5.0 (pow x 4.0)))) (t_1 (* 5.0 (* eps (pow x 4.0)))))
(if (<= x -6.8e-53)
t_0
(if (<= x 1.4e-45)
(pow eps 5.0)
(if (<= x 1.22e-26)
t_0
(if (<= x 1.45e-23)
(pow eps 5.0)
(if (<= x 1.15e-18)
t_1
(if (<= x 1.16e-18)
(pow eps 5.0)
(if (<= x 14000000.0) t_0 t_1)))))))))
double code(double x, double eps) {
double t_0 = eps * (5.0 * pow(x, 4.0));
double t_1 = 5.0 * (eps * pow(x, 4.0));
double tmp;
if (x <= -6.8e-53) {
tmp = t_0;
} else if (x <= 1.4e-45) {
tmp = pow(eps, 5.0);
} else if (x <= 1.22e-26) {
tmp = t_0;
} else if (x <= 1.45e-23) {
tmp = pow(eps, 5.0);
} else if (x <= 1.15e-18) {
tmp = t_1;
} else if (x <= 1.16e-18) {
tmp = pow(eps, 5.0);
} else if (x <= 14000000.0) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = eps * (5.0d0 * (x ** 4.0d0))
t_1 = 5.0d0 * (eps * (x ** 4.0d0))
if (x <= (-6.8d-53)) then
tmp = t_0
else if (x <= 1.4d-45) then
tmp = eps ** 5.0d0
else if (x <= 1.22d-26) then
tmp = t_0
else if (x <= 1.45d-23) then
tmp = eps ** 5.0d0
else if (x <= 1.15d-18) then
tmp = t_1
else if (x <= 1.16d-18) then
tmp = eps ** 5.0d0
else if (x <= 14000000.0d0) then
tmp = t_0
else
tmp = t_1
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 t_1 = 5.0 * (eps * Math.pow(x, 4.0));
double tmp;
if (x <= -6.8e-53) {
tmp = t_0;
} else if (x <= 1.4e-45) {
tmp = Math.pow(eps, 5.0);
} else if (x <= 1.22e-26) {
tmp = t_0;
} else if (x <= 1.45e-23) {
tmp = Math.pow(eps, 5.0);
} else if (x <= 1.15e-18) {
tmp = t_1;
} else if (x <= 1.16e-18) {
tmp = Math.pow(eps, 5.0);
} else if (x <= 14000000.0) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, eps): t_0 = eps * (5.0 * math.pow(x, 4.0)) t_1 = 5.0 * (eps * math.pow(x, 4.0)) tmp = 0 if x <= -6.8e-53: tmp = t_0 elif x <= 1.4e-45: tmp = math.pow(eps, 5.0) elif x <= 1.22e-26: tmp = t_0 elif x <= 1.45e-23: tmp = math.pow(eps, 5.0) elif x <= 1.15e-18: tmp = t_1 elif x <= 1.16e-18: tmp = math.pow(eps, 5.0) elif x <= 14000000.0: tmp = t_0 else: tmp = t_1 return tmp
function code(x, eps) t_0 = Float64(eps * Float64(5.0 * (x ^ 4.0))) t_1 = Float64(5.0 * Float64(eps * (x ^ 4.0))) tmp = 0.0 if (x <= -6.8e-53) tmp = t_0; elseif (x <= 1.4e-45) tmp = eps ^ 5.0; elseif (x <= 1.22e-26) tmp = t_0; elseif (x <= 1.45e-23) tmp = eps ^ 5.0; elseif (x <= 1.15e-18) tmp = t_1; elseif (x <= 1.16e-18) tmp = eps ^ 5.0; elseif (x <= 14000000.0) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, eps) t_0 = eps * (5.0 * (x ^ 4.0)); t_1 = 5.0 * (eps * (x ^ 4.0)); tmp = 0.0; if (x <= -6.8e-53) tmp = t_0; elseif (x <= 1.4e-45) tmp = eps ^ 5.0; elseif (x <= 1.22e-26) tmp = t_0; elseif (x <= 1.45e-23) tmp = eps ^ 5.0; elseif (x <= 1.15e-18) tmp = t_1; elseif (x <= 1.16e-18) tmp = eps ^ 5.0; elseif (x <= 14000000.0) tmp = t_0; else tmp = t_1; 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]}, Block[{t$95$1 = N[(5.0 * N[(eps * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6.8e-53], t$95$0, If[LessEqual[x, 1.4e-45], N[Power[eps, 5.0], $MachinePrecision], If[LessEqual[x, 1.22e-26], t$95$0, If[LessEqual[x, 1.45e-23], N[Power[eps, 5.0], $MachinePrecision], If[LessEqual[x, 1.15e-18], t$95$1, If[LessEqual[x, 1.16e-18], N[Power[eps, 5.0], $MachinePrecision], If[LessEqual[x, 14000000.0], t$95$0, t$95$1]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \varepsilon \cdot \left(5 \cdot {x}^{4}\right)\\
t_1 := 5 \cdot \left(\varepsilon \cdot {x}^{4}\right)\\
\mathbf{if}\;x \leq -6.8 \cdot 10^{-53}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{-45}:\\
\;\;\;\;{\varepsilon}^{5}\\
\mathbf{elif}\;x \leq 1.22 \cdot 10^{-26}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.45 \cdot 10^{-23}:\\
\;\;\;\;{\varepsilon}^{5}\\
\mathbf{elif}\;x \leq 1.15 \cdot 10^{-18}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.16 \cdot 10^{-18}:\\
\;\;\;\;{\varepsilon}^{5}\\
\mathbf{elif}\;x \leq 14000000:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -6.8e-53 or 1.4000000000000001e-45 < x < 1.22e-26 or 1.16e-18 < x < 1.4e7Initial program 38.9%
Taylor expanded in x around inf 95.5%
*-commutative95.5%
distribute-rgt1-in95.5%
metadata-eval95.5%
*-commutative95.5%
associate-*r*95.5%
Simplified95.5%
if -6.8e-53 < x < 1.4000000000000001e-45 or 1.22e-26 < x < 1.4500000000000001e-23 or 1.15e-18 < x < 1.16e-18Initial program 100.0%
Taylor expanded in x around 0 99.0%
if 1.4500000000000001e-23 < x < 1.15e-18 or 1.4e7 < x Initial program 20.4%
Taylor expanded in x around inf 99.7%
*-commutative99.7%
distribute-rgt1-in99.7%
metadata-eval99.7%
*-commutative99.7%
associate-*r*99.7%
Simplified99.7%
Taylor expanded in eps around 0 100.0%
(FPCore (x eps)
:precision binary64
(if (or (<= x -5.7e-52)
(and (not (<= x 1.32e-45))
(or (<= x 1.22e-26)
(and (not (<= x 1.45e-23))
(or (<= x 1.15e-18) (not (<= x 1.16e-18)))))))
(* 5.0 (* eps (pow x 4.0)))
(pow eps 5.0)))
double code(double x, double eps) {
double tmp;
if ((x <= -5.7e-52) || (!(x <= 1.32e-45) && ((x <= 1.22e-26) || (!(x <= 1.45e-23) && ((x <= 1.15e-18) || !(x <= 1.16e-18)))))) {
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 <= (-5.7d-52)) .or. (.not. (x <= 1.32d-45)) .and. (x <= 1.22d-26) .or. (.not. (x <= 1.45d-23)) .and. (x <= 1.15d-18) .or. (.not. (x <= 1.16d-18))) 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 <= -5.7e-52) || (!(x <= 1.32e-45) && ((x <= 1.22e-26) || (!(x <= 1.45e-23) && ((x <= 1.15e-18) || !(x <= 1.16e-18)))))) {
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 <= -5.7e-52) or (not (x <= 1.32e-45) and ((x <= 1.22e-26) or (not (x <= 1.45e-23) and ((x <= 1.15e-18) or not (x <= 1.16e-18))))): 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 <= -5.7e-52) || (!(x <= 1.32e-45) && ((x <= 1.22e-26) || (!(x <= 1.45e-23) && ((x <= 1.15e-18) || !(x <= 1.16e-18)))))) 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 <= -5.7e-52) || (~((x <= 1.32e-45)) && ((x <= 1.22e-26) || (~((x <= 1.45e-23)) && ((x <= 1.15e-18) || ~((x <= 1.16e-18))))))) tmp = 5.0 * (eps * (x ^ 4.0)); else tmp = eps ^ 5.0; end tmp_2 = tmp; end
code[x_, eps_] := If[Or[LessEqual[x, -5.7e-52], And[N[Not[LessEqual[x, 1.32e-45]], $MachinePrecision], Or[LessEqual[x, 1.22e-26], And[N[Not[LessEqual[x, 1.45e-23]], $MachinePrecision], Or[LessEqual[x, 1.15e-18], N[Not[LessEqual[x, 1.16e-18]], $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 -5.7 \cdot 10^{-52} \lor \neg \left(x \leq 1.32 \cdot 10^{-45}\right) \land \left(x \leq 1.22 \cdot 10^{-26} \lor \neg \left(x \leq 1.45 \cdot 10^{-23}\right) \land \left(x \leq 1.15 \cdot 10^{-18} \lor \neg \left(x \leq 1.16 \cdot 10^{-18}\right)\right)\right):\\
\;\;\;\;5 \cdot \left(\varepsilon \cdot {x}^{4}\right)\\
\mathbf{else}:\\
\;\;\;\;{\varepsilon}^{5}\\
\end{array}
\end{array}
if x < -5.6999999999999997e-52 or 1.32000000000000005e-45 < x < 1.22e-26 or 1.4500000000000001e-23 < x < 1.15e-18 or 1.16e-18 < x Initial program 36.0%
Taylor expanded in x around inf 96.2%
*-commutative96.2%
distribute-rgt1-in96.2%
metadata-eval96.2%
*-commutative96.2%
associate-*r*96.2%
Simplified96.2%
Taylor expanded in eps around 0 96.0%
if -5.6999999999999997e-52 < x < 1.32000000000000005e-45 or 1.22e-26 < x < 1.4500000000000001e-23 or 1.15e-18 < x < 1.16e-18Initial program 100.0%
Taylor expanded in x around 0 99.0%
Final simplification98.5%
(FPCore (x eps) :precision binary64 (pow eps 5.0))
double code(double x, double eps) {
return pow(eps, 5.0);
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
code = eps ** 5.0d0
end function
public static double code(double x, double eps) {
return Math.pow(eps, 5.0);
}
def code(x, eps): return math.pow(eps, 5.0)
function code(x, eps) return eps ^ 5.0 end
function tmp = code(x, eps) tmp = eps ^ 5.0; end
code[x_, eps_] := N[Power[eps, 5.0], $MachinePrecision]
\begin{array}{l}
\\
{\varepsilon}^{5}
\end{array}
Initial program 90.5%
Taylor expanded in x around 0 89.1%
herbie shell --seed 2024096
(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)))