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

Percentage Accurate: 88.6% → 99.0%
Time: 9.3s
Alternatives: 8
Speedup: 9.8×

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 8 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.6% 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.0% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(x + \varepsilon\right)}^{5} - {x}^{5}\\ \mathbf{if}\;t\_0 \leq -4 \cdot 10^{-309}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;t\_0 \leq 0:\\ \;\;\;\;\left(x \cdot \varepsilon\right) \cdot \left(x \cdot \left(5 \cdot \left(x \cdot x\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;{\varepsilon}^{5} \cdot \left(1 + \frac{x \cdot 5}{\varepsilon}\right)\\ \end{array} \end{array} \]
(FPCore (x eps)
 :precision binary64
 (let* ((t_0 (- (pow (+ x eps) 5.0) (pow x 5.0))))
   (if (<= t_0 -4e-309)
     t_0
     (if (<= t_0 0.0)
       (* (* x eps) (* x (* 5.0 (* x x))))
       (* (pow eps 5.0) (+ 1.0 (/ (* x 5.0) eps)))))))
double code(double x, double eps) {
	double t_0 = pow((x + eps), 5.0) - pow(x, 5.0);
	double tmp;
	if (t_0 <= -4e-309) {
		tmp = t_0;
	} else if (t_0 <= 0.0) {
		tmp = (x * eps) * (x * (5.0 * (x * x)));
	} else {
		tmp = pow(eps, 5.0) * (1.0 + ((x * 5.0) / eps));
	}
	return tmp;
}
real(8) function code(x, eps)
    real(8), intent (in) :: x
    real(8), intent (in) :: eps
    real(8) :: t_0
    real(8) :: tmp
    t_0 = ((x + eps) ** 5.0d0) - (x ** 5.0d0)
    if (t_0 <= (-4d-309)) then
        tmp = t_0
    else if (t_0 <= 0.0d0) then
        tmp = (x * eps) * (x * (5.0d0 * (x * x)))
    else
        tmp = (eps ** 5.0d0) * (1.0d0 + ((x * 5.0d0) / eps))
    end if
    code = tmp
end function
public static double code(double x, double eps) {
	double t_0 = Math.pow((x + eps), 5.0) - Math.pow(x, 5.0);
	double tmp;
	if (t_0 <= -4e-309) {
		tmp = t_0;
	} else if (t_0 <= 0.0) {
		tmp = (x * eps) * (x * (5.0 * (x * x)));
	} else {
		tmp = Math.pow(eps, 5.0) * (1.0 + ((x * 5.0) / eps));
	}
	return tmp;
}
def code(x, eps):
	t_0 = math.pow((x + eps), 5.0) - math.pow(x, 5.0)
	tmp = 0
	if t_0 <= -4e-309:
		tmp = t_0
	elif t_0 <= 0.0:
		tmp = (x * eps) * (x * (5.0 * (x * x)))
	else:
		tmp = math.pow(eps, 5.0) * (1.0 + ((x * 5.0) / eps))
	return tmp
function code(x, eps)
	t_0 = Float64((Float64(x + eps) ^ 5.0) - (x ^ 5.0))
	tmp = 0.0
	if (t_0 <= -4e-309)
		tmp = t_0;
	elseif (t_0 <= 0.0)
		tmp = Float64(Float64(x * eps) * Float64(x * Float64(5.0 * Float64(x * x))));
	else
		tmp = Float64((eps ^ 5.0) * Float64(1.0 + Float64(Float64(x * 5.0) / eps)));
	end
	return tmp
end
function tmp_2 = code(x, eps)
	t_0 = ((x + eps) ^ 5.0) - (x ^ 5.0);
	tmp = 0.0;
	if (t_0 <= -4e-309)
		tmp = t_0;
	elseif (t_0 <= 0.0)
		tmp = (x * eps) * (x * (5.0 * (x * x)));
	else
		tmp = (eps ^ 5.0) * (1.0 + ((x * 5.0) / eps));
	end
	tmp_2 = tmp;
end
code[x_, eps_] := Block[{t$95$0 = N[(N[Power[N[(x + eps), $MachinePrecision], 5.0], $MachinePrecision] - N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -4e-309], t$95$0, If[LessEqual[t$95$0, 0.0], N[(N[(x * eps), $MachinePrecision] * N[(x * N[(5.0 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[eps, 5.0], $MachinePrecision] * N[(1.0 + N[(N[(x * 5.0), $MachinePrecision] / eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

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

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

\mathbf{else}:\\
\;\;\;\;{\varepsilon}^{5} \cdot \left(1 + \frac{x \cdot 5}{\varepsilon}\right)\\


\end{array}
\end{array}
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))) < -3.9999999999999977e-309

    1. Initial program 99.6%

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

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

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(5, \color{blue}{\left({x}^{4}\right)}\right)\right) \]
      10. pow-lowering-pow.f6499.9%

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(5, \mathsf{pow.f64}\left(x, \color{blue}{4}\right)\right)\right) \]
    5. Simplified99.9%

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left({x}^{\left(2 \cdot 2\right)}\right), \left(\varepsilon \cdot 5\right)\right) \]
      5. pow-sqrN/A

        \[\leadsto \mathsf{*.f64}\left(\left({x}^{2} \cdot {x}^{2}\right), \left(\color{blue}{\varepsilon} \cdot 5\right)\right) \]
      6. pow2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(x \cdot x\right) \cdot {x}^{2}\right), \left(\varepsilon \cdot 5\right)\right) \]
      7. pow2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right), \left(\varepsilon \cdot 5\right)\right) \]
      8. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right), \left(\color{blue}{\varepsilon} \cdot 5\right)\right) \]
      9. cube-unmultN/A

        \[\leadsto \mathsf{*.f64}\left(\left(x \cdot {x}^{3}\right), \left(\varepsilon \cdot 5\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \left({x}^{3}\right)\right), \left(\color{blue}{\varepsilon} \cdot 5\right)\right) \]
      11. cube-unmultN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \left(x \cdot \left(x \cdot x\right)\right)\right), \left(\varepsilon \cdot 5\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \left(x \cdot x\right)\right)\right), \left(\varepsilon \cdot 5\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(\varepsilon \cdot 5\right)\right) \]
      14. *-lowering-*.f6499.9%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{*.f64}\left(\varepsilon, \color{blue}{5}\right)\right) \]
    7. Applied egg-rr99.9%

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

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

        \[\leadsto \left(\left(\varepsilon \cdot 5\right) \cdot x\right) \cdot \color{blue}{\left(x \cdot \left(x \cdot x\right)\right)} \]
      3. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\varepsilon \cdot 5\right), x\right), \left(\color{blue}{x} \cdot \left(x \cdot x\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\varepsilon, 5\right), x\right), \left(x \cdot \left(x \cdot x\right)\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\varepsilon, 5\right), x\right), \mathsf{*.f64}\left(x, \color{blue}{\left(x \cdot x\right)}\right)\right) \]
      7. *-lowering-*.f6499.9%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\varepsilon, 5\right), x\right), \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \color{blue}{x}\right)\right)\right) \]
    9. Applied egg-rr99.9%

      \[\leadsto \color{blue}{\left(\left(\varepsilon \cdot 5\right) \cdot x\right) \cdot \left(x \cdot \left(x \cdot x\right)\right)} \]
    10. Step-by-step derivation
      1. associate-*l*N/A

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

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

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

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

        \[\leadsto \left(\varepsilon \cdot x\right) \cdot \color{blue}{\left(\left(x \cdot \left(x \cdot x\right)\right) \cdot 5\right)} \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\varepsilon \cdot x\right), \color{blue}{\left(\left(x \cdot \left(x \cdot x\right)\right) \cdot 5\right)}\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\varepsilon, x\right), \left(\color{blue}{\left(x \cdot \left(x \cdot x\right)\right)} \cdot 5\right)\right) \]
      8. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\varepsilon, x\right), \left(x \cdot \color{blue}{\left(\left(x \cdot x\right) \cdot 5\right)}\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\varepsilon, x\right), \mathsf{*.f64}\left(x, \color{blue}{\left(\left(x \cdot x\right) \cdot 5\right)}\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\varepsilon, x\right), \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\left(x \cdot x\right), \color{blue}{5}\right)\right)\right) \]
      11. *-lowering-*.f64100.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\varepsilon, x\right), \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), 5\right)\right)\right) \]
    11. Applied egg-rr100.0%

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

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

    1. Initial program 99.9%

      \[{\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. *-lowering-*.f64N/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \left(1 + 5 \cdot \frac{\color{blue}{x}}{\varepsilon}\right)\right) \]
      5. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \left(1 + \frac{5 \cdot x}{\color{blue}{\varepsilon}}\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \left(1 + \frac{\left(4 + 1\right) \cdot x}{\varepsilon}\right)\right) \]
      7. distribute-rgt1-inN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \left(1 + \frac{x + 4 \cdot x}{\varepsilon}\right)\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{x + 4 \cdot x}{\varepsilon}\right)}\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(x + 4 \cdot x\right), \color{blue}{\varepsilon}\right)\right)\right) \]
      10. distribute-rgt1-inN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\left(4 + 1\right) \cdot x\right), \varepsilon\right)\right)\right) \]
      11. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(5 \cdot x\right), \varepsilon\right)\right)\right) \]
      12. *-lowering-*.f64100.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(5, x\right), \varepsilon\right)\right)\right) \]
    5. Simplified100.0%

      \[\leadsto \color{blue}{{\varepsilon}^{5} \cdot \left(1 + \frac{5 \cdot x}{\varepsilon}\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification99.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;{\left(x + \varepsilon\right)}^{5} - {x}^{5} \leq -4 \cdot 10^{-309}:\\ \;\;\;\;{\left(x + \varepsilon\right)}^{5} - {x}^{5}\\ \mathbf{elif}\;{\left(x + \varepsilon\right)}^{5} - {x}^{5} \leq 0:\\ \;\;\;\;\left(x \cdot \varepsilon\right) \cdot \left(x \cdot \left(5 \cdot \left(x \cdot x\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;{\varepsilon}^{5} \cdot \left(1 + \frac{x \cdot 5}{\varepsilon}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 97.8% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -9.4 \cdot 10^{-54}:\\ \;\;\;\;\left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right) \cdot \left(\varepsilon \cdot 5\right)\\ \mathbf{elif}\;x \leq 8 \cdot 10^{-62}:\\ \;\;\;\;{\varepsilon}^{5} \cdot \left(1 + \frac{x \cdot 5}{\varepsilon}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot \varepsilon\right) \cdot \left(x \cdot \left(5 \cdot \left(x \cdot x\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (x eps)
 :precision binary64
 (if (<= x -9.4e-54)
   (* (* x (* x (* x x))) (* eps 5.0))
   (if (<= x 8e-62)
     (* (pow eps 5.0) (+ 1.0 (/ (* x 5.0) eps)))
     (* (* x eps) (* x (* 5.0 (* x x)))))))
double code(double x, double eps) {
	double tmp;
	if (x <= -9.4e-54) {
		tmp = (x * (x * (x * x))) * (eps * 5.0);
	} else if (x <= 8e-62) {
		tmp = pow(eps, 5.0) * (1.0 + ((x * 5.0) / eps));
	} else {
		tmp = (x * eps) * (x * (5.0 * (x * x)));
	}
	return tmp;
}
real(8) function code(x, eps)
    real(8), intent (in) :: x
    real(8), intent (in) :: eps
    real(8) :: tmp
    if (x <= (-9.4d-54)) then
        tmp = (x * (x * (x * x))) * (eps * 5.0d0)
    else if (x <= 8d-62) then
        tmp = (eps ** 5.0d0) * (1.0d0 + ((x * 5.0d0) / eps))
    else
        tmp = (x * eps) * (x * (5.0d0 * (x * x)))
    end if
    code = tmp
end function
public static double code(double x, double eps) {
	double tmp;
	if (x <= -9.4e-54) {
		tmp = (x * (x * (x * x))) * (eps * 5.0);
	} else if (x <= 8e-62) {
		tmp = Math.pow(eps, 5.0) * (1.0 + ((x * 5.0) / eps));
	} else {
		tmp = (x * eps) * (x * (5.0 * (x * x)));
	}
	return tmp;
}
def code(x, eps):
	tmp = 0
	if x <= -9.4e-54:
		tmp = (x * (x * (x * x))) * (eps * 5.0)
	elif x <= 8e-62:
		tmp = math.pow(eps, 5.0) * (1.0 + ((x * 5.0) / eps))
	else:
		tmp = (x * eps) * (x * (5.0 * (x * x)))
	return tmp
function code(x, eps)
	tmp = 0.0
	if (x <= -9.4e-54)
		tmp = Float64(Float64(x * Float64(x * Float64(x * x))) * Float64(eps * 5.0));
	elseif (x <= 8e-62)
		tmp = Float64((eps ^ 5.0) * Float64(1.0 + Float64(Float64(x * 5.0) / eps)));
	else
		tmp = Float64(Float64(x * eps) * Float64(x * Float64(5.0 * Float64(x * x))));
	end
	return tmp
end
function tmp_2 = code(x, eps)
	tmp = 0.0;
	if (x <= -9.4e-54)
		tmp = (x * (x * (x * x))) * (eps * 5.0);
	elseif (x <= 8e-62)
		tmp = (eps ^ 5.0) * (1.0 + ((x * 5.0) / eps));
	else
		tmp = (x * eps) * (x * (5.0 * (x * x)));
	end
	tmp_2 = tmp;
end
code[x_, eps_] := If[LessEqual[x, -9.4e-54], N[(N[(x * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(eps * 5.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 8e-62], N[(N[Power[eps, 5.0], $MachinePrecision] * N[(1.0 + N[(N[(x * 5.0), $MachinePrecision] / eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * eps), $MachinePrecision] * N[(x * N[(5.0 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.4 \cdot 10^{-54}:\\
\;\;\;\;\left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right) \cdot \left(\varepsilon \cdot 5\right)\\

\mathbf{elif}\;x \leq 8 \cdot 10^{-62}:\\
\;\;\;\;{\varepsilon}^{5} \cdot \left(1 + \frac{x \cdot 5}{\varepsilon}\right)\\

\mathbf{else}:\\
\;\;\;\;\left(x \cdot \varepsilon\right) \cdot \left(x \cdot \left(5 \cdot \left(x \cdot x\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -9.4e-54

    1. Initial program 39.0%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(5, \color{blue}{\left({x}^{4}\right)}\right)\right) \]
      10. pow-lowering-pow.f6490.4%

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(5, \mathsf{pow.f64}\left(x, \color{blue}{4}\right)\right)\right) \]
    5. Simplified90.4%

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left({x}^{\left(2 \cdot 2\right)}\right), \left(\varepsilon \cdot 5\right)\right) \]
      5. pow-sqrN/A

        \[\leadsto \mathsf{*.f64}\left(\left({x}^{2} \cdot {x}^{2}\right), \left(\color{blue}{\varepsilon} \cdot 5\right)\right) \]
      6. pow2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(x \cdot x\right) \cdot {x}^{2}\right), \left(\varepsilon \cdot 5\right)\right) \]
      7. pow2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right), \left(\varepsilon \cdot 5\right)\right) \]
      8. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right), \left(\color{blue}{\varepsilon} \cdot 5\right)\right) \]
      9. cube-unmultN/A

        \[\leadsto \mathsf{*.f64}\left(\left(x \cdot {x}^{3}\right), \left(\varepsilon \cdot 5\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \left({x}^{3}\right)\right), \left(\color{blue}{\varepsilon} \cdot 5\right)\right) \]
      11. cube-unmultN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \left(x \cdot \left(x \cdot x\right)\right)\right), \left(\varepsilon \cdot 5\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \left(x \cdot x\right)\right)\right), \left(\varepsilon \cdot 5\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(\varepsilon \cdot 5\right)\right) \]
      14. *-lowering-*.f6490.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{*.f64}\left(\varepsilon, \color{blue}{5}\right)\right) \]
    7. Applied egg-rr90.7%

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

    if -9.4e-54 < x < 8.0000000000000003e-62

    1. Initial program 100.0%

      \[{\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. *-lowering-*.f64N/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \left(1 + 5 \cdot \frac{\color{blue}{x}}{\varepsilon}\right)\right) \]
      5. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \left(1 + \frac{5 \cdot x}{\color{blue}{\varepsilon}}\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \left(1 + \frac{\left(4 + 1\right) \cdot x}{\varepsilon}\right)\right) \]
      7. distribute-rgt1-inN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \left(1 + \frac{x + 4 \cdot x}{\varepsilon}\right)\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{x + 4 \cdot x}{\varepsilon}\right)}\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(x + 4 \cdot x\right), \color{blue}{\varepsilon}\right)\right)\right) \]
      10. distribute-rgt1-inN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\left(4 + 1\right) \cdot x\right), \varepsilon\right)\right)\right) \]
      11. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(5 \cdot x\right), \varepsilon\right)\right)\right) \]
      12. *-lowering-*.f6499.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(5, x\right), \varepsilon\right)\right)\right) \]
    5. Simplified99.8%

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

    if 8.0000000000000003e-62 < x

    1. Initial program 38.8%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(5, \color{blue}{\left({x}^{4}\right)}\right)\right) \]
      10. pow-lowering-pow.f6496.6%

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(5, \mathsf{pow.f64}\left(x, \color{blue}{4}\right)\right)\right) \]
    5. Simplified96.6%

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left({x}^{\left(2 \cdot 2\right)}\right), \left(\varepsilon \cdot 5\right)\right) \]
      5. pow-sqrN/A

        \[\leadsto \mathsf{*.f64}\left(\left({x}^{2} \cdot {x}^{2}\right), \left(\color{blue}{\varepsilon} \cdot 5\right)\right) \]
      6. pow2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(x \cdot x\right) \cdot {x}^{2}\right), \left(\varepsilon \cdot 5\right)\right) \]
      7. pow2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right), \left(\varepsilon \cdot 5\right)\right) \]
      8. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right), \left(\color{blue}{\varepsilon} \cdot 5\right)\right) \]
      9. cube-unmultN/A

        \[\leadsto \mathsf{*.f64}\left(\left(x \cdot {x}^{3}\right), \left(\varepsilon \cdot 5\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \left({x}^{3}\right)\right), \left(\color{blue}{\varepsilon} \cdot 5\right)\right) \]
      11. cube-unmultN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \left(x \cdot \left(x \cdot x\right)\right)\right), \left(\varepsilon \cdot 5\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \left(x \cdot x\right)\right)\right), \left(\varepsilon \cdot 5\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(\varepsilon \cdot 5\right)\right) \]
      14. *-lowering-*.f6496.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{*.f64}\left(\varepsilon, \color{blue}{5}\right)\right) \]
    7. Applied egg-rr96.7%

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

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

        \[\leadsto \left(\left(\varepsilon \cdot 5\right) \cdot x\right) \cdot \color{blue}{\left(x \cdot \left(x \cdot x\right)\right)} \]
      3. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\varepsilon \cdot 5\right), x\right), \left(\color{blue}{x} \cdot \left(x \cdot x\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\varepsilon, 5\right), x\right), \left(x \cdot \left(x \cdot x\right)\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\varepsilon, 5\right), x\right), \mathsf{*.f64}\left(x, \color{blue}{\left(x \cdot x\right)}\right)\right) \]
      7. *-lowering-*.f6496.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\varepsilon, 5\right), x\right), \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \color{blue}{x}\right)\right)\right) \]
    9. Applied egg-rr96.7%

      \[\leadsto \color{blue}{\left(\left(\varepsilon \cdot 5\right) \cdot x\right) \cdot \left(x \cdot \left(x \cdot x\right)\right)} \]
    10. Step-by-step derivation
      1. associate-*l*N/A

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

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

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

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

        \[\leadsto \left(\varepsilon \cdot x\right) \cdot \color{blue}{\left(\left(x \cdot \left(x \cdot x\right)\right) \cdot 5\right)} \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\varepsilon \cdot x\right), \color{blue}{\left(\left(x \cdot \left(x \cdot x\right)\right) \cdot 5\right)}\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\varepsilon, x\right), \left(\color{blue}{\left(x \cdot \left(x \cdot x\right)\right)} \cdot 5\right)\right) \]
      8. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\varepsilon, x\right), \left(x \cdot \color{blue}{\left(\left(x \cdot x\right) \cdot 5\right)}\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\varepsilon, x\right), \mathsf{*.f64}\left(x, \color{blue}{\left(\left(x \cdot x\right) \cdot 5\right)}\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\varepsilon, x\right), \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\left(x \cdot x\right), \color{blue}{5}\right)\right)\right) \]
      11. *-lowering-*.f6497.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\varepsilon, x\right), \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), 5\right)\right)\right) \]
    11. Applied egg-rr97.0%

      \[\leadsto \color{blue}{\left(\varepsilon \cdot x\right) \cdot \left(x \cdot \left(\left(x \cdot x\right) \cdot 5\right)\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification98.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -9.4 \cdot 10^{-54}:\\ \;\;\;\;\left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right) \cdot \left(\varepsilon \cdot 5\right)\\ \mathbf{elif}\;x \leq 8 \cdot 10^{-62}:\\ \;\;\;\;{\varepsilon}^{5} \cdot \left(1 + \frac{x \cdot 5}{\varepsilon}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot \varepsilon\right) \cdot \left(x \cdot \left(5 \cdot \left(x \cdot x\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 97.7% accurate, 7.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -6.8 \cdot 10^{-52}:\\ \;\;\;\;\left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right) \cdot \left(\varepsilon \cdot 5\right)\\ \mathbf{elif}\;x \leq 8 \cdot 10^{-62}:\\ \;\;\;\;\left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right) \cdot \left(\left(x \cdot x\right) \cdot 10 + \varepsilon \cdot \left(\varepsilon - x \cdot -5\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot \varepsilon\right) \cdot \left(x \cdot \left(5 \cdot \left(x \cdot x\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (x eps)
 :precision binary64
 (if (<= x -6.8e-52)
   (* (* x (* x (* x x))) (* eps 5.0))
   (if (<= x 8e-62)
     (* (* eps (* eps eps)) (+ (* (* x x) 10.0) (* eps (- eps (* x -5.0)))))
     (* (* x eps) (* x (* 5.0 (* x x)))))))
double code(double x, double eps) {
	double tmp;
	if (x <= -6.8e-52) {
		tmp = (x * (x * (x * x))) * (eps * 5.0);
	} else if (x <= 8e-62) {
		tmp = (eps * (eps * eps)) * (((x * x) * 10.0) + (eps * (eps - (x * -5.0))));
	} else {
		tmp = (x * eps) * (x * (5.0 * (x * x)));
	}
	return tmp;
}
real(8) function code(x, eps)
    real(8), intent (in) :: x
    real(8), intent (in) :: eps
    real(8) :: tmp
    if (x <= (-6.8d-52)) then
        tmp = (x * (x * (x * x))) * (eps * 5.0d0)
    else if (x <= 8d-62) then
        tmp = (eps * (eps * eps)) * (((x * x) * 10.0d0) + (eps * (eps - (x * (-5.0d0)))))
    else
        tmp = (x * eps) * (x * (5.0d0 * (x * x)))
    end if
    code = tmp
end function
public static double code(double x, double eps) {
	double tmp;
	if (x <= -6.8e-52) {
		tmp = (x * (x * (x * x))) * (eps * 5.0);
	} else if (x <= 8e-62) {
		tmp = (eps * (eps * eps)) * (((x * x) * 10.0) + (eps * (eps - (x * -5.0))));
	} else {
		tmp = (x * eps) * (x * (5.0 * (x * x)));
	}
	return tmp;
}
def code(x, eps):
	tmp = 0
	if x <= -6.8e-52:
		tmp = (x * (x * (x * x))) * (eps * 5.0)
	elif x <= 8e-62:
		tmp = (eps * (eps * eps)) * (((x * x) * 10.0) + (eps * (eps - (x * -5.0))))
	else:
		tmp = (x * eps) * (x * (5.0 * (x * x)))
	return tmp
function code(x, eps)
	tmp = 0.0
	if (x <= -6.8e-52)
		tmp = Float64(Float64(x * Float64(x * Float64(x * x))) * Float64(eps * 5.0));
	elseif (x <= 8e-62)
		tmp = Float64(Float64(eps * Float64(eps * eps)) * Float64(Float64(Float64(x * x) * 10.0) + Float64(eps * Float64(eps - Float64(x * -5.0)))));
	else
		tmp = Float64(Float64(x * eps) * Float64(x * Float64(5.0 * Float64(x * x))));
	end
	return tmp
end
function tmp_2 = code(x, eps)
	tmp = 0.0;
	if (x <= -6.8e-52)
		tmp = (x * (x * (x * x))) * (eps * 5.0);
	elseif (x <= 8e-62)
		tmp = (eps * (eps * eps)) * (((x * x) * 10.0) + (eps * (eps - (x * -5.0))));
	else
		tmp = (x * eps) * (x * (5.0 * (x * x)));
	end
	tmp_2 = tmp;
end
code[x_, eps_] := If[LessEqual[x, -6.8e-52], N[(N[(x * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(eps * 5.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 8e-62], N[(N[(eps * N[(eps * eps), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(x * x), $MachinePrecision] * 10.0), $MachinePrecision] + N[(eps * N[(eps - N[(x * -5.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * eps), $MachinePrecision] * N[(x * N[(5.0 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.8 \cdot 10^{-52}:\\
\;\;\;\;\left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right) \cdot \left(\varepsilon \cdot 5\right)\\

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

\mathbf{else}:\\
\;\;\;\;\left(x \cdot \varepsilon\right) \cdot \left(x \cdot \left(5 \cdot \left(x \cdot x\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -6.80000000000000035e-52

    1. Initial program 39.0%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(5, \color{blue}{\left({x}^{4}\right)}\right)\right) \]
      10. pow-lowering-pow.f6490.4%

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(5, \mathsf{pow.f64}\left(x, \color{blue}{4}\right)\right)\right) \]
    5. Simplified90.4%

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left({x}^{\left(2 \cdot 2\right)}\right), \left(\varepsilon \cdot 5\right)\right) \]
      5. pow-sqrN/A

        \[\leadsto \mathsf{*.f64}\left(\left({x}^{2} \cdot {x}^{2}\right), \left(\color{blue}{\varepsilon} \cdot 5\right)\right) \]
      6. pow2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(x \cdot x\right) \cdot {x}^{2}\right), \left(\varepsilon \cdot 5\right)\right) \]
      7. pow2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right), \left(\varepsilon \cdot 5\right)\right) \]
      8. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right), \left(\color{blue}{\varepsilon} \cdot 5\right)\right) \]
      9. cube-unmultN/A

        \[\leadsto \mathsf{*.f64}\left(\left(x \cdot {x}^{3}\right), \left(\varepsilon \cdot 5\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \left({x}^{3}\right)\right), \left(\color{blue}{\varepsilon} \cdot 5\right)\right) \]
      11. cube-unmultN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \left(x \cdot \left(x \cdot x\right)\right)\right), \left(\varepsilon \cdot 5\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \left(x \cdot x\right)\right)\right), \left(\varepsilon \cdot 5\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(\varepsilon \cdot 5\right)\right) \]
      14. *-lowering-*.f6490.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{*.f64}\left(\varepsilon, \color{blue}{5}\right)\right) \]
    7. Applied egg-rr90.7%

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

    if -6.80000000000000035e-52 < x < 8.0000000000000003e-62

    1. Initial program 100.0%

      \[{\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 \left(-1 \cdot {\varepsilon}^{5}\right) \cdot \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)} \]
      2. *-commutativeN/A

        \[\leadsto \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 \color{blue}{\left(-1 \cdot {\varepsilon}^{5}\right)} \]
      3. sub-negN/A

        \[\leadsto \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(\color{blue}{-1} \cdot {\varepsilon}^{5}\right) \]
      4. *-commutativeN/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 + \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 + -1\right) \cdot \left(-1 \cdot {\varepsilon}^{5}\right) \]
      6. distribute-lft1-inN/A

        \[\leadsto \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(\color{blue}{-1} \cdot {\varepsilon}^{5}\right) \]
      7. associate-*l*N/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} + 1\right) \cdot \color{blue}{\left(-1 \cdot \left(-1 \cdot {\varepsilon}^{5}\right)\right)} \]
    5. Simplified95.9%

      \[\leadsto \color{blue}{\left(\frac{5 \cdot x - \frac{\left(x \cdot x\right) \cdot -10}{\varepsilon}}{\varepsilon} + 1\right) \cdot {\varepsilon}^{5}} \]
    6. Taylor expanded in x around 0

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {\varepsilon}^{4} \cdot \left(\varepsilon + 5 \cdot x\right) + \left(10 \cdot {\varepsilon}^{3}\right) \cdot \color{blue}{\left(x \cdot x\right)} \]
      11. unpow2N/A

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

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

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

        \[\leadsto \mathsf{fma}\left({\varepsilon}^{\left(3 + 1\right)}, \varepsilon + 5 \cdot x, {x}^{2} \cdot \left(10 \cdot {\varepsilon}^{3}\right)\right) \]
      15. pow-plusN/A

        \[\leadsto \mathsf{fma}\left({\varepsilon}^{3} \cdot \varepsilon, \color{blue}{\varepsilon} + 5 \cdot x, {x}^{2} \cdot \left(10 \cdot {\varepsilon}^{3}\right)\right) \]
      16. fma-defineN/A

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

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

    if 8.0000000000000003e-62 < x

    1. Initial program 38.8%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(5, \color{blue}{\left({x}^{4}\right)}\right)\right) \]
      10. pow-lowering-pow.f6496.6%

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(5, \mathsf{pow.f64}\left(x, \color{blue}{4}\right)\right)\right) \]
    5. Simplified96.6%

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left({x}^{\left(2 \cdot 2\right)}\right), \left(\varepsilon \cdot 5\right)\right) \]
      5. pow-sqrN/A

        \[\leadsto \mathsf{*.f64}\left(\left({x}^{2} \cdot {x}^{2}\right), \left(\color{blue}{\varepsilon} \cdot 5\right)\right) \]
      6. pow2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(x \cdot x\right) \cdot {x}^{2}\right), \left(\varepsilon \cdot 5\right)\right) \]
      7. pow2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right), \left(\varepsilon \cdot 5\right)\right) \]
      8. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right), \left(\color{blue}{\varepsilon} \cdot 5\right)\right) \]
      9. cube-unmultN/A

        \[\leadsto \mathsf{*.f64}\left(\left(x \cdot {x}^{3}\right), \left(\varepsilon \cdot 5\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \left({x}^{3}\right)\right), \left(\color{blue}{\varepsilon} \cdot 5\right)\right) \]
      11. cube-unmultN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \left(x \cdot \left(x \cdot x\right)\right)\right), \left(\varepsilon \cdot 5\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \left(x \cdot x\right)\right)\right), \left(\varepsilon \cdot 5\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(\varepsilon \cdot 5\right)\right) \]
      14. *-lowering-*.f6496.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{*.f64}\left(\varepsilon, \color{blue}{5}\right)\right) \]
    7. Applied egg-rr96.7%

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

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

        \[\leadsto \left(\left(\varepsilon \cdot 5\right) \cdot x\right) \cdot \color{blue}{\left(x \cdot \left(x \cdot x\right)\right)} \]
      3. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\varepsilon \cdot 5\right), x\right), \left(\color{blue}{x} \cdot \left(x \cdot x\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\varepsilon, 5\right), x\right), \left(x \cdot \left(x \cdot x\right)\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\varepsilon, 5\right), x\right), \mathsf{*.f64}\left(x, \color{blue}{\left(x \cdot x\right)}\right)\right) \]
      7. *-lowering-*.f6496.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\varepsilon, 5\right), x\right), \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \color{blue}{x}\right)\right)\right) \]
    9. Applied egg-rr96.7%

      \[\leadsto \color{blue}{\left(\left(\varepsilon \cdot 5\right) \cdot x\right) \cdot \left(x \cdot \left(x \cdot x\right)\right)} \]
    10. Step-by-step derivation
      1. associate-*l*N/A

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

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

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

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

        \[\leadsto \left(\varepsilon \cdot x\right) \cdot \color{blue}{\left(\left(x \cdot \left(x \cdot x\right)\right) \cdot 5\right)} \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\varepsilon \cdot x\right), \color{blue}{\left(\left(x \cdot \left(x \cdot x\right)\right) \cdot 5\right)}\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\varepsilon, x\right), \left(\color{blue}{\left(x \cdot \left(x \cdot x\right)\right)} \cdot 5\right)\right) \]
      8. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\varepsilon, x\right), \left(x \cdot \color{blue}{\left(\left(x \cdot x\right) \cdot 5\right)}\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\varepsilon, x\right), \mathsf{*.f64}\left(x, \color{blue}{\left(\left(x \cdot x\right) \cdot 5\right)}\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\varepsilon, x\right), \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\left(x \cdot x\right), \color{blue}{5}\right)\right)\right) \]
      11. *-lowering-*.f6497.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\varepsilon, x\right), \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), 5\right)\right)\right) \]
    11. Applied egg-rr97.0%

      \[\leadsto \color{blue}{\left(\varepsilon \cdot x\right) \cdot \left(x \cdot \left(\left(x \cdot x\right) \cdot 5\right)\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification98.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6.8 \cdot 10^{-52}:\\ \;\;\;\;\left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right) \cdot \left(\varepsilon \cdot 5\right)\\ \mathbf{elif}\;x \leq 8 \cdot 10^{-62}:\\ \;\;\;\;\left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right) \cdot \left(\left(x \cdot x\right) \cdot 10 + \varepsilon \cdot \left(\varepsilon - x \cdot -5\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot \varepsilon\right) \cdot \left(x \cdot \left(5 \cdot \left(x \cdot x\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 97.7% accurate, 9.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -2.15 \cdot 10^{-52}:\\ \;\;\;\;\left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right) \cdot \left(\varepsilon \cdot 5\right)\\ \mathbf{elif}\;x \leq 8 \cdot 10^{-62}:\\ \;\;\;\;\left(\varepsilon - x \cdot -5\right) \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot \varepsilon\right) \cdot \left(x \cdot \left(5 \cdot \left(x \cdot x\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (x eps)
 :precision binary64
 (if (<= x -2.15e-52)
   (* (* x (* x (* x x))) (* eps 5.0))
   (if (<= x 8e-62)
     (* (- eps (* x -5.0)) (* eps (* eps (* eps eps))))
     (* (* x eps) (* x (* 5.0 (* x x)))))))
double code(double x, double eps) {
	double tmp;
	if (x <= -2.15e-52) {
		tmp = (x * (x * (x * x))) * (eps * 5.0);
	} else if (x <= 8e-62) {
		tmp = (eps - (x * -5.0)) * (eps * (eps * (eps * eps)));
	} else {
		tmp = (x * eps) * (x * (5.0 * (x * x)));
	}
	return tmp;
}
real(8) function code(x, eps)
    real(8), intent (in) :: x
    real(8), intent (in) :: eps
    real(8) :: tmp
    if (x <= (-2.15d-52)) then
        tmp = (x * (x * (x * x))) * (eps * 5.0d0)
    else if (x <= 8d-62) then
        tmp = (eps - (x * (-5.0d0))) * (eps * (eps * (eps * eps)))
    else
        tmp = (x * eps) * (x * (5.0d0 * (x * x)))
    end if
    code = tmp
end function
public static double code(double x, double eps) {
	double tmp;
	if (x <= -2.15e-52) {
		tmp = (x * (x * (x * x))) * (eps * 5.0);
	} else if (x <= 8e-62) {
		tmp = (eps - (x * -5.0)) * (eps * (eps * (eps * eps)));
	} else {
		tmp = (x * eps) * (x * (5.0 * (x * x)));
	}
	return tmp;
}
def code(x, eps):
	tmp = 0
	if x <= -2.15e-52:
		tmp = (x * (x * (x * x))) * (eps * 5.0)
	elif x <= 8e-62:
		tmp = (eps - (x * -5.0)) * (eps * (eps * (eps * eps)))
	else:
		tmp = (x * eps) * (x * (5.0 * (x * x)))
	return tmp
function code(x, eps)
	tmp = 0.0
	if (x <= -2.15e-52)
		tmp = Float64(Float64(x * Float64(x * Float64(x * x))) * Float64(eps * 5.0));
	elseif (x <= 8e-62)
		tmp = Float64(Float64(eps - Float64(x * -5.0)) * Float64(eps * Float64(eps * Float64(eps * eps))));
	else
		tmp = Float64(Float64(x * eps) * Float64(x * Float64(5.0 * Float64(x * x))));
	end
	return tmp
end
function tmp_2 = code(x, eps)
	tmp = 0.0;
	if (x <= -2.15e-52)
		tmp = (x * (x * (x * x))) * (eps * 5.0);
	elseif (x <= 8e-62)
		tmp = (eps - (x * -5.0)) * (eps * (eps * (eps * eps)));
	else
		tmp = (x * eps) * (x * (5.0 * (x * x)));
	end
	tmp_2 = tmp;
end
code[x_, eps_] := If[LessEqual[x, -2.15e-52], N[(N[(x * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(eps * 5.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 8e-62], N[(N[(eps - N[(x * -5.0), $MachinePrecision]), $MachinePrecision] * N[(eps * N[(eps * N[(eps * eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * eps), $MachinePrecision] * N[(x * N[(5.0 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.15 \cdot 10^{-52}:\\
\;\;\;\;\left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right) \cdot \left(\varepsilon \cdot 5\right)\\

\mathbf{elif}\;x \leq 8 \cdot 10^{-62}:\\
\;\;\;\;\left(\varepsilon - x \cdot -5\right) \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\left(x \cdot \varepsilon\right) \cdot \left(x \cdot \left(5 \cdot \left(x \cdot x\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2.1500000000000002e-52

    1. Initial program 39.0%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(5, \color{blue}{\left({x}^{4}\right)}\right)\right) \]
      10. pow-lowering-pow.f6490.4%

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(5, \mathsf{pow.f64}\left(x, \color{blue}{4}\right)\right)\right) \]
    5. Simplified90.4%

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left({x}^{\left(2 \cdot 2\right)}\right), \left(\varepsilon \cdot 5\right)\right) \]
      5. pow-sqrN/A

        \[\leadsto \mathsf{*.f64}\left(\left({x}^{2} \cdot {x}^{2}\right), \left(\color{blue}{\varepsilon} \cdot 5\right)\right) \]
      6. pow2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(x \cdot x\right) \cdot {x}^{2}\right), \left(\varepsilon \cdot 5\right)\right) \]
      7. pow2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right), \left(\varepsilon \cdot 5\right)\right) \]
      8. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right), \left(\color{blue}{\varepsilon} \cdot 5\right)\right) \]
      9. cube-unmultN/A

        \[\leadsto \mathsf{*.f64}\left(\left(x \cdot {x}^{3}\right), \left(\varepsilon \cdot 5\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \left({x}^{3}\right)\right), \left(\color{blue}{\varepsilon} \cdot 5\right)\right) \]
      11. cube-unmultN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \left(x \cdot \left(x \cdot x\right)\right)\right), \left(\varepsilon \cdot 5\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \left(x \cdot x\right)\right)\right), \left(\varepsilon \cdot 5\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(\varepsilon \cdot 5\right)\right) \]
      14. *-lowering-*.f6490.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{*.f64}\left(\varepsilon, \color{blue}{5}\right)\right) \]
    7. Applied egg-rr90.7%

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

    if -2.1500000000000002e-52 < x < 8.0000000000000003e-62

    1. Initial program 100.0%

      \[{\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. *-lowering-*.f64N/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \left(1 + 5 \cdot \frac{\color{blue}{x}}{\varepsilon}\right)\right) \]
      5. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \left(1 + \frac{5 \cdot x}{\color{blue}{\varepsilon}}\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \left(1 + \frac{\left(4 + 1\right) \cdot x}{\varepsilon}\right)\right) \]
      7. distribute-rgt1-inN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \left(1 + \frac{x + 4 \cdot x}{\varepsilon}\right)\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{x + 4 \cdot x}{\varepsilon}\right)}\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(x + 4 \cdot x\right), \color{blue}{\varepsilon}\right)\right)\right) \]
      10. distribute-rgt1-inN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\left(4 + 1\right) \cdot x\right), \varepsilon\right)\right)\right) \]
      11. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(5 \cdot x\right), \varepsilon\right)\right)\right) \]
      12. *-lowering-*.f6499.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(5, x\right), \varepsilon\right)\right)\right) \]
    5. Simplified99.8%

      \[\leadsto \color{blue}{{\varepsilon}^{5} \cdot \left(1 + \frac{5 \cdot x}{\varepsilon}\right)} \]
    6. Taylor expanded in eps around 0

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

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

        \[\leadsto \mathsf{*.f64}\left(\left({\varepsilon}^{\left(3 + 1\right)}\right), \left(\varepsilon + 5 \cdot x\right)\right) \]
      3. pow-plusN/A

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

        \[\leadsto \mathsf{*.f64}\left(\left(\varepsilon \cdot {\varepsilon}^{3}\right), \left(\color{blue}{\varepsilon} + 5 \cdot x\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\varepsilon, \left({\varepsilon}^{3}\right)\right), \left(\color{blue}{\varepsilon} + 5 \cdot x\right)\right) \]
      6. cube-multN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\varepsilon, \left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right)\right), \left(\varepsilon + 5 \cdot x\right)\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\varepsilon, \left(\varepsilon \cdot {\varepsilon}^{2}\right)\right), \left(\varepsilon + 5 \cdot x\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \left({\varepsilon}^{2}\right)\right)\right), \left(\varepsilon + 5 \cdot x\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \left(\varepsilon \cdot \varepsilon\right)\right)\right), \left(\varepsilon + 5 \cdot x\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \varepsilon\right)\right)\right), \left(\varepsilon + 5 \cdot x\right)\right) \]
      11. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \varepsilon\right)\right)\right), \left(\varepsilon + \left(\mathsf{neg}\left(-5\right)\right) \cdot x\right)\right) \]
      12. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \varepsilon\right)\right)\right), \left(\varepsilon + \left(\mathsf{neg}\left(-5 \cdot x\right)\right)\right)\right) \]
      13. unsub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \varepsilon\right)\right)\right), \left(\varepsilon - \color{blue}{-5 \cdot x}\right)\right) \]
      14. --lowering--.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \varepsilon\right)\right)\right), \mathsf{\_.f64}\left(\varepsilon, \left(x \cdot \color{blue}{-5}\right)\right)\right) \]
      16. *-lowering-*.f6499.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \varepsilon\right)\right)\right), \mathsf{\_.f64}\left(\varepsilon, \mathsf{*.f64}\left(x, \color{blue}{-5}\right)\right)\right) \]
    8. Simplified99.7%

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

    if 8.0000000000000003e-62 < x

    1. Initial program 38.8%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(5, \color{blue}{\left({x}^{4}\right)}\right)\right) \]
      10. pow-lowering-pow.f6496.6%

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(5, \mathsf{pow.f64}\left(x, \color{blue}{4}\right)\right)\right) \]
    5. Simplified96.6%

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left({x}^{\left(2 \cdot 2\right)}\right), \left(\varepsilon \cdot 5\right)\right) \]
      5. pow-sqrN/A

        \[\leadsto \mathsf{*.f64}\left(\left({x}^{2} \cdot {x}^{2}\right), \left(\color{blue}{\varepsilon} \cdot 5\right)\right) \]
      6. pow2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(x \cdot x\right) \cdot {x}^{2}\right), \left(\varepsilon \cdot 5\right)\right) \]
      7. pow2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right), \left(\varepsilon \cdot 5\right)\right) \]
      8. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right), \left(\color{blue}{\varepsilon} \cdot 5\right)\right) \]
      9. cube-unmultN/A

        \[\leadsto \mathsf{*.f64}\left(\left(x \cdot {x}^{3}\right), \left(\varepsilon \cdot 5\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \left({x}^{3}\right)\right), \left(\color{blue}{\varepsilon} \cdot 5\right)\right) \]
      11. cube-unmultN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \left(x \cdot \left(x \cdot x\right)\right)\right), \left(\varepsilon \cdot 5\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \left(x \cdot x\right)\right)\right), \left(\varepsilon \cdot 5\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(\varepsilon \cdot 5\right)\right) \]
      14. *-lowering-*.f6496.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{*.f64}\left(\varepsilon, \color{blue}{5}\right)\right) \]
    7. Applied egg-rr96.7%

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

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

        \[\leadsto \left(\left(\varepsilon \cdot 5\right) \cdot x\right) \cdot \color{blue}{\left(x \cdot \left(x \cdot x\right)\right)} \]
      3. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\varepsilon \cdot 5\right), x\right), \left(\color{blue}{x} \cdot \left(x \cdot x\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\varepsilon, 5\right), x\right), \left(x \cdot \left(x \cdot x\right)\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\varepsilon, 5\right), x\right), \mathsf{*.f64}\left(x, \color{blue}{\left(x \cdot x\right)}\right)\right) \]
      7. *-lowering-*.f6496.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\varepsilon, 5\right), x\right), \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \color{blue}{x}\right)\right)\right) \]
    9. Applied egg-rr96.7%

      \[\leadsto \color{blue}{\left(\left(\varepsilon \cdot 5\right) \cdot x\right) \cdot \left(x \cdot \left(x \cdot x\right)\right)} \]
    10. Step-by-step derivation
      1. associate-*l*N/A

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

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

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

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

        \[\leadsto \left(\varepsilon \cdot x\right) \cdot \color{blue}{\left(\left(x \cdot \left(x \cdot x\right)\right) \cdot 5\right)} \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\varepsilon \cdot x\right), \color{blue}{\left(\left(x \cdot \left(x \cdot x\right)\right) \cdot 5\right)}\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\varepsilon, x\right), \left(\color{blue}{\left(x \cdot \left(x \cdot x\right)\right)} \cdot 5\right)\right) \]
      8. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\varepsilon, x\right), \left(x \cdot \color{blue}{\left(\left(x \cdot x\right) \cdot 5\right)}\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\varepsilon, x\right), \mathsf{*.f64}\left(x, \color{blue}{\left(\left(x \cdot x\right) \cdot 5\right)}\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\varepsilon, x\right), \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\left(x \cdot x\right), \color{blue}{5}\right)\right)\right) \]
      11. *-lowering-*.f6497.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\varepsilon, x\right), \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), 5\right)\right)\right) \]
    11. Applied egg-rr97.0%

      \[\leadsto \color{blue}{\left(\varepsilon \cdot x\right) \cdot \left(x \cdot \left(\left(x \cdot x\right) \cdot 5\right)\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification98.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.15 \cdot 10^{-52}:\\ \;\;\;\;\left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right) \cdot \left(\varepsilon \cdot 5\right)\\ \mathbf{elif}\;x \leq 8 \cdot 10^{-62}:\\ \;\;\;\;\left(\varepsilon - x \cdot -5\right) \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot \varepsilon\right) \cdot \left(x \cdot \left(5 \cdot \left(x \cdot x\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 97.7% accurate, 9.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -3.9 \cdot 10^{-52}:\\ \;\;\;\;\left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right) \cdot \left(\varepsilon \cdot 5\right)\\ \mathbf{elif}\;x \leq 8 \cdot 10^{-62}:\\ \;\;\;\;\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot \varepsilon\right) \cdot \left(x \cdot \left(5 \cdot \left(x \cdot x\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (x eps)
 :precision binary64
 (if (<= x -3.9e-52)
   (* (* x (* x (* x x))) (* eps 5.0))
   (if (<= x 8e-62)
     (* eps (* eps (* eps (* eps eps))))
     (* (* x eps) (* x (* 5.0 (* x x)))))))
double code(double x, double eps) {
	double tmp;
	if (x <= -3.9e-52) {
		tmp = (x * (x * (x * x))) * (eps * 5.0);
	} else if (x <= 8e-62) {
		tmp = eps * (eps * (eps * (eps * eps)));
	} else {
		tmp = (x * eps) * (x * (5.0 * (x * x)));
	}
	return tmp;
}
real(8) function code(x, eps)
    real(8), intent (in) :: x
    real(8), intent (in) :: eps
    real(8) :: tmp
    if (x <= (-3.9d-52)) then
        tmp = (x * (x * (x * x))) * (eps * 5.0d0)
    else if (x <= 8d-62) then
        tmp = eps * (eps * (eps * (eps * eps)))
    else
        tmp = (x * eps) * (x * (5.0d0 * (x * x)))
    end if
    code = tmp
end function
public static double code(double x, double eps) {
	double tmp;
	if (x <= -3.9e-52) {
		tmp = (x * (x * (x * x))) * (eps * 5.0);
	} else if (x <= 8e-62) {
		tmp = eps * (eps * (eps * (eps * eps)));
	} else {
		tmp = (x * eps) * (x * (5.0 * (x * x)));
	}
	return tmp;
}
def code(x, eps):
	tmp = 0
	if x <= -3.9e-52:
		tmp = (x * (x * (x * x))) * (eps * 5.0)
	elif x <= 8e-62:
		tmp = eps * (eps * (eps * (eps * eps)))
	else:
		tmp = (x * eps) * (x * (5.0 * (x * x)))
	return tmp
function code(x, eps)
	tmp = 0.0
	if (x <= -3.9e-52)
		tmp = Float64(Float64(x * Float64(x * Float64(x * x))) * Float64(eps * 5.0));
	elseif (x <= 8e-62)
		tmp = Float64(eps * Float64(eps * Float64(eps * Float64(eps * eps))));
	else
		tmp = Float64(Float64(x * eps) * Float64(x * Float64(5.0 * Float64(x * x))));
	end
	return tmp
end
function tmp_2 = code(x, eps)
	tmp = 0.0;
	if (x <= -3.9e-52)
		tmp = (x * (x * (x * x))) * (eps * 5.0);
	elseif (x <= 8e-62)
		tmp = eps * (eps * (eps * (eps * eps)));
	else
		tmp = (x * eps) * (x * (5.0 * (x * x)));
	end
	tmp_2 = tmp;
end
code[x_, eps_] := If[LessEqual[x, -3.9e-52], N[(N[(x * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(eps * 5.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 8e-62], N[(eps * N[(eps * N[(eps * N[(eps * eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * eps), $MachinePrecision] * N[(x * N[(5.0 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.9 \cdot 10^{-52}:\\
\;\;\;\;\left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right) \cdot \left(\varepsilon \cdot 5\right)\\

\mathbf{elif}\;x \leq 8 \cdot 10^{-62}:\\
\;\;\;\;\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\left(x \cdot \varepsilon\right) \cdot \left(x \cdot \left(5 \cdot \left(x \cdot x\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -3.90000000000000018e-52

    1. Initial program 39.0%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(5, \color{blue}{\left({x}^{4}\right)}\right)\right) \]
      10. pow-lowering-pow.f6490.4%

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(5, \mathsf{pow.f64}\left(x, \color{blue}{4}\right)\right)\right) \]
    5. Simplified90.4%

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left({x}^{\left(2 \cdot 2\right)}\right), \left(\varepsilon \cdot 5\right)\right) \]
      5. pow-sqrN/A

        \[\leadsto \mathsf{*.f64}\left(\left({x}^{2} \cdot {x}^{2}\right), \left(\color{blue}{\varepsilon} \cdot 5\right)\right) \]
      6. pow2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(x \cdot x\right) \cdot {x}^{2}\right), \left(\varepsilon \cdot 5\right)\right) \]
      7. pow2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right), \left(\varepsilon \cdot 5\right)\right) \]
      8. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right), \left(\color{blue}{\varepsilon} \cdot 5\right)\right) \]
      9. cube-unmultN/A

        \[\leadsto \mathsf{*.f64}\left(\left(x \cdot {x}^{3}\right), \left(\varepsilon \cdot 5\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \left({x}^{3}\right)\right), \left(\color{blue}{\varepsilon} \cdot 5\right)\right) \]
      11. cube-unmultN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \left(x \cdot \left(x \cdot x\right)\right)\right), \left(\varepsilon \cdot 5\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \left(x \cdot x\right)\right)\right), \left(\varepsilon \cdot 5\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(\varepsilon \cdot 5\right)\right) \]
      14. *-lowering-*.f6490.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{*.f64}\left(\varepsilon, \color{blue}{5}\right)\right) \]
    7. Applied egg-rr90.7%

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

    if -3.90000000000000018e-52 < x < 8.0000000000000003e-62

    1. Initial program 100.0%

      \[{\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. *-lowering-*.f64N/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \left(1 + 5 \cdot \frac{\color{blue}{x}}{\varepsilon}\right)\right) \]
      5. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \left(1 + \frac{5 \cdot x}{\color{blue}{\varepsilon}}\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \left(1 + \frac{\left(4 + 1\right) \cdot x}{\varepsilon}\right)\right) \]
      7. distribute-rgt1-inN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \left(1 + \frac{x + 4 \cdot x}{\varepsilon}\right)\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{x + 4 \cdot x}{\varepsilon}\right)}\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(x + 4 \cdot x\right), \color{blue}{\varepsilon}\right)\right)\right) \]
      10. distribute-rgt1-inN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\left(4 + 1\right) \cdot x\right), \varepsilon\right)\right)\right) \]
      11. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(5 \cdot x\right), \varepsilon\right)\right)\right) \]
      12. *-lowering-*.f6499.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(5, x\right), \varepsilon\right)\right)\right) \]
    5. Simplified99.8%

      \[\leadsto \color{blue}{{\varepsilon}^{5} \cdot \left(1 + \frac{5 \cdot x}{\varepsilon}\right)} \]
    6. Taylor expanded in eps around inf

      \[\leadsto \color{blue}{{\varepsilon}^{5}} \]
    7. Step-by-step derivation
      1. metadata-evalN/A

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

        \[\leadsto {\varepsilon}^{4} \cdot \color{blue}{\varepsilon} \]
      3. *-commutativeN/A

        \[\leadsto \varepsilon \cdot \color{blue}{{\varepsilon}^{4}} \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \color{blue}{\left({\varepsilon}^{4}\right)}\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \left({\varepsilon}^{\left(3 + \color{blue}{1}\right)}\right)\right) \]
      6. pow-plusN/A

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \left({\varepsilon}^{3} \cdot \color{blue}{\varepsilon}\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \left(\varepsilon \cdot \color{blue}{{\varepsilon}^{3}}\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \color{blue}{\left({\varepsilon}^{3}\right)}\right)\right) \]
      9. cube-multN/A

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \left(\varepsilon \cdot \color{blue}{\left(\varepsilon \cdot \varepsilon\right)}\right)\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \left(\varepsilon \cdot {\varepsilon}^{\color{blue}{2}}\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \color{blue}{\left({\varepsilon}^{2}\right)}\right)\right)\right) \]
      12. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \left(\varepsilon \cdot \color{blue}{\varepsilon}\right)\right)\right)\right) \]
      13. *-lowering-*.f6499.6%

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \color{blue}{\varepsilon}\right)\right)\right)\right) \]
    8. Simplified99.6%

      \[\leadsto \color{blue}{\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right)\right)} \]

    if 8.0000000000000003e-62 < x

    1. Initial program 38.8%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(5, \color{blue}{\left({x}^{4}\right)}\right)\right) \]
      10. pow-lowering-pow.f6496.6%

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(5, \mathsf{pow.f64}\left(x, \color{blue}{4}\right)\right)\right) \]
    5. Simplified96.6%

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left({x}^{\left(2 \cdot 2\right)}\right), \left(\varepsilon \cdot 5\right)\right) \]
      5. pow-sqrN/A

        \[\leadsto \mathsf{*.f64}\left(\left({x}^{2} \cdot {x}^{2}\right), \left(\color{blue}{\varepsilon} \cdot 5\right)\right) \]
      6. pow2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(x \cdot x\right) \cdot {x}^{2}\right), \left(\varepsilon \cdot 5\right)\right) \]
      7. pow2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right), \left(\varepsilon \cdot 5\right)\right) \]
      8. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right), \left(\color{blue}{\varepsilon} \cdot 5\right)\right) \]
      9. cube-unmultN/A

        \[\leadsto \mathsf{*.f64}\left(\left(x \cdot {x}^{3}\right), \left(\varepsilon \cdot 5\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \left({x}^{3}\right)\right), \left(\color{blue}{\varepsilon} \cdot 5\right)\right) \]
      11. cube-unmultN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \left(x \cdot \left(x \cdot x\right)\right)\right), \left(\varepsilon \cdot 5\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \left(x \cdot x\right)\right)\right), \left(\varepsilon \cdot 5\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(\varepsilon \cdot 5\right)\right) \]
      14. *-lowering-*.f6496.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{*.f64}\left(\varepsilon, \color{blue}{5}\right)\right) \]
    7. Applied egg-rr96.7%

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

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

        \[\leadsto \left(\left(\varepsilon \cdot 5\right) \cdot x\right) \cdot \color{blue}{\left(x \cdot \left(x \cdot x\right)\right)} \]
      3. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\varepsilon \cdot 5\right), x\right), \left(\color{blue}{x} \cdot \left(x \cdot x\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\varepsilon, 5\right), x\right), \left(x \cdot \left(x \cdot x\right)\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\varepsilon, 5\right), x\right), \mathsf{*.f64}\left(x, \color{blue}{\left(x \cdot x\right)}\right)\right) \]
      7. *-lowering-*.f6496.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\varepsilon, 5\right), x\right), \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \color{blue}{x}\right)\right)\right) \]
    9. Applied egg-rr96.7%

      \[\leadsto \color{blue}{\left(\left(\varepsilon \cdot 5\right) \cdot x\right) \cdot \left(x \cdot \left(x \cdot x\right)\right)} \]
    10. Step-by-step derivation
      1. associate-*l*N/A

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

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

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

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

        \[\leadsto \left(\varepsilon \cdot x\right) \cdot \color{blue}{\left(\left(x \cdot \left(x \cdot x\right)\right) \cdot 5\right)} \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\varepsilon \cdot x\right), \color{blue}{\left(\left(x \cdot \left(x \cdot x\right)\right) \cdot 5\right)}\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\varepsilon, x\right), \left(\color{blue}{\left(x \cdot \left(x \cdot x\right)\right)} \cdot 5\right)\right) \]
      8. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\varepsilon, x\right), \left(x \cdot \color{blue}{\left(\left(x \cdot x\right) \cdot 5\right)}\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\varepsilon, x\right), \mathsf{*.f64}\left(x, \color{blue}{\left(\left(x \cdot x\right) \cdot 5\right)}\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\varepsilon, x\right), \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\left(x \cdot x\right), \color{blue}{5}\right)\right)\right) \]
      11. *-lowering-*.f6497.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\varepsilon, x\right), \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), 5\right)\right)\right) \]
    11. Applied egg-rr97.0%

      \[\leadsto \color{blue}{\left(\varepsilon \cdot x\right) \cdot \left(x \cdot \left(\left(x \cdot x\right) \cdot 5\right)\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification98.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.9 \cdot 10^{-52}:\\ \;\;\;\;\left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right) \cdot \left(\varepsilon \cdot 5\right)\\ \mathbf{elif}\;x \leq 8 \cdot 10^{-62}:\\ \;\;\;\;\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot \varepsilon\right) \cdot \left(x \cdot \left(5 \cdot \left(x \cdot x\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 97.7% accurate, 9.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(x \cdot \varepsilon\right) \cdot \left(x \cdot \left(5 \cdot \left(x \cdot x\right)\right)\right)\\ \mathbf{if}\;x \leq -1.24 \cdot 10^{-51}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 7.8 \cdot 10^{-62}:\\ \;\;\;\;\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x eps)
 :precision binary64
 (let* ((t_0 (* (* x eps) (* x (* 5.0 (* x x))))))
   (if (<= x -1.24e-51)
     t_0
     (if (<= x 7.8e-62) (* eps (* eps (* eps (* eps eps)))) t_0))))
double code(double x, double eps) {
	double t_0 = (x * eps) * (x * (5.0 * (x * x)));
	double tmp;
	if (x <= -1.24e-51) {
		tmp = t_0;
	} else if (x <= 7.8e-62) {
		tmp = eps * (eps * (eps * (eps * eps)));
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(x, eps)
    real(8), intent (in) :: x
    real(8), intent (in) :: eps
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (x * eps) * (x * (5.0d0 * (x * x)))
    if (x <= (-1.24d-51)) then
        tmp = t_0
    else if (x <= 7.8d-62) then
        tmp = eps * (eps * (eps * (eps * eps)))
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double eps) {
	double t_0 = (x * eps) * (x * (5.0 * (x * x)));
	double tmp;
	if (x <= -1.24e-51) {
		tmp = t_0;
	} else if (x <= 7.8e-62) {
		tmp = eps * (eps * (eps * (eps * eps)));
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, eps):
	t_0 = (x * eps) * (x * (5.0 * (x * x)))
	tmp = 0
	if x <= -1.24e-51:
		tmp = t_0
	elif x <= 7.8e-62:
		tmp = eps * (eps * (eps * (eps * eps)))
	else:
		tmp = t_0
	return tmp
function code(x, eps)
	t_0 = Float64(Float64(x * eps) * Float64(x * Float64(5.0 * Float64(x * x))))
	tmp = 0.0
	if (x <= -1.24e-51)
		tmp = t_0;
	elseif (x <= 7.8e-62)
		tmp = Float64(eps * Float64(eps * Float64(eps * Float64(eps * eps))));
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, eps)
	t_0 = (x * eps) * (x * (5.0 * (x * x)));
	tmp = 0.0;
	if (x <= -1.24e-51)
		tmp = t_0;
	elseif (x <= 7.8e-62)
		tmp = eps * (eps * (eps * (eps * eps)));
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, eps_] := Block[{t$95$0 = N[(N[(x * eps), $MachinePrecision] * N[(x * N[(5.0 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.24e-51], t$95$0, If[LessEqual[x, 7.8e-62], N[(eps * N[(eps * N[(eps * N[(eps * eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq 7.8 \cdot 10^{-62}:\\
\;\;\;\;\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.24e-51 or 7.8000000000000007e-62 < x

    1. Initial program 38.9%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(5, \color{blue}{\left({x}^{4}\right)}\right)\right) \]
      10. pow-lowering-pow.f6494.2%

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(5, \mathsf{pow.f64}\left(x, \color{blue}{4}\right)\right)\right) \]
    5. Simplified94.2%

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left({x}^{\left(2 \cdot 2\right)}\right), \left(\varepsilon \cdot 5\right)\right) \]
      5. pow-sqrN/A

        \[\leadsto \mathsf{*.f64}\left(\left({x}^{2} \cdot {x}^{2}\right), \left(\color{blue}{\varepsilon} \cdot 5\right)\right) \]
      6. pow2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(x \cdot x\right) \cdot {x}^{2}\right), \left(\varepsilon \cdot 5\right)\right) \]
      7. pow2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right), \left(\varepsilon \cdot 5\right)\right) \]
      8. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right), \left(\color{blue}{\varepsilon} \cdot 5\right)\right) \]
      9. cube-unmultN/A

        \[\leadsto \mathsf{*.f64}\left(\left(x \cdot {x}^{3}\right), \left(\varepsilon \cdot 5\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \left({x}^{3}\right)\right), \left(\color{blue}{\varepsilon} \cdot 5\right)\right) \]
      11. cube-unmultN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \left(x \cdot \left(x \cdot x\right)\right)\right), \left(\varepsilon \cdot 5\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \left(x \cdot x\right)\right)\right), \left(\varepsilon \cdot 5\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(\varepsilon \cdot 5\right)\right) \]
      14. *-lowering-*.f6494.4%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{*.f64}\left(\varepsilon, \color{blue}{5}\right)\right) \]
    7. Applied egg-rr94.4%

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

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

        \[\leadsto \left(\left(\varepsilon \cdot 5\right) \cdot x\right) \cdot \color{blue}{\left(x \cdot \left(x \cdot x\right)\right)} \]
      3. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\varepsilon \cdot 5\right), x\right), \left(\color{blue}{x} \cdot \left(x \cdot x\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\varepsilon, 5\right), x\right), \left(x \cdot \left(x \cdot x\right)\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\varepsilon, 5\right), x\right), \mathsf{*.f64}\left(x, \color{blue}{\left(x \cdot x\right)}\right)\right) \]
      7. *-lowering-*.f6494.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\varepsilon, 5\right), x\right), \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \color{blue}{x}\right)\right)\right) \]
    9. Applied egg-rr94.3%

      \[\leadsto \color{blue}{\left(\left(\varepsilon \cdot 5\right) \cdot x\right) \cdot \left(x \cdot \left(x \cdot x\right)\right)} \]
    10. Step-by-step derivation
      1. associate-*l*N/A

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

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

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

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

        \[\leadsto \left(\varepsilon \cdot x\right) \cdot \color{blue}{\left(\left(x \cdot \left(x \cdot x\right)\right) \cdot 5\right)} \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\varepsilon \cdot x\right), \color{blue}{\left(\left(x \cdot \left(x \cdot x\right)\right) \cdot 5\right)}\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\varepsilon, x\right), \left(\color{blue}{\left(x \cdot \left(x \cdot x\right)\right)} \cdot 5\right)\right) \]
      8. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\varepsilon, x\right), \left(x \cdot \color{blue}{\left(\left(x \cdot x\right) \cdot 5\right)}\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\varepsilon, x\right), \mathsf{*.f64}\left(x, \color{blue}{\left(\left(x \cdot x\right) \cdot 5\right)}\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\varepsilon, x\right), \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\left(x \cdot x\right), \color{blue}{5}\right)\right)\right) \]
      11. *-lowering-*.f6494.4%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\varepsilon, x\right), \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), 5\right)\right)\right) \]
    11. Applied egg-rr94.4%

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

    if -1.24e-51 < x < 7.8000000000000007e-62

    1. Initial program 100.0%

      \[{\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. *-lowering-*.f64N/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \left(1 + 5 \cdot \frac{\color{blue}{x}}{\varepsilon}\right)\right) \]
      5. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \left(1 + \frac{5 \cdot x}{\color{blue}{\varepsilon}}\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \left(1 + \frac{\left(4 + 1\right) \cdot x}{\varepsilon}\right)\right) \]
      7. distribute-rgt1-inN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \left(1 + \frac{x + 4 \cdot x}{\varepsilon}\right)\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{x + 4 \cdot x}{\varepsilon}\right)}\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(x + 4 \cdot x\right), \color{blue}{\varepsilon}\right)\right)\right) \]
      10. distribute-rgt1-inN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\left(4 + 1\right) \cdot x\right), \varepsilon\right)\right)\right) \]
      11. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(5 \cdot x\right), \varepsilon\right)\right)\right) \]
      12. *-lowering-*.f6499.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(5, x\right), \varepsilon\right)\right)\right) \]
    5. Simplified99.8%

      \[\leadsto \color{blue}{{\varepsilon}^{5} \cdot \left(1 + \frac{5 \cdot x}{\varepsilon}\right)} \]
    6. Taylor expanded in eps around inf

      \[\leadsto \color{blue}{{\varepsilon}^{5}} \]
    7. Step-by-step derivation
      1. metadata-evalN/A

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

        \[\leadsto {\varepsilon}^{4} \cdot \color{blue}{\varepsilon} \]
      3. *-commutativeN/A

        \[\leadsto \varepsilon \cdot \color{blue}{{\varepsilon}^{4}} \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \color{blue}{\left({\varepsilon}^{4}\right)}\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \left({\varepsilon}^{\left(3 + \color{blue}{1}\right)}\right)\right) \]
      6. pow-plusN/A

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \left({\varepsilon}^{3} \cdot \color{blue}{\varepsilon}\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \left(\varepsilon \cdot \color{blue}{{\varepsilon}^{3}}\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \color{blue}{\left({\varepsilon}^{3}\right)}\right)\right) \]
      9. cube-multN/A

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \left(\varepsilon \cdot \color{blue}{\left(\varepsilon \cdot \varepsilon\right)}\right)\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \left(\varepsilon \cdot {\varepsilon}^{\color{blue}{2}}\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \color{blue}{\left({\varepsilon}^{2}\right)}\right)\right)\right) \]
      12. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \left(\varepsilon \cdot \color{blue}{\varepsilon}\right)\right)\right)\right) \]
      13. *-lowering-*.f6499.6%

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \color{blue}{\varepsilon}\right)\right)\right)\right) \]
    8. Simplified99.6%

      \[\leadsto \color{blue}{\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification98.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.24 \cdot 10^{-51}:\\ \;\;\;\;\left(x \cdot \varepsilon\right) \cdot \left(x \cdot \left(5 \cdot \left(x \cdot x\right)\right)\right)\\ \mathbf{elif}\;x \leq 7.8 \cdot 10^{-62}:\\ \;\;\;\;\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot \varepsilon\right) \cdot \left(x \cdot \left(5 \cdot \left(x \cdot x\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 97.7% accurate, 9.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \varepsilon \cdot \left(5 \cdot \left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right)\right)\\ \mathbf{if}\;x \leq -1.32 \cdot 10^{-52}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 3.3 \cdot 10^{-62}:\\ \;\;\;\;\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x eps)
 :precision binary64
 (let* ((t_0 (* eps (* 5.0 (* x (* x (* x x)))))))
   (if (<= x -1.32e-52)
     t_0
     (if (<= x 3.3e-62) (* eps (* eps (* eps (* eps eps)))) t_0))))
double code(double x, double eps) {
	double t_0 = eps * (5.0 * (x * (x * (x * x))));
	double tmp;
	if (x <= -1.32e-52) {
		tmp = t_0;
	} else if (x <= 3.3e-62) {
		tmp = eps * (eps * (eps * (eps * eps)));
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(x, eps)
    real(8), intent (in) :: x
    real(8), intent (in) :: eps
    real(8) :: t_0
    real(8) :: tmp
    t_0 = eps * (5.0d0 * (x * (x * (x * x))))
    if (x <= (-1.32d-52)) then
        tmp = t_0
    else if (x <= 3.3d-62) then
        tmp = eps * (eps * (eps * (eps * eps)))
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double eps) {
	double t_0 = eps * (5.0 * (x * (x * (x * x))));
	double tmp;
	if (x <= -1.32e-52) {
		tmp = t_0;
	} else if (x <= 3.3e-62) {
		tmp = eps * (eps * (eps * (eps * eps)));
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, eps):
	t_0 = eps * (5.0 * (x * (x * (x * x))))
	tmp = 0
	if x <= -1.32e-52:
		tmp = t_0
	elif x <= 3.3e-62:
		tmp = eps * (eps * (eps * (eps * eps)))
	else:
		tmp = t_0
	return tmp
function code(x, eps)
	t_0 = Float64(eps * Float64(5.0 * Float64(x * Float64(x * Float64(x * x)))))
	tmp = 0.0
	if (x <= -1.32e-52)
		tmp = t_0;
	elseif (x <= 3.3e-62)
		tmp = Float64(eps * Float64(eps * Float64(eps * Float64(eps * eps))));
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, eps)
	t_0 = eps * (5.0 * (x * (x * (x * x))));
	tmp = 0.0;
	if (x <= -1.32e-52)
		tmp = t_0;
	elseif (x <= 3.3e-62)
		tmp = eps * (eps * (eps * (eps * eps)));
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, eps_] := Block[{t$95$0 = N[(eps * N[(5.0 * N[(x * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.32e-52], t$95$0, If[LessEqual[x, 3.3e-62], N[(eps * N[(eps * N[(eps * N[(eps * eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq 3.3 \cdot 10^{-62}:\\
\;\;\;\;\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.32000000000000002e-52 or 3.30000000000000004e-62 < x

    1. Initial program 38.9%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(5, \color{blue}{\left({x}^{4}\right)}\right)\right) \]
      10. pow-lowering-pow.f6494.2%

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(5, \mathsf{pow.f64}\left(x, \color{blue}{4}\right)\right)\right) \]
    5. Simplified94.2%

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(5, \left({x}^{4}\right)\right), \varepsilon\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(5, \left({x}^{\left(2 \cdot 2\right)}\right)\right), \varepsilon\right) \]
      5. pow-sqrN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(5, \left({x}^{2} \cdot {x}^{2}\right)\right), \varepsilon\right) \]
      6. pow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(5, \left(\left(x \cdot x\right) \cdot {x}^{2}\right)\right), \varepsilon\right) \]
      7. pow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(5, \left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right)\right), \varepsilon\right) \]
      8. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(5, \left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right)\right), \varepsilon\right) \]
      9. cube-unmultN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(5, \left(x \cdot {x}^{3}\right)\right), \varepsilon\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(5, \mathsf{*.f64}\left(x, \left({x}^{3}\right)\right)\right), \varepsilon\right) \]
      11. cube-unmultN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(5, \mathsf{*.f64}\left(x, \left(x \cdot \left(x \cdot x\right)\right)\right)\right), \varepsilon\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(5, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \left(x \cdot x\right)\right)\right)\right), \varepsilon\right) \]
      13. *-lowering-*.f6494.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(5, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right)\right), \varepsilon\right) \]
    7. Applied egg-rr94.3%

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

    if -1.32000000000000002e-52 < x < 3.30000000000000004e-62

    1. Initial program 100.0%

      \[{\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. *-lowering-*.f64N/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \left(1 + 5 \cdot \frac{\color{blue}{x}}{\varepsilon}\right)\right) \]
      5. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \left(1 + \frac{5 \cdot x}{\color{blue}{\varepsilon}}\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \left(1 + \frac{\left(4 + 1\right) \cdot x}{\varepsilon}\right)\right) \]
      7. distribute-rgt1-inN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \left(1 + \frac{x + 4 \cdot x}{\varepsilon}\right)\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{x + 4 \cdot x}{\varepsilon}\right)}\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(x + 4 \cdot x\right), \color{blue}{\varepsilon}\right)\right)\right) \]
      10. distribute-rgt1-inN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\left(4 + 1\right) \cdot x\right), \varepsilon\right)\right)\right) \]
      11. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(5 \cdot x\right), \varepsilon\right)\right)\right) \]
      12. *-lowering-*.f6499.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(5, x\right), \varepsilon\right)\right)\right) \]
    5. Simplified99.8%

      \[\leadsto \color{blue}{{\varepsilon}^{5} \cdot \left(1 + \frac{5 \cdot x}{\varepsilon}\right)} \]
    6. Taylor expanded in eps around inf

      \[\leadsto \color{blue}{{\varepsilon}^{5}} \]
    7. Step-by-step derivation
      1. metadata-evalN/A

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

        \[\leadsto {\varepsilon}^{4} \cdot \color{blue}{\varepsilon} \]
      3. *-commutativeN/A

        \[\leadsto \varepsilon \cdot \color{blue}{{\varepsilon}^{4}} \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \color{blue}{\left({\varepsilon}^{4}\right)}\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \left({\varepsilon}^{\left(3 + \color{blue}{1}\right)}\right)\right) \]
      6. pow-plusN/A

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \left({\varepsilon}^{3} \cdot \color{blue}{\varepsilon}\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \left(\varepsilon \cdot \color{blue}{{\varepsilon}^{3}}\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \color{blue}{\left({\varepsilon}^{3}\right)}\right)\right) \]
      9. cube-multN/A

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \left(\varepsilon \cdot \color{blue}{\left(\varepsilon \cdot \varepsilon\right)}\right)\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \left(\varepsilon \cdot {\varepsilon}^{\color{blue}{2}}\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \color{blue}{\left({\varepsilon}^{2}\right)}\right)\right)\right) \]
      12. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \left(\varepsilon \cdot \color{blue}{\varepsilon}\right)\right)\right)\right) \]
      13. *-lowering-*.f6499.6%

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \color{blue}{\varepsilon}\right)\right)\right)\right) \]
    8. Simplified99.6%

      \[\leadsto \color{blue}{\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification98.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.32 \cdot 10^{-52}:\\ \;\;\;\;\varepsilon \cdot \left(5 \cdot \left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right)\right)\\ \mathbf{elif}\;x \leq 3.3 \cdot 10^{-62}:\\ \;\;\;\;\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\varepsilon \cdot \left(5 \cdot \left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 87.5% accurate, 23.0× speedup?

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

\\
\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right)\right)
\end{array}
Derivation
  1. Initial program 87.8%

    \[{\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. *-lowering-*.f64N/A

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

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

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \left(1 + 5 \cdot \frac{\color{blue}{x}}{\varepsilon}\right)\right) \]
    5. associate-*r/N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \left(1 + \frac{5 \cdot x}{\color{blue}{\varepsilon}}\right)\right) \]
    6. metadata-evalN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \left(1 + \frac{\left(4 + 1\right) \cdot x}{\varepsilon}\right)\right) \]
    7. distribute-rgt1-inN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \left(1 + \frac{x + 4 \cdot x}{\varepsilon}\right)\right) \]
    8. +-lowering-+.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{x + 4 \cdot x}{\varepsilon}\right)}\right)\right) \]
    9. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(x + 4 \cdot x\right), \color{blue}{\varepsilon}\right)\right)\right) \]
    10. distribute-rgt1-inN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\left(4 + 1\right) \cdot x\right), \varepsilon\right)\right)\right) \]
    11. metadata-evalN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(5 \cdot x\right), \varepsilon\right)\right)\right) \]
    12. *-lowering-*.f6487.5%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\varepsilon, 5\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(5, x\right), \varepsilon\right)\right)\right) \]
  5. Simplified87.5%

    \[\leadsto \color{blue}{{\varepsilon}^{5} \cdot \left(1 + \frac{5 \cdot x}{\varepsilon}\right)} \]
  6. Taylor expanded in eps around inf

    \[\leadsto \color{blue}{{\varepsilon}^{5}} \]
  7. Step-by-step derivation
    1. metadata-evalN/A

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

      \[\leadsto {\varepsilon}^{4} \cdot \color{blue}{\varepsilon} \]
    3. *-commutativeN/A

      \[\leadsto \varepsilon \cdot \color{blue}{{\varepsilon}^{4}} \]
    4. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\varepsilon, \color{blue}{\left({\varepsilon}^{4}\right)}\right) \]
    5. metadata-evalN/A

      \[\leadsto \mathsf{*.f64}\left(\varepsilon, \left({\varepsilon}^{\left(3 + \color{blue}{1}\right)}\right)\right) \]
    6. pow-plusN/A

      \[\leadsto \mathsf{*.f64}\left(\varepsilon, \left({\varepsilon}^{3} \cdot \color{blue}{\varepsilon}\right)\right) \]
    7. *-commutativeN/A

      \[\leadsto \mathsf{*.f64}\left(\varepsilon, \left(\varepsilon \cdot \color{blue}{{\varepsilon}^{3}}\right)\right) \]
    8. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \color{blue}{\left({\varepsilon}^{3}\right)}\right)\right) \]
    9. cube-multN/A

      \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \left(\varepsilon \cdot \color{blue}{\left(\varepsilon \cdot \varepsilon\right)}\right)\right)\right) \]
    10. unpow2N/A

      \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \left(\varepsilon \cdot {\varepsilon}^{\color{blue}{2}}\right)\right)\right) \]
    11. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \color{blue}{\left({\varepsilon}^{2}\right)}\right)\right)\right) \]
    12. unpow2N/A

      \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \left(\varepsilon \cdot \color{blue}{\varepsilon}\right)\right)\right)\right) \]
    13. *-lowering-*.f6487.1%

      \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \color{blue}{\varepsilon}\right)\right)\right)\right) \]
  8. Simplified87.1%

    \[\leadsto \color{blue}{\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right)\right)} \]
  9. Add Preprocessing

Reproduce

?
herbie shell --seed 2024158 
(FPCore (x eps)
  :name "ENA, Section 1.4, Exercise 4b, n=5"
  :precision binary64
  :pre (and (and (<= -1000000000.0 x) (<= x 1000000000.0)) (and (<= -1.0 eps) (<= eps 1.0)))
  (- (pow (+ x eps) 5.0) (pow x 5.0)))