Average Error: 7.8 → 1.5
Time: 6.8s
Precision: binary64
Cost: 14216
\[\left(-1000000000 \leq x \land x \leq 1000000000\right) \land \left(-1 \leq \varepsilon \land \varepsilon \leq 1\right)\]
\[{\left(x + \varepsilon\right)}^{5} - {x}^{5} \]
\[\begin{array}{l} t_0 := \mathsf{fma}\left(\varepsilon \cdot 5, {x}^{4}, \left(x \cdot x\right) \cdot \left(\left(10 \cdot \left(\varepsilon \cdot \varepsilon\right)\right) \cdot \left(x + \varepsilon\right)\right)\right)\\ \mathbf{if}\;x \leq -2.8 \cdot 10^{-39}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 6.2 \cdot 10^{-66}:\\ \;\;\;\;{\varepsilon}^{5} + x \cdot \left(5 \cdot {\varepsilon}^{4}\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
(FPCore (x eps) :precision binary64 (- (pow (+ x eps) 5.0) (pow x 5.0)))
(FPCore (x eps)
 :precision binary64
 (let* ((t_0
         (fma
          (* eps 5.0)
          (pow x 4.0)
          (* (* x x) (* (* 10.0 (* eps eps)) (+ x eps))))))
   (if (<= x -2.8e-39)
     t_0
     (if (<= x 6.2e-66) (+ (pow eps 5.0) (* x (* 5.0 (pow eps 4.0)))) t_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 = fma((eps * 5.0), pow(x, 4.0), ((x * x) * ((10.0 * (eps * eps)) * (x + eps))));
	double tmp;
	if (x <= -2.8e-39) {
		tmp = t_0;
	} else if (x <= 6.2e-66) {
		tmp = pow(eps, 5.0) + (x * (5.0 * pow(eps, 4.0)));
	} else {
		tmp = t_0;
	}
	return tmp;
}
function code(x, eps)
	return Float64((Float64(x + eps) ^ 5.0) - (x ^ 5.0))
end
function code(x, eps)
	t_0 = fma(Float64(eps * 5.0), (x ^ 4.0), Float64(Float64(x * x) * Float64(Float64(10.0 * Float64(eps * eps)) * Float64(x + eps))))
	tmp = 0.0
	if (x <= -2.8e-39)
		tmp = t_0;
	elseif (x <= 6.2e-66)
		tmp = Float64((eps ^ 5.0) + Float64(x * Float64(5.0 * (eps ^ 4.0))));
	else
		tmp = t_0;
	end
	return tmp
end
code[x_, eps_] := N[(N[Power[N[(x + eps), $MachinePrecision], 5.0], $MachinePrecision] - N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision]
code[x_, eps_] := Block[{t$95$0 = N[(N[(eps * 5.0), $MachinePrecision] * N[Power[x, 4.0], $MachinePrecision] + N[(N[(x * x), $MachinePrecision] * N[(N[(10.0 * N[(eps * eps), $MachinePrecision]), $MachinePrecision] * N[(x + eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.8e-39], t$95$0, If[LessEqual[x, 6.2e-66], N[(N[Power[eps, 5.0], $MachinePrecision] + N[(x * N[(5.0 * N[Power[eps, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
{\left(x + \varepsilon\right)}^{5} - {x}^{5}
\begin{array}{l}
t_0 := \mathsf{fma}\left(\varepsilon \cdot 5, {x}^{4}, \left(x \cdot x\right) \cdot \left(\left(10 \cdot \left(\varepsilon \cdot \varepsilon\right)\right) \cdot \left(x + \varepsilon\right)\right)\right)\\
\mathbf{if}\;x \leq -2.8 \cdot 10^{-39}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;x \leq 6.2 \cdot 10^{-66}:\\
\;\;\;\;{\varepsilon}^{5} + x \cdot \left(5 \cdot {\varepsilon}^{4}\right)\\

\mathbf{else}:\\
\;\;\;\;t_0\\


\end{array}

Error

Derivation

  1. Split input into 2 regimes
  2. if x < -2.8000000000000001e-39 or 6.1999999999999995e-66 < x

    1. Initial program 37.1

      \[{\left(x + \varepsilon\right)}^{5} - {x}^{5} \]
    2. Taylor expanded in x around -inf 5.1

      \[\leadsto \color{blue}{-1 \cdot \left(\left(-1 \cdot \left(2 \cdot {\varepsilon}^{2} + 4 \cdot {\varepsilon}^{2}\right) + -4 \cdot {\varepsilon}^{2}\right) \cdot {x}^{3}\right) + \left(\left(4 \cdot \varepsilon + \varepsilon\right) \cdot {x}^{4} + \left(\left(2 \cdot {\varepsilon}^{2} + 4 \cdot {\varepsilon}^{2}\right) \cdot \varepsilon + 4 \cdot {\varepsilon}^{3}\right) \cdot {x}^{2}\right)} \]
    3. Simplified5.1

      \[\leadsto \color{blue}{\mathsf{fma}\left(\varepsilon \cdot 5, {x}^{4}, \left(x \cdot x\right) \cdot \left({\varepsilon}^{3} \cdot 10 - \left(\left(\varepsilon \cdot \varepsilon\right) \cdot -10\right) \cdot x\right)\right)} \]
      Proof
      (fma.f64 (*.f64 eps 5) (pow.f64 x 4) (*.f64 (*.f64 x x) (-.f64 (*.f64 (pow.f64 eps 3) 10) (*.f64 (*.f64 (*.f64 eps eps) -10) x)))): 0 points increase in error, 0 points decrease in error
      (fma.f64 (Rewrite<= *-commutative_binary64 (*.f64 5 eps)) (pow.f64 x 4) (*.f64 (*.f64 x x) (-.f64 (*.f64 (pow.f64 eps 3) 10) (*.f64 (*.f64 (*.f64 eps eps) -10) x)))): 0 points increase in error, 0 points decrease in error
      (fma.f64 (*.f64 (Rewrite<= metadata-eval (+.f64 4 1)) eps) (pow.f64 x 4) (*.f64 (*.f64 x x) (-.f64 (*.f64 (pow.f64 eps 3) 10) (*.f64 (*.f64 (*.f64 eps eps) -10) x)))): 0 points increase in error, 0 points decrease in error
      (fma.f64 (Rewrite<= distribute-lft1-in_binary64 (+.f64 (*.f64 4 eps) eps)) (pow.f64 x 4) (*.f64 (*.f64 x x) (-.f64 (*.f64 (pow.f64 eps 3) 10) (*.f64 (*.f64 (*.f64 eps eps) -10) x)))): 0 points increase in error, 0 points decrease in error
      (fma.f64 (+.f64 (*.f64 4 eps) eps) (pow.f64 x 4) (*.f64 (Rewrite<= unpow2_binary64 (pow.f64 x 2)) (-.f64 (*.f64 (pow.f64 eps 3) 10) (*.f64 (*.f64 (*.f64 eps eps) -10) x)))): 0 points increase in error, 0 points decrease in error
      (fma.f64 (+.f64 (*.f64 4 eps) eps) (pow.f64 x 4) (*.f64 (pow.f64 x 2) (-.f64 (*.f64 (pow.f64 eps 3) (Rewrite<= metadata-eval (+.f64 6 4))) (*.f64 (*.f64 (*.f64 eps eps) -10) x)))): 0 points increase in error, 0 points decrease in error
      (fma.f64 (+.f64 (*.f64 4 eps) eps) (pow.f64 x 4) (*.f64 (pow.f64 x 2) (-.f64 (*.f64 (pow.f64 eps 3) (+.f64 (Rewrite<= metadata-eval (+.f64 2 4)) 4)) (*.f64 (*.f64 (*.f64 eps eps) -10) x)))): 0 points increase in error, 0 points decrease in error
      (fma.f64 (+.f64 (*.f64 4 eps) eps) (pow.f64 x 4) (*.f64 (pow.f64 x 2) (-.f64 (Rewrite<= distribute-lft-out_binary64 (+.f64 (*.f64 (pow.f64 eps 3) (+.f64 2 4)) (*.f64 (pow.f64 eps 3) 4))) (*.f64 (*.f64 (*.f64 eps eps) -10) x)))): 1 points increase in error, 1 points decrease in error
      (fma.f64 (+.f64 (*.f64 4 eps) eps) (pow.f64 x 4) (*.f64 (pow.f64 x 2) (-.f64 (+.f64 (*.f64 (Rewrite=> cube-mult_binary64 (*.f64 eps (*.f64 eps eps))) (+.f64 2 4)) (*.f64 (pow.f64 eps 3) 4)) (*.f64 (*.f64 (*.f64 eps eps) -10) x)))): 2 points increase in error, 2 points decrease in error
      (fma.f64 (+.f64 (*.f64 4 eps) eps) (pow.f64 x 4) (*.f64 (pow.f64 x 2) (-.f64 (+.f64 (*.f64 (*.f64 eps (Rewrite<= unpow2_binary64 (pow.f64 eps 2))) (+.f64 2 4)) (*.f64 (pow.f64 eps 3) 4)) (*.f64 (*.f64 (*.f64 eps eps) -10) x)))): 0 points increase in error, 0 points decrease in error
      (fma.f64 (+.f64 (*.f64 4 eps) eps) (pow.f64 x 4) (*.f64 (pow.f64 x 2) (-.f64 (+.f64 (Rewrite<= associate-*r*_binary64 (*.f64 eps (*.f64 (pow.f64 eps 2) (+.f64 2 4)))) (*.f64 (pow.f64 eps 3) 4)) (*.f64 (*.f64 (*.f64 eps eps) -10) x)))): 3 points increase in error, 0 points decrease in error
      (fma.f64 (+.f64 (*.f64 4 eps) eps) (pow.f64 x 4) (*.f64 (pow.f64 x 2) (-.f64 (+.f64 (*.f64 eps (Rewrite<= distribute-rgt-out_binary64 (+.f64 (*.f64 2 (pow.f64 eps 2)) (*.f64 4 (pow.f64 eps 2))))) (*.f64 (pow.f64 eps 3) 4)) (*.f64 (*.f64 (*.f64 eps eps) -10) x)))): 0 points increase in error, 0 points decrease in error
      (fma.f64 (+.f64 (*.f64 4 eps) eps) (pow.f64 x 4) (*.f64 (pow.f64 x 2) (-.f64 (+.f64 (Rewrite<= *-commutative_binary64 (*.f64 (+.f64 (*.f64 2 (pow.f64 eps 2)) (*.f64 4 (pow.f64 eps 2))) eps)) (*.f64 (pow.f64 eps 3) 4)) (*.f64 (*.f64 (*.f64 eps eps) -10) x)))): 0 points increase in error, 0 points decrease in error
      (fma.f64 (+.f64 (*.f64 4 eps) eps) (pow.f64 x 4) (*.f64 (pow.f64 x 2) (-.f64 (+.f64 (*.f64 (+.f64 (*.f64 2 (pow.f64 eps 2)) (*.f64 4 (pow.f64 eps 2))) eps) (Rewrite<= *-commutative_binary64 (*.f64 4 (pow.f64 eps 3)))) (*.f64 (*.f64 (*.f64 eps eps) -10) x)))): 0 points increase in error, 0 points decrease in error
      (fma.f64 (+.f64 (*.f64 4 eps) eps) (pow.f64 x 4) (*.f64 (pow.f64 x 2) (-.f64 (+.f64 (*.f64 (+.f64 (*.f64 2 (pow.f64 eps 2)) (*.f64 4 (pow.f64 eps 2))) eps) (*.f64 4 (pow.f64 eps 3))) (*.f64 (*.f64 (Rewrite<= unpow2_binary64 (pow.f64 eps 2)) -10) x)))): 0 points increase in error, 0 points decrease in error
      (fma.f64 (+.f64 (*.f64 4 eps) eps) (pow.f64 x 4) (*.f64 (pow.f64 x 2) (-.f64 (+.f64 (*.f64 (+.f64 (*.f64 2 (pow.f64 eps 2)) (*.f64 4 (pow.f64 eps 2))) eps) (*.f64 4 (pow.f64 eps 3))) (*.f64 (*.f64 (pow.f64 eps 2) (Rewrite<= metadata-eval (-.f64 -4 6))) x)))): 0 points increase in error, 0 points decrease in error
      (fma.f64 (+.f64 (*.f64 4 eps) eps) (pow.f64 x 4) (*.f64 (pow.f64 x 2) (-.f64 (+.f64 (*.f64 (+.f64 (*.f64 2 (pow.f64 eps 2)) (*.f64 4 (pow.f64 eps 2))) eps) (*.f64 4 (pow.f64 eps 3))) (*.f64 (*.f64 (pow.f64 eps 2) (-.f64 -4 (Rewrite<= metadata-eval (+.f64 2 4)))) x)))): 0 points increase in error, 0 points decrease in error
      (fma.f64 (+.f64 (*.f64 4 eps) eps) (pow.f64 x 4) (*.f64 (pow.f64 x 2) (-.f64 (+.f64 (*.f64 (+.f64 (*.f64 2 (pow.f64 eps 2)) (*.f64 4 (pow.f64 eps 2))) eps) (*.f64 4 (pow.f64 eps 3))) (*.f64 (Rewrite<= distribute-rgt-out--_binary64 (-.f64 (*.f64 -4 (pow.f64 eps 2)) (*.f64 (+.f64 2 4) (pow.f64 eps 2)))) x)))): 0 points increase in error, 0 points decrease in error
      (fma.f64 (+.f64 (*.f64 4 eps) eps) (pow.f64 x 4) (*.f64 (pow.f64 x 2) (-.f64 (+.f64 (*.f64 (+.f64 (*.f64 2 (pow.f64 eps 2)) (*.f64 4 (pow.f64 eps 2))) eps) (*.f64 4 (pow.f64 eps 3))) (*.f64 (-.f64 (*.f64 -4 (pow.f64 eps 2)) (Rewrite<= *-commutative_binary64 (*.f64 (pow.f64 eps 2) (+.f64 2 4)))) x)))): 0 points increase in error, 0 points decrease in error
      (fma.f64 (+.f64 (*.f64 4 eps) eps) (pow.f64 x 4) (*.f64 (pow.f64 x 2) (-.f64 (+.f64 (*.f64 (+.f64 (*.f64 2 (pow.f64 eps 2)) (*.f64 4 (pow.f64 eps 2))) eps) (*.f64 4 (pow.f64 eps 3))) (*.f64 (-.f64 (*.f64 -4 (pow.f64 eps 2)) (Rewrite<= distribute-rgt-out_binary64 (+.f64 (*.f64 2 (pow.f64 eps 2)) (*.f64 4 (pow.f64 eps 2))))) x)))): 0 points increase in error, 0 points decrease in error
      (fma.f64 (+.f64 (*.f64 4 eps) eps) (pow.f64 x 4) (*.f64 (pow.f64 x 2) (-.f64 (+.f64 (*.f64 (+.f64 (*.f64 2 (pow.f64 eps 2)) (*.f64 4 (pow.f64 eps 2))) eps) (*.f64 4 (pow.f64 eps 3))) (*.f64 (Rewrite<= unsub-neg_binary64 (+.f64 (*.f64 -4 (pow.f64 eps 2)) (neg.f64 (+.f64 (*.f64 2 (pow.f64 eps 2)) (*.f64 4 (pow.f64 eps 2)))))) x)))): 0 points increase in error, 0 points decrease in error
      (fma.f64 (+.f64 (*.f64 4 eps) eps) (pow.f64 x 4) (*.f64 (pow.f64 x 2) (-.f64 (+.f64 (*.f64 (+.f64 (*.f64 2 (pow.f64 eps 2)) (*.f64 4 (pow.f64 eps 2))) eps) (*.f64 4 (pow.f64 eps 3))) (*.f64 (+.f64 (*.f64 -4 (pow.f64 eps 2)) (Rewrite<= mul-1-neg_binary64 (*.f64 -1 (+.f64 (*.f64 2 (pow.f64 eps 2)) (*.f64 4 (pow.f64 eps 2)))))) x)))): 0 points increase in error, 0 points decrease in error
      (fma.f64 (+.f64 (*.f64 4 eps) eps) (pow.f64 x 4) (*.f64 (pow.f64 x 2) (-.f64 (+.f64 (*.f64 (+.f64 (*.f64 2 (pow.f64 eps 2)) (*.f64 4 (pow.f64 eps 2))) eps) (*.f64 4 (pow.f64 eps 3))) (*.f64 (Rewrite<= +-commutative_binary64 (+.f64 (*.f64 -1 (+.f64 (*.f64 2 (pow.f64 eps 2)) (*.f64 4 (pow.f64 eps 2)))) (*.f64 -4 (pow.f64 eps 2)))) x)))): 0 points increase in error, 0 points decrease in error
      (fma.f64 (+.f64 (*.f64 4 eps) eps) (pow.f64 x 4) (Rewrite<= distribute-rgt-out--_binary64 (-.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 2 (pow.f64 eps 2)) (*.f64 4 (pow.f64 eps 2))) eps) (*.f64 4 (pow.f64 eps 3))) (pow.f64 x 2)) (*.f64 (*.f64 (+.f64 (*.f64 -1 (+.f64 (*.f64 2 (pow.f64 eps 2)) (*.f64 4 (pow.f64 eps 2)))) (*.f64 -4 (pow.f64 eps 2))) x) (pow.f64 x 2))))): 0 points increase in error, 0 points decrease in error
      (fma.f64 (+.f64 (*.f64 4 eps) eps) (pow.f64 x 4) (-.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 2 (pow.f64 eps 2)) (*.f64 4 (pow.f64 eps 2))) eps) (*.f64 4 (pow.f64 eps 3))) (pow.f64 x 2)) (Rewrite<= associate-*r*_binary64 (*.f64 (+.f64 (*.f64 -1 (+.f64 (*.f64 2 (pow.f64 eps 2)) (*.f64 4 (pow.f64 eps 2)))) (*.f64 -4 (pow.f64 eps 2))) (*.f64 x (pow.f64 x 2)))))): 0 points increase in error, 0 points decrease in error
      (fma.f64 (+.f64 (*.f64 4 eps) eps) (pow.f64 x 4) (-.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 2 (pow.f64 eps 2)) (*.f64 4 (pow.f64 eps 2))) eps) (*.f64 4 (pow.f64 eps 3))) (pow.f64 x 2)) (*.f64 (+.f64 (*.f64 -1 (+.f64 (*.f64 2 (pow.f64 eps 2)) (*.f64 4 (pow.f64 eps 2)))) (*.f64 -4 (pow.f64 eps 2))) (*.f64 x (Rewrite=> unpow2_binary64 (*.f64 x x)))))): 0 points increase in error, 0 points decrease in error
      (fma.f64 (+.f64 (*.f64 4 eps) eps) (pow.f64 x 4) (-.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 2 (pow.f64 eps 2)) (*.f64 4 (pow.f64 eps 2))) eps) (*.f64 4 (pow.f64 eps 3))) (pow.f64 x 2)) (*.f64 (+.f64 (*.f64 -1 (+.f64 (*.f64 2 (pow.f64 eps 2)) (*.f64 4 (pow.f64 eps 2)))) (*.f64 -4 (pow.f64 eps 2))) (Rewrite<= cube-mult_binary64 (pow.f64 x 3))))): 0 points increase in error, 0 points decrease in error
      (fma.f64 (+.f64 (*.f64 4 eps) eps) (pow.f64 x 4) (Rewrite<= unsub-neg_binary64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 2 (pow.f64 eps 2)) (*.f64 4 (pow.f64 eps 2))) eps) (*.f64 4 (pow.f64 eps 3))) (pow.f64 x 2)) (neg.f64 (*.f64 (+.f64 (*.f64 -1 (+.f64 (*.f64 2 (pow.f64 eps 2)) (*.f64 4 (pow.f64 eps 2)))) (*.f64 -4 (pow.f64 eps 2))) (pow.f64 x 3)))))): 0 points increase in error, 0 points decrease in error
      (fma.f64 (+.f64 (*.f64 4 eps) eps) (pow.f64 x 4) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 2 (pow.f64 eps 2)) (*.f64 4 (pow.f64 eps 2))) eps) (*.f64 4 (pow.f64 eps 3))) (pow.f64 x 2)) (Rewrite<= mul-1-neg_binary64 (*.f64 -1 (*.f64 (+.f64 (*.f64 -1 (+.f64 (*.f64 2 (pow.f64 eps 2)) (*.f64 4 (pow.f64 eps 2)))) (*.f64 -4 (pow.f64 eps 2))) (pow.f64 x 3)))))): 0 points increase in error, 0 points decrease in error
      (fma.f64 (+.f64 (*.f64 4 eps) eps) (pow.f64 x 4) (Rewrite<= +-commutative_binary64 (+.f64 (*.f64 -1 (*.f64 (+.f64 (*.f64 -1 (+.f64 (*.f64 2 (pow.f64 eps 2)) (*.f64 4 (pow.f64 eps 2)))) (*.f64 -4 (pow.f64 eps 2))) (pow.f64 x 3))) (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 2 (pow.f64 eps 2)) (*.f64 4 (pow.f64 eps 2))) eps) (*.f64 4 (pow.f64 eps 3))) (pow.f64 x 2))))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= fma-def_binary64 (+.f64 (*.f64 (+.f64 (*.f64 4 eps) eps) (pow.f64 x 4)) (+.f64 (*.f64 -1 (*.f64 (+.f64 (*.f64 -1 (+.f64 (*.f64 2 (pow.f64 eps 2)) (*.f64 4 (pow.f64 eps 2)))) (*.f64 -4 (pow.f64 eps 2))) (pow.f64 x 3))) (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 2 (pow.f64 eps 2)) (*.f64 4 (pow.f64 eps 2))) eps) (*.f64 4 (pow.f64 eps 3))) (pow.f64 x 2))))): 2 points increase in error, 0 points decrease in error
      (Rewrite=> associate-+r+_binary64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 4 eps) eps) (pow.f64 x 4)) (*.f64 -1 (*.f64 (+.f64 (*.f64 -1 (+.f64 (*.f64 2 (pow.f64 eps 2)) (*.f64 4 (pow.f64 eps 2)))) (*.f64 -4 (pow.f64 eps 2))) (pow.f64 x 3)))) (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 2 (pow.f64 eps 2)) (*.f64 4 (pow.f64 eps 2))) eps) (*.f64 4 (pow.f64 eps 3))) (pow.f64 x 2)))): 1 points increase in error, 0 points decrease in error
      (+.f64 (Rewrite<= +-commutative_binary64 (+.f64 (*.f64 -1 (*.f64 (+.f64 (*.f64 -1 (+.f64 (*.f64 2 (pow.f64 eps 2)) (*.f64 4 (pow.f64 eps 2)))) (*.f64 -4 (pow.f64 eps 2))) (pow.f64 x 3))) (*.f64 (+.f64 (*.f64 4 eps) eps) (pow.f64 x 4)))) (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 2 (pow.f64 eps 2)) (*.f64 4 (pow.f64 eps 2))) eps) (*.f64 4 (pow.f64 eps 3))) (pow.f64 x 2))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate-+r+_binary64 (+.f64 (*.f64 -1 (*.f64 (+.f64 (*.f64 -1 (+.f64 (*.f64 2 (pow.f64 eps 2)) (*.f64 4 (pow.f64 eps 2)))) (*.f64 -4 (pow.f64 eps 2))) (pow.f64 x 3))) (+.f64 (*.f64 (+.f64 (*.f64 4 eps) eps) (pow.f64 x 4)) (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 2 (pow.f64 eps 2)) (*.f64 4 (pow.f64 eps 2))) eps) (*.f64 4 (pow.f64 eps 3))) (pow.f64 x 2))))): 0 points increase in error, 0 points decrease in error
    4. Taylor expanded in x around 0 5.1

      \[\leadsto \mathsf{fma}\left(\varepsilon \cdot 5, {x}^{4}, \color{blue}{10 \cdot \left({\varepsilon}^{2} \cdot {x}^{3}\right) + 10 \cdot \left({\varepsilon}^{3} \cdot {x}^{2}\right)}\right) \]
    5. Simplified5.1

      \[\leadsto \mathsf{fma}\left(\varepsilon \cdot 5, {x}^{4}, \color{blue}{\left(x \cdot x\right) \cdot \left(\left(10 \cdot \left(\varepsilon \cdot \varepsilon\right)\right) \cdot \left(\varepsilon + x\right)\right)}\right) \]
      Proof
      (*.f64 (*.f64 x x) (*.f64 (*.f64 10 (*.f64 eps eps)) (+.f64 eps x))): 0 points increase in error, 0 points decrease in error
      (*.f64 (*.f64 x x) (Rewrite<= distribute-rgt-out_binary64 (+.f64 (*.f64 eps (*.f64 10 (*.f64 eps eps))) (*.f64 x (*.f64 10 (*.f64 eps eps)))))): 0 points increase in error, 1 points decrease in error
      (*.f64 (*.f64 x x) (+.f64 (*.f64 eps (Rewrite=> *-commutative_binary64 (*.f64 (*.f64 eps eps) 10))) (*.f64 x (*.f64 10 (*.f64 eps eps))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (*.f64 x x) (+.f64 (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 eps (*.f64 eps eps)) 10)) (*.f64 x (*.f64 10 (*.f64 eps eps))))): 3 points increase in error, 3 points decrease in error
      (*.f64 (*.f64 x x) (+.f64 (*.f64 (Rewrite<= cube-mult_binary64 (pow.f64 eps 3)) 10) (*.f64 x (*.f64 10 (*.f64 eps eps))))): 4 points increase in error, 2 points decrease in error
      (*.f64 (*.f64 x x) (Rewrite<= +-commutative_binary64 (+.f64 (*.f64 x (*.f64 10 (*.f64 eps eps))) (*.f64 (pow.f64 eps 3) 10)))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= distribute-rgt-out_binary64 (+.f64 (*.f64 (*.f64 x (*.f64 10 (*.f64 eps eps))) (*.f64 x x)) (*.f64 (*.f64 (pow.f64 eps 3) 10) (*.f64 x x)))): 2 points increase in error, 1 points decrease in error
      (+.f64 (*.f64 (Rewrite=> *-commutative_binary64 (*.f64 (*.f64 10 (*.f64 eps eps)) x)) (*.f64 x x)) (*.f64 (*.f64 (pow.f64 eps 3) 10) (*.f64 x x))): 0 points increase in error, 0 points decrease in error
      (+.f64 (Rewrite=> associate-*l*_binary64 (*.f64 (*.f64 10 (*.f64 eps eps)) (*.f64 x (*.f64 x x)))) (*.f64 (*.f64 (pow.f64 eps 3) 10) (*.f64 x x))): 1 points increase in error, 2 points decrease in error
      (+.f64 (*.f64 (*.f64 10 (*.f64 eps eps)) (Rewrite<= cube-mult_binary64 (pow.f64 x 3))) (*.f64 (*.f64 (pow.f64 eps 3) 10) (*.f64 x x))): 2 points increase in error, 1 points decrease in error
      (+.f64 (Rewrite<= associate-*r*_binary64 (*.f64 10 (*.f64 (*.f64 eps eps) (pow.f64 x 3)))) (*.f64 (*.f64 (pow.f64 eps 3) 10) (*.f64 x x))): 6 points increase in error, 3 points decrease in error
      (+.f64 (*.f64 10 (*.f64 (Rewrite<= unpow2_binary64 (pow.f64 eps 2)) (pow.f64 x 3))) (*.f64 (*.f64 (pow.f64 eps 3) 10) (*.f64 x x))): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 10 (*.f64 (pow.f64 eps 2) (pow.f64 x 3))) (*.f64 (Rewrite<= *-commutative_binary64 (*.f64 10 (pow.f64 eps 3))) (*.f64 x x))): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 10 (*.f64 (pow.f64 eps 2) (pow.f64 x 3))) (Rewrite<= associate-*r*_binary64 (*.f64 10 (*.f64 (pow.f64 eps 3) (*.f64 x x))))): 5 points increase in error, 2 points decrease in error
      (+.f64 (*.f64 10 (*.f64 (pow.f64 eps 2) (pow.f64 x 3))) (*.f64 10 (*.f64 (pow.f64 eps 3) (Rewrite<= unpow2_binary64 (pow.f64 x 2))))): 0 points increase in error, 0 points decrease in error

    if -2.8000000000000001e-39 < x < 6.1999999999999995e-66

    1. Initial program 0.5

      \[{\left(x + \varepsilon\right)}^{5} - {x}^{5} \]
    2. Taylor expanded in x around 0 0.6

      \[\leadsto \color{blue}{{\varepsilon}^{5} + \left(4 \cdot {\varepsilon}^{4} + {\varepsilon}^{4}\right) \cdot x} \]
    3. Simplified0.6

      \[\leadsto \color{blue}{{\varepsilon}^{5} + \left(5 \cdot {\varepsilon}^{4}\right) \cdot x} \]
      Proof
      (+.f64 (pow.f64 eps 5) (*.f64 (*.f64 5 (pow.f64 eps 4)) x)): 0 points increase in error, 0 points decrease in error
      (+.f64 (pow.f64 eps 5) (*.f64 (*.f64 (Rewrite<= metadata-eval (+.f64 4 1)) (pow.f64 eps 4)) x)): 0 points increase in error, 0 points decrease in error
      (+.f64 (pow.f64 eps 5) (*.f64 (Rewrite<= distribute-lft1-in_binary64 (+.f64 (*.f64 4 (pow.f64 eps 4)) (pow.f64 eps 4))) x)): 0 points increase in error, 0 points decrease in error
  3. Recombined 2 regimes into one program.
  4. Final simplification1.5

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.8 \cdot 10^{-39}:\\ \;\;\;\;\mathsf{fma}\left(\varepsilon \cdot 5, {x}^{4}, \left(x \cdot x\right) \cdot \left(\left(10 \cdot \left(\varepsilon \cdot \varepsilon\right)\right) \cdot \left(x + \varepsilon\right)\right)\right)\\ \mathbf{elif}\;x \leq 6.2 \cdot 10^{-66}:\\ \;\;\;\;{\varepsilon}^{5} + x \cdot \left(5 \cdot {\varepsilon}^{4}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\varepsilon \cdot 5, {x}^{4}, \left(x \cdot x\right) \cdot \left(\left(10 \cdot \left(\varepsilon \cdot \varepsilon\right)\right) \cdot \left(x + \varepsilon\right)\right)\right)\\ \end{array} \]

Alternatives

Alternative 1
Error1.5
Cost13640
\[\begin{array}{l} t_0 := \varepsilon \cdot \left(5 \cdot {x}^{4}\right) + 10 \cdot \left(\left(x \cdot x\right) \cdot \left(\left(\varepsilon \cdot \varepsilon\right) \cdot \left(x + \varepsilon\right)\right)\right)\\ \mathbf{if}\;x \leq -2.8 \cdot 10^{-39}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 6.2 \cdot 10^{-66}:\\ \;\;\;\;{\varepsilon}^{5} + x \cdot \left(5 \cdot {\varepsilon}^{4}\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 2
Error1.5
Cost13512
\[\begin{array}{l} t_0 := \varepsilon \cdot \left(5 \cdot {x}^{4}\right) + 10 \cdot \left(\left(x \cdot x\right) \cdot \left(\left(\varepsilon \cdot \varepsilon\right) \cdot \left(x + \varepsilon\right)\right)\right)\\ \mathbf{if}\;x \leq -5.8 \cdot 10^{-36}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 6.2 \cdot 10^{-66}:\\ \;\;\;\;{\left(x + \varepsilon\right)}^{5} - {x}^{5}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 3
Error1.3
Cost7944
\[\begin{array}{l} t_0 := \varepsilon \cdot \left(5 \cdot {x}^{4}\right) + 10 \cdot \left(\left(x \cdot x\right) \cdot \left(\left(\varepsilon \cdot \varepsilon\right) \cdot \left(x + \varepsilon\right)\right)\right)\\ \mathbf{if}\;x \leq -1.15 \cdot 10^{-52}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 6.2 \cdot 10^{-66}:\\ \;\;\;\;{\varepsilon}^{5}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 4
Error1.4
Cost7816
\[\begin{array}{l} t_0 := \varepsilon \cdot \left(5 \cdot {x}^{4}\right) + 10 \cdot \left(\left(x \cdot x\right) \cdot \left(x \cdot \left(\varepsilon \cdot \varepsilon\right)\right)\right)\\ \mathbf{if}\;x \leq -5 \cdot 10^{-51}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 5 \cdot 10^{-66}:\\ \;\;\;\;{\varepsilon}^{5}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 5
Error1.6
Cost7048
\[\begin{array}{l} \mathbf{if}\;x \leq -4.2 \cdot 10^{-51}:\\ \;\;\;\;\left(x \cdot x\right) \cdot \left(5 \cdot \left(x \cdot \left(x \cdot \varepsilon\right)\right)\right)\\ \mathbf{elif}\;x \leq 6.2 \cdot 10^{-66}:\\ \;\;\;\;{\varepsilon}^{5}\\ \mathbf{else}:\\ \;\;\;\;\varepsilon \cdot \left(5 \cdot {x}^{4}\right)\\ \end{array} \]
Alternative 6
Error1.6
Cost7048
\[\begin{array}{l} t_0 := \left(\varepsilon \cdot 5\right) \cdot {x}^{4}\\ \mathbf{if}\;x \leq -9 \cdot 10^{-53}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 6.2 \cdot 10^{-66}:\\ \;\;\;\;{\varepsilon}^{5}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 7
Error1.6
Cost6792
\[\begin{array}{l} t_0 := \left(x \cdot x\right) \cdot \left(5 \cdot \left(x \cdot \left(x \cdot \varepsilon\right)\right)\right)\\ \mathbf{if}\;x \leq -2.45 \cdot 10^{-51}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 6.2 \cdot 10^{-66}:\\ \;\;\;\;{\varepsilon}^{5}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 8
Error10.7
Cost704
\[5 \cdot \left(\left(x \cdot x\right) \cdot \left(\varepsilon \cdot \left(x \cdot x\right)\right)\right) \]
Alternative 9
Error10.7
Cost704
\[\left(x \cdot x\right) \cdot \left(5 \cdot \left(x \cdot \left(x \cdot \varepsilon\right)\right)\right) \]

Error

Reproduce

herbie shell --seed 2022330 
(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)))