{\left(x + \varepsilon\right)}^{5} - {x}^{5}
\begin{array}{l}
t_0 := \left(x \cdot x\right) \cdot \left(\left(10 \cdot \left(\varepsilon \cdot \varepsilon\right)\right) \cdot \left(x + \varepsilon\right)\right)\\
\mathbf{if}\;x \leq -6.091962211134749 \cdot 10^{-61}:\\
\;\;\;\;\mathsf{fma}\left(\varepsilon, 5 \cdot {x}^{4}, t_0\right)\\
\mathbf{elif}\;x \leq 1.1002273010802258 \cdot 10^{-50}:\\
\;\;\;\;{\varepsilon}^{5} + \mathsf{fma}\left(5, x \cdot {\varepsilon}^{4}, t_0\right)\\
\mathbf{else}:\\
\;\;\;\;5 \cdot \left(\varepsilon \cdot {x}^{4}\right) + 10 \cdot \left({\varepsilon}^{2} \cdot {x}^{3}\right)\\
\end{array}
(FPCore (x eps) :precision binary64 (- (pow (+ x eps) 5.0) (pow x 5.0)))
(FPCore (x eps)
:precision binary64
(let* ((t_0 (* (* x x) (* (* 10.0 (* eps eps)) (+ x eps)))))
(if (<= x -6.091962211134749e-61)
(fma eps (* 5.0 (pow x 4.0)) t_0)
(if (<= x 1.1002273010802258e-50)
(+ (pow eps 5.0) (fma 5.0 (* x (pow eps 4.0)) t_0))
(+
(* 5.0 (* eps (pow x 4.0)))
(* 10.0 (* (pow eps 2.0) (pow x 3.0))))))))double code(double x, double eps) {
return pow((x + eps), 5.0) - pow(x, 5.0);
}
double code(double x, double eps) {
double t_0 = (x * x) * ((10.0 * (eps * eps)) * (x + eps));
double tmp;
if (x <= -6.091962211134749e-61) {
tmp = fma(eps, (5.0 * pow(x, 4.0)), t_0);
} else if (x <= 1.1002273010802258e-50) {
tmp = pow(eps, 5.0) + fma(5.0, (x * pow(eps, 4.0)), t_0);
} else {
tmp = (5.0 * (eps * pow(x, 4.0))) + (10.0 * (pow(eps, 2.0) * pow(x, 3.0)));
}
return tmp;
}



Bits error versus x



Bits error versus eps
if x < -6.0919622111347492e-61Initial program 33.2
Taylor expanded in x around inf 5.7
Simplified5.6
if -6.0919622111347492e-61 < x < 1.10022730108022582e-50Initial program 0.1
Taylor expanded in x around 0 0.1
Simplified0.1
if 1.10022730108022582e-50 < x Initial program 38.1
Taylor expanded in x around inf 5.5
Final simplification1.2
herbie shell --seed 2022125
(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)))