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

Percentage Accurate: 88.4% → 99.5%
Time: 11.2s
Alternatives: 15
Speedup: 1.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 15 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.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ {\left(x + \varepsilon\right)}^{5} - {x}^{5} \end{array} \]
(FPCore (x eps) :precision binary64 (- (pow (+ x eps) 5.0) (pow x 5.0)))
double code(double x, double eps) {
	return pow((x + eps), 5.0) - pow(x, 5.0);
}
real(8) function code(x, eps)
    real(8), intent (in) :: x
    real(8), intent (in) :: eps
    code = ((x + eps) ** 5.0d0) - (x ** 5.0d0)
end function
public static double code(double x, double eps) {
	return Math.pow((x + eps), 5.0) - Math.pow(x, 5.0);
}
def code(x, eps):
	return math.pow((x + eps), 5.0) - math.pow(x, 5.0)
function code(x, eps)
	return Float64((Float64(x + eps) ^ 5.0) - (x ^ 5.0))
end
function tmp = code(x, eps)
	tmp = ((x + eps) ^ 5.0) - (x ^ 5.0);
end
code[x_, eps_] := N[(N[Power[N[(x + eps), $MachinePrecision], 5.0], $MachinePrecision] - N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
{\left(x + \varepsilon\right)}^{5} - {x}^{5}
\end{array}

Alternative 1: 99.5% accurate, 0.3× speedup?

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

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

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

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


\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))) < -4.94066e-324

    1. Initial program 96.7%

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

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

    1. Initial program 84.6%

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

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

      \[\leadsto \color{blue}{\varepsilon \cdot \left(5 \cdot {x}^{4} + \varepsilon \cdot \left(\left(x \cdot \left(x \cdot x\right)\right) \cdot 10 + \varepsilon \cdot \left(\left(x \cdot x\right) \cdot 10 + \varepsilon \cdot \left(5 \cdot x\right)\right)\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.6%

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(1, \left(\frac{\varepsilon}{x}\right)\right)\right), 5\right), \mathsf{pow.f64}\left(x, 5\right)\right) \]
      3. /-lowering-/.f6499.6%

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

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

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

Alternative 2: 99.5% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(x + \varepsilon\right)}^{5} - {x}^{5}\\ \mathbf{if}\;t\_0 \leq -5 \cdot 10^{-324}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;t\_0 \leq 0:\\ \;\;\;\;\varepsilon \cdot \left(5 \cdot {x}^{4} + \varepsilon \cdot \left(\left(x \cdot \left(x \cdot x\right)\right) \cdot 10 + \varepsilon \cdot \left(\left(x \cdot x\right) \cdot 10 + \varepsilon \cdot \left(x \cdot 5\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x eps)
 :precision binary64
 (let* ((t_0 (- (pow (+ x eps) 5.0) (pow x 5.0))))
   (if (<= t_0 -5e-324)
     t_0
     (if (<= t_0 0.0)
       (*
        eps
        (+
         (* 5.0 (pow x 4.0))
         (*
          eps
          (+
           (* (* x (* x x)) 10.0)
           (* eps (+ (* (* x x) 10.0) (* eps (* x 5.0))))))))
       t_0))))
double code(double x, double eps) {
	double t_0 = pow((x + eps), 5.0) - pow(x, 5.0);
	double tmp;
	if (t_0 <= -5e-324) {
		tmp = t_0;
	} else if (t_0 <= 0.0) {
		tmp = eps * ((5.0 * pow(x, 4.0)) + (eps * (((x * (x * x)) * 10.0) + (eps * (((x * x) * 10.0) + (eps * (x * 5.0)))))));
	} 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) ** 5.0d0) - (x ** 5.0d0)
    if (t_0 <= (-5d-324)) then
        tmp = t_0
    else if (t_0 <= 0.0d0) then
        tmp = eps * ((5.0d0 * (x ** 4.0d0)) + (eps * (((x * (x * x)) * 10.0d0) + (eps * (((x * x) * 10.0d0) + (eps * (x * 5.0d0)))))))
    else
        tmp = t_0
    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 <= -5e-324) {
		tmp = t_0;
	} else if (t_0 <= 0.0) {
		tmp = eps * ((5.0 * Math.pow(x, 4.0)) + (eps * (((x * (x * x)) * 10.0) + (eps * (((x * x) * 10.0) + (eps * (x * 5.0)))))));
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, eps):
	t_0 = math.pow((x + eps), 5.0) - math.pow(x, 5.0)
	tmp = 0
	if t_0 <= -5e-324:
		tmp = t_0
	elif t_0 <= 0.0:
		tmp = eps * ((5.0 * math.pow(x, 4.0)) + (eps * (((x * (x * x)) * 10.0) + (eps * (((x * x) * 10.0) + (eps * (x * 5.0)))))))
	else:
		tmp = t_0
	return tmp
function code(x, eps)
	t_0 = Float64((Float64(x + eps) ^ 5.0) - (x ^ 5.0))
	tmp = 0.0
	if (t_0 <= -5e-324)
		tmp = t_0;
	elseif (t_0 <= 0.0)
		tmp = Float64(eps * Float64(Float64(5.0 * (x ^ 4.0)) + Float64(eps * Float64(Float64(Float64(x * Float64(x * x)) * 10.0) + Float64(eps * Float64(Float64(Float64(x * x) * 10.0) + Float64(eps * Float64(x * 5.0))))))));
	else
		tmp = t_0;
	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 <= -5e-324)
		tmp = t_0;
	elseif (t_0 <= 0.0)
		tmp = eps * ((5.0 * (x ^ 4.0)) + (eps * (((x * (x * x)) * 10.0) + (eps * (((x * x) * 10.0) + (eps * (x * 5.0)))))));
	else
		tmp = t_0;
	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, -5e-324], t$95$0, If[LessEqual[t$95$0, 0.0], N[(eps * N[(N[(5.0 * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision] + N[(eps * N[(N[(N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision] * 10.0), $MachinePrecision] + N[(eps * N[(N[(N[(x * x), $MachinePrecision] * 10.0), $MachinePrecision] + N[(eps * N[(x * 5.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}

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

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

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


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

    1. Initial program 97.8%

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

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

    1. Initial program 84.6%

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

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

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

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

Alternative 3: 98.0% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \varepsilon \cdot \left(5 \cdot {x}^{4} + \varepsilon \cdot \left(\left(x \cdot \left(x \cdot x\right)\right) \cdot 10 + \varepsilon \cdot \left(\left(x \cdot x\right) \cdot 10 + \varepsilon \cdot \left(x \cdot 5\right)\right)\right)\right)\\ \mathbf{if}\;x \leq -1.1 \cdot 10^{-42}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 1.25 \cdot 10^{-47}:\\ \;\;\;\;{\varepsilon}^{5} \cdot \left(1 + \frac{x \cdot 5}{\varepsilon}\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x eps)
 :precision binary64
 (let* ((t_0
         (*
          eps
          (+
           (* 5.0 (pow x 4.0))
           (*
            eps
            (+
             (* (* x (* x x)) 10.0)
             (* eps (+ (* (* x x) 10.0) (* eps (* x 5.0))))))))))
   (if (<= x -1.1e-42)
     t_0
     (if (<= x 1.25e-47) (* (pow eps 5.0) (+ 1.0 (/ (* x 5.0) eps))) t_0))))
double code(double x, double eps) {
	double t_0 = eps * ((5.0 * pow(x, 4.0)) + (eps * (((x * (x * x)) * 10.0) + (eps * (((x * x) * 10.0) + (eps * (x * 5.0)))))));
	double tmp;
	if (x <= -1.1e-42) {
		tmp = t_0;
	} else if (x <= 1.25e-47) {
		tmp = pow(eps, 5.0) * (1.0 + ((x * 5.0) / 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 ** 4.0d0)) + (eps * (((x * (x * x)) * 10.0d0) + (eps * (((x * x) * 10.0d0) + (eps * (x * 5.0d0)))))))
    if (x <= (-1.1d-42)) then
        tmp = t_0
    else if (x <= 1.25d-47) then
        tmp = (eps ** 5.0d0) * (1.0d0 + ((x * 5.0d0) / 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 * Math.pow(x, 4.0)) + (eps * (((x * (x * x)) * 10.0) + (eps * (((x * x) * 10.0) + (eps * (x * 5.0)))))));
	double tmp;
	if (x <= -1.1e-42) {
		tmp = t_0;
	} else if (x <= 1.25e-47) {
		tmp = Math.pow(eps, 5.0) * (1.0 + ((x * 5.0) / eps));
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, eps):
	t_0 = eps * ((5.0 * math.pow(x, 4.0)) + (eps * (((x * (x * x)) * 10.0) + (eps * (((x * x) * 10.0) + (eps * (x * 5.0)))))))
	tmp = 0
	if x <= -1.1e-42:
		tmp = t_0
	elif x <= 1.25e-47:
		tmp = math.pow(eps, 5.0) * (1.0 + ((x * 5.0) / eps))
	else:
		tmp = t_0
	return tmp
function code(x, eps)
	t_0 = Float64(eps * Float64(Float64(5.0 * (x ^ 4.0)) + Float64(eps * Float64(Float64(Float64(x * Float64(x * x)) * 10.0) + Float64(eps * Float64(Float64(Float64(x * x) * 10.0) + Float64(eps * Float64(x * 5.0))))))))
	tmp = 0.0
	if (x <= -1.1e-42)
		tmp = t_0;
	elseif (x <= 1.25e-47)
		tmp = Float64((eps ^ 5.0) * Float64(1.0 + Float64(Float64(x * 5.0) / eps)));
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, eps)
	t_0 = eps * ((5.0 * (x ^ 4.0)) + (eps * (((x * (x * x)) * 10.0) + (eps * (((x * x) * 10.0) + (eps * (x * 5.0)))))));
	tmp = 0.0;
	if (x <= -1.1e-42)
		tmp = t_0;
	elseif (x <= 1.25e-47)
		tmp = (eps ^ 5.0) * (1.0 + ((x * 5.0) / eps));
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, eps_] := Block[{t$95$0 = N[(eps * N[(N[(5.0 * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision] + N[(eps * N[(N[(N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision] * 10.0), $MachinePrecision] + N[(eps * N[(N[(N[(x * x), $MachinePrecision] * 10.0), $MachinePrecision] + N[(eps * N[(x * 5.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.1e-42], t$95$0, If[LessEqual[x, 1.25e-47], N[(N[Power[eps, 5.0], $MachinePrecision] * N[(1.0 + N[(N[(x * 5.0), $MachinePrecision] / eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.10000000000000003e-42 or 1.25000000000000003e-47 < x

    1. Initial program 25.5%

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

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

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

    if -1.10000000000000003e-42 < x < 1.25000000000000003e-47

    1. Initial program 99.6%

      \[{\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.1%

        \[\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.1%

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

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

Alternative 4: 97.8% accurate, 1.7× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.36000000000000007e-43 or 1.25000000000000003e-47 < x

    1. Initial program 25.5%

      \[{\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.f6497.6%

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

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

    if -1.36000000000000007e-43 < x < 1.25000000000000003e-47

    1. Initial program 99.6%

      \[{\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.1%

        \[\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.1%

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

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

Alternative 5: 97.7% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \varepsilon \cdot \left(5 \cdot {x}^{4}\right)\\ \mathbf{if}\;x \leq -1.75 \cdot 10^{-43}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 1.3 \cdot 10^{-47}:\\ \;\;\;\;{\varepsilon}^{4} \cdot \left(\varepsilon + x \cdot 5\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x eps)
 :precision binary64
 (let* ((t_0 (* eps (* 5.0 (pow x 4.0)))))
   (if (<= x -1.75e-43)
     t_0
     (if (<= x 1.3e-47) (* (pow eps 4.0) (+ eps (* x 5.0))) t_0))))
double code(double x, double eps) {
	double t_0 = eps * (5.0 * pow(x, 4.0));
	double tmp;
	if (x <= -1.75e-43) {
		tmp = t_0;
	} else if (x <= 1.3e-47) {
		tmp = pow(eps, 4.0) * (eps + (x * 5.0));
	} 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 ** 4.0d0))
    if (x <= (-1.75d-43)) then
        tmp = t_0
    else if (x <= 1.3d-47) then
        tmp = (eps ** 4.0d0) * (eps + (x * 5.0d0))
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double eps) {
	double t_0 = eps * (5.0 * Math.pow(x, 4.0));
	double tmp;
	if (x <= -1.75e-43) {
		tmp = t_0;
	} else if (x <= 1.3e-47) {
		tmp = Math.pow(eps, 4.0) * (eps + (x * 5.0));
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, eps):
	t_0 = eps * (5.0 * math.pow(x, 4.0))
	tmp = 0
	if x <= -1.75e-43:
		tmp = t_0
	elif x <= 1.3e-47:
		tmp = math.pow(eps, 4.0) * (eps + (x * 5.0))
	else:
		tmp = t_0
	return tmp
function code(x, eps)
	t_0 = Float64(eps * Float64(5.0 * (x ^ 4.0)))
	tmp = 0.0
	if (x <= -1.75e-43)
		tmp = t_0;
	elseif (x <= 1.3e-47)
		tmp = Float64((eps ^ 4.0) * Float64(eps + Float64(x * 5.0)));
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, eps)
	t_0 = eps * (5.0 * (x ^ 4.0));
	tmp = 0.0;
	if (x <= -1.75e-43)
		tmp = t_0;
	elseif (x <= 1.3e-47)
		tmp = (eps ^ 4.0) * (eps + (x * 5.0));
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, eps_] := Block[{t$95$0 = N[(eps * N[(5.0 * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.75e-43], t$95$0, If[LessEqual[x, 1.3e-47], N[(N[Power[eps, 4.0], $MachinePrecision] * N[(eps + N[(x * 5.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.74999999999999999e-43 or 1.3e-47 < x

    1. Initial program 25.5%

      \[{\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.f6497.6%

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

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

    if -1.74999999999999999e-43 < x < 1.3e-47

    1. Initial program 99.6%

      \[{\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.1%

        \[\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.1%

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

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

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

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

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

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

Alternative 6: 97.7% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \varepsilon \cdot \left(5 \cdot {x}^{4}\right)\\ \mathbf{if}\;x \leq -1.55 \cdot 10^{-43}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 1.45 \cdot 10^{-47}:\\ \;\;\;\;{\varepsilon}^{5}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x eps)
 :precision binary64
 (let* ((t_0 (* eps (* 5.0 (pow x 4.0)))))
   (if (<= x -1.55e-43) t_0 (if (<= x 1.45e-47) (pow eps 5.0) t_0))))
double code(double x, double eps) {
	double t_0 = eps * (5.0 * pow(x, 4.0));
	double tmp;
	if (x <= -1.55e-43) {
		tmp = t_0;
	} else if (x <= 1.45e-47) {
		tmp = pow(eps, 5.0);
	} 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 ** 4.0d0))
    if (x <= (-1.55d-43)) then
        tmp = t_0
    else if (x <= 1.45d-47) then
        tmp = eps ** 5.0d0
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double eps) {
	double t_0 = eps * (5.0 * Math.pow(x, 4.0));
	double tmp;
	if (x <= -1.55e-43) {
		tmp = t_0;
	} else if (x <= 1.45e-47) {
		tmp = Math.pow(eps, 5.0);
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, eps):
	t_0 = eps * (5.0 * math.pow(x, 4.0))
	tmp = 0
	if x <= -1.55e-43:
		tmp = t_0
	elif x <= 1.45e-47:
		tmp = math.pow(eps, 5.0)
	else:
		tmp = t_0
	return tmp
function code(x, eps)
	t_0 = Float64(eps * Float64(5.0 * (x ^ 4.0)))
	tmp = 0.0
	if (x <= -1.55e-43)
		tmp = t_0;
	elseif (x <= 1.45e-47)
		tmp = eps ^ 5.0;
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, eps)
	t_0 = eps * (5.0 * (x ^ 4.0));
	tmp = 0.0;
	if (x <= -1.55e-43)
		tmp = t_0;
	elseif (x <= 1.45e-47)
		tmp = eps ^ 5.0;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, eps_] := Block[{t$95$0 = N[(eps * N[(5.0 * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.55e-43], t$95$0, If[LessEqual[x, 1.45e-47], N[Power[eps, 5.0], $MachinePrecision], t$95$0]]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq 1.45 \cdot 10^{-47}:\\
\;\;\;\;{\varepsilon}^{5}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.55e-43 or 1.45e-47 < x

    1. Initial program 25.5%

      \[{\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.f6497.6%

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

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

    if -1.55e-43 < x < 1.45e-47

    1. Initial program 99.6%

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

      \[\leadsto \color{blue}{{\varepsilon}^{5}} \]
    4. Step-by-step derivation
      1. pow-lowering-pow.f6498.9%

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

      \[\leadsto \color{blue}{{\varepsilon}^{5}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 7: 97.9% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 5 \cdot \left(x \cdot x\right)\\ \mathbf{if}\;x \leq -3.7 \cdot 10^{-43}:\\ \;\;\;\;\varepsilon \cdot \left(x \cdot \left(5 \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right) + x \cdot \left(t\_0 + 10 \cdot \left(\varepsilon \cdot \left(x + \varepsilon\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x \leq 1.65 \cdot 10^{-47}:\\ \;\;\;\;{\varepsilon}^{5}\\ \mathbf{else}:\\ \;\;\;\;\left(\varepsilon \cdot \varepsilon\right) \cdot \left(\left(x \cdot \left(x \cdot x\right)\right) \cdot \left(10 + \frac{\varepsilon \cdot 10}{x}\right)\right) + \varepsilon \cdot \left(\left(x \cdot x\right) \cdot t\_0\right)\\ \end{array} \end{array} \]
(FPCore (x eps)
 :precision binary64
 (let* ((t_0 (* 5.0 (* x x))))
   (if (<= x -3.7e-43)
     (*
      eps
      (*
       x
       (+
        (* 5.0 (* eps (* eps eps)))
        (* x (+ t_0 (* 10.0 (* eps (+ x eps))))))))
     (if (<= x 1.65e-47)
       (pow eps 5.0)
       (+
        (* (* eps eps) (* (* x (* x x)) (+ 10.0 (/ (* eps 10.0) x))))
        (* eps (* (* x x) t_0)))))))
double code(double x, double eps) {
	double t_0 = 5.0 * (x * x);
	double tmp;
	if (x <= -3.7e-43) {
		tmp = eps * (x * ((5.0 * (eps * (eps * eps))) + (x * (t_0 + (10.0 * (eps * (x + eps)))))));
	} else if (x <= 1.65e-47) {
		tmp = pow(eps, 5.0);
	} else {
		tmp = ((eps * eps) * ((x * (x * x)) * (10.0 + ((eps * 10.0) / x)))) + (eps * ((x * x) * 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 = 5.0d0 * (x * x)
    if (x <= (-3.7d-43)) then
        tmp = eps * (x * ((5.0d0 * (eps * (eps * eps))) + (x * (t_0 + (10.0d0 * (eps * (x + eps)))))))
    else if (x <= 1.65d-47) then
        tmp = eps ** 5.0d0
    else
        tmp = ((eps * eps) * ((x * (x * x)) * (10.0d0 + ((eps * 10.0d0) / x)))) + (eps * ((x * x) * t_0))
    end if
    code = tmp
end function
public static double code(double x, double eps) {
	double t_0 = 5.0 * (x * x);
	double tmp;
	if (x <= -3.7e-43) {
		tmp = eps * (x * ((5.0 * (eps * (eps * eps))) + (x * (t_0 + (10.0 * (eps * (x + eps)))))));
	} else if (x <= 1.65e-47) {
		tmp = Math.pow(eps, 5.0);
	} else {
		tmp = ((eps * eps) * ((x * (x * x)) * (10.0 + ((eps * 10.0) / x)))) + (eps * ((x * x) * t_0));
	}
	return tmp;
}
def code(x, eps):
	t_0 = 5.0 * (x * x)
	tmp = 0
	if x <= -3.7e-43:
		tmp = eps * (x * ((5.0 * (eps * (eps * eps))) + (x * (t_0 + (10.0 * (eps * (x + eps)))))))
	elif x <= 1.65e-47:
		tmp = math.pow(eps, 5.0)
	else:
		tmp = ((eps * eps) * ((x * (x * x)) * (10.0 + ((eps * 10.0) / x)))) + (eps * ((x * x) * t_0))
	return tmp
function code(x, eps)
	t_0 = Float64(5.0 * Float64(x * x))
	tmp = 0.0
	if (x <= -3.7e-43)
		tmp = Float64(eps * Float64(x * Float64(Float64(5.0 * Float64(eps * Float64(eps * eps))) + Float64(x * Float64(t_0 + Float64(10.0 * Float64(eps * Float64(x + eps))))))));
	elseif (x <= 1.65e-47)
		tmp = eps ^ 5.0;
	else
		tmp = Float64(Float64(Float64(eps * eps) * Float64(Float64(x * Float64(x * x)) * Float64(10.0 + Float64(Float64(eps * 10.0) / x)))) + Float64(eps * Float64(Float64(x * x) * t_0)));
	end
	return tmp
end
function tmp_2 = code(x, eps)
	t_0 = 5.0 * (x * x);
	tmp = 0.0;
	if (x <= -3.7e-43)
		tmp = eps * (x * ((5.0 * (eps * (eps * eps))) + (x * (t_0 + (10.0 * (eps * (x + eps)))))));
	elseif (x <= 1.65e-47)
		tmp = eps ^ 5.0;
	else
		tmp = ((eps * eps) * ((x * (x * x)) * (10.0 + ((eps * 10.0) / x)))) + (eps * ((x * x) * t_0));
	end
	tmp_2 = tmp;
end
code[x_, eps_] := Block[{t$95$0 = N[(5.0 * N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.7e-43], N[(eps * N[(x * N[(N[(5.0 * N[(eps * N[(eps * eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * N[(t$95$0 + N[(10.0 * N[(eps * N[(x + eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.65e-47], N[Power[eps, 5.0], $MachinePrecision], N[(N[(N[(eps * eps), $MachinePrecision] * N[(N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision] * N[(10.0 + N[(N[(eps * 10.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(eps * N[(N[(x * x), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq 1.65 \cdot 10^{-47}:\\
\;\;\;\;{\varepsilon}^{5}\\

\mathbf{else}:\\
\;\;\;\;\left(\varepsilon \cdot \varepsilon\right) \cdot \left(\left(x \cdot \left(x \cdot x\right)\right) \cdot \left(10 + \frac{\varepsilon \cdot 10}{x}\right)\right) + \varepsilon \cdot \left(\left(x \cdot x\right) \cdot t\_0\right)\\


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

    1. Initial program 17.1%

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

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

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

      \[\leadsto \mathsf{*.f64}\left(\varepsilon, \color{blue}{\left(x \cdot \left(5 \cdot {\varepsilon}^{3} + x \cdot \left(10 \cdot {\varepsilon}^{2} + x \cdot \left(5 \cdot x + 10 \cdot \varepsilon\right)\right)\right)\right)}\right) \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(5, \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \varepsilon\right)\right)\right), \mathsf{*.f64}\left(x, \left(x \cdot \left(5 \cdot x + 10 \cdot \varepsilon\right) + \color{blue}{10 \cdot {\varepsilon}^{2}}\right)\right)\right)\right)\right) \]
      11. distribute-rgt-inN/A

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(5, \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \varepsilon\right)\right)\right), \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(x \cdot \left(5 \cdot x\right)\right), \color{blue}{\left(10 \cdot \left(\varepsilon \cdot x\right) + 10 \cdot {\varepsilon}^{2}\right)}\right)\right)\right)\right)\right) \]
    7. Simplified95.6%

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

    if -3.7e-43 < x < 1.65000000000000002e-47

    1. Initial program 99.6%

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

      \[\leadsto \color{blue}{{\varepsilon}^{5}} \]
    4. Step-by-step derivation
      1. pow-lowering-pow.f6498.9%

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

      \[\leadsto \color{blue}{{\varepsilon}^{5}} \]

    if 1.65000000000000002e-47 < x

    1. Initial program 34.4%

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

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

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

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

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

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

        \[\leadsto \mathsf{+.f64}\left(\left(\varepsilon \cdot \left(\varepsilon \cdot \left(\left(x \cdot \left(x \cdot x\right)\right) \cdot 10 + \varepsilon \cdot \left(\left(x \cdot x\right) \cdot 10 + \varepsilon \cdot \left(5 \cdot x\right)\right)\right)\right)\right), \color{blue}{\left(\left(5 \cdot {x}^{4}\right) \cdot \varepsilon\right)}\right) \]
    6. Applied egg-rr99.6%

      \[\leadsto \color{blue}{\left(\left(x \cdot \left(x \cdot x\right)\right) \cdot 10 + \varepsilon \cdot \left(x \cdot \left(x \cdot 10\right) + \varepsilon \cdot \left(x \cdot 5\right)\right)\right) \cdot \left(\varepsilon \cdot \varepsilon\right) + \varepsilon \cdot \left(\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot 5\right)\right)} \]
    7. Taylor expanded in x around inf

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\color{blue}{\left({x}^{3} \cdot \left(10 + 10 \cdot \frac{\varepsilon}{x}\right)\right)}, \mathsf{*.f64}\left(\varepsilon, \varepsilon\right)\right), \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), 5\right)\right)\right)\right) \]
    8. Step-by-step derivation
      1. *-lowering-*.f64N/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right), \mathsf{+.f64}\left(10, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\varepsilon, 10\right), x\right)\right)\right), \mathsf{*.f64}\left(\varepsilon, \varepsilon\right)\right), \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), 5\right)\right)\right)\right) \]
    9. Simplified99.6%

      \[\leadsto \color{blue}{\left(\left(x \cdot \left(x \cdot x\right)\right) \cdot \left(10 + \frac{\varepsilon \cdot 10}{x}\right)\right)} \cdot \left(\varepsilon \cdot \varepsilon\right) + \varepsilon \cdot \left(\left(x \cdot x\right) \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 -3.7 \cdot 10^{-43}:\\ \;\;\;\;\varepsilon \cdot \left(x \cdot \left(5 \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right) + x \cdot \left(5 \cdot \left(x \cdot x\right) + 10 \cdot \left(\varepsilon \cdot \left(x + \varepsilon\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x \leq 1.65 \cdot 10^{-47}:\\ \;\;\;\;{\varepsilon}^{5}\\ \mathbf{else}:\\ \;\;\;\;\left(\varepsilon \cdot \varepsilon\right) \cdot \left(\left(x \cdot \left(x \cdot x\right)\right) \cdot \left(10 + \frac{\varepsilon \cdot 10}{x}\right)\right) + \varepsilon \cdot \left(\left(x \cdot x\right) \cdot \left(5 \cdot \left(x \cdot x\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 83.7% accurate, 5.6× speedup?

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

\\
\varepsilon \cdot \left(\left(x \cdot x\right) \cdot \left(5 \cdot \left(x \cdot x\right)\right)\right) + \left(\varepsilon \cdot \varepsilon\right) \cdot \left(\left(x \cdot \left(x \cdot x\right)\right) \cdot 10 + \varepsilon \cdot \left(x \cdot \left(x \cdot \left(10 + \frac{\varepsilon \cdot 5}{x}\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 86.5%

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

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

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

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

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

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

      \[\leadsto \mathsf{+.f64}\left(\left(\varepsilon \cdot \left(\varepsilon \cdot \left(\left(x \cdot \left(x \cdot x\right)\right) \cdot 10 + \varepsilon \cdot \left(\left(x \cdot x\right) \cdot 10 + \varepsilon \cdot \left(5 \cdot x\right)\right)\right)\right)\right), \color{blue}{\left(\left(5 \cdot {x}^{4}\right) \cdot \varepsilon\right)}\right) \]
  6. Applied egg-rr86.7%

    \[\leadsto \color{blue}{\left(\left(x \cdot \left(x \cdot x\right)\right) \cdot 10 + \varepsilon \cdot \left(x \cdot \left(x \cdot 10\right) + \varepsilon \cdot \left(x \cdot 5\right)\right)\right) \cdot \left(\varepsilon \cdot \varepsilon\right) + \varepsilon \cdot \left(\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot 5\right)\right)} \]
  7. Taylor expanded in x around inf

    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right), 10\right), \mathsf{*.f64}\left(\varepsilon, \color{blue}{\left({x}^{2} \cdot \left(10 + 5 \cdot \frac{\varepsilon}{x}\right)\right)}\right)\right), \mathsf{*.f64}\left(\varepsilon, \varepsilon\right)\right), \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), 5\right)\right)\right)\right) \]
  8. Step-by-step derivation
    1. unpow2N/A

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

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

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

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

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

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

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right), 10\right), \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(10, \mathsf{/.f64}\left(\mathsf{*.f64}\left(5, \varepsilon\right), x\right)\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\varepsilon, \varepsilon\right)\right), \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), 5\right)\right)\right)\right) \]
  9. Simplified86.7%

    \[\leadsto \left(\left(x \cdot \left(x \cdot x\right)\right) \cdot 10 + \varepsilon \cdot \color{blue}{\left(x \cdot \left(x \cdot \left(10 + \frac{5 \cdot \varepsilon}{x}\right)\right)\right)}\right) \cdot \left(\varepsilon \cdot \varepsilon\right) + \varepsilon \cdot \left(\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot 5\right)\right) \]
  10. Final simplification86.7%

    \[\leadsto \varepsilon \cdot \left(\left(x \cdot x\right) \cdot \left(5 \cdot \left(x \cdot x\right)\right)\right) + \left(\varepsilon \cdot \varepsilon\right) \cdot \left(\left(x \cdot \left(x \cdot x\right)\right) \cdot 10 + \varepsilon \cdot \left(x \cdot \left(x \cdot \left(10 + \frac{\varepsilon \cdot 5}{x}\right)\right)\right)\right) \]
  11. Add Preprocessing

Alternative 9: 83.7% accurate, 7.1× speedup?

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

\\
\left(\varepsilon \cdot \varepsilon\right) \cdot \left(\left(x \cdot \left(x \cdot x\right)\right) \cdot \left(10 + \frac{\varepsilon \cdot 10}{x}\right)\right) + \varepsilon \cdot \left(\left(x \cdot x\right) \cdot \left(5 \cdot \left(x \cdot x\right)\right)\right)
\end{array}
Derivation
  1. Initial program 86.5%

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

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

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

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

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

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

      \[\leadsto \mathsf{+.f64}\left(\left(\varepsilon \cdot \left(\varepsilon \cdot \left(\left(x \cdot \left(x \cdot x\right)\right) \cdot 10 + \varepsilon \cdot \left(\left(x \cdot x\right) \cdot 10 + \varepsilon \cdot \left(5 \cdot x\right)\right)\right)\right)\right), \color{blue}{\left(\left(5 \cdot {x}^{4}\right) \cdot \varepsilon\right)}\right) \]
  6. Applied egg-rr86.7%

    \[\leadsto \color{blue}{\left(\left(x \cdot \left(x \cdot x\right)\right) \cdot 10 + \varepsilon \cdot \left(x \cdot \left(x \cdot 10\right) + \varepsilon \cdot \left(x \cdot 5\right)\right)\right) \cdot \left(\varepsilon \cdot \varepsilon\right) + \varepsilon \cdot \left(\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot 5\right)\right)} \]
  7. Taylor expanded in x around inf

    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\color{blue}{\left({x}^{3} \cdot \left(10 + 10 \cdot \frac{\varepsilon}{x}\right)\right)}, \mathsf{*.f64}\left(\varepsilon, \varepsilon\right)\right), \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), 5\right)\right)\right)\right) \]
  8. Step-by-step derivation
    1. *-lowering-*.f64N/A

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right), \mathsf{+.f64}\left(10, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\varepsilon, 10\right), x\right)\right)\right), \mathsf{*.f64}\left(\varepsilon, \varepsilon\right)\right), \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), 5\right)\right)\right)\right) \]
  9. Simplified86.7%

    \[\leadsto \color{blue}{\left(\left(x \cdot \left(x \cdot x\right)\right) \cdot \left(10 + \frac{\varepsilon \cdot 10}{x}\right)\right)} \cdot \left(\varepsilon \cdot \varepsilon\right) + \varepsilon \cdot \left(\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot 5\right)\right) \]
  10. Final simplification86.7%

    \[\leadsto \left(\varepsilon \cdot \varepsilon\right) \cdot \left(\left(x \cdot \left(x \cdot x\right)\right) \cdot \left(10 + \frac{\varepsilon \cdot 10}{x}\right)\right) + \varepsilon \cdot \left(\left(x \cdot x\right) \cdot \left(5 \cdot \left(x \cdot x\right)\right)\right) \]
  11. Add Preprocessing

Alternative 10: 83.7% accurate, 7.7× speedup?

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

\\
\varepsilon \cdot \left(x \cdot \left(5 \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right) + x \cdot \left(5 \cdot \left(x \cdot x\right) + 10 \cdot \left(\varepsilon \cdot \left(x + \varepsilon\right)\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 86.5%

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

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

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

    \[\leadsto \mathsf{*.f64}\left(\varepsilon, \color{blue}{\left(x \cdot \left(5 \cdot {\varepsilon}^{3} + x \cdot \left(10 \cdot {\varepsilon}^{2} + x \cdot \left(5 \cdot x + 10 \cdot \varepsilon\right)\right)\right)\right)}\right) \]
  6. Step-by-step derivation
    1. *-lowering-*.f64N/A

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(5, \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \varepsilon\right)\right)\right), \mathsf{*.f64}\left(x, \left(x \cdot \left(5 \cdot x + 10 \cdot \varepsilon\right) + \color{blue}{10 \cdot {\varepsilon}^{2}}\right)\right)\right)\right)\right) \]
    11. distribute-rgt-inN/A

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

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

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

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

      \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(5, \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \varepsilon\right)\right)\right), \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(x \cdot \left(5 \cdot x\right)\right), \color{blue}{\left(10 \cdot \left(\varepsilon \cdot x\right) + 10 \cdot {\varepsilon}^{2}\right)}\right)\right)\right)\right)\right) \]
  7. Simplified86.7%

    \[\leadsto \varepsilon \cdot \color{blue}{\left(x \cdot \left(5 \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right) + x \cdot \left(5 \cdot \left(x \cdot x\right) + 10 \cdot \left(\varepsilon \cdot \left(\varepsilon + x\right)\right)\right)\right)\right)} \]
  8. Final simplification86.7%

    \[\leadsto \varepsilon \cdot \left(x \cdot \left(5 \cdot \left(\varepsilon \cdot \left(\varepsilon \cdot \varepsilon\right)\right) + x \cdot \left(5 \cdot \left(x \cdot x\right) + 10 \cdot \left(\varepsilon \cdot \left(x + \varepsilon\right)\right)\right)\right)\right) \]
  9. Add Preprocessing

Alternative 11: 83.7% accurate, 10.9× speedup?

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

\\
\varepsilon \cdot \left(x \cdot \left(x \cdot \left(5 \cdot \left(x \cdot x\right) + \varepsilon \cdot \left(10 \cdot \left(x + \varepsilon\right)\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 86.5%

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(x \cdot \left(x \cdot x\right)\right), x\right), \left(5 + -1 \cdot \frac{-10 \cdot \varepsilon + -1 \cdot \frac{5 \cdot \frac{{\varepsilon}^{3}}{x} + 10 \cdot {\varepsilon}^{2}}{x}}{x}\right)\right)\right) \]
    6. unpow2N/A

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

      \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \left({x}^{2}\right)\right), x\right), \left(5 + -1 \cdot \frac{-10 \cdot \varepsilon + -1 \cdot \frac{5 \cdot \frac{{\varepsilon}^{3}}{x} + 10 \cdot {\varepsilon}^{2}}{x}}{x}\right)\right)\right) \]
    8. unpow2N/A

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

      \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right), x\right), \left(5 + -1 \cdot \frac{-10 \cdot \varepsilon + -1 \cdot \frac{5 \cdot \frac{{\varepsilon}^{3}}{x} + 10 \cdot {\varepsilon}^{2}}{x}}{x}\right)\right)\right) \]
    10. mul-1-negN/A

      \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right), x\right), \left(5 + \left(\mathsf{neg}\left(\frac{-10 \cdot \varepsilon + -1 \cdot \frac{5 \cdot \frac{{\varepsilon}^{3}}{x} + 10 \cdot {\varepsilon}^{2}}{x}}{x}\right)\right)\right)\right)\right) \]
    11. unsub-negN/A

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

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

      \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right), x\right), \mathsf{\_.f64}\left(5, \mathsf{/.f64}\left(\left(-10 \cdot \varepsilon + -1 \cdot \frac{5 \cdot \frac{{\varepsilon}^{3}}{x} + 10 \cdot {\varepsilon}^{2}}{x}\right), \color{blue}{x}\right)\right)\right)\right) \]
  7. Simplified78.4%

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

    \[\leadsto \mathsf{*.f64}\left(\varepsilon, \color{blue}{\left(x \cdot \left(5 \cdot {\varepsilon}^{3} + x \cdot \left(10 \cdot {\varepsilon}^{2} + x \cdot \left(5 \cdot x + 10 \cdot \varepsilon\right)\right)\right)\right)}\right) \]
  9. Step-by-step derivation
    1. *-lowering-*.f64N/A

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(5, \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \varepsilon\right)\right)\right), \mathsf{*.f64}\left(x, \left(x \cdot \left(5 \cdot x + 10 \cdot \varepsilon\right) + \color{blue}{10 \cdot {\varepsilon}^{2}}\right)\right)\right)\right)\right) \]
    11. distribute-rgt-inN/A

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

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

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

      \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(5, \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \varepsilon\right)\right)\right), \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(5 \cdot x\right) \cdot x\right), \color{blue}{\left(10 \cdot \left(\varepsilon \cdot x\right) + 10 \cdot {\varepsilon}^{2}\right)}\right)\right)\right)\right)\right) \]
  10. Simplified86.7%

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

    \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(x, \color{blue}{\left(5 \cdot {x}^{3} + \varepsilon \cdot \left(10 \cdot \left(\varepsilon \cdot x\right) + 10 \cdot {x}^{2}\right)\right)}\right)\right) \]
  12. Simplified86.7%

    \[\leadsto \varepsilon \cdot \left(x \cdot \color{blue}{\left(x \cdot \left(5 \cdot \left(x \cdot x\right) + \varepsilon \cdot \left(10 \cdot \left(\varepsilon + x\right)\right)\right)\right)}\right) \]
  13. Final simplification86.7%

    \[\leadsto \varepsilon \cdot \left(x \cdot \left(x \cdot \left(5 \cdot \left(x \cdot x\right) + \varepsilon \cdot \left(10 \cdot \left(x + \varepsilon\right)\right)\right)\right)\right) \]
  14. Add Preprocessing

Alternative 12: 83.4% accurate, 18.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{*.f64}\left(5, \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \left(x \cdot x\right)\right), x\right)\right)\right) \]
    10. *-lowering-*.f6486.6%

      \[\leadsto \mathsf{*.f64}\left(5, \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right), x\right)\right)\right) \]
  7. Simplified86.6%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(x \cdot \left(\varepsilon \cdot \left(x \cdot \left(x \cdot x\right)\right)\right)\right) \cdot 5 \]
    4. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{x \cdot \left(\left(x \cdot \left(x \cdot \left(x \cdot \varepsilon\right)\right)\right) \cdot 5\right)} \]
  12. Final simplification86.7%

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

Alternative 13: 83.4% accurate, 18.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(5, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right), x\right)\right)\right) \]
  7. Simplified86.6%

    \[\leadsto \varepsilon \cdot \color{blue}{\left(5 \cdot \left(\left(x \cdot \left(x \cdot x\right)\right) \cdot x\right)\right)} \]
  8. Final simplification86.6%

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

Alternative 14: 83.4% accurate, 18.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{*.f64}\left(5, \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \left(x \cdot x\right)\right), x\right)\right)\right) \]
    10. *-lowering-*.f6486.6%

      \[\leadsto \mathsf{*.f64}\left(5, \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right), x\right)\right)\right) \]
  7. Simplified86.6%

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

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

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

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

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

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

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

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

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

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

Alternative 15: 83.4% accurate, 18.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{*.f64}\left(5, \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \left(x \cdot x\right)\right), x\right)\right)\right) \]
    10. *-lowering-*.f6486.6%

      \[\leadsto \mathsf{*.f64}\left(5, \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right), x\right)\right)\right) \]
  7. Simplified86.6%

    \[\leadsto \color{blue}{5 \cdot \left(\varepsilon \cdot \left(\left(x \cdot \left(x \cdot x\right)\right) \cdot x\right)\right)} \]
  8. Final simplification86.6%

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

Reproduce

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