ENA, Section 1.4, Exercise 4b, n=5

Percentage Accurate: 88.2% → 99.5%
Time: 8.2s
Alternatives: 12
Speedup: 0.5×

Specification

?
\[\left(-1000000000 \leq x \land x \leq 1000000000\right) \land \left(-1 \leq \varepsilon \land \varepsilon \leq 1\right)\]
\[\begin{array}{l} \\ {\left(x + \varepsilon\right)}^{5} - {x}^{5} \end{array} \]
(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:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 12 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 88.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ {\left(x + \varepsilon\right)}^{5} - {x}^{5} \end{array} \]
(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}

Alternative 1: 99.5% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(\varepsilon + x\right)}^{5} - {x}^{5}\\ \mathbf{if}\;t\_0 \leq -2 \cdot 10^{-317}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;t\_0 \leq 0:\\ \;\;\;\;\left(\left(x \cdot x\right) \cdot \mathsf{fma}\left(5 \cdot x, x, \left(\varepsilon \cdot x\right) \cdot 10\right)\right) \cdot \varepsilon\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x eps)
 :precision binary64
 (let* ((t_0 (- (pow (+ eps x) 5.0) (pow x 5.0))))
   (if (<= t_0 -2e-317)
     t_0
     (if (<= t_0 0.0)
       (* (* (* x x) (fma (* 5.0 x) x (* (* eps x) 10.0))) eps)
       t_0))))
double code(double x, double eps) {
	double t_0 = pow((eps + x), 5.0) - pow(x, 5.0);
	double tmp;
	if (t_0 <= -2e-317) {
		tmp = t_0;
	} else if (t_0 <= 0.0) {
		tmp = ((x * x) * fma((5.0 * x), x, ((eps * x) * 10.0))) * eps;
	} else {
		tmp = t_0;
	}
	return tmp;
}
function code(x, eps)
	t_0 = Float64((Float64(eps + x) ^ 5.0) - (x ^ 5.0))
	tmp = 0.0
	if (t_0 <= -2e-317)
		tmp = t_0;
	elseif (t_0 <= 0.0)
		tmp = Float64(Float64(Float64(x * x) * fma(Float64(5.0 * x), x, Float64(Float64(eps * x) * 10.0))) * eps);
	else
		tmp = t_0;
	end
	return tmp
end
code[x_, eps_] := Block[{t$95$0 = N[(N[Power[N[(eps + x), $MachinePrecision], 5.0], $MachinePrecision] - N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e-317], t$95$0, If[LessEqual[t$95$0, 0.0], N[(N[(N[(x * x), $MachinePrecision] * N[(N[(5.0 * x), $MachinePrecision] * x + N[(N[(eps * x), $MachinePrecision] * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * eps), $MachinePrecision], t$95$0]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := {\left(\varepsilon + x\right)}^{5} - {x}^{5}\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{-317}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\left(\left(x \cdot x\right) \cdot \mathsf{fma}\left(5 \cdot x, x, \left(\varepsilon \cdot x\right) \cdot 10\right)\right) \cdot \varepsilon\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -1.99999997e-317 or 0.0 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64)))

    1. Initial program 96.3%

      \[{\left(x + \varepsilon\right)}^{5} - {x}^{5} \]
    2. Add Preprocessing

    if -1.99999997e-317 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 0.0

    1. Initial program 90.3%

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

      \[\leadsto \color{blue}{\varepsilon \cdot \left(4 \cdot {x}^{4} + \left(\varepsilon \cdot \left(4 \cdot {x}^{3} + \left(\varepsilon \cdot \left(2 \cdot {x}^{2} + 8 \cdot {x}^{2}\right) + x \cdot \left(2 \cdot {x}^{2} + 4 \cdot {x}^{2}\right)\right)\right) + {x}^{4}\right)\right)} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \color{blue}{\left(4 \cdot {x}^{4} + \left(\varepsilon \cdot \left(4 \cdot {x}^{3} + \left(\varepsilon \cdot \left(2 \cdot {x}^{2} + 8 \cdot {x}^{2}\right) + x \cdot \left(2 \cdot {x}^{2} + 4 \cdot {x}^{2}\right)\right)\right) + {x}^{4}\right)\right) \cdot \varepsilon} \]
      2. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(4 \cdot {x}^{4} + \left(\varepsilon \cdot \left(4 \cdot {x}^{3} + \left(\varepsilon \cdot \left(2 \cdot {x}^{2} + 8 \cdot {x}^{2}\right) + x \cdot \left(2 \cdot {x}^{2} + 4 \cdot {x}^{2}\right)\right)\right) + {x}^{4}\right)\right) \cdot \varepsilon} \]
    5. Applied rewrites99.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(10 \cdot \left(x \cdot x\right), \varepsilon, {x}^{3} \cdot 10\right), \varepsilon, {x}^{4} \cdot 5\right) \cdot \varepsilon} \]
    6. Taylor expanded in x around 0

      \[\leadsto \left({x}^{2} \cdot \left(10 \cdot {\varepsilon}^{2} + x \cdot \left(5 \cdot x + 10 \cdot \varepsilon\right)\right)\right) \cdot \varepsilon \]
    7. Step-by-step derivation
      1. Applied rewrites99.9%

        \[\leadsto \left(\left(\mathsf{fma}\left(x \cdot x, 5, \left(\varepsilon \cdot \left(\varepsilon + x\right)\right) \cdot 10\right) \cdot x\right) \cdot x\right) \cdot \varepsilon \]
      2. Taylor expanded in x around inf

        \[\leadsto \left(\left(\mathsf{fma}\left(x \cdot x, 5, 10 \cdot \left(\varepsilon \cdot x\right)\right) \cdot x\right) \cdot x\right) \cdot \varepsilon \]
      3. Step-by-step derivation
        1. Applied rewrites99.9%

          \[\leadsto \left(\left(\mathsf{fma}\left(x \cdot x, 5, \left(\varepsilon \cdot x\right) \cdot 10\right) \cdot x\right) \cdot x\right) \cdot \varepsilon \]
        2. Step-by-step derivation
          1. Applied rewrites100.0%

            \[\leadsto \left(\mathsf{fma}\left(5 \cdot x, x, \left(\varepsilon \cdot x\right) \cdot 10\right) \cdot \left(x \cdot x\right)\right) \cdot \varepsilon \]
        3. Recombined 2 regimes into one program.
        4. Final simplification99.1%

          \[\leadsto \begin{array}{l} \mathbf{if}\;{\left(\varepsilon + x\right)}^{5} - {x}^{5} \leq -2 \cdot 10^{-317}:\\ \;\;\;\;{\left(\varepsilon + x\right)}^{5} - {x}^{5}\\ \mathbf{elif}\;{\left(\varepsilon + x\right)}^{5} - {x}^{5} \leq 0:\\ \;\;\;\;\left(\left(x \cdot x\right) \cdot \mathsf{fma}\left(5 \cdot x, x, \left(\varepsilon \cdot x\right) \cdot 10\right)\right) \cdot \varepsilon\\ \mathbf{else}:\\ \;\;\;\;{\left(\varepsilon + x\right)}^{5} - {x}^{5}\\ \end{array} \]
        5. Add Preprocessing

        Alternative 2: 97.4% accurate, 0.4× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(\varepsilon + x\right)}^{5} - {x}^{5}\\ \mathbf{if}\;t\_0 \leq -2 \cdot 10^{-317}:\\ \;\;\;\;{\varepsilon}^{5} \cdot \left(1 + \frac{\mathsf{fma}\left(5, x, \frac{-10 \cdot \left(x \cdot x\right)}{-\varepsilon}\right)}{\varepsilon}\right)\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-254}:\\ \;\;\;\;\left(\left(x \cdot x\right) \cdot \mathsf{fma}\left(5 \cdot x, x, \left(\varepsilon \cdot x\right) \cdot 10\right)\right) \cdot \varepsilon\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(\mathsf{fma}\left(5 \cdot \varepsilon, \varepsilon, \left(\left(\varepsilon + x\right) \cdot x\right) \cdot 10\right) \cdot \varepsilon\right) \cdot \varepsilon, x, {\varepsilon}^{5}\right)\\ \end{array} \end{array} \]
        (FPCore (x eps)
         :precision binary64
         (let* ((t_0 (- (pow (+ eps x) 5.0) (pow x 5.0))))
           (if (<= t_0 -2e-317)
             (*
              (pow eps 5.0)
              (+ 1.0 (/ (fma 5.0 x (/ (* -10.0 (* x x)) (- eps))) eps)))
             (if (<= t_0 5e-254)
               (* (* (* x x) (fma (* 5.0 x) x (* (* eps x) 10.0))) eps)
               (fma
                (* (* (fma (* 5.0 eps) eps (* (* (+ eps x) x) 10.0)) eps) eps)
                x
                (pow eps 5.0))))))
        double code(double x, double eps) {
        	double t_0 = pow((eps + x), 5.0) - pow(x, 5.0);
        	double tmp;
        	if (t_0 <= -2e-317) {
        		tmp = pow(eps, 5.0) * (1.0 + (fma(5.0, x, ((-10.0 * (x * x)) / -eps)) / eps));
        	} else if (t_0 <= 5e-254) {
        		tmp = ((x * x) * fma((5.0 * x), x, ((eps * x) * 10.0))) * eps;
        	} else {
        		tmp = fma(((fma((5.0 * eps), eps, (((eps + x) * x) * 10.0)) * eps) * eps), x, pow(eps, 5.0));
        	}
        	return tmp;
        }
        
        function code(x, eps)
        	t_0 = Float64((Float64(eps + x) ^ 5.0) - (x ^ 5.0))
        	tmp = 0.0
        	if (t_0 <= -2e-317)
        		tmp = Float64((eps ^ 5.0) * Float64(1.0 + Float64(fma(5.0, x, Float64(Float64(-10.0 * Float64(x * x)) / Float64(-eps))) / eps)));
        	elseif (t_0 <= 5e-254)
        		tmp = Float64(Float64(Float64(x * x) * fma(Float64(5.0 * x), x, Float64(Float64(eps * x) * 10.0))) * eps);
        	else
        		tmp = fma(Float64(Float64(fma(Float64(5.0 * eps), eps, Float64(Float64(Float64(eps + x) * x) * 10.0)) * eps) * eps), x, (eps ^ 5.0));
        	end
        	return tmp
        end
        
        code[x_, eps_] := Block[{t$95$0 = N[(N[Power[N[(eps + x), $MachinePrecision], 5.0], $MachinePrecision] - N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e-317], N[(N[Power[eps, 5.0], $MachinePrecision] * N[(1.0 + N[(N[(5.0 * x + N[(N[(-10.0 * N[(x * x), $MachinePrecision]), $MachinePrecision] / (-eps)), $MachinePrecision]), $MachinePrecision] / eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e-254], N[(N[(N[(x * x), $MachinePrecision] * N[(N[(5.0 * x), $MachinePrecision] * x + N[(N[(eps * x), $MachinePrecision] * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * eps), $MachinePrecision], N[(N[(N[(N[(N[(5.0 * eps), $MachinePrecision] * eps + N[(N[(N[(eps + x), $MachinePrecision] * x), $MachinePrecision] * 10.0), $MachinePrecision]), $MachinePrecision] * eps), $MachinePrecision] * eps), $MachinePrecision] * x + N[Power[eps, 5.0], $MachinePrecision]), $MachinePrecision]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := {\left(\varepsilon + x\right)}^{5} - {x}^{5}\\
        \mathbf{if}\;t\_0 \leq -2 \cdot 10^{-317}:\\
        \;\;\;\;{\varepsilon}^{5} \cdot \left(1 + \frac{\mathsf{fma}\left(5, x, \frac{-10 \cdot \left(x \cdot x\right)}{-\varepsilon}\right)}{\varepsilon}\right)\\
        
        \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-254}:\\
        \;\;\;\;\left(\left(x \cdot x\right) \cdot \mathsf{fma}\left(5 \cdot x, x, \left(\varepsilon \cdot x\right) \cdot 10\right)\right) \cdot \varepsilon\\
        
        \mathbf{else}:\\
        \;\;\;\;\mathsf{fma}\left(\left(\mathsf{fma}\left(5 \cdot \varepsilon, \varepsilon, \left(\left(\varepsilon + x\right) \cdot x\right) \cdot 10\right) \cdot \varepsilon\right) \cdot \varepsilon, x, {\varepsilon}^{5}\right)\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -1.99999997e-317

          1. Initial program 97.7%

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

            \[\leadsto \color{blue}{-1 \cdot \left({\varepsilon}^{5} \cdot \left(-1 \cdot \frac{x + \left(-1 \cdot \frac{-4 \cdot {x}^{2} + -1 \cdot \left(2 \cdot {x}^{2} + 4 \cdot {x}^{2}\right)}{\varepsilon} + 4 \cdot x\right)}{\varepsilon} - 1\right)\right)} \]
          4. Step-by-step derivation
            1. associate-*r*N/A

              \[\leadsto \color{blue}{\left(-1 \cdot {\varepsilon}^{5}\right) \cdot \left(-1 \cdot \frac{x + \left(-1 \cdot \frac{-4 \cdot {x}^{2} + -1 \cdot \left(2 \cdot {x}^{2} + 4 \cdot {x}^{2}\right)}{\varepsilon} + 4 \cdot x\right)}{\varepsilon} - 1\right)} \]
            2. *-commutativeN/A

              \[\leadsto \color{blue}{\left(-1 \cdot \frac{x + \left(-1 \cdot \frac{-4 \cdot {x}^{2} + -1 \cdot \left(2 \cdot {x}^{2} + 4 \cdot {x}^{2}\right)}{\varepsilon} + 4 \cdot x\right)}{\varepsilon} - 1\right) \cdot \left(-1 \cdot {\varepsilon}^{5}\right)} \]
            3. sub-negN/A

              \[\leadsto \color{blue}{\left(-1 \cdot \frac{x + \left(-1 \cdot \frac{-4 \cdot {x}^{2} + -1 \cdot \left(2 \cdot {x}^{2} + 4 \cdot {x}^{2}\right)}{\varepsilon} + 4 \cdot x\right)}{\varepsilon} + \left(\mathsf{neg}\left(1\right)\right)\right)} \cdot \left(-1 \cdot {\varepsilon}^{5}\right) \]
            4. *-commutativeN/A

              \[\leadsto \left(\color{blue}{\frac{x + \left(-1 \cdot \frac{-4 \cdot {x}^{2} + -1 \cdot \left(2 \cdot {x}^{2} + 4 \cdot {x}^{2}\right)}{\varepsilon} + 4 \cdot x\right)}{\varepsilon} \cdot -1} + \left(\mathsf{neg}\left(1\right)\right)\right) \cdot \left(-1 \cdot {\varepsilon}^{5}\right) \]
            5. metadata-evalN/A

              \[\leadsto \left(\frac{x + \left(-1 \cdot \frac{-4 \cdot {x}^{2} + -1 \cdot \left(2 \cdot {x}^{2} + 4 \cdot {x}^{2}\right)}{\varepsilon} + 4 \cdot x\right)}{\varepsilon} \cdot -1 + \color{blue}{-1}\right) \cdot \left(-1 \cdot {\varepsilon}^{5}\right) \]
            6. distribute-lft1-inN/A

              \[\leadsto \color{blue}{\left(\left(\frac{x + \left(-1 \cdot \frac{-4 \cdot {x}^{2} + -1 \cdot \left(2 \cdot {x}^{2} + 4 \cdot {x}^{2}\right)}{\varepsilon} + 4 \cdot x\right)}{\varepsilon} + 1\right) \cdot -1\right)} \cdot \left(-1 \cdot {\varepsilon}^{5}\right) \]
            7. associate-*l*N/A

              \[\leadsto \color{blue}{\left(\frac{x + \left(-1 \cdot \frac{-4 \cdot {x}^{2} + -1 \cdot \left(2 \cdot {x}^{2} + 4 \cdot {x}^{2}\right)}{\varepsilon} + 4 \cdot x\right)}{\varepsilon} + 1\right) \cdot \left(-1 \cdot \left(-1 \cdot {\varepsilon}^{5}\right)\right)} \]
          5. Applied rewrites90.6%

            \[\leadsto \color{blue}{\left(\frac{\mathsf{fma}\left(5, x, \frac{\left(x \cdot x\right) \cdot -10}{-\varepsilon}\right)}{\varepsilon} + 1\right) \cdot {\varepsilon}^{5}} \]

          if -1.99999997e-317 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 5.0000000000000003e-254

          1. Initial program 90.1%

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

            \[\leadsto \color{blue}{\varepsilon \cdot \left(4 \cdot {x}^{4} + \left(\varepsilon \cdot \left(4 \cdot {x}^{3} + \left(\varepsilon \cdot \left(2 \cdot {x}^{2} + 8 \cdot {x}^{2}\right) + x \cdot \left(2 \cdot {x}^{2} + 4 \cdot {x}^{2}\right)\right)\right) + {x}^{4}\right)\right)} \]
          4. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto \color{blue}{\left(4 \cdot {x}^{4} + \left(\varepsilon \cdot \left(4 \cdot {x}^{3} + \left(\varepsilon \cdot \left(2 \cdot {x}^{2} + 8 \cdot {x}^{2}\right) + x \cdot \left(2 \cdot {x}^{2} + 4 \cdot {x}^{2}\right)\right)\right) + {x}^{4}\right)\right) \cdot \varepsilon} \]
            2. lower-*.f64N/A

              \[\leadsto \color{blue}{\left(4 \cdot {x}^{4} + \left(\varepsilon \cdot \left(4 \cdot {x}^{3} + \left(\varepsilon \cdot \left(2 \cdot {x}^{2} + 8 \cdot {x}^{2}\right) + x \cdot \left(2 \cdot {x}^{2} + 4 \cdot {x}^{2}\right)\right)\right) + {x}^{4}\right)\right) \cdot \varepsilon} \]
          5. Applied rewrites99.3%

            \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(10 \cdot \left(x \cdot x\right), \varepsilon, {x}^{3} \cdot 10\right), \varepsilon, {x}^{4} \cdot 5\right) \cdot \varepsilon} \]
          6. Taylor expanded in x around 0

            \[\leadsto \left({x}^{2} \cdot \left(10 \cdot {\varepsilon}^{2} + x \cdot \left(5 \cdot x + 10 \cdot \varepsilon\right)\right)\right) \cdot \varepsilon \]
          7. Step-by-step derivation
            1. Applied rewrites99.3%

              \[\leadsto \left(\left(\mathsf{fma}\left(x \cdot x, 5, \left(\varepsilon \cdot \left(\varepsilon + x\right)\right) \cdot 10\right) \cdot x\right) \cdot x\right) \cdot \varepsilon \]
            2. Taylor expanded in x around inf

              \[\leadsto \left(\left(\mathsf{fma}\left(x \cdot x, 5, 10 \cdot \left(\varepsilon \cdot x\right)\right) \cdot x\right) \cdot x\right) \cdot \varepsilon \]
            3. Step-by-step derivation
              1. Applied rewrites99.3%

                \[\leadsto \left(\left(\mathsf{fma}\left(x \cdot x, 5, \left(\varepsilon \cdot x\right) \cdot 10\right) \cdot x\right) \cdot x\right) \cdot \varepsilon \]
              2. Step-by-step derivation
                1. Applied rewrites99.3%

                  \[\leadsto \left(\mathsf{fma}\left(5 \cdot x, x, \left(\varepsilon \cdot x\right) \cdot 10\right) \cdot \left(x \cdot x\right)\right) \cdot \varepsilon \]

                if 5.0000000000000003e-254 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64)))

                1. Initial program 98.4%

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

                  \[\leadsto \color{blue}{x \cdot \left(4 \cdot {\varepsilon}^{4} + {\varepsilon}^{4}\right) + {\varepsilon}^{5}} \]
                4. Step-by-step derivation
                  1. *-commutativeN/A

                    \[\leadsto \color{blue}{\left(4 \cdot {\varepsilon}^{4} + {\varepsilon}^{4}\right) \cdot x} + {\varepsilon}^{5} \]
                  2. lower-fma.f64N/A

                    \[\leadsto \color{blue}{\mathsf{fma}\left(4 \cdot {\varepsilon}^{4} + {\varepsilon}^{4}, x, {\varepsilon}^{5}\right)} \]
                  3. distribute-lft1-inN/A

                    \[\leadsto \mathsf{fma}\left(\color{blue}{\left(4 + 1\right) \cdot {\varepsilon}^{4}}, x, {\varepsilon}^{5}\right) \]
                  4. metadata-evalN/A

                    \[\leadsto \mathsf{fma}\left(\color{blue}{5} \cdot {\varepsilon}^{4}, x, {\varepsilon}^{5}\right) \]
                  5. *-commutativeN/A

                    \[\leadsto \mathsf{fma}\left(\color{blue}{{\varepsilon}^{4} \cdot 5}, x, {\varepsilon}^{5}\right) \]
                  6. lower-*.f64N/A

                    \[\leadsto \mathsf{fma}\left(\color{blue}{{\varepsilon}^{4} \cdot 5}, x, {\varepsilon}^{5}\right) \]
                  7. lower-pow.f64N/A

                    \[\leadsto \mathsf{fma}\left(\color{blue}{{\varepsilon}^{4}} \cdot 5, x, {\varepsilon}^{5}\right) \]
                  8. lower-pow.f6491.9

                    \[\leadsto \mathsf{fma}\left({\varepsilon}^{4} \cdot 5, x, \color{blue}{{\varepsilon}^{5}}\right) \]
                5. Applied rewrites91.9%

                  \[\leadsto \color{blue}{\mathsf{fma}\left({\varepsilon}^{4} \cdot 5, x, {\varepsilon}^{5}\right)} \]
                6. Taylor expanded in x around 0

                  \[\leadsto \color{blue}{x \cdot \left(4 \cdot {\varepsilon}^{4} + \left(x \cdot \left(4 \cdot {\varepsilon}^{3} + \left(\varepsilon \cdot \left(2 \cdot {\varepsilon}^{2} + 4 \cdot {\varepsilon}^{2}\right) + x \cdot \left(2 \cdot {\varepsilon}^{2} + 8 \cdot {\varepsilon}^{2}\right)\right)\right) + {\varepsilon}^{4}\right)\right) + {\varepsilon}^{5}} \]
                7. Applied rewrites94.9%

                  \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(\left(\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon + x\right)\right)\right) \cdot 10, x, {\varepsilon}^{4} \cdot 5\right), x, {\varepsilon}^{5}\right)} \]
                8. Taylor expanded in eps around 0

                  \[\leadsto \mathsf{fma}\left({\varepsilon}^{2} \cdot \left(10 \cdot {x}^{2} + \varepsilon \cdot \left(5 \cdot \varepsilon + 10 \cdot x\right)\right), x, {\varepsilon}^{5}\right) \]
                9. Step-by-step derivation
                  1. Applied rewrites94.9%

                    \[\leadsto \mathsf{fma}\left(\left(\mathsf{fma}\left(5 \cdot \varepsilon, \varepsilon, \left(x \cdot \left(\varepsilon + x\right)\right) \cdot 10\right) \cdot \varepsilon\right) \cdot \varepsilon, x, {\varepsilon}^{5}\right) \]
                10. Recombined 3 regimes into one program.
                11. Final simplification98.0%

                  \[\leadsto \begin{array}{l} \mathbf{if}\;{\left(\varepsilon + x\right)}^{5} - {x}^{5} \leq -2 \cdot 10^{-317}:\\ \;\;\;\;{\varepsilon}^{5} \cdot \left(1 + \frac{\mathsf{fma}\left(5, x, \frac{-10 \cdot \left(x \cdot x\right)}{-\varepsilon}\right)}{\varepsilon}\right)\\ \mathbf{elif}\;{\left(\varepsilon + x\right)}^{5} - {x}^{5} \leq 5 \cdot 10^{-254}:\\ \;\;\;\;\left(\left(x \cdot x\right) \cdot \mathsf{fma}\left(5 \cdot x, x, \left(\varepsilon \cdot x\right) \cdot 10\right)\right) \cdot \varepsilon\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(\mathsf{fma}\left(5 \cdot \varepsilon, \varepsilon, \left(\left(\varepsilon + x\right) \cdot x\right) \cdot 10\right) \cdot \varepsilon\right) \cdot \varepsilon, x, {\varepsilon}^{5}\right)\\ \end{array} \]
                12. Add Preprocessing

                Alternative 3: 97.4% accurate, 0.4× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(\varepsilon + x\right)}^{5} - {x}^{5}\\ \mathbf{if}\;t\_0 \leq -2 \cdot 10^{-317}:\\ \;\;\;\;{\varepsilon}^{3} \cdot \mathsf{fma}\left(\mathsf{fma}\left(5, x, \varepsilon\right), \varepsilon, \left(10 \cdot x\right) \cdot x\right)\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-254}:\\ \;\;\;\;\left(\left(x \cdot x\right) \cdot \mathsf{fma}\left(5 \cdot x, x, \left(\varepsilon \cdot x\right) \cdot 10\right)\right) \cdot \varepsilon\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(\mathsf{fma}\left(5 \cdot \varepsilon, \varepsilon, \left(\left(\varepsilon + x\right) \cdot x\right) \cdot 10\right) \cdot \varepsilon\right) \cdot \varepsilon, x, {\varepsilon}^{5}\right)\\ \end{array} \end{array} \]
                (FPCore (x eps)
                 :precision binary64
                 (let* ((t_0 (- (pow (+ eps x) 5.0) (pow x 5.0))))
                   (if (<= t_0 -2e-317)
                     (* (pow eps 3.0) (fma (fma 5.0 x eps) eps (* (* 10.0 x) x)))
                     (if (<= t_0 5e-254)
                       (* (* (* x x) (fma (* 5.0 x) x (* (* eps x) 10.0))) eps)
                       (fma
                        (* (* (fma (* 5.0 eps) eps (* (* (+ eps x) x) 10.0)) eps) eps)
                        x
                        (pow eps 5.0))))))
                double code(double x, double eps) {
                	double t_0 = pow((eps + x), 5.0) - pow(x, 5.0);
                	double tmp;
                	if (t_0 <= -2e-317) {
                		tmp = pow(eps, 3.0) * fma(fma(5.0, x, eps), eps, ((10.0 * x) * x));
                	} else if (t_0 <= 5e-254) {
                		tmp = ((x * x) * fma((5.0 * x), x, ((eps * x) * 10.0))) * eps;
                	} else {
                		tmp = fma(((fma((5.0 * eps), eps, (((eps + x) * x) * 10.0)) * eps) * eps), x, pow(eps, 5.0));
                	}
                	return tmp;
                }
                
                function code(x, eps)
                	t_0 = Float64((Float64(eps + x) ^ 5.0) - (x ^ 5.0))
                	tmp = 0.0
                	if (t_0 <= -2e-317)
                		tmp = Float64((eps ^ 3.0) * fma(fma(5.0, x, eps), eps, Float64(Float64(10.0 * x) * x)));
                	elseif (t_0 <= 5e-254)
                		tmp = Float64(Float64(Float64(x * x) * fma(Float64(5.0 * x), x, Float64(Float64(eps * x) * 10.0))) * eps);
                	else
                		tmp = fma(Float64(Float64(fma(Float64(5.0 * eps), eps, Float64(Float64(Float64(eps + x) * x) * 10.0)) * eps) * eps), x, (eps ^ 5.0));
                	end
                	return tmp
                end
                
                code[x_, eps_] := Block[{t$95$0 = N[(N[Power[N[(eps + x), $MachinePrecision], 5.0], $MachinePrecision] - N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e-317], N[(N[Power[eps, 3.0], $MachinePrecision] * N[(N[(5.0 * x + eps), $MachinePrecision] * eps + N[(N[(10.0 * x), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e-254], N[(N[(N[(x * x), $MachinePrecision] * N[(N[(5.0 * x), $MachinePrecision] * x + N[(N[(eps * x), $MachinePrecision] * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * eps), $MachinePrecision], N[(N[(N[(N[(N[(5.0 * eps), $MachinePrecision] * eps + N[(N[(N[(eps + x), $MachinePrecision] * x), $MachinePrecision] * 10.0), $MachinePrecision]), $MachinePrecision] * eps), $MachinePrecision] * eps), $MachinePrecision] * x + N[Power[eps, 5.0], $MachinePrecision]), $MachinePrecision]]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                t_0 := {\left(\varepsilon + x\right)}^{5} - {x}^{5}\\
                \mathbf{if}\;t\_0 \leq -2 \cdot 10^{-317}:\\
                \;\;\;\;{\varepsilon}^{3} \cdot \mathsf{fma}\left(\mathsf{fma}\left(5, x, \varepsilon\right), \varepsilon, \left(10 \cdot x\right) \cdot x\right)\\
                
                \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-254}:\\
                \;\;\;\;\left(\left(x \cdot x\right) \cdot \mathsf{fma}\left(5 \cdot x, x, \left(\varepsilon \cdot x\right) \cdot 10\right)\right) \cdot \varepsilon\\
                
                \mathbf{else}:\\
                \;\;\;\;\mathsf{fma}\left(\left(\mathsf{fma}\left(5 \cdot \varepsilon, \varepsilon, \left(\left(\varepsilon + x\right) \cdot x\right) \cdot 10\right) \cdot \varepsilon\right) \cdot \varepsilon, x, {\varepsilon}^{5}\right)\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 3 regimes
                2. if (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -1.99999997e-317

                  1. Initial program 97.7%

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

                    \[\leadsto \color{blue}{x \cdot \left(4 \cdot {\varepsilon}^{4} + {\varepsilon}^{4}\right) + {\varepsilon}^{5}} \]
                  4. Step-by-step derivation
                    1. *-commutativeN/A

                      \[\leadsto \color{blue}{\left(4 \cdot {\varepsilon}^{4} + {\varepsilon}^{4}\right) \cdot x} + {\varepsilon}^{5} \]
                    2. lower-fma.f64N/A

                      \[\leadsto \color{blue}{\mathsf{fma}\left(4 \cdot {\varepsilon}^{4} + {\varepsilon}^{4}, x, {\varepsilon}^{5}\right)} \]
                    3. distribute-lft1-inN/A

                      \[\leadsto \mathsf{fma}\left(\color{blue}{\left(4 + 1\right) \cdot {\varepsilon}^{4}}, x, {\varepsilon}^{5}\right) \]
                    4. metadata-evalN/A

                      \[\leadsto \mathsf{fma}\left(\color{blue}{5} \cdot {\varepsilon}^{4}, x, {\varepsilon}^{5}\right) \]
                    5. *-commutativeN/A

                      \[\leadsto \mathsf{fma}\left(\color{blue}{{\varepsilon}^{4} \cdot 5}, x, {\varepsilon}^{5}\right) \]
                    6. lower-*.f64N/A

                      \[\leadsto \mathsf{fma}\left(\color{blue}{{\varepsilon}^{4} \cdot 5}, x, {\varepsilon}^{5}\right) \]
                    7. lower-pow.f64N/A

                      \[\leadsto \mathsf{fma}\left(\color{blue}{{\varepsilon}^{4}} \cdot 5, x, {\varepsilon}^{5}\right) \]
                    8. lower-pow.f6489.4

                      \[\leadsto \mathsf{fma}\left({\varepsilon}^{4} \cdot 5, x, \color{blue}{{\varepsilon}^{5}}\right) \]
                  5. Applied rewrites89.4%

                    \[\leadsto \color{blue}{\mathsf{fma}\left({\varepsilon}^{4} \cdot 5, x, {\varepsilon}^{5}\right)} \]
                  6. Taylor expanded in x around 0

                    \[\leadsto \color{blue}{x \cdot \left(4 \cdot {\varepsilon}^{4} + \left(x \cdot \left(4 \cdot {\varepsilon}^{3} + \varepsilon \cdot \left(2 \cdot {\varepsilon}^{2} + 4 \cdot {\varepsilon}^{2}\right)\right) + {\varepsilon}^{4}\right)\right) + {\varepsilon}^{5}} \]
                  7. Applied rewrites90.1%

                    \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(5, x, \varepsilon\right), \varepsilon, \left(10 \cdot x\right) \cdot x\right) \cdot {\varepsilon}^{3}} \]

                  if -1.99999997e-317 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 5.0000000000000003e-254

                  1. Initial program 90.1%

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

                    \[\leadsto \color{blue}{\varepsilon \cdot \left(4 \cdot {x}^{4} + \left(\varepsilon \cdot \left(4 \cdot {x}^{3} + \left(\varepsilon \cdot \left(2 \cdot {x}^{2} + 8 \cdot {x}^{2}\right) + x \cdot \left(2 \cdot {x}^{2} + 4 \cdot {x}^{2}\right)\right)\right) + {x}^{4}\right)\right)} \]
                  4. Step-by-step derivation
                    1. *-commutativeN/A

                      \[\leadsto \color{blue}{\left(4 \cdot {x}^{4} + \left(\varepsilon \cdot \left(4 \cdot {x}^{3} + \left(\varepsilon \cdot \left(2 \cdot {x}^{2} + 8 \cdot {x}^{2}\right) + x \cdot \left(2 \cdot {x}^{2} + 4 \cdot {x}^{2}\right)\right)\right) + {x}^{4}\right)\right) \cdot \varepsilon} \]
                    2. lower-*.f64N/A

                      \[\leadsto \color{blue}{\left(4 \cdot {x}^{4} + \left(\varepsilon \cdot \left(4 \cdot {x}^{3} + \left(\varepsilon \cdot \left(2 \cdot {x}^{2} + 8 \cdot {x}^{2}\right) + x \cdot \left(2 \cdot {x}^{2} + 4 \cdot {x}^{2}\right)\right)\right) + {x}^{4}\right)\right) \cdot \varepsilon} \]
                  5. Applied rewrites99.3%

                    \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(10 \cdot \left(x \cdot x\right), \varepsilon, {x}^{3} \cdot 10\right), \varepsilon, {x}^{4} \cdot 5\right) \cdot \varepsilon} \]
                  6. Taylor expanded in x around 0

                    \[\leadsto \left({x}^{2} \cdot \left(10 \cdot {\varepsilon}^{2} + x \cdot \left(5 \cdot x + 10 \cdot \varepsilon\right)\right)\right) \cdot \varepsilon \]
                  7. Step-by-step derivation
                    1. Applied rewrites99.3%

                      \[\leadsto \left(\left(\mathsf{fma}\left(x \cdot x, 5, \left(\varepsilon \cdot \left(\varepsilon + x\right)\right) \cdot 10\right) \cdot x\right) \cdot x\right) \cdot \varepsilon \]
                    2. Taylor expanded in x around inf

                      \[\leadsto \left(\left(\mathsf{fma}\left(x \cdot x, 5, 10 \cdot \left(\varepsilon \cdot x\right)\right) \cdot x\right) \cdot x\right) \cdot \varepsilon \]
                    3. Step-by-step derivation
                      1. Applied rewrites99.3%

                        \[\leadsto \left(\left(\mathsf{fma}\left(x \cdot x, 5, \left(\varepsilon \cdot x\right) \cdot 10\right) \cdot x\right) \cdot x\right) \cdot \varepsilon \]
                      2. Step-by-step derivation
                        1. Applied rewrites99.3%

                          \[\leadsto \left(\mathsf{fma}\left(5 \cdot x, x, \left(\varepsilon \cdot x\right) \cdot 10\right) \cdot \left(x \cdot x\right)\right) \cdot \varepsilon \]

                        if 5.0000000000000003e-254 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64)))

                        1. Initial program 98.4%

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

                          \[\leadsto \color{blue}{x \cdot \left(4 \cdot {\varepsilon}^{4} + {\varepsilon}^{4}\right) + {\varepsilon}^{5}} \]
                        4. Step-by-step derivation
                          1. *-commutativeN/A

                            \[\leadsto \color{blue}{\left(4 \cdot {\varepsilon}^{4} + {\varepsilon}^{4}\right) \cdot x} + {\varepsilon}^{5} \]
                          2. lower-fma.f64N/A

                            \[\leadsto \color{blue}{\mathsf{fma}\left(4 \cdot {\varepsilon}^{4} + {\varepsilon}^{4}, x, {\varepsilon}^{5}\right)} \]
                          3. distribute-lft1-inN/A

                            \[\leadsto \mathsf{fma}\left(\color{blue}{\left(4 + 1\right) \cdot {\varepsilon}^{4}}, x, {\varepsilon}^{5}\right) \]
                          4. metadata-evalN/A

                            \[\leadsto \mathsf{fma}\left(\color{blue}{5} \cdot {\varepsilon}^{4}, x, {\varepsilon}^{5}\right) \]
                          5. *-commutativeN/A

                            \[\leadsto \mathsf{fma}\left(\color{blue}{{\varepsilon}^{4} \cdot 5}, x, {\varepsilon}^{5}\right) \]
                          6. lower-*.f64N/A

                            \[\leadsto \mathsf{fma}\left(\color{blue}{{\varepsilon}^{4} \cdot 5}, x, {\varepsilon}^{5}\right) \]
                          7. lower-pow.f64N/A

                            \[\leadsto \mathsf{fma}\left(\color{blue}{{\varepsilon}^{4}} \cdot 5, x, {\varepsilon}^{5}\right) \]
                          8. lower-pow.f6491.9

                            \[\leadsto \mathsf{fma}\left({\varepsilon}^{4} \cdot 5, x, \color{blue}{{\varepsilon}^{5}}\right) \]
                        5. Applied rewrites91.9%

                          \[\leadsto \color{blue}{\mathsf{fma}\left({\varepsilon}^{4} \cdot 5, x, {\varepsilon}^{5}\right)} \]
                        6. Taylor expanded in x around 0

                          \[\leadsto \color{blue}{x \cdot \left(4 \cdot {\varepsilon}^{4} + \left(x \cdot \left(4 \cdot {\varepsilon}^{3} + \left(\varepsilon \cdot \left(2 \cdot {\varepsilon}^{2} + 4 \cdot {\varepsilon}^{2}\right) + x \cdot \left(2 \cdot {\varepsilon}^{2} + 8 \cdot {\varepsilon}^{2}\right)\right)\right) + {\varepsilon}^{4}\right)\right) + {\varepsilon}^{5}} \]
                        7. Applied rewrites94.9%

                          \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(\left(\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon + x\right)\right)\right) \cdot 10, x, {\varepsilon}^{4} \cdot 5\right), x, {\varepsilon}^{5}\right)} \]
                        8. Taylor expanded in eps around 0

                          \[\leadsto \mathsf{fma}\left({\varepsilon}^{2} \cdot \left(10 \cdot {x}^{2} + \varepsilon \cdot \left(5 \cdot \varepsilon + 10 \cdot x\right)\right), x, {\varepsilon}^{5}\right) \]
                        9. Step-by-step derivation
                          1. Applied rewrites94.9%

                            \[\leadsto \mathsf{fma}\left(\left(\mathsf{fma}\left(5 \cdot \varepsilon, \varepsilon, \left(x \cdot \left(\varepsilon + x\right)\right) \cdot 10\right) \cdot \varepsilon\right) \cdot \varepsilon, x, {\varepsilon}^{5}\right) \]
                        10. Recombined 3 regimes into one program.
                        11. Final simplification97.9%

                          \[\leadsto \begin{array}{l} \mathbf{if}\;{\left(\varepsilon + x\right)}^{5} - {x}^{5} \leq -2 \cdot 10^{-317}:\\ \;\;\;\;{\varepsilon}^{3} \cdot \mathsf{fma}\left(\mathsf{fma}\left(5, x, \varepsilon\right), \varepsilon, \left(10 \cdot x\right) \cdot x\right)\\ \mathbf{elif}\;{\left(\varepsilon + x\right)}^{5} - {x}^{5} \leq 5 \cdot 10^{-254}:\\ \;\;\;\;\left(\left(x \cdot x\right) \cdot \mathsf{fma}\left(5 \cdot x, x, \left(\varepsilon \cdot x\right) \cdot 10\right)\right) \cdot \varepsilon\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(\mathsf{fma}\left(5 \cdot \varepsilon, \varepsilon, \left(\left(\varepsilon + x\right) \cdot x\right) \cdot 10\right) \cdot \varepsilon\right) \cdot \varepsilon, x, {\varepsilon}^{5}\right)\\ \end{array} \]
                        12. Add Preprocessing

                        Alternative 4: 97.3% accurate, 0.4× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(\varepsilon + x\right)}^{5} - {x}^{5}\\ \mathbf{if}\;t\_0 \leq -2 \cdot 10^{-317}:\\ \;\;\;\;{\varepsilon}^{3} \cdot \mathsf{fma}\left(\mathsf{fma}\left(5, x, \varepsilon\right), \varepsilon, \left(10 \cdot x\right) \cdot x\right)\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-254}:\\ \;\;\;\;\left(\left(x \cdot x\right) \cdot \mathsf{fma}\left(5 \cdot x, x, \left(\varepsilon \cdot x\right) \cdot 10\right)\right) \cdot \varepsilon\\ \mathbf{else}:\\ \;\;\;\;\left(\varepsilon \cdot \varepsilon\right) \cdot \mathsf{fma}\left(\left(\varepsilon + x\right) \cdot \left(x \cdot x\right), 10, \left(\mathsf{fma}\left(5, x, \varepsilon\right) \cdot \varepsilon\right) \cdot \varepsilon\right)\\ \end{array} \end{array} \]
                        (FPCore (x eps)
                         :precision binary64
                         (let* ((t_0 (- (pow (+ eps x) 5.0) (pow x 5.0))))
                           (if (<= t_0 -2e-317)
                             (* (pow eps 3.0) (fma (fma 5.0 x eps) eps (* (* 10.0 x) x)))
                             (if (<= t_0 5e-254)
                               (* (* (* x x) (fma (* 5.0 x) x (* (* eps x) 10.0))) eps)
                               (*
                                (* eps eps)
                                (fma (* (+ eps x) (* x x)) 10.0 (* (* (fma 5.0 x eps) eps) eps)))))))
                        double code(double x, double eps) {
                        	double t_0 = pow((eps + x), 5.0) - pow(x, 5.0);
                        	double tmp;
                        	if (t_0 <= -2e-317) {
                        		tmp = pow(eps, 3.0) * fma(fma(5.0, x, eps), eps, ((10.0 * x) * x));
                        	} else if (t_0 <= 5e-254) {
                        		tmp = ((x * x) * fma((5.0 * x), x, ((eps * x) * 10.0))) * eps;
                        	} else {
                        		tmp = (eps * eps) * fma(((eps + x) * (x * x)), 10.0, ((fma(5.0, x, eps) * eps) * eps));
                        	}
                        	return tmp;
                        }
                        
                        function code(x, eps)
                        	t_0 = Float64((Float64(eps + x) ^ 5.0) - (x ^ 5.0))
                        	tmp = 0.0
                        	if (t_0 <= -2e-317)
                        		tmp = Float64((eps ^ 3.0) * fma(fma(5.0, x, eps), eps, Float64(Float64(10.0 * x) * x)));
                        	elseif (t_0 <= 5e-254)
                        		tmp = Float64(Float64(Float64(x * x) * fma(Float64(5.0 * x), x, Float64(Float64(eps * x) * 10.0))) * eps);
                        	else
                        		tmp = Float64(Float64(eps * eps) * fma(Float64(Float64(eps + x) * Float64(x * x)), 10.0, Float64(Float64(fma(5.0, x, eps) * eps) * eps)));
                        	end
                        	return tmp
                        end
                        
                        code[x_, eps_] := Block[{t$95$0 = N[(N[Power[N[(eps + x), $MachinePrecision], 5.0], $MachinePrecision] - N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e-317], N[(N[Power[eps, 3.0], $MachinePrecision] * N[(N[(5.0 * x + eps), $MachinePrecision] * eps + N[(N[(10.0 * x), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e-254], N[(N[(N[(x * x), $MachinePrecision] * N[(N[(5.0 * x), $MachinePrecision] * x + N[(N[(eps * x), $MachinePrecision] * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * eps), $MachinePrecision], N[(N[(eps * eps), $MachinePrecision] * N[(N[(N[(eps + x), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision] * 10.0 + N[(N[(N[(5.0 * x + eps), $MachinePrecision] * eps), $MachinePrecision] * eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        t_0 := {\left(\varepsilon + x\right)}^{5} - {x}^{5}\\
                        \mathbf{if}\;t\_0 \leq -2 \cdot 10^{-317}:\\
                        \;\;\;\;{\varepsilon}^{3} \cdot \mathsf{fma}\left(\mathsf{fma}\left(5, x, \varepsilon\right), \varepsilon, \left(10 \cdot x\right) \cdot x\right)\\
                        
                        \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-254}:\\
                        \;\;\;\;\left(\left(x \cdot x\right) \cdot \mathsf{fma}\left(5 \cdot x, x, \left(\varepsilon \cdot x\right) \cdot 10\right)\right) \cdot \varepsilon\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;\left(\varepsilon \cdot \varepsilon\right) \cdot \mathsf{fma}\left(\left(\varepsilon + x\right) \cdot \left(x \cdot x\right), 10, \left(\mathsf{fma}\left(5, x, \varepsilon\right) \cdot \varepsilon\right) \cdot \varepsilon\right)\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 3 regimes
                        2. if (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -1.99999997e-317

                          1. Initial program 97.7%

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

                            \[\leadsto \color{blue}{x \cdot \left(4 \cdot {\varepsilon}^{4} + {\varepsilon}^{4}\right) + {\varepsilon}^{5}} \]
                          4. Step-by-step derivation
                            1. *-commutativeN/A

                              \[\leadsto \color{blue}{\left(4 \cdot {\varepsilon}^{4} + {\varepsilon}^{4}\right) \cdot x} + {\varepsilon}^{5} \]
                            2. lower-fma.f64N/A

                              \[\leadsto \color{blue}{\mathsf{fma}\left(4 \cdot {\varepsilon}^{4} + {\varepsilon}^{4}, x, {\varepsilon}^{5}\right)} \]
                            3. distribute-lft1-inN/A

                              \[\leadsto \mathsf{fma}\left(\color{blue}{\left(4 + 1\right) \cdot {\varepsilon}^{4}}, x, {\varepsilon}^{5}\right) \]
                            4. metadata-evalN/A

                              \[\leadsto \mathsf{fma}\left(\color{blue}{5} \cdot {\varepsilon}^{4}, x, {\varepsilon}^{5}\right) \]
                            5. *-commutativeN/A

                              \[\leadsto \mathsf{fma}\left(\color{blue}{{\varepsilon}^{4} \cdot 5}, x, {\varepsilon}^{5}\right) \]
                            6. lower-*.f64N/A

                              \[\leadsto \mathsf{fma}\left(\color{blue}{{\varepsilon}^{4} \cdot 5}, x, {\varepsilon}^{5}\right) \]
                            7. lower-pow.f64N/A

                              \[\leadsto \mathsf{fma}\left(\color{blue}{{\varepsilon}^{4}} \cdot 5, x, {\varepsilon}^{5}\right) \]
                            8. lower-pow.f6489.4

                              \[\leadsto \mathsf{fma}\left({\varepsilon}^{4} \cdot 5, x, \color{blue}{{\varepsilon}^{5}}\right) \]
                          5. Applied rewrites89.4%

                            \[\leadsto \color{blue}{\mathsf{fma}\left({\varepsilon}^{4} \cdot 5, x, {\varepsilon}^{5}\right)} \]
                          6. Taylor expanded in x around 0

                            \[\leadsto \color{blue}{x \cdot \left(4 \cdot {\varepsilon}^{4} + \left(x \cdot \left(4 \cdot {\varepsilon}^{3} + \varepsilon \cdot \left(2 \cdot {\varepsilon}^{2} + 4 \cdot {\varepsilon}^{2}\right)\right) + {\varepsilon}^{4}\right)\right) + {\varepsilon}^{5}} \]
                          7. Applied rewrites90.1%

                            \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(5, x, \varepsilon\right), \varepsilon, \left(10 \cdot x\right) \cdot x\right) \cdot {\varepsilon}^{3}} \]

                          if -1.99999997e-317 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 5.0000000000000003e-254

                          1. Initial program 90.1%

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

                            \[\leadsto \color{blue}{\varepsilon \cdot \left(4 \cdot {x}^{4} + \left(\varepsilon \cdot \left(4 \cdot {x}^{3} + \left(\varepsilon \cdot \left(2 \cdot {x}^{2} + 8 \cdot {x}^{2}\right) + x \cdot \left(2 \cdot {x}^{2} + 4 \cdot {x}^{2}\right)\right)\right) + {x}^{4}\right)\right)} \]
                          4. Step-by-step derivation
                            1. *-commutativeN/A

                              \[\leadsto \color{blue}{\left(4 \cdot {x}^{4} + \left(\varepsilon \cdot \left(4 \cdot {x}^{3} + \left(\varepsilon \cdot \left(2 \cdot {x}^{2} + 8 \cdot {x}^{2}\right) + x \cdot \left(2 \cdot {x}^{2} + 4 \cdot {x}^{2}\right)\right)\right) + {x}^{4}\right)\right) \cdot \varepsilon} \]
                            2. lower-*.f64N/A

                              \[\leadsto \color{blue}{\left(4 \cdot {x}^{4} + \left(\varepsilon \cdot \left(4 \cdot {x}^{3} + \left(\varepsilon \cdot \left(2 \cdot {x}^{2} + 8 \cdot {x}^{2}\right) + x \cdot \left(2 \cdot {x}^{2} + 4 \cdot {x}^{2}\right)\right)\right) + {x}^{4}\right)\right) \cdot \varepsilon} \]
                          5. Applied rewrites99.3%

                            \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(10 \cdot \left(x \cdot x\right), \varepsilon, {x}^{3} \cdot 10\right), \varepsilon, {x}^{4} \cdot 5\right) \cdot \varepsilon} \]
                          6. Taylor expanded in x around 0

                            \[\leadsto \left({x}^{2} \cdot \left(10 \cdot {\varepsilon}^{2} + x \cdot \left(5 \cdot x + 10 \cdot \varepsilon\right)\right)\right) \cdot \varepsilon \]
                          7. Step-by-step derivation
                            1. Applied rewrites99.3%

                              \[\leadsto \left(\left(\mathsf{fma}\left(x \cdot x, 5, \left(\varepsilon \cdot \left(\varepsilon + x\right)\right) \cdot 10\right) \cdot x\right) \cdot x\right) \cdot \varepsilon \]
                            2. Taylor expanded in x around inf

                              \[\leadsto \left(\left(\mathsf{fma}\left(x \cdot x, 5, 10 \cdot \left(\varepsilon \cdot x\right)\right) \cdot x\right) \cdot x\right) \cdot \varepsilon \]
                            3. Step-by-step derivation
                              1. Applied rewrites99.3%

                                \[\leadsto \left(\left(\mathsf{fma}\left(x \cdot x, 5, \left(\varepsilon \cdot x\right) \cdot 10\right) \cdot x\right) \cdot x\right) \cdot \varepsilon \]
                              2. Step-by-step derivation
                                1. Applied rewrites99.3%

                                  \[\leadsto \left(\mathsf{fma}\left(5 \cdot x, x, \left(\varepsilon \cdot x\right) \cdot 10\right) \cdot \left(x \cdot x\right)\right) \cdot \varepsilon \]

                                if 5.0000000000000003e-254 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64)))

                                1. Initial program 98.4%

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

                                  \[\leadsto \color{blue}{x \cdot \left(4 \cdot {\varepsilon}^{4} + {\varepsilon}^{4}\right) + {\varepsilon}^{5}} \]
                                4. Step-by-step derivation
                                  1. *-commutativeN/A

                                    \[\leadsto \color{blue}{\left(4 \cdot {\varepsilon}^{4} + {\varepsilon}^{4}\right) \cdot x} + {\varepsilon}^{5} \]
                                  2. lower-fma.f64N/A

                                    \[\leadsto \color{blue}{\mathsf{fma}\left(4 \cdot {\varepsilon}^{4} + {\varepsilon}^{4}, x, {\varepsilon}^{5}\right)} \]
                                  3. distribute-lft1-inN/A

                                    \[\leadsto \mathsf{fma}\left(\color{blue}{\left(4 + 1\right) \cdot {\varepsilon}^{4}}, x, {\varepsilon}^{5}\right) \]
                                  4. metadata-evalN/A

                                    \[\leadsto \mathsf{fma}\left(\color{blue}{5} \cdot {\varepsilon}^{4}, x, {\varepsilon}^{5}\right) \]
                                  5. *-commutativeN/A

                                    \[\leadsto \mathsf{fma}\left(\color{blue}{{\varepsilon}^{4} \cdot 5}, x, {\varepsilon}^{5}\right) \]
                                  6. lower-*.f64N/A

                                    \[\leadsto \mathsf{fma}\left(\color{blue}{{\varepsilon}^{4} \cdot 5}, x, {\varepsilon}^{5}\right) \]
                                  7. lower-pow.f64N/A

                                    \[\leadsto \mathsf{fma}\left(\color{blue}{{\varepsilon}^{4}} \cdot 5, x, {\varepsilon}^{5}\right) \]
                                  8. lower-pow.f6491.9

                                    \[\leadsto \mathsf{fma}\left({\varepsilon}^{4} \cdot 5, x, \color{blue}{{\varepsilon}^{5}}\right) \]
                                5. Applied rewrites91.9%

                                  \[\leadsto \color{blue}{\mathsf{fma}\left({\varepsilon}^{4} \cdot 5, x, {\varepsilon}^{5}\right)} \]
                                6. Taylor expanded in x around 0

                                  \[\leadsto \color{blue}{x \cdot \left(4 \cdot {\varepsilon}^{4} + \left(x \cdot \left(4 \cdot {\varepsilon}^{3} + \left(\varepsilon \cdot \left(2 \cdot {\varepsilon}^{2} + 4 \cdot {\varepsilon}^{2}\right) + x \cdot \left(2 \cdot {\varepsilon}^{2} + 8 \cdot {\varepsilon}^{2}\right)\right)\right) + {\varepsilon}^{4}\right)\right) + {\varepsilon}^{5}} \]
                                7. Applied rewrites94.9%

                                  \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(\left(\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon + x\right)\right)\right) \cdot 10, x, {\varepsilon}^{4} \cdot 5\right), x, {\varepsilon}^{5}\right)} \]
                                8. Taylor expanded in eps around 0

                                  \[\leadsto {\varepsilon}^{2} \cdot \color{blue}{\left(10 \cdot {x}^{3} + \varepsilon \cdot \left(10 \cdot {x}^{2} + \varepsilon \cdot \left(\varepsilon + 5 \cdot x\right)\right)\right)} \]
                                9. Step-by-step derivation
                                  1. Applied rewrites94.1%

                                    \[\leadsto \mathsf{fma}\left(\left(x \cdot x\right) \cdot \left(\varepsilon + x\right), 10, \left(\mathsf{fma}\left(5, x, \varepsilon\right) \cdot \varepsilon\right) \cdot \varepsilon\right) \cdot \color{blue}{\left(\varepsilon \cdot \varepsilon\right)} \]
                                10. Recombined 3 regimes into one program.
                                11. Final simplification97.8%

                                  \[\leadsto \begin{array}{l} \mathbf{if}\;{\left(\varepsilon + x\right)}^{5} - {x}^{5} \leq -2 \cdot 10^{-317}:\\ \;\;\;\;{\varepsilon}^{3} \cdot \mathsf{fma}\left(\mathsf{fma}\left(5, x, \varepsilon\right), \varepsilon, \left(10 \cdot x\right) \cdot x\right)\\ \mathbf{elif}\;{\left(\varepsilon + x\right)}^{5} - {x}^{5} \leq 5 \cdot 10^{-254}:\\ \;\;\;\;\left(\left(x \cdot x\right) \cdot \mathsf{fma}\left(5 \cdot x, x, \left(\varepsilon \cdot x\right) \cdot 10\right)\right) \cdot \varepsilon\\ \mathbf{else}:\\ \;\;\;\;\left(\varepsilon \cdot \varepsilon\right) \cdot \mathsf{fma}\left(\left(\varepsilon + x\right) \cdot \left(x \cdot x\right), 10, \left(\mathsf{fma}\left(5, x, \varepsilon\right) \cdot \varepsilon\right) \cdot \varepsilon\right)\\ \end{array} \]
                                12. Add Preprocessing

                                Alternative 5: 97.3% accurate, 0.4× speedup?

                                \[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(\varepsilon + x\right)}^{5} - {x}^{5}\\ \mathbf{if}\;t\_0 \leq -2 \cdot 10^{-317}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{\varepsilon}, 5, 1\right) \cdot {\varepsilon}^{5}\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-254}:\\ \;\;\;\;\left(\left(x \cdot x\right) \cdot \mathsf{fma}\left(5 \cdot x, x, \left(\varepsilon \cdot x\right) \cdot 10\right)\right) \cdot \varepsilon\\ \mathbf{else}:\\ \;\;\;\;\left(\varepsilon \cdot \varepsilon\right) \cdot \mathsf{fma}\left(\left(\varepsilon + x\right) \cdot \left(x \cdot x\right), 10, \left(\mathsf{fma}\left(5, x, \varepsilon\right) \cdot \varepsilon\right) \cdot \varepsilon\right)\\ \end{array} \end{array} \]
                                (FPCore (x eps)
                                 :precision binary64
                                 (let* ((t_0 (- (pow (+ eps x) 5.0) (pow x 5.0))))
                                   (if (<= t_0 -2e-317)
                                     (* (fma (/ x eps) 5.0 1.0) (pow eps 5.0))
                                     (if (<= t_0 5e-254)
                                       (* (* (* x x) (fma (* 5.0 x) x (* (* eps x) 10.0))) eps)
                                       (*
                                        (* eps eps)
                                        (fma (* (+ eps x) (* x x)) 10.0 (* (* (fma 5.0 x eps) eps) eps)))))))
                                double code(double x, double eps) {
                                	double t_0 = pow((eps + x), 5.0) - pow(x, 5.0);
                                	double tmp;
                                	if (t_0 <= -2e-317) {
                                		tmp = fma((x / eps), 5.0, 1.0) * pow(eps, 5.0);
                                	} else if (t_0 <= 5e-254) {
                                		tmp = ((x * x) * fma((5.0 * x), x, ((eps * x) * 10.0))) * eps;
                                	} else {
                                		tmp = (eps * eps) * fma(((eps + x) * (x * x)), 10.0, ((fma(5.0, x, eps) * eps) * eps));
                                	}
                                	return tmp;
                                }
                                
                                function code(x, eps)
                                	t_0 = Float64((Float64(eps + x) ^ 5.0) - (x ^ 5.0))
                                	tmp = 0.0
                                	if (t_0 <= -2e-317)
                                		tmp = Float64(fma(Float64(x / eps), 5.0, 1.0) * (eps ^ 5.0));
                                	elseif (t_0 <= 5e-254)
                                		tmp = Float64(Float64(Float64(x * x) * fma(Float64(5.0 * x), x, Float64(Float64(eps * x) * 10.0))) * eps);
                                	else
                                		tmp = Float64(Float64(eps * eps) * fma(Float64(Float64(eps + x) * Float64(x * x)), 10.0, Float64(Float64(fma(5.0, x, eps) * eps) * eps)));
                                	end
                                	return tmp
                                end
                                
                                code[x_, eps_] := Block[{t$95$0 = N[(N[Power[N[(eps + x), $MachinePrecision], 5.0], $MachinePrecision] - N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e-317], N[(N[(N[(x / eps), $MachinePrecision] * 5.0 + 1.0), $MachinePrecision] * N[Power[eps, 5.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e-254], N[(N[(N[(x * x), $MachinePrecision] * N[(N[(5.0 * x), $MachinePrecision] * x + N[(N[(eps * x), $MachinePrecision] * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * eps), $MachinePrecision], N[(N[(eps * eps), $MachinePrecision] * N[(N[(N[(eps + x), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision] * 10.0 + N[(N[(N[(5.0 * x + eps), $MachinePrecision] * eps), $MachinePrecision] * eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
                                
                                \begin{array}{l}
                                
                                \\
                                \begin{array}{l}
                                t_0 := {\left(\varepsilon + x\right)}^{5} - {x}^{5}\\
                                \mathbf{if}\;t\_0 \leq -2 \cdot 10^{-317}:\\
                                \;\;\;\;\mathsf{fma}\left(\frac{x}{\varepsilon}, 5, 1\right) \cdot {\varepsilon}^{5}\\
                                
                                \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-254}:\\
                                \;\;\;\;\left(\left(x \cdot x\right) \cdot \mathsf{fma}\left(5 \cdot x, x, \left(\varepsilon \cdot x\right) \cdot 10\right)\right) \cdot \varepsilon\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;\left(\varepsilon \cdot \varepsilon\right) \cdot \mathsf{fma}\left(\left(\varepsilon + x\right) \cdot \left(x \cdot x\right), 10, \left(\mathsf{fma}\left(5, x, \varepsilon\right) \cdot \varepsilon\right) \cdot \varepsilon\right)\\
                                
                                
                                \end{array}
                                \end{array}
                                
                                Derivation
                                1. Split input into 3 regimes
                                2. if (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -1.99999997e-317

                                  1. Initial program 97.7%

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

                                    \[\leadsto \color{blue}{{\varepsilon}^{5} \cdot \left(1 + \left(4 \cdot \frac{x}{\varepsilon} + \frac{x}{\varepsilon}\right)\right)} \]
                                  4. Step-by-step derivation
                                    1. *-commutativeN/A

                                      \[\leadsto \color{blue}{\left(1 + \left(4 \cdot \frac{x}{\varepsilon} + \frac{x}{\varepsilon}\right)\right) \cdot {\varepsilon}^{5}} \]
                                    2. lower-*.f64N/A

                                      \[\leadsto \color{blue}{\left(1 + \left(4 \cdot \frac{x}{\varepsilon} + \frac{x}{\varepsilon}\right)\right) \cdot {\varepsilon}^{5}} \]
                                    3. +-commutativeN/A

                                      \[\leadsto \color{blue}{\left(\left(4 \cdot \frac{x}{\varepsilon} + \frac{x}{\varepsilon}\right) + 1\right)} \cdot {\varepsilon}^{5} \]
                                    4. distribute-lft1-inN/A

                                      \[\leadsto \left(\color{blue}{\left(4 + 1\right) \cdot \frac{x}{\varepsilon}} + 1\right) \cdot {\varepsilon}^{5} \]
                                    5. metadata-evalN/A

                                      \[\leadsto \left(\color{blue}{5} \cdot \frac{x}{\varepsilon} + 1\right) \cdot {\varepsilon}^{5} \]
                                    6. *-commutativeN/A

                                      \[\leadsto \left(\color{blue}{\frac{x}{\varepsilon} \cdot 5} + 1\right) \cdot {\varepsilon}^{5} \]
                                    7. lower-fma.f64N/A

                                      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{x}{\varepsilon}, 5, 1\right)} \cdot {\varepsilon}^{5} \]
                                    8. lower-/.f64N/A

                                      \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{x}{\varepsilon}}, 5, 1\right) \cdot {\varepsilon}^{5} \]
                                    9. lower-pow.f6489.4

                                      \[\leadsto \mathsf{fma}\left(\frac{x}{\varepsilon}, 5, 1\right) \cdot \color{blue}{{\varepsilon}^{5}} \]
                                  5. Applied rewrites89.4%

                                    \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{x}{\varepsilon}, 5, 1\right) \cdot {\varepsilon}^{5}} \]

                                  if -1.99999997e-317 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 5.0000000000000003e-254

                                  1. Initial program 90.1%

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

                                    \[\leadsto \color{blue}{\varepsilon \cdot \left(4 \cdot {x}^{4} + \left(\varepsilon \cdot \left(4 \cdot {x}^{3} + \left(\varepsilon \cdot \left(2 \cdot {x}^{2} + 8 \cdot {x}^{2}\right) + x \cdot \left(2 \cdot {x}^{2} + 4 \cdot {x}^{2}\right)\right)\right) + {x}^{4}\right)\right)} \]
                                  4. Step-by-step derivation
                                    1. *-commutativeN/A

                                      \[\leadsto \color{blue}{\left(4 \cdot {x}^{4} + \left(\varepsilon \cdot \left(4 \cdot {x}^{3} + \left(\varepsilon \cdot \left(2 \cdot {x}^{2} + 8 \cdot {x}^{2}\right) + x \cdot \left(2 \cdot {x}^{2} + 4 \cdot {x}^{2}\right)\right)\right) + {x}^{4}\right)\right) \cdot \varepsilon} \]
                                    2. lower-*.f64N/A

                                      \[\leadsto \color{blue}{\left(4 \cdot {x}^{4} + \left(\varepsilon \cdot \left(4 \cdot {x}^{3} + \left(\varepsilon \cdot \left(2 \cdot {x}^{2} + 8 \cdot {x}^{2}\right) + x \cdot \left(2 \cdot {x}^{2} + 4 \cdot {x}^{2}\right)\right)\right) + {x}^{4}\right)\right) \cdot \varepsilon} \]
                                  5. Applied rewrites99.3%

                                    \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(10 \cdot \left(x \cdot x\right), \varepsilon, {x}^{3} \cdot 10\right), \varepsilon, {x}^{4} \cdot 5\right) \cdot \varepsilon} \]
                                  6. Taylor expanded in x around 0

                                    \[\leadsto \left({x}^{2} \cdot \left(10 \cdot {\varepsilon}^{2} + x \cdot \left(5 \cdot x + 10 \cdot \varepsilon\right)\right)\right) \cdot \varepsilon \]
                                  7. Step-by-step derivation
                                    1. Applied rewrites99.3%

                                      \[\leadsto \left(\left(\mathsf{fma}\left(x \cdot x, 5, \left(\varepsilon \cdot \left(\varepsilon + x\right)\right) \cdot 10\right) \cdot x\right) \cdot x\right) \cdot \varepsilon \]
                                    2. Taylor expanded in x around inf

                                      \[\leadsto \left(\left(\mathsf{fma}\left(x \cdot x, 5, 10 \cdot \left(\varepsilon \cdot x\right)\right) \cdot x\right) \cdot x\right) \cdot \varepsilon \]
                                    3. Step-by-step derivation
                                      1. Applied rewrites99.3%

                                        \[\leadsto \left(\left(\mathsf{fma}\left(x \cdot x, 5, \left(\varepsilon \cdot x\right) \cdot 10\right) \cdot x\right) \cdot x\right) \cdot \varepsilon \]
                                      2. Step-by-step derivation
                                        1. Applied rewrites99.3%

                                          \[\leadsto \left(\mathsf{fma}\left(5 \cdot x, x, \left(\varepsilon \cdot x\right) \cdot 10\right) \cdot \left(x \cdot x\right)\right) \cdot \varepsilon \]

                                        if 5.0000000000000003e-254 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64)))

                                        1. Initial program 98.4%

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

                                          \[\leadsto \color{blue}{x \cdot \left(4 \cdot {\varepsilon}^{4} + {\varepsilon}^{4}\right) + {\varepsilon}^{5}} \]
                                        4. Step-by-step derivation
                                          1. *-commutativeN/A

                                            \[\leadsto \color{blue}{\left(4 \cdot {\varepsilon}^{4} + {\varepsilon}^{4}\right) \cdot x} + {\varepsilon}^{5} \]
                                          2. lower-fma.f64N/A

                                            \[\leadsto \color{blue}{\mathsf{fma}\left(4 \cdot {\varepsilon}^{4} + {\varepsilon}^{4}, x, {\varepsilon}^{5}\right)} \]
                                          3. distribute-lft1-inN/A

                                            \[\leadsto \mathsf{fma}\left(\color{blue}{\left(4 + 1\right) \cdot {\varepsilon}^{4}}, x, {\varepsilon}^{5}\right) \]
                                          4. metadata-evalN/A

                                            \[\leadsto \mathsf{fma}\left(\color{blue}{5} \cdot {\varepsilon}^{4}, x, {\varepsilon}^{5}\right) \]
                                          5. *-commutativeN/A

                                            \[\leadsto \mathsf{fma}\left(\color{blue}{{\varepsilon}^{4} \cdot 5}, x, {\varepsilon}^{5}\right) \]
                                          6. lower-*.f64N/A

                                            \[\leadsto \mathsf{fma}\left(\color{blue}{{\varepsilon}^{4} \cdot 5}, x, {\varepsilon}^{5}\right) \]
                                          7. lower-pow.f64N/A

                                            \[\leadsto \mathsf{fma}\left(\color{blue}{{\varepsilon}^{4}} \cdot 5, x, {\varepsilon}^{5}\right) \]
                                          8. lower-pow.f6491.9

                                            \[\leadsto \mathsf{fma}\left({\varepsilon}^{4} \cdot 5, x, \color{blue}{{\varepsilon}^{5}}\right) \]
                                        5. Applied rewrites91.9%

                                          \[\leadsto \color{blue}{\mathsf{fma}\left({\varepsilon}^{4} \cdot 5, x, {\varepsilon}^{5}\right)} \]
                                        6. Taylor expanded in x around 0

                                          \[\leadsto \color{blue}{x \cdot \left(4 \cdot {\varepsilon}^{4} + \left(x \cdot \left(4 \cdot {\varepsilon}^{3} + \left(\varepsilon \cdot \left(2 \cdot {\varepsilon}^{2} + 4 \cdot {\varepsilon}^{2}\right) + x \cdot \left(2 \cdot {\varepsilon}^{2} + 8 \cdot {\varepsilon}^{2}\right)\right)\right) + {\varepsilon}^{4}\right)\right) + {\varepsilon}^{5}} \]
                                        7. Applied rewrites94.9%

                                          \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(\left(\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon + x\right)\right)\right) \cdot 10, x, {\varepsilon}^{4} \cdot 5\right), x, {\varepsilon}^{5}\right)} \]
                                        8. Taylor expanded in eps around 0

                                          \[\leadsto {\varepsilon}^{2} \cdot \color{blue}{\left(10 \cdot {x}^{3} + \varepsilon \cdot \left(10 \cdot {x}^{2} + \varepsilon \cdot \left(\varepsilon + 5 \cdot x\right)\right)\right)} \]
                                        9. Step-by-step derivation
                                          1. Applied rewrites94.1%

                                            \[\leadsto \mathsf{fma}\left(\left(x \cdot x\right) \cdot \left(\varepsilon + x\right), 10, \left(\mathsf{fma}\left(5, x, \varepsilon\right) \cdot \varepsilon\right) \cdot \varepsilon\right) \cdot \color{blue}{\left(\varepsilon \cdot \varepsilon\right)} \]
                                        10. Recombined 3 regimes into one program.
                                        11. Final simplification97.8%

                                          \[\leadsto \begin{array}{l} \mathbf{if}\;{\left(\varepsilon + x\right)}^{5} - {x}^{5} \leq -2 \cdot 10^{-317}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{\varepsilon}, 5, 1\right) \cdot {\varepsilon}^{5}\\ \mathbf{elif}\;{\left(\varepsilon + x\right)}^{5} - {x}^{5} \leq 5 \cdot 10^{-254}:\\ \;\;\;\;\left(\left(x \cdot x\right) \cdot \mathsf{fma}\left(5 \cdot x, x, \left(\varepsilon \cdot x\right) \cdot 10\right)\right) \cdot \varepsilon\\ \mathbf{else}:\\ \;\;\;\;\left(\varepsilon \cdot \varepsilon\right) \cdot \mathsf{fma}\left(\left(\varepsilon + x\right) \cdot \left(x \cdot x\right), 10, \left(\mathsf{fma}\left(5, x, \varepsilon\right) \cdot \varepsilon\right) \cdot \varepsilon\right)\\ \end{array} \]
                                        12. Add Preprocessing

                                        Alternative 6: 97.3% accurate, 0.4× speedup?

                                        \[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(\varepsilon + x\right)}^{5} - {x}^{5}\\ t_1 := \left(\varepsilon \cdot \varepsilon\right) \cdot \mathsf{fma}\left(\left(\varepsilon + x\right) \cdot \left(x \cdot x\right), 10, \left(\mathsf{fma}\left(5, x, \varepsilon\right) \cdot \varepsilon\right) \cdot \varepsilon\right)\\ \mathbf{if}\;t\_0 \leq -2 \cdot 10^{-317}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-254}:\\ \;\;\;\;\left(\left(x \cdot x\right) \cdot \mathsf{fma}\left(5 \cdot x, x, \left(\varepsilon \cdot x\right) \cdot 10\right)\right) \cdot \varepsilon\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                                        (FPCore (x eps)
                                         :precision binary64
                                         (let* ((t_0 (- (pow (+ eps x) 5.0) (pow x 5.0)))
                                                (t_1
                                                 (*
                                                  (* eps eps)
                                                  (fma (* (+ eps x) (* x x)) 10.0 (* (* (fma 5.0 x eps) eps) eps)))))
                                           (if (<= t_0 -2e-317)
                                             t_1
                                             (if (<= t_0 5e-254)
                                               (* (* (* x x) (fma (* 5.0 x) x (* (* eps x) 10.0))) eps)
                                               t_1))))
                                        double code(double x, double eps) {
                                        	double t_0 = pow((eps + x), 5.0) - pow(x, 5.0);
                                        	double t_1 = (eps * eps) * fma(((eps + x) * (x * x)), 10.0, ((fma(5.0, x, eps) * eps) * eps));
                                        	double tmp;
                                        	if (t_0 <= -2e-317) {
                                        		tmp = t_1;
                                        	} else if (t_0 <= 5e-254) {
                                        		tmp = ((x * x) * fma((5.0 * x), x, ((eps * x) * 10.0))) * eps;
                                        	} else {
                                        		tmp = t_1;
                                        	}
                                        	return tmp;
                                        }
                                        
                                        function code(x, eps)
                                        	t_0 = Float64((Float64(eps + x) ^ 5.0) - (x ^ 5.0))
                                        	t_1 = Float64(Float64(eps * eps) * fma(Float64(Float64(eps + x) * Float64(x * x)), 10.0, Float64(Float64(fma(5.0, x, eps) * eps) * eps)))
                                        	tmp = 0.0
                                        	if (t_0 <= -2e-317)
                                        		tmp = t_1;
                                        	elseif (t_0 <= 5e-254)
                                        		tmp = Float64(Float64(Float64(x * x) * fma(Float64(5.0 * x), x, Float64(Float64(eps * x) * 10.0))) * eps);
                                        	else
                                        		tmp = t_1;
                                        	end
                                        	return tmp
                                        end
                                        
                                        code[x_, eps_] := Block[{t$95$0 = N[(N[Power[N[(eps + x), $MachinePrecision], 5.0], $MachinePrecision] - N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(eps * eps), $MachinePrecision] * N[(N[(N[(eps + x), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision] * 10.0 + N[(N[(N[(5.0 * x + eps), $MachinePrecision] * eps), $MachinePrecision] * eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e-317], t$95$1, If[LessEqual[t$95$0, 5e-254], N[(N[(N[(x * x), $MachinePrecision] * N[(N[(5.0 * x), $MachinePrecision] * x + N[(N[(eps * x), $MachinePrecision] * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * eps), $MachinePrecision], t$95$1]]]]
                                        
                                        \begin{array}{l}
                                        
                                        \\
                                        \begin{array}{l}
                                        t_0 := {\left(\varepsilon + x\right)}^{5} - {x}^{5}\\
                                        t_1 := \left(\varepsilon \cdot \varepsilon\right) \cdot \mathsf{fma}\left(\left(\varepsilon + x\right) \cdot \left(x \cdot x\right), 10, \left(\mathsf{fma}\left(5, x, \varepsilon\right) \cdot \varepsilon\right) \cdot \varepsilon\right)\\
                                        \mathbf{if}\;t\_0 \leq -2 \cdot 10^{-317}:\\
                                        \;\;\;\;t\_1\\
                                        
                                        \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-254}:\\
                                        \;\;\;\;\left(\left(x \cdot x\right) \cdot \mathsf{fma}\left(5 \cdot x, x, \left(\varepsilon \cdot x\right) \cdot 10\right)\right) \cdot \varepsilon\\
                                        
                                        \mathbf{else}:\\
                                        \;\;\;\;t\_1\\
                                        
                                        
                                        \end{array}
                                        \end{array}
                                        
                                        Derivation
                                        1. Split input into 2 regimes
                                        2. if (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -1.99999997e-317 or 5.0000000000000003e-254 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64)))

                                          1. Initial program 98.0%

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

                                            \[\leadsto \color{blue}{x \cdot \left(4 \cdot {\varepsilon}^{4} + {\varepsilon}^{4}\right) + {\varepsilon}^{5}} \]
                                          4. Step-by-step derivation
                                            1. *-commutativeN/A

                                              \[\leadsto \color{blue}{\left(4 \cdot {\varepsilon}^{4} + {\varepsilon}^{4}\right) \cdot x} + {\varepsilon}^{5} \]
                                            2. lower-fma.f64N/A

                                              \[\leadsto \color{blue}{\mathsf{fma}\left(4 \cdot {\varepsilon}^{4} + {\varepsilon}^{4}, x, {\varepsilon}^{5}\right)} \]
                                            3. distribute-lft1-inN/A

                                              \[\leadsto \mathsf{fma}\left(\color{blue}{\left(4 + 1\right) \cdot {\varepsilon}^{4}}, x, {\varepsilon}^{5}\right) \]
                                            4. metadata-evalN/A

                                              \[\leadsto \mathsf{fma}\left(\color{blue}{5} \cdot {\varepsilon}^{4}, x, {\varepsilon}^{5}\right) \]
                                            5. *-commutativeN/A

                                              \[\leadsto \mathsf{fma}\left(\color{blue}{{\varepsilon}^{4} \cdot 5}, x, {\varepsilon}^{5}\right) \]
                                            6. lower-*.f64N/A

                                              \[\leadsto \mathsf{fma}\left(\color{blue}{{\varepsilon}^{4} \cdot 5}, x, {\varepsilon}^{5}\right) \]
                                            7. lower-pow.f64N/A

                                              \[\leadsto \mathsf{fma}\left(\color{blue}{{\varepsilon}^{4}} \cdot 5, x, {\varepsilon}^{5}\right) \]
                                            8. lower-pow.f6490.6

                                              \[\leadsto \mathsf{fma}\left({\varepsilon}^{4} \cdot 5, x, \color{blue}{{\varepsilon}^{5}}\right) \]
                                          5. Applied rewrites90.6%

                                            \[\leadsto \color{blue}{\mathsf{fma}\left({\varepsilon}^{4} \cdot 5, x, {\varepsilon}^{5}\right)} \]
                                          6. Taylor expanded in x around 0

                                            \[\leadsto \color{blue}{x \cdot \left(4 \cdot {\varepsilon}^{4} + \left(x \cdot \left(4 \cdot {\varepsilon}^{3} + \left(\varepsilon \cdot \left(2 \cdot {\varepsilon}^{2} + 4 \cdot {\varepsilon}^{2}\right) + x \cdot \left(2 \cdot {\varepsilon}^{2} + 8 \cdot {\varepsilon}^{2}\right)\right)\right) + {\varepsilon}^{4}\right)\right) + {\varepsilon}^{5}} \]
                                          7. Applied rewrites92.2%

                                            \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(\left(\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon + x\right)\right)\right) \cdot 10, x, {\varepsilon}^{4} \cdot 5\right), x, {\varepsilon}^{5}\right)} \]
                                          8. Taylor expanded in eps around 0

                                            \[\leadsto {\varepsilon}^{2} \cdot \color{blue}{\left(10 \cdot {x}^{3} + \varepsilon \cdot \left(10 \cdot {x}^{2} + \varepsilon \cdot \left(\varepsilon + 5 \cdot x\right)\right)\right)} \]
                                          9. Step-by-step derivation
                                            1. Applied rewrites91.5%

                                              \[\leadsto \mathsf{fma}\left(\left(x \cdot x\right) \cdot \left(\varepsilon + x\right), 10, \left(\mathsf{fma}\left(5, x, \varepsilon\right) \cdot \varepsilon\right) \cdot \varepsilon\right) \cdot \color{blue}{\left(\varepsilon \cdot \varepsilon\right)} \]

                                            if -1.99999997e-317 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 5.0000000000000003e-254

                                            1. Initial program 90.1%

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

                                              \[\leadsto \color{blue}{\varepsilon \cdot \left(4 \cdot {x}^{4} + \left(\varepsilon \cdot \left(4 \cdot {x}^{3} + \left(\varepsilon \cdot \left(2 \cdot {x}^{2} + 8 \cdot {x}^{2}\right) + x \cdot \left(2 \cdot {x}^{2} + 4 \cdot {x}^{2}\right)\right)\right) + {x}^{4}\right)\right)} \]
                                            4. Step-by-step derivation
                                              1. *-commutativeN/A

                                                \[\leadsto \color{blue}{\left(4 \cdot {x}^{4} + \left(\varepsilon \cdot \left(4 \cdot {x}^{3} + \left(\varepsilon \cdot \left(2 \cdot {x}^{2} + 8 \cdot {x}^{2}\right) + x \cdot \left(2 \cdot {x}^{2} + 4 \cdot {x}^{2}\right)\right)\right) + {x}^{4}\right)\right) \cdot \varepsilon} \]
                                              2. lower-*.f64N/A

                                                \[\leadsto \color{blue}{\left(4 \cdot {x}^{4} + \left(\varepsilon \cdot \left(4 \cdot {x}^{3} + \left(\varepsilon \cdot \left(2 \cdot {x}^{2} + 8 \cdot {x}^{2}\right) + x \cdot \left(2 \cdot {x}^{2} + 4 \cdot {x}^{2}\right)\right)\right) + {x}^{4}\right)\right) \cdot \varepsilon} \]
                                            5. Applied rewrites99.3%

                                              \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(10 \cdot \left(x \cdot x\right), \varepsilon, {x}^{3} \cdot 10\right), \varepsilon, {x}^{4} \cdot 5\right) \cdot \varepsilon} \]
                                            6. Taylor expanded in x around 0

                                              \[\leadsto \left({x}^{2} \cdot \left(10 \cdot {\varepsilon}^{2} + x \cdot \left(5 \cdot x + 10 \cdot \varepsilon\right)\right)\right) \cdot \varepsilon \]
                                            7. Step-by-step derivation
                                              1. Applied rewrites99.3%

                                                \[\leadsto \left(\left(\mathsf{fma}\left(x \cdot x, 5, \left(\varepsilon \cdot \left(\varepsilon + x\right)\right) \cdot 10\right) \cdot x\right) \cdot x\right) \cdot \varepsilon \]
                                              2. Taylor expanded in x around inf

                                                \[\leadsto \left(\left(\mathsf{fma}\left(x \cdot x, 5, 10 \cdot \left(\varepsilon \cdot x\right)\right) \cdot x\right) \cdot x\right) \cdot \varepsilon \]
                                              3. Step-by-step derivation
                                                1. Applied rewrites99.3%

                                                  \[\leadsto \left(\left(\mathsf{fma}\left(x \cdot x, 5, \left(\varepsilon \cdot x\right) \cdot 10\right) \cdot x\right) \cdot x\right) \cdot \varepsilon \]
                                                2. Step-by-step derivation
                                                  1. Applied rewrites99.3%

                                                    \[\leadsto \left(\mathsf{fma}\left(5 \cdot x, x, \left(\varepsilon \cdot x\right) \cdot 10\right) \cdot \left(x \cdot x\right)\right) \cdot \varepsilon \]
                                                3. Recombined 2 regimes into one program.
                                                4. Final simplification97.7%

                                                  \[\leadsto \begin{array}{l} \mathbf{if}\;{\left(\varepsilon + x\right)}^{5} - {x}^{5} \leq -2 \cdot 10^{-317}:\\ \;\;\;\;\left(\varepsilon \cdot \varepsilon\right) \cdot \mathsf{fma}\left(\left(\varepsilon + x\right) \cdot \left(x \cdot x\right), 10, \left(\mathsf{fma}\left(5, x, \varepsilon\right) \cdot \varepsilon\right) \cdot \varepsilon\right)\\ \mathbf{elif}\;{\left(\varepsilon + x\right)}^{5} - {x}^{5} \leq 5 \cdot 10^{-254}:\\ \;\;\;\;\left(\left(x \cdot x\right) \cdot \mathsf{fma}\left(5 \cdot x, x, \left(\varepsilon \cdot x\right) \cdot 10\right)\right) \cdot \varepsilon\\ \mathbf{else}:\\ \;\;\;\;\left(\varepsilon \cdot \varepsilon\right) \cdot \mathsf{fma}\left(\left(\varepsilon + x\right) \cdot \left(x \cdot x\right), 10, \left(\mathsf{fma}\left(5, x, \varepsilon\right) \cdot \varepsilon\right) \cdot \varepsilon\right)\\ \end{array} \]
                                                5. Add Preprocessing

                                                Alternative 7: 97.2% accurate, 0.4× speedup?

                                                \[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(\varepsilon + x\right)}^{5} - {x}^{5}\\ t_1 := \left(\left(\varepsilon \cdot \varepsilon\right) \cdot \left(\varepsilon \cdot \varepsilon\right)\right) \cdot \mathsf{fma}\left(5, x, \varepsilon\right)\\ \mathbf{if}\;t\_0 \leq -2 \cdot 10^{-317}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-254}:\\ \;\;\;\;\left(\left(x \cdot x\right) \cdot \mathsf{fma}\left(5 \cdot x, x, \left(\varepsilon \cdot x\right) \cdot 10\right)\right) \cdot \varepsilon\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                                                (FPCore (x eps)
                                                 :precision binary64
                                                 (let* ((t_0 (- (pow (+ eps x) 5.0) (pow x 5.0)))
                                                        (t_1 (* (* (* eps eps) (* eps eps)) (fma 5.0 x eps))))
                                                   (if (<= t_0 -2e-317)
                                                     t_1
                                                     (if (<= t_0 5e-254)
                                                       (* (* (* x x) (fma (* 5.0 x) x (* (* eps x) 10.0))) eps)
                                                       t_1))))
                                                double code(double x, double eps) {
                                                	double t_0 = pow((eps + x), 5.0) - pow(x, 5.0);
                                                	double t_1 = ((eps * eps) * (eps * eps)) * fma(5.0, x, eps);
                                                	double tmp;
                                                	if (t_0 <= -2e-317) {
                                                		tmp = t_1;
                                                	} else if (t_0 <= 5e-254) {
                                                		tmp = ((x * x) * fma((5.0 * x), x, ((eps * x) * 10.0))) * eps;
                                                	} else {
                                                		tmp = t_1;
                                                	}
                                                	return tmp;
                                                }
                                                
                                                function code(x, eps)
                                                	t_0 = Float64((Float64(eps + x) ^ 5.0) - (x ^ 5.0))
                                                	t_1 = Float64(Float64(Float64(eps * eps) * Float64(eps * eps)) * fma(5.0, x, eps))
                                                	tmp = 0.0
                                                	if (t_0 <= -2e-317)
                                                		tmp = t_1;
                                                	elseif (t_0 <= 5e-254)
                                                		tmp = Float64(Float64(Float64(x * x) * fma(Float64(5.0 * x), x, Float64(Float64(eps * x) * 10.0))) * eps);
                                                	else
                                                		tmp = t_1;
                                                	end
                                                	return tmp
                                                end
                                                
                                                code[x_, eps_] := Block[{t$95$0 = N[(N[Power[N[(eps + x), $MachinePrecision], 5.0], $MachinePrecision] - N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(eps * eps), $MachinePrecision] * N[(eps * eps), $MachinePrecision]), $MachinePrecision] * N[(5.0 * x + eps), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e-317], t$95$1, If[LessEqual[t$95$0, 5e-254], N[(N[(N[(x * x), $MachinePrecision] * N[(N[(5.0 * x), $MachinePrecision] * x + N[(N[(eps * x), $MachinePrecision] * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * eps), $MachinePrecision], t$95$1]]]]
                                                
                                                \begin{array}{l}
                                                
                                                \\
                                                \begin{array}{l}
                                                t_0 := {\left(\varepsilon + x\right)}^{5} - {x}^{5}\\
                                                t_1 := \left(\left(\varepsilon \cdot \varepsilon\right) \cdot \left(\varepsilon \cdot \varepsilon\right)\right) \cdot \mathsf{fma}\left(5, x, \varepsilon\right)\\
                                                \mathbf{if}\;t\_0 \leq -2 \cdot 10^{-317}:\\
                                                \;\;\;\;t\_1\\
                                                
                                                \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-254}:\\
                                                \;\;\;\;\left(\left(x \cdot x\right) \cdot \mathsf{fma}\left(5 \cdot x, x, \left(\varepsilon \cdot x\right) \cdot 10\right)\right) \cdot \varepsilon\\
                                                
                                                \mathbf{else}:\\
                                                \;\;\;\;t\_1\\
                                                
                                                
                                                \end{array}
                                                \end{array}
                                                
                                                Derivation
                                                1. Split input into 2 regimes
                                                2. if (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -1.99999997e-317 or 5.0000000000000003e-254 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64)))

                                                  1. Initial program 98.0%

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

                                                    \[\leadsto \color{blue}{x \cdot \left(4 \cdot {\varepsilon}^{4} + {\varepsilon}^{4}\right) + {\varepsilon}^{5}} \]
                                                  4. Step-by-step derivation
                                                    1. *-commutativeN/A

                                                      \[\leadsto \color{blue}{\left(4 \cdot {\varepsilon}^{4} + {\varepsilon}^{4}\right) \cdot x} + {\varepsilon}^{5} \]
                                                    2. lower-fma.f64N/A

                                                      \[\leadsto \color{blue}{\mathsf{fma}\left(4 \cdot {\varepsilon}^{4} + {\varepsilon}^{4}, x, {\varepsilon}^{5}\right)} \]
                                                    3. distribute-lft1-inN/A

                                                      \[\leadsto \mathsf{fma}\left(\color{blue}{\left(4 + 1\right) \cdot {\varepsilon}^{4}}, x, {\varepsilon}^{5}\right) \]
                                                    4. metadata-evalN/A

                                                      \[\leadsto \mathsf{fma}\left(\color{blue}{5} \cdot {\varepsilon}^{4}, x, {\varepsilon}^{5}\right) \]
                                                    5. *-commutativeN/A

                                                      \[\leadsto \mathsf{fma}\left(\color{blue}{{\varepsilon}^{4} \cdot 5}, x, {\varepsilon}^{5}\right) \]
                                                    6. lower-*.f64N/A

                                                      \[\leadsto \mathsf{fma}\left(\color{blue}{{\varepsilon}^{4} \cdot 5}, x, {\varepsilon}^{5}\right) \]
                                                    7. lower-pow.f64N/A

                                                      \[\leadsto \mathsf{fma}\left(\color{blue}{{\varepsilon}^{4}} \cdot 5, x, {\varepsilon}^{5}\right) \]
                                                    8. lower-pow.f6490.6

                                                      \[\leadsto \mathsf{fma}\left({\varepsilon}^{4} \cdot 5, x, \color{blue}{{\varepsilon}^{5}}\right) \]
                                                  5. Applied rewrites90.6%

                                                    \[\leadsto \color{blue}{\mathsf{fma}\left({\varepsilon}^{4} \cdot 5, x, {\varepsilon}^{5}\right)} \]
                                                  6. Taylor expanded in x around 0

                                                    \[\leadsto \color{blue}{x \cdot \left(4 \cdot {\varepsilon}^{4} + {\varepsilon}^{4}\right) + {\varepsilon}^{5}} \]
                                                  7. Step-by-step derivation
                                                    1. distribute-lft1-inN/A

                                                      \[\leadsto x \cdot \color{blue}{\left(\left(4 + 1\right) \cdot {\varepsilon}^{4}\right)} + {\varepsilon}^{5} \]
                                                    2. metadata-evalN/A

                                                      \[\leadsto x \cdot \left(\color{blue}{5} \cdot {\varepsilon}^{4}\right) + {\varepsilon}^{5} \]
                                                    3. associate-*r*N/A

                                                      \[\leadsto \color{blue}{\left(x \cdot 5\right) \cdot {\varepsilon}^{4}} + {\varepsilon}^{5} \]
                                                    4. *-commutativeN/A

                                                      \[\leadsto \color{blue}{\left(5 \cdot x\right)} \cdot {\varepsilon}^{4} + {\varepsilon}^{5} \]
                                                    5. metadata-evalN/A

                                                      \[\leadsto \left(5 \cdot x\right) \cdot {\varepsilon}^{4} + {\varepsilon}^{\color{blue}{\left(4 + 1\right)}} \]
                                                    6. pow-plusN/A

                                                      \[\leadsto \left(5 \cdot x\right) \cdot {\varepsilon}^{4} + \color{blue}{{\varepsilon}^{4} \cdot \varepsilon} \]
                                                    7. *-commutativeN/A

                                                      \[\leadsto \left(5 \cdot x\right) \cdot {\varepsilon}^{4} + \color{blue}{\varepsilon \cdot {\varepsilon}^{4}} \]
                                                    8. distribute-rgt-inN/A

                                                      \[\leadsto \color{blue}{{\varepsilon}^{4} \cdot \left(5 \cdot x + \varepsilon\right)} \]
                                                    9. +-commutativeN/A

                                                      \[\leadsto {\varepsilon}^{4} \cdot \color{blue}{\left(\varepsilon + 5 \cdot x\right)} \]
                                                    10. *-commutativeN/A

                                                      \[\leadsto \color{blue}{\left(\varepsilon + 5 \cdot x\right) \cdot {\varepsilon}^{4}} \]
                                                    11. lower-*.f64N/A

                                                      \[\leadsto \color{blue}{\left(\varepsilon + 5 \cdot x\right) \cdot {\varepsilon}^{4}} \]
                                                    12. +-commutativeN/A

                                                      \[\leadsto \color{blue}{\left(5 \cdot x + \varepsilon\right)} \cdot {\varepsilon}^{4} \]
                                                    13. lower-fma.f64N/A

                                                      \[\leadsto \color{blue}{\mathsf{fma}\left(5, x, \varepsilon\right)} \cdot {\varepsilon}^{4} \]
                                                    14. lower-pow.f6490.3

                                                      \[\leadsto \mathsf{fma}\left(5, x, \varepsilon\right) \cdot \color{blue}{{\varepsilon}^{4}} \]
                                                  8. Applied rewrites90.3%

                                                    \[\leadsto \color{blue}{\mathsf{fma}\left(5, x, \varepsilon\right) \cdot {\varepsilon}^{4}} \]
                                                  9. Step-by-step derivation
                                                    1. Applied rewrites89.9%

                                                      \[\leadsto \mathsf{fma}\left(5, x, \varepsilon\right) \cdot \left(\left(\varepsilon \cdot \varepsilon\right) \cdot \color{blue}{\left(\varepsilon \cdot \varepsilon\right)}\right) \]

                                                    if -1.99999997e-317 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 5.0000000000000003e-254

                                                    1. Initial program 90.1%

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

                                                      \[\leadsto \color{blue}{\varepsilon \cdot \left(4 \cdot {x}^{4} + \left(\varepsilon \cdot \left(4 \cdot {x}^{3} + \left(\varepsilon \cdot \left(2 \cdot {x}^{2} + 8 \cdot {x}^{2}\right) + x \cdot \left(2 \cdot {x}^{2} + 4 \cdot {x}^{2}\right)\right)\right) + {x}^{4}\right)\right)} \]
                                                    4. Step-by-step derivation
                                                      1. *-commutativeN/A

                                                        \[\leadsto \color{blue}{\left(4 \cdot {x}^{4} + \left(\varepsilon \cdot \left(4 \cdot {x}^{3} + \left(\varepsilon \cdot \left(2 \cdot {x}^{2} + 8 \cdot {x}^{2}\right) + x \cdot \left(2 \cdot {x}^{2} + 4 \cdot {x}^{2}\right)\right)\right) + {x}^{4}\right)\right) \cdot \varepsilon} \]
                                                      2. lower-*.f64N/A

                                                        \[\leadsto \color{blue}{\left(4 \cdot {x}^{4} + \left(\varepsilon \cdot \left(4 \cdot {x}^{3} + \left(\varepsilon \cdot \left(2 \cdot {x}^{2} + 8 \cdot {x}^{2}\right) + x \cdot \left(2 \cdot {x}^{2} + 4 \cdot {x}^{2}\right)\right)\right) + {x}^{4}\right)\right) \cdot \varepsilon} \]
                                                    5. Applied rewrites99.3%

                                                      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(10 \cdot \left(x \cdot x\right), \varepsilon, {x}^{3} \cdot 10\right), \varepsilon, {x}^{4} \cdot 5\right) \cdot \varepsilon} \]
                                                    6. Taylor expanded in x around 0

                                                      \[\leadsto \left({x}^{2} \cdot \left(10 \cdot {\varepsilon}^{2} + x \cdot \left(5 \cdot x + 10 \cdot \varepsilon\right)\right)\right) \cdot \varepsilon \]
                                                    7. Step-by-step derivation
                                                      1. Applied rewrites99.3%

                                                        \[\leadsto \left(\left(\mathsf{fma}\left(x \cdot x, 5, \left(\varepsilon \cdot \left(\varepsilon + x\right)\right) \cdot 10\right) \cdot x\right) \cdot x\right) \cdot \varepsilon \]
                                                      2. Taylor expanded in x around inf

                                                        \[\leadsto \left(\left(\mathsf{fma}\left(x \cdot x, 5, 10 \cdot \left(\varepsilon \cdot x\right)\right) \cdot x\right) \cdot x\right) \cdot \varepsilon \]
                                                      3. Step-by-step derivation
                                                        1. Applied rewrites99.3%

                                                          \[\leadsto \left(\left(\mathsf{fma}\left(x \cdot x, 5, \left(\varepsilon \cdot x\right) \cdot 10\right) \cdot x\right) \cdot x\right) \cdot \varepsilon \]
                                                        2. Step-by-step derivation
                                                          1. Applied rewrites99.3%

                                                            \[\leadsto \left(\mathsf{fma}\left(5 \cdot x, x, \left(\varepsilon \cdot x\right) \cdot 10\right) \cdot \left(x \cdot x\right)\right) \cdot \varepsilon \]
                                                        3. Recombined 2 regimes into one program.
                                                        4. Final simplification97.4%

                                                          \[\leadsto \begin{array}{l} \mathbf{if}\;{\left(\varepsilon + x\right)}^{5} - {x}^{5} \leq -2 \cdot 10^{-317}:\\ \;\;\;\;\left(\left(\varepsilon \cdot \varepsilon\right) \cdot \left(\varepsilon \cdot \varepsilon\right)\right) \cdot \mathsf{fma}\left(5, x, \varepsilon\right)\\ \mathbf{elif}\;{\left(\varepsilon + x\right)}^{5} - {x}^{5} \leq 5 \cdot 10^{-254}:\\ \;\;\;\;\left(\left(x \cdot x\right) \cdot \mathsf{fma}\left(5 \cdot x, x, \left(\varepsilon \cdot x\right) \cdot 10\right)\right) \cdot \varepsilon\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\varepsilon \cdot \varepsilon\right) \cdot \left(\varepsilon \cdot \varepsilon\right)\right) \cdot \mathsf{fma}\left(5, x, \varepsilon\right)\\ \end{array} \]
                                                        5. Add Preprocessing

                                                        Alternative 8: 97.2% accurate, 0.5× speedup?

                                                        \[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(\varepsilon + x\right)}^{5} - {x}^{5}\\ t_1 := \left(\left(\varepsilon \cdot \varepsilon\right) \cdot \left(\varepsilon \cdot \varepsilon\right)\right) \cdot \mathsf{fma}\left(5, x, \varepsilon\right)\\ \mathbf{if}\;t\_0 \leq -2 \cdot 10^{-317}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-254}:\\ \;\;\;\;\left(\left(\left(\mathsf{fma}\left(10, \varepsilon, 5 \cdot x\right) \cdot x\right) \cdot x\right) \cdot x\right) \cdot \varepsilon\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                                                        (FPCore (x eps)
                                                         :precision binary64
                                                         (let* ((t_0 (- (pow (+ eps x) 5.0) (pow x 5.0)))
                                                                (t_1 (* (* (* eps eps) (* eps eps)) (fma 5.0 x eps))))
                                                           (if (<= t_0 -2e-317)
                                                             t_1
                                                             (if (<= t_0 5e-254)
                                                               (* (* (* (* (fma 10.0 eps (* 5.0 x)) x) x) x) eps)
                                                               t_1))))
                                                        double code(double x, double eps) {
                                                        	double t_0 = pow((eps + x), 5.0) - pow(x, 5.0);
                                                        	double t_1 = ((eps * eps) * (eps * eps)) * fma(5.0, x, eps);
                                                        	double tmp;
                                                        	if (t_0 <= -2e-317) {
                                                        		tmp = t_1;
                                                        	} else if (t_0 <= 5e-254) {
                                                        		tmp = (((fma(10.0, eps, (5.0 * x)) * x) * x) * x) * eps;
                                                        	} else {
                                                        		tmp = t_1;
                                                        	}
                                                        	return tmp;
                                                        }
                                                        
                                                        function code(x, eps)
                                                        	t_0 = Float64((Float64(eps + x) ^ 5.0) - (x ^ 5.0))
                                                        	t_1 = Float64(Float64(Float64(eps * eps) * Float64(eps * eps)) * fma(5.0, x, eps))
                                                        	tmp = 0.0
                                                        	if (t_0 <= -2e-317)
                                                        		tmp = t_1;
                                                        	elseif (t_0 <= 5e-254)
                                                        		tmp = Float64(Float64(Float64(Float64(fma(10.0, eps, Float64(5.0 * x)) * x) * x) * x) * eps);
                                                        	else
                                                        		tmp = t_1;
                                                        	end
                                                        	return tmp
                                                        end
                                                        
                                                        code[x_, eps_] := Block[{t$95$0 = N[(N[Power[N[(eps + x), $MachinePrecision], 5.0], $MachinePrecision] - N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(eps * eps), $MachinePrecision] * N[(eps * eps), $MachinePrecision]), $MachinePrecision] * N[(5.0 * x + eps), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e-317], t$95$1, If[LessEqual[t$95$0, 5e-254], N[(N[(N[(N[(N[(10.0 * eps + N[(5.0 * x), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision] * eps), $MachinePrecision], t$95$1]]]]
                                                        
                                                        \begin{array}{l}
                                                        
                                                        \\
                                                        \begin{array}{l}
                                                        t_0 := {\left(\varepsilon + x\right)}^{5} - {x}^{5}\\
                                                        t_1 := \left(\left(\varepsilon \cdot \varepsilon\right) \cdot \left(\varepsilon \cdot \varepsilon\right)\right) \cdot \mathsf{fma}\left(5, x, \varepsilon\right)\\
                                                        \mathbf{if}\;t\_0 \leq -2 \cdot 10^{-317}:\\
                                                        \;\;\;\;t\_1\\
                                                        
                                                        \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-254}:\\
                                                        \;\;\;\;\left(\left(\left(\mathsf{fma}\left(10, \varepsilon, 5 \cdot x\right) \cdot x\right) \cdot x\right) \cdot x\right) \cdot \varepsilon\\
                                                        
                                                        \mathbf{else}:\\
                                                        \;\;\;\;t\_1\\
                                                        
                                                        
                                                        \end{array}
                                                        \end{array}
                                                        
                                                        Derivation
                                                        1. Split input into 2 regimes
                                                        2. if (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -1.99999997e-317 or 5.0000000000000003e-254 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64)))

                                                          1. Initial program 98.0%

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

                                                            \[\leadsto \color{blue}{x \cdot \left(4 \cdot {\varepsilon}^{4} + {\varepsilon}^{4}\right) + {\varepsilon}^{5}} \]
                                                          4. Step-by-step derivation
                                                            1. *-commutativeN/A

                                                              \[\leadsto \color{blue}{\left(4 \cdot {\varepsilon}^{4} + {\varepsilon}^{4}\right) \cdot x} + {\varepsilon}^{5} \]
                                                            2. lower-fma.f64N/A

                                                              \[\leadsto \color{blue}{\mathsf{fma}\left(4 \cdot {\varepsilon}^{4} + {\varepsilon}^{4}, x, {\varepsilon}^{5}\right)} \]
                                                            3. distribute-lft1-inN/A

                                                              \[\leadsto \mathsf{fma}\left(\color{blue}{\left(4 + 1\right) \cdot {\varepsilon}^{4}}, x, {\varepsilon}^{5}\right) \]
                                                            4. metadata-evalN/A

                                                              \[\leadsto \mathsf{fma}\left(\color{blue}{5} \cdot {\varepsilon}^{4}, x, {\varepsilon}^{5}\right) \]
                                                            5. *-commutativeN/A

                                                              \[\leadsto \mathsf{fma}\left(\color{blue}{{\varepsilon}^{4} \cdot 5}, x, {\varepsilon}^{5}\right) \]
                                                            6. lower-*.f64N/A

                                                              \[\leadsto \mathsf{fma}\left(\color{blue}{{\varepsilon}^{4} \cdot 5}, x, {\varepsilon}^{5}\right) \]
                                                            7. lower-pow.f64N/A

                                                              \[\leadsto \mathsf{fma}\left(\color{blue}{{\varepsilon}^{4}} \cdot 5, x, {\varepsilon}^{5}\right) \]
                                                            8. lower-pow.f6490.6

                                                              \[\leadsto \mathsf{fma}\left({\varepsilon}^{4} \cdot 5, x, \color{blue}{{\varepsilon}^{5}}\right) \]
                                                          5. Applied rewrites90.6%

                                                            \[\leadsto \color{blue}{\mathsf{fma}\left({\varepsilon}^{4} \cdot 5, x, {\varepsilon}^{5}\right)} \]
                                                          6. Taylor expanded in x around 0

                                                            \[\leadsto \color{blue}{x \cdot \left(4 \cdot {\varepsilon}^{4} + {\varepsilon}^{4}\right) + {\varepsilon}^{5}} \]
                                                          7. Step-by-step derivation
                                                            1. distribute-lft1-inN/A

                                                              \[\leadsto x \cdot \color{blue}{\left(\left(4 + 1\right) \cdot {\varepsilon}^{4}\right)} + {\varepsilon}^{5} \]
                                                            2. metadata-evalN/A

                                                              \[\leadsto x \cdot \left(\color{blue}{5} \cdot {\varepsilon}^{4}\right) + {\varepsilon}^{5} \]
                                                            3. associate-*r*N/A

                                                              \[\leadsto \color{blue}{\left(x \cdot 5\right) \cdot {\varepsilon}^{4}} + {\varepsilon}^{5} \]
                                                            4. *-commutativeN/A

                                                              \[\leadsto \color{blue}{\left(5 \cdot x\right)} \cdot {\varepsilon}^{4} + {\varepsilon}^{5} \]
                                                            5. metadata-evalN/A

                                                              \[\leadsto \left(5 \cdot x\right) \cdot {\varepsilon}^{4} + {\varepsilon}^{\color{blue}{\left(4 + 1\right)}} \]
                                                            6. pow-plusN/A

                                                              \[\leadsto \left(5 \cdot x\right) \cdot {\varepsilon}^{4} + \color{blue}{{\varepsilon}^{4} \cdot \varepsilon} \]
                                                            7. *-commutativeN/A

                                                              \[\leadsto \left(5 \cdot x\right) \cdot {\varepsilon}^{4} + \color{blue}{\varepsilon \cdot {\varepsilon}^{4}} \]
                                                            8. distribute-rgt-inN/A

                                                              \[\leadsto \color{blue}{{\varepsilon}^{4} \cdot \left(5 \cdot x + \varepsilon\right)} \]
                                                            9. +-commutativeN/A

                                                              \[\leadsto {\varepsilon}^{4} \cdot \color{blue}{\left(\varepsilon + 5 \cdot x\right)} \]
                                                            10. *-commutativeN/A

                                                              \[\leadsto \color{blue}{\left(\varepsilon + 5 \cdot x\right) \cdot {\varepsilon}^{4}} \]
                                                            11. lower-*.f64N/A

                                                              \[\leadsto \color{blue}{\left(\varepsilon + 5 \cdot x\right) \cdot {\varepsilon}^{4}} \]
                                                            12. +-commutativeN/A

                                                              \[\leadsto \color{blue}{\left(5 \cdot x + \varepsilon\right)} \cdot {\varepsilon}^{4} \]
                                                            13. lower-fma.f64N/A

                                                              \[\leadsto \color{blue}{\mathsf{fma}\left(5, x, \varepsilon\right)} \cdot {\varepsilon}^{4} \]
                                                            14. lower-pow.f6490.3

                                                              \[\leadsto \mathsf{fma}\left(5, x, \varepsilon\right) \cdot \color{blue}{{\varepsilon}^{4}} \]
                                                          8. Applied rewrites90.3%

                                                            \[\leadsto \color{blue}{\mathsf{fma}\left(5, x, \varepsilon\right) \cdot {\varepsilon}^{4}} \]
                                                          9. Step-by-step derivation
                                                            1. Applied rewrites89.9%

                                                              \[\leadsto \mathsf{fma}\left(5, x, \varepsilon\right) \cdot \left(\left(\varepsilon \cdot \varepsilon\right) \cdot \color{blue}{\left(\varepsilon \cdot \varepsilon\right)}\right) \]

                                                            if -1.99999997e-317 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 5.0000000000000003e-254

                                                            1. Initial program 90.1%

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

                                                              \[\leadsto \color{blue}{\varepsilon \cdot \left(4 \cdot {x}^{4} + \left(\varepsilon \cdot \left(4 \cdot {x}^{3} + \left(\varepsilon \cdot \left(2 \cdot {x}^{2} + 8 \cdot {x}^{2}\right) + x \cdot \left(2 \cdot {x}^{2} + 4 \cdot {x}^{2}\right)\right)\right) + {x}^{4}\right)\right)} \]
                                                            4. Step-by-step derivation
                                                              1. *-commutativeN/A

                                                                \[\leadsto \color{blue}{\left(4 \cdot {x}^{4} + \left(\varepsilon \cdot \left(4 \cdot {x}^{3} + \left(\varepsilon \cdot \left(2 \cdot {x}^{2} + 8 \cdot {x}^{2}\right) + x \cdot \left(2 \cdot {x}^{2} + 4 \cdot {x}^{2}\right)\right)\right) + {x}^{4}\right)\right) \cdot \varepsilon} \]
                                                              2. lower-*.f64N/A

                                                                \[\leadsto \color{blue}{\left(4 \cdot {x}^{4} + \left(\varepsilon \cdot \left(4 \cdot {x}^{3} + \left(\varepsilon \cdot \left(2 \cdot {x}^{2} + 8 \cdot {x}^{2}\right) + x \cdot \left(2 \cdot {x}^{2} + 4 \cdot {x}^{2}\right)\right)\right) + {x}^{4}\right)\right) \cdot \varepsilon} \]
                                                            5. Applied rewrites99.3%

                                                              \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(10 \cdot \left(x \cdot x\right), \varepsilon, {x}^{3} \cdot 10\right), \varepsilon, {x}^{4} \cdot 5\right) \cdot \varepsilon} \]
                                                            6. Taylor expanded in x around 0

                                                              \[\leadsto \left({x}^{2} \cdot \left(10 \cdot {\varepsilon}^{2} + x \cdot \left(5 \cdot x + 10 \cdot \varepsilon\right)\right)\right) \cdot \varepsilon \]
                                                            7. Step-by-step derivation
                                                              1. Applied rewrites99.3%

                                                                \[\leadsto \left(\left(\mathsf{fma}\left(x \cdot x, 5, \left(\varepsilon \cdot \left(\varepsilon + x\right)\right) \cdot 10\right) \cdot x\right) \cdot x\right) \cdot \varepsilon \]
                                                              2. Taylor expanded in eps around 0

                                                                \[\leadsto \left(\left(\left(5 \cdot {x}^{2} + 10 \cdot \left(\varepsilon \cdot x\right)\right) \cdot x\right) \cdot x\right) \cdot \varepsilon \]
                                                              3. Step-by-step derivation
                                                                1. Applied rewrites99.3%

                                                                  \[\leadsto \left(\left(\left(\mathsf{fma}\left(10, \varepsilon, 5 \cdot x\right) \cdot x\right) \cdot x\right) \cdot x\right) \cdot \varepsilon \]
                                                              4. Recombined 2 regimes into one program.
                                                              5. Final simplification97.4%

                                                                \[\leadsto \begin{array}{l} \mathbf{if}\;{\left(\varepsilon + x\right)}^{5} - {x}^{5} \leq -2 \cdot 10^{-317}:\\ \;\;\;\;\left(\left(\varepsilon \cdot \varepsilon\right) \cdot \left(\varepsilon \cdot \varepsilon\right)\right) \cdot \mathsf{fma}\left(5, x, \varepsilon\right)\\ \mathbf{elif}\;{\left(\varepsilon + x\right)}^{5} - {x}^{5} \leq 5 \cdot 10^{-254}:\\ \;\;\;\;\left(\left(\left(\mathsf{fma}\left(10, \varepsilon, 5 \cdot x\right) \cdot x\right) \cdot x\right) \cdot x\right) \cdot \varepsilon\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\varepsilon \cdot \varepsilon\right) \cdot \left(\varepsilon \cdot \varepsilon\right)\right) \cdot \mathsf{fma}\left(5, x, \varepsilon\right)\\ \end{array} \]
                                                              6. Add Preprocessing

                                                              Alternative 9: 97.1% accurate, 0.5× speedup?

                                                              \[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(\varepsilon + x\right)}^{5} - {x}^{5}\\ t_1 := \left(\left(\varepsilon \cdot \varepsilon\right) \cdot \left(\varepsilon \cdot \varepsilon\right)\right) \cdot \mathsf{fma}\left(5, x, \varepsilon\right)\\ \mathbf{if}\;t\_0 \leq -2 \cdot 10^{-317}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-254}:\\ \;\;\;\;\left(\left(\left(\left(5 \cdot x\right) \cdot x\right) \cdot x\right) \cdot x\right) \cdot \varepsilon\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                                                              (FPCore (x eps)
                                                               :precision binary64
                                                               (let* ((t_0 (- (pow (+ eps x) 5.0) (pow x 5.0)))
                                                                      (t_1 (* (* (* eps eps) (* eps eps)) (fma 5.0 x eps))))
                                                                 (if (<= t_0 -2e-317)
                                                                   t_1
                                                                   (if (<= t_0 5e-254) (* (* (* (* (* 5.0 x) x) x) x) eps) t_1))))
                                                              double code(double x, double eps) {
                                                              	double t_0 = pow((eps + x), 5.0) - pow(x, 5.0);
                                                              	double t_1 = ((eps * eps) * (eps * eps)) * fma(5.0, x, eps);
                                                              	double tmp;
                                                              	if (t_0 <= -2e-317) {
                                                              		tmp = t_1;
                                                              	} else if (t_0 <= 5e-254) {
                                                              		tmp = ((((5.0 * x) * x) * x) * x) * eps;
                                                              	} else {
                                                              		tmp = t_1;
                                                              	}
                                                              	return tmp;
                                                              }
                                                              
                                                              function code(x, eps)
                                                              	t_0 = Float64((Float64(eps + x) ^ 5.0) - (x ^ 5.0))
                                                              	t_1 = Float64(Float64(Float64(eps * eps) * Float64(eps * eps)) * fma(5.0, x, eps))
                                                              	tmp = 0.0
                                                              	if (t_0 <= -2e-317)
                                                              		tmp = t_1;
                                                              	elseif (t_0 <= 5e-254)
                                                              		tmp = Float64(Float64(Float64(Float64(Float64(5.0 * x) * x) * x) * x) * eps);
                                                              	else
                                                              		tmp = t_1;
                                                              	end
                                                              	return tmp
                                                              end
                                                              
                                                              code[x_, eps_] := Block[{t$95$0 = N[(N[Power[N[(eps + x), $MachinePrecision], 5.0], $MachinePrecision] - N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(eps * eps), $MachinePrecision] * N[(eps * eps), $MachinePrecision]), $MachinePrecision] * N[(5.0 * x + eps), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e-317], t$95$1, If[LessEqual[t$95$0, 5e-254], N[(N[(N[(N[(N[(5.0 * x), $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision] * eps), $MachinePrecision], t$95$1]]]]
                                                              
                                                              \begin{array}{l}
                                                              
                                                              \\
                                                              \begin{array}{l}
                                                              t_0 := {\left(\varepsilon + x\right)}^{5} - {x}^{5}\\
                                                              t_1 := \left(\left(\varepsilon \cdot \varepsilon\right) \cdot \left(\varepsilon \cdot \varepsilon\right)\right) \cdot \mathsf{fma}\left(5, x, \varepsilon\right)\\
                                                              \mathbf{if}\;t\_0 \leq -2 \cdot 10^{-317}:\\
                                                              \;\;\;\;t\_1\\
                                                              
                                                              \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-254}:\\
                                                              \;\;\;\;\left(\left(\left(\left(5 \cdot x\right) \cdot x\right) \cdot x\right) \cdot x\right) \cdot \varepsilon\\
                                                              
                                                              \mathbf{else}:\\
                                                              \;\;\;\;t\_1\\
                                                              
                                                              
                                                              \end{array}
                                                              \end{array}
                                                              
                                                              Derivation
                                                              1. Split input into 2 regimes
                                                              2. if (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -1.99999997e-317 or 5.0000000000000003e-254 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64)))

                                                                1. Initial program 98.0%

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

                                                                  \[\leadsto \color{blue}{x \cdot \left(4 \cdot {\varepsilon}^{4} + {\varepsilon}^{4}\right) + {\varepsilon}^{5}} \]
                                                                4. Step-by-step derivation
                                                                  1. *-commutativeN/A

                                                                    \[\leadsto \color{blue}{\left(4 \cdot {\varepsilon}^{4} + {\varepsilon}^{4}\right) \cdot x} + {\varepsilon}^{5} \]
                                                                  2. lower-fma.f64N/A

                                                                    \[\leadsto \color{blue}{\mathsf{fma}\left(4 \cdot {\varepsilon}^{4} + {\varepsilon}^{4}, x, {\varepsilon}^{5}\right)} \]
                                                                  3. distribute-lft1-inN/A

                                                                    \[\leadsto \mathsf{fma}\left(\color{blue}{\left(4 + 1\right) \cdot {\varepsilon}^{4}}, x, {\varepsilon}^{5}\right) \]
                                                                  4. metadata-evalN/A

                                                                    \[\leadsto \mathsf{fma}\left(\color{blue}{5} \cdot {\varepsilon}^{4}, x, {\varepsilon}^{5}\right) \]
                                                                  5. *-commutativeN/A

                                                                    \[\leadsto \mathsf{fma}\left(\color{blue}{{\varepsilon}^{4} \cdot 5}, x, {\varepsilon}^{5}\right) \]
                                                                  6. lower-*.f64N/A

                                                                    \[\leadsto \mathsf{fma}\left(\color{blue}{{\varepsilon}^{4} \cdot 5}, x, {\varepsilon}^{5}\right) \]
                                                                  7. lower-pow.f64N/A

                                                                    \[\leadsto \mathsf{fma}\left(\color{blue}{{\varepsilon}^{4}} \cdot 5, x, {\varepsilon}^{5}\right) \]
                                                                  8. lower-pow.f6490.6

                                                                    \[\leadsto \mathsf{fma}\left({\varepsilon}^{4} \cdot 5, x, \color{blue}{{\varepsilon}^{5}}\right) \]
                                                                5. Applied rewrites90.6%

                                                                  \[\leadsto \color{blue}{\mathsf{fma}\left({\varepsilon}^{4} \cdot 5, x, {\varepsilon}^{5}\right)} \]
                                                                6. Taylor expanded in x around 0

                                                                  \[\leadsto \color{blue}{x \cdot \left(4 \cdot {\varepsilon}^{4} + {\varepsilon}^{4}\right) + {\varepsilon}^{5}} \]
                                                                7. Step-by-step derivation
                                                                  1. distribute-lft1-inN/A

                                                                    \[\leadsto x \cdot \color{blue}{\left(\left(4 + 1\right) \cdot {\varepsilon}^{4}\right)} + {\varepsilon}^{5} \]
                                                                  2. metadata-evalN/A

                                                                    \[\leadsto x \cdot \left(\color{blue}{5} \cdot {\varepsilon}^{4}\right) + {\varepsilon}^{5} \]
                                                                  3. associate-*r*N/A

                                                                    \[\leadsto \color{blue}{\left(x \cdot 5\right) \cdot {\varepsilon}^{4}} + {\varepsilon}^{5} \]
                                                                  4. *-commutativeN/A

                                                                    \[\leadsto \color{blue}{\left(5 \cdot x\right)} \cdot {\varepsilon}^{4} + {\varepsilon}^{5} \]
                                                                  5. metadata-evalN/A

                                                                    \[\leadsto \left(5 \cdot x\right) \cdot {\varepsilon}^{4} + {\varepsilon}^{\color{blue}{\left(4 + 1\right)}} \]
                                                                  6. pow-plusN/A

                                                                    \[\leadsto \left(5 \cdot x\right) \cdot {\varepsilon}^{4} + \color{blue}{{\varepsilon}^{4} \cdot \varepsilon} \]
                                                                  7. *-commutativeN/A

                                                                    \[\leadsto \left(5 \cdot x\right) \cdot {\varepsilon}^{4} + \color{blue}{\varepsilon \cdot {\varepsilon}^{4}} \]
                                                                  8. distribute-rgt-inN/A

                                                                    \[\leadsto \color{blue}{{\varepsilon}^{4} \cdot \left(5 \cdot x + \varepsilon\right)} \]
                                                                  9. +-commutativeN/A

                                                                    \[\leadsto {\varepsilon}^{4} \cdot \color{blue}{\left(\varepsilon + 5 \cdot x\right)} \]
                                                                  10. *-commutativeN/A

                                                                    \[\leadsto \color{blue}{\left(\varepsilon + 5 \cdot x\right) \cdot {\varepsilon}^{4}} \]
                                                                  11. lower-*.f64N/A

                                                                    \[\leadsto \color{blue}{\left(\varepsilon + 5 \cdot x\right) \cdot {\varepsilon}^{4}} \]
                                                                  12. +-commutativeN/A

                                                                    \[\leadsto \color{blue}{\left(5 \cdot x + \varepsilon\right)} \cdot {\varepsilon}^{4} \]
                                                                  13. lower-fma.f64N/A

                                                                    \[\leadsto \color{blue}{\mathsf{fma}\left(5, x, \varepsilon\right)} \cdot {\varepsilon}^{4} \]
                                                                  14. lower-pow.f6490.3

                                                                    \[\leadsto \mathsf{fma}\left(5, x, \varepsilon\right) \cdot \color{blue}{{\varepsilon}^{4}} \]
                                                                8. Applied rewrites90.3%

                                                                  \[\leadsto \color{blue}{\mathsf{fma}\left(5, x, \varepsilon\right) \cdot {\varepsilon}^{4}} \]
                                                                9. Step-by-step derivation
                                                                  1. Applied rewrites89.9%

                                                                    \[\leadsto \mathsf{fma}\left(5, x, \varepsilon\right) \cdot \left(\left(\varepsilon \cdot \varepsilon\right) \cdot \color{blue}{\left(\varepsilon \cdot \varepsilon\right)}\right) \]

                                                                  if -1.99999997e-317 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 5.0000000000000003e-254

                                                                  1. Initial program 90.1%

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

                                                                    \[\leadsto \color{blue}{\varepsilon \cdot \left(4 \cdot {x}^{4} + \left(\varepsilon \cdot \left(4 \cdot {x}^{3} + \left(\varepsilon \cdot \left(2 \cdot {x}^{2} + 8 \cdot {x}^{2}\right) + x \cdot \left(2 \cdot {x}^{2} + 4 \cdot {x}^{2}\right)\right)\right) + {x}^{4}\right)\right)} \]
                                                                  4. Step-by-step derivation
                                                                    1. *-commutativeN/A

                                                                      \[\leadsto \color{blue}{\left(4 \cdot {x}^{4} + \left(\varepsilon \cdot \left(4 \cdot {x}^{3} + \left(\varepsilon \cdot \left(2 \cdot {x}^{2} + 8 \cdot {x}^{2}\right) + x \cdot \left(2 \cdot {x}^{2} + 4 \cdot {x}^{2}\right)\right)\right) + {x}^{4}\right)\right) \cdot \varepsilon} \]
                                                                    2. lower-*.f64N/A

                                                                      \[\leadsto \color{blue}{\left(4 \cdot {x}^{4} + \left(\varepsilon \cdot \left(4 \cdot {x}^{3} + \left(\varepsilon \cdot \left(2 \cdot {x}^{2} + 8 \cdot {x}^{2}\right) + x \cdot \left(2 \cdot {x}^{2} + 4 \cdot {x}^{2}\right)\right)\right) + {x}^{4}\right)\right) \cdot \varepsilon} \]
                                                                  5. Applied rewrites99.3%

                                                                    \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(10 \cdot \left(x \cdot x\right), \varepsilon, {x}^{3} \cdot 10\right), \varepsilon, {x}^{4} \cdot 5\right) \cdot \varepsilon} \]
                                                                  6. Taylor expanded in x around 0

                                                                    \[\leadsto \left({x}^{2} \cdot \left(10 \cdot {\varepsilon}^{2} + x \cdot \left(5 \cdot x + 10 \cdot \varepsilon\right)\right)\right) \cdot \varepsilon \]
                                                                  7. Step-by-step derivation
                                                                    1. Applied rewrites99.3%

                                                                      \[\leadsto \left(\left(\mathsf{fma}\left(x \cdot x, 5, \left(\varepsilon \cdot \left(\varepsilon + x\right)\right) \cdot 10\right) \cdot x\right) \cdot x\right) \cdot \varepsilon \]
                                                                    2. Taylor expanded in x around inf

                                                                      \[\leadsto \left(\left(\left(5 \cdot {x}^{2}\right) \cdot x\right) \cdot x\right) \cdot \varepsilon \]
                                                                    3. Step-by-step derivation
                                                                      1. Applied rewrites99.0%

                                                                        \[\leadsto \left(\left(\left(\left(5 \cdot x\right) \cdot x\right) \cdot x\right) \cdot x\right) \cdot \varepsilon \]
                                                                    4. Recombined 2 regimes into one program.
                                                                    5. Final simplification97.2%

                                                                      \[\leadsto \begin{array}{l} \mathbf{if}\;{\left(\varepsilon + x\right)}^{5} - {x}^{5} \leq -2 \cdot 10^{-317}:\\ \;\;\;\;\left(\left(\varepsilon \cdot \varepsilon\right) \cdot \left(\varepsilon \cdot \varepsilon\right)\right) \cdot \mathsf{fma}\left(5, x, \varepsilon\right)\\ \mathbf{elif}\;{\left(\varepsilon + x\right)}^{5} - {x}^{5} \leq 5 \cdot 10^{-254}:\\ \;\;\;\;\left(\left(\left(\left(5 \cdot x\right) \cdot x\right) \cdot x\right) \cdot x\right) \cdot \varepsilon\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\varepsilon \cdot \varepsilon\right) \cdot \left(\varepsilon \cdot \varepsilon\right)\right) \cdot \mathsf{fma}\left(5, x, \varepsilon\right)\\ \end{array} \]
                                                                    6. Add Preprocessing

                                                                    Alternative 10: 97.2% accurate, 0.5× speedup?

                                                                    \[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(\varepsilon + x\right)}^{5} - {x}^{5}\\ t_1 := \left(\left(\varepsilon \cdot \varepsilon\right) \cdot \mathsf{fma}\left(5, x, \varepsilon\right)\right) \cdot \left(\varepsilon \cdot \varepsilon\right)\\ \mathbf{if}\;t\_0 \leq -2 \cdot 10^{-317}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-254}:\\ \;\;\;\;\left(\left(\left(\left(5 \cdot x\right) \cdot x\right) \cdot x\right) \cdot x\right) \cdot \varepsilon\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                                                                    (FPCore (x eps)
                                                                     :precision binary64
                                                                     (let* ((t_0 (- (pow (+ eps x) 5.0) (pow x 5.0)))
                                                                            (t_1 (* (* (* eps eps) (fma 5.0 x eps)) (* eps eps))))
                                                                       (if (<= t_0 -2e-317)
                                                                         t_1
                                                                         (if (<= t_0 5e-254) (* (* (* (* (* 5.0 x) x) x) x) eps) t_1))))
                                                                    double code(double x, double eps) {
                                                                    	double t_0 = pow((eps + x), 5.0) - pow(x, 5.0);
                                                                    	double t_1 = ((eps * eps) * fma(5.0, x, eps)) * (eps * eps);
                                                                    	double tmp;
                                                                    	if (t_0 <= -2e-317) {
                                                                    		tmp = t_1;
                                                                    	} else if (t_0 <= 5e-254) {
                                                                    		tmp = ((((5.0 * x) * x) * x) * x) * eps;
                                                                    	} else {
                                                                    		tmp = t_1;
                                                                    	}
                                                                    	return tmp;
                                                                    }
                                                                    
                                                                    function code(x, eps)
                                                                    	t_0 = Float64((Float64(eps + x) ^ 5.0) - (x ^ 5.0))
                                                                    	t_1 = Float64(Float64(Float64(eps * eps) * fma(5.0, x, eps)) * Float64(eps * eps))
                                                                    	tmp = 0.0
                                                                    	if (t_0 <= -2e-317)
                                                                    		tmp = t_1;
                                                                    	elseif (t_0 <= 5e-254)
                                                                    		tmp = Float64(Float64(Float64(Float64(Float64(5.0 * x) * x) * x) * x) * eps);
                                                                    	else
                                                                    		tmp = t_1;
                                                                    	end
                                                                    	return tmp
                                                                    end
                                                                    
                                                                    code[x_, eps_] := Block[{t$95$0 = N[(N[Power[N[(eps + x), $MachinePrecision], 5.0], $MachinePrecision] - N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(eps * eps), $MachinePrecision] * N[(5.0 * x + eps), $MachinePrecision]), $MachinePrecision] * N[(eps * eps), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e-317], t$95$1, If[LessEqual[t$95$0, 5e-254], N[(N[(N[(N[(N[(5.0 * x), $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision] * eps), $MachinePrecision], t$95$1]]]]
                                                                    
                                                                    \begin{array}{l}
                                                                    
                                                                    \\
                                                                    \begin{array}{l}
                                                                    t_0 := {\left(\varepsilon + x\right)}^{5} - {x}^{5}\\
                                                                    t_1 := \left(\left(\varepsilon \cdot \varepsilon\right) \cdot \mathsf{fma}\left(5, x, \varepsilon\right)\right) \cdot \left(\varepsilon \cdot \varepsilon\right)\\
                                                                    \mathbf{if}\;t\_0 \leq -2 \cdot 10^{-317}:\\
                                                                    \;\;\;\;t\_1\\
                                                                    
                                                                    \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-254}:\\
                                                                    \;\;\;\;\left(\left(\left(\left(5 \cdot x\right) \cdot x\right) \cdot x\right) \cdot x\right) \cdot \varepsilon\\
                                                                    
                                                                    \mathbf{else}:\\
                                                                    \;\;\;\;t\_1\\
                                                                    
                                                                    
                                                                    \end{array}
                                                                    \end{array}
                                                                    
                                                                    Derivation
                                                                    1. Split input into 2 regimes
                                                                    2. if (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -1.99999997e-317 or 5.0000000000000003e-254 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64)))

                                                                      1. Initial program 98.0%

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

                                                                        \[\leadsto \color{blue}{x \cdot \left(4 \cdot {\varepsilon}^{4} + {\varepsilon}^{4}\right) + {\varepsilon}^{5}} \]
                                                                      4. Step-by-step derivation
                                                                        1. *-commutativeN/A

                                                                          \[\leadsto \color{blue}{\left(4 \cdot {\varepsilon}^{4} + {\varepsilon}^{4}\right) \cdot x} + {\varepsilon}^{5} \]
                                                                        2. lower-fma.f64N/A

                                                                          \[\leadsto \color{blue}{\mathsf{fma}\left(4 \cdot {\varepsilon}^{4} + {\varepsilon}^{4}, x, {\varepsilon}^{5}\right)} \]
                                                                        3. distribute-lft1-inN/A

                                                                          \[\leadsto \mathsf{fma}\left(\color{blue}{\left(4 + 1\right) \cdot {\varepsilon}^{4}}, x, {\varepsilon}^{5}\right) \]
                                                                        4. metadata-evalN/A

                                                                          \[\leadsto \mathsf{fma}\left(\color{blue}{5} \cdot {\varepsilon}^{4}, x, {\varepsilon}^{5}\right) \]
                                                                        5. *-commutativeN/A

                                                                          \[\leadsto \mathsf{fma}\left(\color{blue}{{\varepsilon}^{4} \cdot 5}, x, {\varepsilon}^{5}\right) \]
                                                                        6. lower-*.f64N/A

                                                                          \[\leadsto \mathsf{fma}\left(\color{blue}{{\varepsilon}^{4} \cdot 5}, x, {\varepsilon}^{5}\right) \]
                                                                        7. lower-pow.f64N/A

                                                                          \[\leadsto \mathsf{fma}\left(\color{blue}{{\varepsilon}^{4}} \cdot 5, x, {\varepsilon}^{5}\right) \]
                                                                        8. lower-pow.f6490.6

                                                                          \[\leadsto \mathsf{fma}\left({\varepsilon}^{4} \cdot 5, x, \color{blue}{{\varepsilon}^{5}}\right) \]
                                                                      5. Applied rewrites90.6%

                                                                        \[\leadsto \color{blue}{\mathsf{fma}\left({\varepsilon}^{4} \cdot 5, x, {\varepsilon}^{5}\right)} \]
                                                                      6. Taylor expanded in x around 0

                                                                        \[\leadsto \color{blue}{x \cdot \left(4 \cdot {\varepsilon}^{4} + {\varepsilon}^{4}\right) + {\varepsilon}^{5}} \]
                                                                      7. Step-by-step derivation
                                                                        1. distribute-lft1-inN/A

                                                                          \[\leadsto x \cdot \color{blue}{\left(\left(4 + 1\right) \cdot {\varepsilon}^{4}\right)} + {\varepsilon}^{5} \]
                                                                        2. metadata-evalN/A

                                                                          \[\leadsto x \cdot \left(\color{blue}{5} \cdot {\varepsilon}^{4}\right) + {\varepsilon}^{5} \]
                                                                        3. associate-*r*N/A

                                                                          \[\leadsto \color{blue}{\left(x \cdot 5\right) \cdot {\varepsilon}^{4}} + {\varepsilon}^{5} \]
                                                                        4. *-commutativeN/A

                                                                          \[\leadsto \color{blue}{\left(5 \cdot x\right)} \cdot {\varepsilon}^{4} + {\varepsilon}^{5} \]
                                                                        5. metadata-evalN/A

                                                                          \[\leadsto \left(5 \cdot x\right) \cdot {\varepsilon}^{4} + {\varepsilon}^{\color{blue}{\left(4 + 1\right)}} \]
                                                                        6. pow-plusN/A

                                                                          \[\leadsto \left(5 \cdot x\right) \cdot {\varepsilon}^{4} + \color{blue}{{\varepsilon}^{4} \cdot \varepsilon} \]
                                                                        7. *-commutativeN/A

                                                                          \[\leadsto \left(5 \cdot x\right) \cdot {\varepsilon}^{4} + \color{blue}{\varepsilon \cdot {\varepsilon}^{4}} \]
                                                                        8. distribute-rgt-inN/A

                                                                          \[\leadsto \color{blue}{{\varepsilon}^{4} \cdot \left(5 \cdot x + \varepsilon\right)} \]
                                                                        9. +-commutativeN/A

                                                                          \[\leadsto {\varepsilon}^{4} \cdot \color{blue}{\left(\varepsilon + 5 \cdot x\right)} \]
                                                                        10. *-commutativeN/A

                                                                          \[\leadsto \color{blue}{\left(\varepsilon + 5 \cdot x\right) \cdot {\varepsilon}^{4}} \]
                                                                        11. lower-*.f64N/A

                                                                          \[\leadsto \color{blue}{\left(\varepsilon + 5 \cdot x\right) \cdot {\varepsilon}^{4}} \]
                                                                        12. +-commutativeN/A

                                                                          \[\leadsto \color{blue}{\left(5 \cdot x + \varepsilon\right)} \cdot {\varepsilon}^{4} \]
                                                                        13. lower-fma.f64N/A

                                                                          \[\leadsto \color{blue}{\mathsf{fma}\left(5, x, \varepsilon\right)} \cdot {\varepsilon}^{4} \]
                                                                        14. lower-pow.f6490.3

                                                                          \[\leadsto \mathsf{fma}\left(5, x, \varepsilon\right) \cdot \color{blue}{{\varepsilon}^{4}} \]
                                                                      8. Applied rewrites90.3%

                                                                        \[\leadsto \color{blue}{\mathsf{fma}\left(5, x, \varepsilon\right) \cdot {\varepsilon}^{4}} \]
                                                                      9. Step-by-step derivation
                                                                        1. Applied rewrites89.9%

                                                                          \[\leadsto \left(\mathsf{fma}\left(5, x, \varepsilon\right) \cdot \left(\varepsilon \cdot \varepsilon\right)\right) \cdot \color{blue}{\left(\varepsilon \cdot \varepsilon\right)} \]

                                                                        if -1.99999997e-317 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 5.0000000000000003e-254

                                                                        1. Initial program 90.1%

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

                                                                          \[\leadsto \color{blue}{\varepsilon \cdot \left(4 \cdot {x}^{4} + \left(\varepsilon \cdot \left(4 \cdot {x}^{3} + \left(\varepsilon \cdot \left(2 \cdot {x}^{2} + 8 \cdot {x}^{2}\right) + x \cdot \left(2 \cdot {x}^{2} + 4 \cdot {x}^{2}\right)\right)\right) + {x}^{4}\right)\right)} \]
                                                                        4. Step-by-step derivation
                                                                          1. *-commutativeN/A

                                                                            \[\leadsto \color{blue}{\left(4 \cdot {x}^{4} + \left(\varepsilon \cdot \left(4 \cdot {x}^{3} + \left(\varepsilon \cdot \left(2 \cdot {x}^{2} + 8 \cdot {x}^{2}\right) + x \cdot \left(2 \cdot {x}^{2} + 4 \cdot {x}^{2}\right)\right)\right) + {x}^{4}\right)\right) \cdot \varepsilon} \]
                                                                          2. lower-*.f64N/A

                                                                            \[\leadsto \color{blue}{\left(4 \cdot {x}^{4} + \left(\varepsilon \cdot \left(4 \cdot {x}^{3} + \left(\varepsilon \cdot \left(2 \cdot {x}^{2} + 8 \cdot {x}^{2}\right) + x \cdot \left(2 \cdot {x}^{2} + 4 \cdot {x}^{2}\right)\right)\right) + {x}^{4}\right)\right) \cdot \varepsilon} \]
                                                                        5. Applied rewrites99.3%

                                                                          \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(10 \cdot \left(x \cdot x\right), \varepsilon, {x}^{3} \cdot 10\right), \varepsilon, {x}^{4} \cdot 5\right) \cdot \varepsilon} \]
                                                                        6. Taylor expanded in x around 0

                                                                          \[\leadsto \left({x}^{2} \cdot \left(10 \cdot {\varepsilon}^{2} + x \cdot \left(5 \cdot x + 10 \cdot \varepsilon\right)\right)\right) \cdot \varepsilon \]
                                                                        7. Step-by-step derivation
                                                                          1. Applied rewrites99.3%

                                                                            \[\leadsto \left(\left(\mathsf{fma}\left(x \cdot x, 5, \left(\varepsilon \cdot \left(\varepsilon + x\right)\right) \cdot 10\right) \cdot x\right) \cdot x\right) \cdot \varepsilon \]
                                                                          2. Taylor expanded in x around inf

                                                                            \[\leadsto \left(\left(\left(5 \cdot {x}^{2}\right) \cdot x\right) \cdot x\right) \cdot \varepsilon \]
                                                                          3. Step-by-step derivation
                                                                            1. Applied rewrites99.0%

                                                                              \[\leadsto \left(\left(\left(\left(5 \cdot x\right) \cdot x\right) \cdot x\right) \cdot x\right) \cdot \varepsilon \]
                                                                          4. Recombined 2 regimes into one program.
                                                                          5. Final simplification97.2%

                                                                            \[\leadsto \begin{array}{l} \mathbf{if}\;{\left(\varepsilon + x\right)}^{5} - {x}^{5} \leq -2 \cdot 10^{-317}:\\ \;\;\;\;\left(\left(\varepsilon \cdot \varepsilon\right) \cdot \mathsf{fma}\left(5, x, \varepsilon\right)\right) \cdot \left(\varepsilon \cdot \varepsilon\right)\\ \mathbf{elif}\;{\left(\varepsilon + x\right)}^{5} - {x}^{5} \leq 5 \cdot 10^{-254}:\\ \;\;\;\;\left(\left(\left(\left(5 \cdot x\right) \cdot x\right) \cdot x\right) \cdot x\right) \cdot \varepsilon\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\varepsilon \cdot \varepsilon\right) \cdot \mathsf{fma}\left(5, x, \varepsilon\right)\right) \cdot \left(\varepsilon \cdot \varepsilon\right)\\ \end{array} \]
                                                                          6. Add Preprocessing

                                                                          Alternative 11: 82.8% accurate, 8.0× speedup?

                                                                          \[\begin{array}{l} \\ \left(\left(\left(\left(5 \cdot x\right) \cdot x\right) \cdot x\right) \cdot x\right) \cdot \varepsilon \end{array} \]
                                                                          (FPCore (x eps) :precision binary64 (* (* (* (* (* 5.0 x) x) x) x) eps))
                                                                          double code(double x, double eps) {
                                                                          	return ((((5.0 * x) * x) * x) * x) * eps;
                                                                          }
                                                                          
                                                                          real(8) function code(x, eps)
                                                                              real(8), intent (in) :: x
                                                                              real(8), intent (in) :: eps
                                                                              code = ((((5.0d0 * x) * x) * x) * x) * eps
                                                                          end function
                                                                          
                                                                          public static double code(double x, double eps) {
                                                                          	return ((((5.0 * x) * x) * x) * x) * eps;
                                                                          }
                                                                          
                                                                          def code(x, eps):
                                                                          	return ((((5.0 * x) * x) * x) * x) * eps
                                                                          
                                                                          function code(x, eps)
                                                                          	return Float64(Float64(Float64(Float64(Float64(5.0 * x) * x) * x) * x) * eps)
                                                                          end
                                                                          
                                                                          function tmp = code(x, eps)
                                                                          	tmp = ((((5.0 * x) * x) * x) * x) * eps;
                                                                          end
                                                                          
                                                                          code[x_, eps_] := N[(N[(N[(N[(N[(5.0 * x), $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision] * eps), $MachinePrecision]
                                                                          
                                                                          \begin{array}{l}
                                                                          
                                                                          \\
                                                                          \left(\left(\left(\left(5 \cdot x\right) \cdot x\right) \cdot x\right) \cdot x\right) \cdot \varepsilon
                                                                          \end{array}
                                                                          
                                                                          Derivation
                                                                          1. Initial program 91.7%

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

                                                                            \[\leadsto \color{blue}{\varepsilon \cdot \left(4 \cdot {x}^{4} + \left(\varepsilon \cdot \left(4 \cdot {x}^{3} + \left(\varepsilon \cdot \left(2 \cdot {x}^{2} + 8 \cdot {x}^{2}\right) + x \cdot \left(2 \cdot {x}^{2} + 4 \cdot {x}^{2}\right)\right)\right) + {x}^{4}\right)\right)} \]
                                                                          4. Step-by-step derivation
                                                                            1. *-commutativeN/A

                                                                              \[\leadsto \color{blue}{\left(4 \cdot {x}^{4} + \left(\varepsilon \cdot \left(4 \cdot {x}^{3} + \left(\varepsilon \cdot \left(2 \cdot {x}^{2} + 8 \cdot {x}^{2}\right) + x \cdot \left(2 \cdot {x}^{2} + 4 \cdot {x}^{2}\right)\right)\right) + {x}^{4}\right)\right) \cdot \varepsilon} \]
                                                                            2. lower-*.f64N/A

                                                                              \[\leadsto \color{blue}{\left(4 \cdot {x}^{4} + \left(\varepsilon \cdot \left(4 \cdot {x}^{3} + \left(\varepsilon \cdot \left(2 \cdot {x}^{2} + 8 \cdot {x}^{2}\right) + x \cdot \left(2 \cdot {x}^{2} + 4 \cdot {x}^{2}\right)\right)\right) + {x}^{4}\right)\right) \cdot \varepsilon} \]
                                                                          5. Applied rewrites81.7%

                                                                            \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(10 \cdot \left(x \cdot x\right), \varepsilon, {x}^{3} \cdot 10\right), \varepsilon, {x}^{4} \cdot 5\right) \cdot \varepsilon} \]
                                                                          6. Taylor expanded in x around 0

                                                                            \[\leadsto \left({x}^{2} \cdot \left(10 \cdot {\varepsilon}^{2} + x \cdot \left(5 \cdot x + 10 \cdot \varepsilon\right)\right)\right) \cdot \varepsilon \]
                                                                          7. Step-by-step derivation
                                                                            1. Applied rewrites81.7%

                                                                              \[\leadsto \left(\left(\mathsf{fma}\left(x \cdot x, 5, \left(\varepsilon \cdot \left(\varepsilon + x\right)\right) \cdot 10\right) \cdot x\right) \cdot x\right) \cdot \varepsilon \]
                                                                            2. Taylor expanded in x around inf

                                                                              \[\leadsto \left(\left(\left(5 \cdot {x}^{2}\right) \cdot x\right) \cdot x\right) \cdot \varepsilon \]
                                                                            3. Step-by-step derivation
                                                                              1. Applied rewrites80.9%

                                                                                \[\leadsto \left(\left(\left(\left(5 \cdot x\right) \cdot x\right) \cdot x\right) \cdot x\right) \cdot \varepsilon \]
                                                                              2. Add Preprocessing

                                                                              Alternative 12: 71.1% accurate, 8.0× speedup?

                                                                              \[\begin{array}{l} \\ \left(\left(\left(\left(\varepsilon \cdot \varepsilon\right) \cdot x\right) \cdot 10\right) \cdot x\right) \cdot \varepsilon \end{array} \]
                                                                              (FPCore (x eps) :precision binary64 (* (* (* (* (* eps eps) x) 10.0) x) eps))
                                                                              double code(double x, double eps) {
                                                                              	return ((((eps * eps) * x) * 10.0) * x) * eps;
                                                                              }
                                                                              
                                                                              real(8) function code(x, eps)
                                                                                  real(8), intent (in) :: x
                                                                                  real(8), intent (in) :: eps
                                                                                  code = ((((eps * eps) * x) * 10.0d0) * x) * eps
                                                                              end function
                                                                              
                                                                              public static double code(double x, double eps) {
                                                                              	return ((((eps * eps) * x) * 10.0) * x) * eps;
                                                                              }
                                                                              
                                                                              def code(x, eps):
                                                                              	return ((((eps * eps) * x) * 10.0) * x) * eps
                                                                              
                                                                              function code(x, eps)
                                                                              	return Float64(Float64(Float64(Float64(Float64(eps * eps) * x) * 10.0) * x) * eps)
                                                                              end
                                                                              
                                                                              function tmp = code(x, eps)
                                                                              	tmp = ((((eps * eps) * x) * 10.0) * x) * eps;
                                                                              end
                                                                              
                                                                              code[x_, eps_] := N[(N[(N[(N[(N[(eps * eps), $MachinePrecision] * x), $MachinePrecision] * 10.0), $MachinePrecision] * x), $MachinePrecision] * eps), $MachinePrecision]
                                                                              
                                                                              \begin{array}{l}
                                                                              
                                                                              \\
                                                                              \left(\left(\left(\left(\varepsilon \cdot \varepsilon\right) \cdot x\right) \cdot 10\right) \cdot x\right) \cdot \varepsilon
                                                                              \end{array}
                                                                              
                                                                              Derivation
                                                                              1. Initial program 91.7%

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

                                                                                \[\leadsto \color{blue}{\varepsilon \cdot \left(4 \cdot {x}^{4} + \left(\varepsilon \cdot \left(4 \cdot {x}^{3} + \left(\varepsilon \cdot \left(2 \cdot {x}^{2} + 8 \cdot {x}^{2}\right) + x \cdot \left(2 \cdot {x}^{2} + 4 \cdot {x}^{2}\right)\right)\right) + {x}^{4}\right)\right)} \]
                                                                              4. Step-by-step derivation
                                                                                1. *-commutativeN/A

                                                                                  \[\leadsto \color{blue}{\left(4 \cdot {x}^{4} + \left(\varepsilon \cdot \left(4 \cdot {x}^{3} + \left(\varepsilon \cdot \left(2 \cdot {x}^{2} + 8 \cdot {x}^{2}\right) + x \cdot \left(2 \cdot {x}^{2} + 4 \cdot {x}^{2}\right)\right)\right) + {x}^{4}\right)\right) \cdot \varepsilon} \]
                                                                                2. lower-*.f64N/A

                                                                                  \[\leadsto \color{blue}{\left(4 \cdot {x}^{4} + \left(\varepsilon \cdot \left(4 \cdot {x}^{3} + \left(\varepsilon \cdot \left(2 \cdot {x}^{2} + 8 \cdot {x}^{2}\right) + x \cdot \left(2 \cdot {x}^{2} + 4 \cdot {x}^{2}\right)\right)\right) + {x}^{4}\right)\right) \cdot \varepsilon} \]
                                                                              5. Applied rewrites81.7%

                                                                                \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(10 \cdot \left(x \cdot x\right), \varepsilon, {x}^{3} \cdot 10\right), \varepsilon, {x}^{4} \cdot 5\right) \cdot \varepsilon} \]
                                                                              6. Taylor expanded in x around 0

                                                                                \[\leadsto \left({x}^{2} \cdot \left(10 \cdot {\varepsilon}^{2} + x \cdot \left(5 \cdot x + 10 \cdot \varepsilon\right)\right)\right) \cdot \varepsilon \]
                                                                              7. Step-by-step derivation
                                                                                1. Applied rewrites81.7%

                                                                                  \[\leadsto \left(\left(\mathsf{fma}\left(x \cdot x, 5, \left(\varepsilon \cdot \left(\varepsilon + x\right)\right) \cdot 10\right) \cdot x\right) \cdot x\right) \cdot \varepsilon \]
                                                                                2. Taylor expanded in x around 0

                                                                                  \[\leadsto \left(\left(10 \cdot \left({\varepsilon}^{2} \cdot x\right)\right) \cdot x\right) \cdot \varepsilon \]
                                                                                3. Step-by-step derivation
                                                                                  1. Applied rewrites72.5%

                                                                                    \[\leadsto \left(\left(\left(\left(\varepsilon \cdot \varepsilon\right) \cdot x\right) \cdot 10\right) \cdot x\right) \cdot \varepsilon \]
                                                                                  2. Add Preprocessing

                                                                                  Reproduce

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