Rosa's FloatVsDoubleBenchmark

Percentage Accurate: 70.0% → 99.6%
Time: 33.4s
Alternatives: 20
Speedup: 6.6×

Specification

?
\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(3 \cdot x1\right) \cdot x1\\ t_1 := x1 \cdot x1 + 1\\ t_2 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\ x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t_2 - 6\right)\right) \cdot t_1 + t_0 \cdot t_2\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1}\right) \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (* (* 3.0 x1) x1))
        (t_1 (+ (* x1 x1) 1.0))
        (t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
   (+
    x1
    (+
     (+
      (+
       (+
        (*
         (+
          (* (* (* 2.0 x1) t_2) (- t_2 3.0))
          (* (* x1 x1) (- (* 4.0 t_2) 6.0)))
         t_1)
        (* t_0 t_2))
       (* (* x1 x1) x1))
      x1)
     (* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
double code(double x1, double x2) {
	double t_0 = (3.0 * x1) * x1;
	double t_1 = (x1 * x1) + 1.0;
	double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
	return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
real(8) function code(x1, x2)
    real(8), intent (in) :: x1
    real(8), intent (in) :: x2
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    t_0 = (3.0d0 * x1) * x1
    t_1 = (x1 * x1) + 1.0d0
    t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
    code = x1 + (((((((((2.0d0 * x1) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_2) - 6.0d0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)))
end function
public static double code(double x1, double x2) {
	double t_0 = (3.0 * x1) * x1;
	double t_1 = (x1 * x1) + 1.0;
	double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
	return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
def code(x1, x2):
	t_0 = (3.0 * x1) * x1
	t_1 = (x1 * x1) + 1.0
	t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1
	return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))
function code(x1, x2)
	t_0 = Float64(Float64(3.0 * x1) * x1)
	t_1 = Float64(Float64(x1 * x1) + 1.0)
	t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1)
	return Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0))) * t_1) + Float64(t_0 * t_2)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1))))
end
function tmp = code(x1, x2)
	t_0 = (3.0 * x1) * x1;
	t_1 = (x1 * x1) + 1.0;
	t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
	tmp = x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\
x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t_2 - 6\right)\right) \cdot t_1 + t_0 \cdot t_2\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1}\right)
\end{array}
\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 20 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: 70.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(3 \cdot x1\right) \cdot x1\\ t_1 := x1 \cdot x1 + 1\\ t_2 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\ x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t_2 - 6\right)\right) \cdot t_1 + t_0 \cdot t_2\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1}\right) \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (* (* 3.0 x1) x1))
        (t_1 (+ (* x1 x1) 1.0))
        (t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
   (+
    x1
    (+
     (+
      (+
       (+
        (*
         (+
          (* (* (* 2.0 x1) t_2) (- t_2 3.0))
          (* (* x1 x1) (- (* 4.0 t_2) 6.0)))
         t_1)
        (* t_0 t_2))
       (* (* x1 x1) x1))
      x1)
     (* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
double code(double x1, double x2) {
	double t_0 = (3.0 * x1) * x1;
	double t_1 = (x1 * x1) + 1.0;
	double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
	return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
real(8) function code(x1, x2)
    real(8), intent (in) :: x1
    real(8), intent (in) :: x2
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    t_0 = (3.0d0 * x1) * x1
    t_1 = (x1 * x1) + 1.0d0
    t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
    code = x1 + (((((((((2.0d0 * x1) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_2) - 6.0d0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)))
end function
public static double code(double x1, double x2) {
	double t_0 = (3.0 * x1) * x1;
	double t_1 = (x1 * x1) + 1.0;
	double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
	return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
def code(x1, x2):
	t_0 = (3.0 * x1) * x1
	t_1 = (x1 * x1) + 1.0
	t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1
	return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))
function code(x1, x2)
	t_0 = Float64(Float64(3.0 * x1) * x1)
	t_1 = Float64(Float64(x1 * x1) + 1.0)
	t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1)
	return Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0))) * t_1) + Float64(t_0 * t_2)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1))))
end
function tmp = code(x1, x2)
	t_0 = (3.0 * x1) * x1;
	t_1 = (x1 * x1) + 1.0;
	t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
	tmp = x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\
x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t_2 - 6\right)\right) \cdot t_1 + t_0 \cdot t_2\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1}\right)
\end{array}
\end{array}

Alternative 1: 99.6% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2 - x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}\\ t_1 := x1 \cdot \left(x1 \cdot 3\right)\\ t_2 := x1 \cdot x1 + 1\\ t_3 := \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_2}\\ \mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t_2 \cdot \left(\left(t_3 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_3 \cdot 4 - 6\right)\right) + t_1 \cdot t_3\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_2}\right) \leq \infty:\\ \;\;\;\;x1 + \mathsf{fma}\left(3, \frac{t_1 - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, x1 + \mathsf{fma}\left(\mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, x1 \cdot \mathsf{fma}\left(t_0, 4, -6\right), t_0 \cdot \left(\left(x1 \cdot 2\right) \cdot \left(t_0 + -3\right)\right)\right), \mathsf{fma}\left(t_1, t_0, {x1}^{3}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (/ (fma x1 (* x1 3.0) (- (* 2.0 x2) x1)) (fma x1 x1 1.0)))
        (t_1 (* x1 (* x1 3.0)))
        (t_2 (+ (* x1 x1) 1.0))
        (t_3 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2)))
   (if (<=
        (+
         x1
         (+
          (+
           x1
           (+
            (+
             (*
              t_2
              (+
               (* (* t_3 (* x1 2.0)) (- t_3 3.0))
               (* (* x1 x1) (- (* t_3 4.0) 6.0))))
             (* t_1 t_3))
            (* x1 (* x1 x1))))
          (* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2))))
        INFINITY)
     (+
      x1
      (fma
       3.0
       (/ (- t_1 (fma 2.0 x2 x1)) (fma x1 x1 1.0))
       (+
        x1
        (fma
         (fma x1 x1 1.0)
         (fma x1 (* x1 (fma t_0 4.0 -6.0)) (* t_0 (* (* x1 2.0) (+ t_0 -3.0))))
         (fma t_1 t_0 (pow x1 3.0))))))
     (+ x1 (+ x1 (* 6.0 (* (* x1 x1) (* x1 x1))))))))
double code(double x1, double x2) {
	double t_0 = fma(x1, (x1 * 3.0), ((2.0 * x2) - x1)) / fma(x1, x1, 1.0);
	double t_1 = x1 * (x1 * 3.0);
	double t_2 = (x1 * x1) + 1.0;
	double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
	double tmp;
	if ((x1 + ((x1 + (((t_2 * (((t_3 * (x1 * 2.0)) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_1 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)))) <= ((double) INFINITY)) {
		tmp = x1 + fma(3.0, ((t_1 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), (x1 + fma(fma(x1, x1, 1.0), fma(x1, (x1 * fma(t_0, 4.0, -6.0)), (t_0 * ((x1 * 2.0) * (t_0 + -3.0)))), fma(t_1, t_0, pow(x1, 3.0)))));
	} else {
		tmp = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
	}
	return tmp;
}
function code(x1, x2)
	t_0 = Float64(fma(x1, Float64(x1 * 3.0), Float64(Float64(2.0 * x2) - x1)) / fma(x1, x1, 1.0))
	t_1 = Float64(x1 * Float64(x1 * 3.0))
	t_2 = Float64(Float64(x1 * x1) + 1.0)
	t_3 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2)
	tmp = 0.0
	if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_2 * Float64(Float64(Float64(t_3 * Float64(x1 * 2.0)) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)))) + Float64(t_1 * t_3)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)))) <= Inf)
		tmp = Float64(x1 + fma(3.0, Float64(Float64(t_1 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), Float64(x1 + fma(fma(x1, x1, 1.0), fma(x1, Float64(x1 * fma(t_0, 4.0, -6.0)), Float64(t_0 * Float64(Float64(x1 * 2.0) * Float64(t_0 + -3.0)))), fma(t_1, t_0, (x1 ^ 3.0))))));
	else
		tmp = Float64(x1 + Float64(x1 + Float64(6.0 * Float64(Float64(x1 * x1) * Float64(x1 * x1)))));
	end
	return tmp
end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision] + N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$2 * N[(N[(N[(t$95$3 * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(3.0 * N[(N[(t$95$1 - N[(2.0 * x2 + x1), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * x1 + 1.0), $MachinePrecision] * N[(x1 * N[(x1 * N[(t$95$0 * 4.0 + -6.0), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(N[(x1 * 2.0), $MachinePrecision] * N[(t$95$0 + -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * t$95$0 + N[Power[x1, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 + N[(6.0 * N[(N[(x1 * x1), $MachinePrecision] * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2 - x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_2}\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t_2 \cdot \left(\left(t_3 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_3 \cdot 4 - 6\right)\right) + t_1 \cdot t_3\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_2}\right) \leq \infty:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, \frac{t_1 - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, x1 + \mathsf{fma}\left(\mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, x1 \cdot \mathsf{fma}\left(t_0, 4, -6\right), t_0 \cdot \left(\left(x1 \cdot 2\right) \cdot \left(t_0 + -3\right)\right)\right), \mathsf{fma}\left(t_1, t_0, {x1}^{3}\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) < +inf.0

    1. Initial program 99.3%

      \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    2. Simplified99.6%

      \[\leadsto \color{blue}{x1 + \mathsf{fma}\left(3, \frac{x1 \cdot \left(x1 \cdot 3\right) - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, x1 + \mathsf{fma}\left(\mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, x1 \cdot \mathsf{fma}\left(\frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2 - x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, 4, -6\right), \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2 - x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)} \cdot \left(\left(x1 \cdot 2\right) \cdot \left(\frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2 - x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)} + -3\right)\right)\right), \mathsf{fma}\left(x1 \cdot \left(x1 \cdot 3\right), \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2 - x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, {x1}^{3}\right)\right)\right)} \]

    if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))))

    1. Initial program 0.0%

      \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    2. Taylor expanded in x1 around inf 15.5%

      \[\leadsto x1 + \left(\left(\color{blue}{6 \cdot {x1}^{4}} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    3. Step-by-step derivation
      1. *-commutative15.5%

        \[\leadsto x1 + \left(\left(\color{blue}{{x1}^{4} \cdot 6} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    4. Simplified15.5%

      \[\leadsto x1 + \left(\left(\color{blue}{{x1}^{4} \cdot 6} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    5. Taylor expanded in x1 around inf 98.6%

      \[\leadsto x1 + \color{blue}{\left(x1 + 6 \cdot {x1}^{4}\right)} \]
    6. Step-by-step derivation
      1. sqr-pow98.6%

        \[\leadsto x1 + \left(x1 + 6 \cdot \color{blue}{\left({x1}^{\left(\frac{4}{2}\right)} \cdot {x1}^{\left(\frac{4}{2}\right)}\right)}\right) \]
      2. metadata-eval98.6%

        \[\leadsto x1 + \left(x1 + 6 \cdot \left({x1}^{\color{blue}{2}} \cdot {x1}^{\left(\frac{4}{2}\right)}\right)\right) \]
      3. pow298.6%

        \[\leadsto x1 + \left(x1 + 6 \cdot \left(\color{blue}{\left(x1 \cdot x1\right)} \cdot {x1}^{\left(\frac{4}{2}\right)}\right)\right) \]
      4. metadata-eval98.6%

        \[\leadsto x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot {x1}^{\color{blue}{2}}\right)\right) \]
      5. pow298.6%

        \[\leadsto x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \color{blue}{\left(x1 \cdot x1\right)}\right)\right) \]
    7. Applied egg-rr98.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 + \left(\left(x1 + \left(\left(\left(x1 \cdot x1 + 1\right) \cdot \left(\left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} \cdot \left(x1 \cdot 2\right)\right) \cdot \left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} \cdot 4 - 6\right)\right) + \left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \leq \infty:\\ \;\;\;\;x1 + \mathsf{fma}\left(3, \frac{x1 \cdot \left(x1 \cdot 3\right) - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, x1 + \mathsf{fma}\left(\mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, x1 \cdot \mathsf{fma}\left(\frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2 - x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, 4, -6\right), \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2 - x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)} \cdot \left(\left(x1 \cdot 2\right) \cdot \left(\frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2 - x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)} + -3\right)\right)\right), \mathsf{fma}\left(x1 \cdot \left(x1 \cdot 3\right), \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2 - x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, {x1}^{3}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)\right)\\ \end{array} \]

Alternative 2: 99.4% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 \cdot \left(x1 \cdot x1\right)\\ t_1 := x1 \cdot \left(x1 \cdot 3\right)\\ t_2 := x1 \cdot x1 + 1\\ t_3 := 3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_2}\\ t_4 := \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_2}\\ t_5 := \left(t_4 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t_4 - 3\right)\\ t_6 := t_1 \cdot t_4\\ \mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t_2 \cdot \left(t_5 + \left(x1 \cdot x1\right) \cdot \left(t_4 \cdot 4 - 6\right)\right) + t_6\right) + t_0\right)\right) + t_3\right) \leq \infty:\\ \;\;\;\;x1 + \left(t_3 + \left(x1 + \left(t_0 + \left(t_6 + t_2 \cdot \left(t_5 + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \left(\left(\mathsf{fma}\left(x1 \cdot 3, x1, x2 + x2\right) - x1\right) \cdot \frac{1}{\mathsf{fma}\left(x1, x1, 1\right)}\right) - 6\right)\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (* x1 (* x1 x1)))
        (t_1 (* x1 (* x1 3.0)))
        (t_2 (+ (* x1 x1) 1.0))
        (t_3 (* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2)))
        (t_4 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2))
        (t_5 (* (* t_4 (* x1 2.0)) (- t_4 3.0)))
        (t_6 (* t_1 t_4)))
   (if (<=
        (+
         x1
         (+
          (+
           x1
           (+ (+ (* t_2 (+ t_5 (* (* x1 x1) (- (* t_4 4.0) 6.0)))) t_6) t_0))
          t_3))
        INFINITY)
     (+
      x1
      (+
       t_3
       (+
        x1
        (+
         t_0
         (+
          t_6
          (*
           t_2
           (+
            t_5
            (*
             (* x1 x1)
             (-
              (*
               4.0
               (*
                (- (fma (* x1 3.0) x1 (+ x2 x2)) x1)
                (/ 1.0 (fma x1 x1 1.0))))
              6.0)))))))))
     (+ x1 (+ x1 (* 6.0 (* (* x1 x1) (* x1 x1))))))))
double code(double x1, double x2) {
	double t_0 = x1 * (x1 * x1);
	double t_1 = x1 * (x1 * 3.0);
	double t_2 = (x1 * x1) + 1.0;
	double t_3 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2);
	double t_4 = ((t_1 + (2.0 * x2)) - x1) / t_2;
	double t_5 = (t_4 * (x1 * 2.0)) * (t_4 - 3.0);
	double t_6 = t_1 * t_4;
	double tmp;
	if ((x1 + ((x1 + (((t_2 * (t_5 + ((x1 * x1) * ((t_4 * 4.0) - 6.0)))) + t_6) + t_0)) + t_3)) <= ((double) INFINITY)) {
		tmp = x1 + (t_3 + (x1 + (t_0 + (t_6 + (t_2 * (t_5 + ((x1 * x1) * ((4.0 * ((fma((x1 * 3.0), x1, (x2 + x2)) - x1) * (1.0 / fma(x1, x1, 1.0)))) - 6.0))))))));
	} else {
		tmp = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
	}
	return tmp;
}
function code(x1, x2)
	t_0 = Float64(x1 * Float64(x1 * x1))
	t_1 = Float64(x1 * Float64(x1 * 3.0))
	t_2 = Float64(Float64(x1 * x1) + 1.0)
	t_3 = Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2))
	t_4 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2)
	t_5 = Float64(Float64(t_4 * Float64(x1 * 2.0)) * Float64(t_4 - 3.0))
	t_6 = Float64(t_1 * t_4)
	tmp = 0.0
	if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_2 * Float64(t_5 + Float64(Float64(x1 * x1) * Float64(Float64(t_4 * 4.0) - 6.0)))) + t_6) + t_0)) + t_3)) <= Inf)
		tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(t_0 + Float64(t_6 + Float64(t_2 * Float64(t_5 + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * Float64(Float64(fma(Float64(x1 * 3.0), x1, Float64(x2 + x2)) - x1) * Float64(1.0 / fma(x1, x1, 1.0)))) - 6.0)))))))));
	else
		tmp = Float64(x1 + Float64(x1 + Float64(6.0 * Float64(Float64(x1 * x1) * Float64(x1 * x1)))));
	end
	return tmp
end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$5 = N[(N[(t$95$4 * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision] * N[(t$95$4 - 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(t$95$1 * t$95$4), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$2 * N[(t$95$5 + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$4 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$6), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(t$95$3 + N[(x1 + N[(t$95$0 + N[(t$95$6 + N[(t$95$2 * N[(t$95$5 + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * N[(N[(N[(N[(x1 * 3.0), $MachinePrecision] * x1 + N[(x2 + x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] * N[(1.0 / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 + N[(6.0 * N[(N[(x1 * x1), $MachinePrecision] * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := 3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_2}\\
t_4 := \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_2}\\
t_5 := \left(t_4 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t_4 - 3\right)\\
t_6 := t_1 \cdot t_4\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t_2 \cdot \left(t_5 + \left(x1 \cdot x1\right) \cdot \left(t_4 \cdot 4 - 6\right)\right) + t_6\right) + t_0\right)\right) + t_3\right) \leq \infty:\\
\;\;\;\;x1 + \left(t_3 + \left(x1 + \left(t_0 + \left(t_6 + t_2 \cdot \left(t_5 + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \left(\left(\mathsf{fma}\left(x1 \cdot 3, x1, x2 + x2\right) - x1\right) \cdot \frac{1}{\mathsf{fma}\left(x1, x1, 1\right)}\right) - 6\right)\right)\right)\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) < +inf.0

    1. Initial program 99.3%

      \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    2. Step-by-step derivation
      1. fma-def99.3%

        \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{\color{blue}{\mathsf{fma}\left(x1, x1, 1\right)}} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
      2. div-inv99.4%

        \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \color{blue}{\left(\left(\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1\right) \cdot \frac{1}{\mathsf{fma}\left(x1, x1, 1\right)}\right)} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
      3. fma-def99.4%

        \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \left(\left(\color{blue}{\mathsf{fma}\left(3 \cdot x1, x1, 2 \cdot x2\right)} - x1\right) \cdot \frac{1}{\mathsf{fma}\left(x1, x1, 1\right)}\right) - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
      4. count-299.4%

        \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \left(\left(\mathsf{fma}\left(3 \cdot x1, x1, \color{blue}{x2 + x2}\right) - x1\right) \cdot \frac{1}{\mathsf{fma}\left(x1, x1, 1\right)}\right) - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    3. Applied egg-rr99.4%

      \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \color{blue}{\left(\left(\mathsf{fma}\left(3 \cdot x1, x1, x2 + x2\right) - x1\right) \cdot \frac{1}{\mathsf{fma}\left(x1, x1, 1\right)}\right)} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]

    if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))))

    1. Initial program 0.0%

      \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    2. Taylor expanded in x1 around inf 15.5%

      \[\leadsto x1 + \left(\left(\color{blue}{6 \cdot {x1}^{4}} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    3. Step-by-step derivation
      1. *-commutative15.5%

        \[\leadsto x1 + \left(\left(\color{blue}{{x1}^{4} \cdot 6} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    4. Simplified15.5%

      \[\leadsto x1 + \left(\left(\color{blue}{{x1}^{4} \cdot 6} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    5. Taylor expanded in x1 around inf 98.6%

      \[\leadsto x1 + \color{blue}{\left(x1 + 6 \cdot {x1}^{4}\right)} \]
    6. Step-by-step derivation
      1. sqr-pow98.6%

        \[\leadsto x1 + \left(x1 + 6 \cdot \color{blue}{\left({x1}^{\left(\frac{4}{2}\right)} \cdot {x1}^{\left(\frac{4}{2}\right)}\right)}\right) \]
      2. metadata-eval98.6%

        \[\leadsto x1 + \left(x1 + 6 \cdot \left({x1}^{\color{blue}{2}} \cdot {x1}^{\left(\frac{4}{2}\right)}\right)\right) \]
      3. pow298.6%

        \[\leadsto x1 + \left(x1 + 6 \cdot \left(\color{blue}{\left(x1 \cdot x1\right)} \cdot {x1}^{\left(\frac{4}{2}\right)}\right)\right) \]
      4. metadata-eval98.6%

        \[\leadsto x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot {x1}^{\color{blue}{2}}\right)\right) \]
      5. pow298.6%

        \[\leadsto x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \color{blue}{\left(x1 \cdot x1\right)}\right)\right) \]
    7. Applied egg-rr98.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 + \left(\left(x1 + \left(\left(\left(x1 \cdot x1 + 1\right) \cdot \left(\left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} \cdot \left(x1 \cdot 2\right)\right) \cdot \left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} \cdot 4 - 6\right)\right) + \left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \leq \infty:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(\left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 \cdot x1 + 1\right) \cdot \left(\left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} \cdot \left(x1 \cdot 2\right)\right) \cdot \left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \left(\left(\mathsf{fma}\left(x1 \cdot 3, x1, x2 + x2\right) - x1\right) \cdot \frac{1}{\mathsf{fma}\left(x1, x1, 1\right)}\right) - 6\right)\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)\right)\\ \end{array} \]

Alternative 3: 99.4% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 \cdot x1 + 1\\ t_1 := x1 \cdot \left(x1 \cdot 3\right)\\ t_2 := \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_0}\\ t_3 := x1 + \left(\left(x1 + \left(\left(t_0 \cdot \left(\left(t_2 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_2 \cdot 4 - 6\right)\right) + t_1 \cdot t_2\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_0}\right)\\ \mathbf{if}\;t_3 \leq \infty:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (+ (* x1 x1) 1.0))
        (t_1 (* x1 (* x1 3.0)))
        (t_2 (/ (- (+ t_1 (* 2.0 x2)) x1) t_0))
        (t_3
         (+
          x1
          (+
           (+
            x1
            (+
             (+
              (*
               t_0
               (+
                (* (* t_2 (* x1 2.0)) (- t_2 3.0))
                (* (* x1 x1) (- (* t_2 4.0) 6.0))))
              (* t_1 t_2))
             (* x1 (* x1 x1))))
           (* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_0))))))
   (if (<= t_3 INFINITY) t_3 (+ x1 (+ x1 (* 6.0 (* (* x1 x1) (* x1 x1))))))))
double code(double x1, double x2) {
	double t_0 = (x1 * x1) + 1.0;
	double t_1 = x1 * (x1 * 3.0);
	double t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0;
	double t_3 = x1 + ((x1 + (((t_0 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_1 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)));
	double tmp;
	if (t_3 <= ((double) INFINITY)) {
		tmp = t_3;
	} else {
		tmp = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
	}
	return tmp;
}
public static double code(double x1, double x2) {
	double t_0 = (x1 * x1) + 1.0;
	double t_1 = x1 * (x1 * 3.0);
	double t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0;
	double t_3 = x1 + ((x1 + (((t_0 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_1 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)));
	double tmp;
	if (t_3 <= Double.POSITIVE_INFINITY) {
		tmp = t_3;
	} else {
		tmp = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
	}
	return tmp;
}
def code(x1, x2):
	t_0 = (x1 * x1) + 1.0
	t_1 = x1 * (x1 * 3.0)
	t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0
	t_3 = x1 + ((x1 + (((t_0 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_1 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)))
	tmp = 0
	if t_3 <= math.inf:
		tmp = t_3
	else:
		tmp = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))))
	return tmp
function code(x1, x2)
	t_0 = Float64(Float64(x1 * x1) + 1.0)
	t_1 = Float64(x1 * Float64(x1 * 3.0))
	t_2 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_0)
	t_3 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_0 * Float64(Float64(Float64(t_2 * Float64(x1 * 2.0)) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(t_1 * t_2)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_0))))
	tmp = 0.0
	if (t_3 <= Inf)
		tmp = t_3;
	else
		tmp = Float64(x1 + Float64(x1 + Float64(6.0 * Float64(Float64(x1 * x1) * Float64(x1 * x1)))));
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	t_0 = (x1 * x1) + 1.0;
	t_1 = x1 * (x1 * 3.0);
	t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0;
	t_3 = x1 + ((x1 + (((t_0 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_1 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)));
	tmp = 0.0;
	if (t_3 <= Inf)
		tmp = t_3;
	else
		tmp = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$3 = N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$0 * N[(N[(N[(t$95$2 * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, Infinity], t$95$3, N[(x1 + N[(x1 + N[(6.0 * N[(N[(x1 * x1), $MachinePrecision] * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_0}\\
t_3 := x1 + \left(\left(x1 + \left(\left(t_0 \cdot \left(\left(t_2 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_2 \cdot 4 - 6\right)\right) + t_1 \cdot t_2\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_0}\right)\\
\mathbf{if}\;t_3 \leq \infty:\\
\;\;\;\;t_3\\

\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) < +inf.0

    1. Initial program 99.3%

      \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]

    if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))))

    1. Initial program 0.0%

      \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    2. Taylor expanded in x1 around inf 15.5%

      \[\leadsto x1 + \left(\left(\color{blue}{6 \cdot {x1}^{4}} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    3. Step-by-step derivation
      1. *-commutative15.5%

        \[\leadsto x1 + \left(\left(\color{blue}{{x1}^{4} \cdot 6} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    4. Simplified15.5%

      \[\leadsto x1 + \left(\left(\color{blue}{{x1}^{4} \cdot 6} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    5. Taylor expanded in x1 around inf 98.6%

      \[\leadsto x1 + \color{blue}{\left(x1 + 6 \cdot {x1}^{4}\right)} \]
    6. Step-by-step derivation
      1. sqr-pow98.6%

        \[\leadsto x1 + \left(x1 + 6 \cdot \color{blue}{\left({x1}^{\left(\frac{4}{2}\right)} \cdot {x1}^{\left(\frac{4}{2}\right)}\right)}\right) \]
      2. metadata-eval98.6%

        \[\leadsto x1 + \left(x1 + 6 \cdot \left({x1}^{\color{blue}{2}} \cdot {x1}^{\left(\frac{4}{2}\right)}\right)\right) \]
      3. pow298.6%

        \[\leadsto x1 + \left(x1 + 6 \cdot \left(\color{blue}{\left(x1 \cdot x1\right)} \cdot {x1}^{\left(\frac{4}{2}\right)}\right)\right) \]
      4. metadata-eval98.6%

        \[\leadsto x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot {x1}^{\color{blue}{2}}\right)\right) \]
      5. pow298.6%

        \[\leadsto x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \color{blue}{\left(x1 \cdot x1\right)}\right)\right) \]
    7. Applied egg-rr98.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 + \left(\left(x1 + \left(\left(\left(x1 \cdot x1 + 1\right) \cdot \left(\left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} \cdot \left(x1 \cdot 2\right)\right) \cdot \left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} \cdot 4 - 6\right)\right) + \left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \leq \infty:\\ \;\;\;\;x1 + \left(\left(x1 + \left(\left(\left(x1 \cdot x1 + 1\right) \cdot \left(\left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} \cdot \left(x1 \cdot 2\right)\right) \cdot \left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} \cdot 4 - 6\right)\right) + \left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)\right)\\ \end{array} \]

Alternative 4: 98.4% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 \cdot \left(x1 \cdot 3\right)\\ t_1 := x1 \cdot x1 + 1\\ t_2 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\ \mathbf{if}\;x1 \leq -5 \cdot 10^{+102} \lor \neg \left(x1 \leq 5 \cdot 10^{+86}\right):\\ \;\;\;\;x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_1 \cdot \left(\left(t_2 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_2 \cdot 4 - 6\right)\right) + 3 \cdot t_0\right)\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (* x1 (* x1 3.0)))
        (t_1 (+ (* x1 x1) 1.0))
        (t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
   (if (or (<= x1 -5e+102) (not (<= x1 5e+86)))
     (+ x1 (+ x1 (* 6.0 (* (* x1 x1) (* x1 x1)))))
     (+
      x1
      (+
       (* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))
       (+
        x1
        (+
         (* x1 (* x1 x1))
         (+
          (*
           t_1
           (+
            (* (* t_2 (* x1 2.0)) (- t_2 3.0))
            (* (* x1 x1) (- (* t_2 4.0) 6.0))))
          (* 3.0 t_0)))))))))
double code(double x1, double x2) {
	double t_0 = x1 * (x1 * 3.0);
	double t_1 = (x1 * x1) + 1.0;
	double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
	double tmp;
	if ((x1 <= -5e+102) || !(x1 <= 5e+86)) {
		tmp = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
	} else {
		tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_0)))));
	}
	return tmp;
}
real(8) function code(x1, x2)
    real(8), intent (in) :: x1
    real(8), intent (in) :: x2
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_0 = x1 * (x1 * 3.0d0)
    t_1 = (x1 * x1) + 1.0d0
    t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
    if ((x1 <= (-5d+102)) .or. (.not. (x1 <= 5d+86))) then
        tmp = x1 + (x1 + (6.0d0 * ((x1 * x1) * (x1 * x1))))
    else
        tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_2 * (x1 * 2.0d0)) * (t_2 - 3.0d0)) + ((x1 * x1) * ((t_2 * 4.0d0) - 6.0d0)))) + (3.0d0 * t_0)))))
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double t_0 = x1 * (x1 * 3.0);
	double t_1 = (x1 * x1) + 1.0;
	double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
	double tmp;
	if ((x1 <= -5e+102) || !(x1 <= 5e+86)) {
		tmp = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
	} else {
		tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_0)))));
	}
	return tmp;
}
def code(x1, x2):
	t_0 = x1 * (x1 * 3.0)
	t_1 = (x1 * x1) + 1.0
	t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1
	tmp = 0
	if (x1 <= -5e+102) or not (x1 <= 5e+86):
		tmp = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))))
	else:
		tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_0)))))
	return tmp
function code(x1, x2)
	t_0 = Float64(x1 * Float64(x1 * 3.0))
	t_1 = Float64(Float64(x1 * x1) + 1.0)
	t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1)
	tmp = 0.0
	if ((x1 <= -5e+102) || !(x1 <= 5e+86))
		tmp = Float64(x1 + Float64(x1 + Float64(6.0 * Float64(Float64(x1 * x1) * Float64(x1 * x1)))));
	else
		tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_1 * Float64(Float64(Float64(t_2 * Float64(x1 * 2.0)) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(3.0 * t_0))))));
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	t_0 = x1 * (x1 * 3.0);
	t_1 = (x1 * x1) + 1.0;
	t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
	tmp = 0.0;
	if ((x1 <= -5e+102) || ~((x1 <= 5e+86)))
		tmp = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
	else
		tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_0)))));
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[Or[LessEqual[x1, -5e+102], N[Not[LessEqual[x1, 5e+86]], $MachinePrecision]], N[(x1 + N[(x1 + N[(6.0 * N[(N[(x1 * x1), $MachinePrecision] * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 * N[(N[(N[(t$95$2 * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\
\mathbf{if}\;x1 \leq -5 \cdot 10^{+102} \lor \neg \left(x1 \leq 5 \cdot 10^{+86}\right):\\
\;\;\;\;x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_1 \cdot \left(\left(t_2 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_2 \cdot 4 - 6\right)\right) + 3 \cdot t_0\right)\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x1 < -5e102 or 4.9999999999999998e86 < x1

    1. Initial program 18.6%

      \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    2. Taylor expanded in x1 around inf 30.2%

      \[\leadsto x1 + \left(\left(\color{blue}{6 \cdot {x1}^{4}} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    3. Step-by-step derivation
      1. *-commutative30.2%

        \[\leadsto x1 + \left(\left(\color{blue}{{x1}^{4} \cdot 6} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    4. Simplified30.2%

      \[\leadsto x1 + \left(\left(\color{blue}{{x1}^{4} \cdot 6} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    5. Taylor expanded in x1 around inf 98.8%

      \[\leadsto x1 + \color{blue}{\left(x1 + 6 \cdot {x1}^{4}\right)} \]
    6. Step-by-step derivation
      1. sqr-pow98.8%

        \[\leadsto x1 + \left(x1 + 6 \cdot \color{blue}{\left({x1}^{\left(\frac{4}{2}\right)} \cdot {x1}^{\left(\frac{4}{2}\right)}\right)}\right) \]
      2. metadata-eval98.8%

        \[\leadsto x1 + \left(x1 + 6 \cdot \left({x1}^{\color{blue}{2}} \cdot {x1}^{\left(\frac{4}{2}\right)}\right)\right) \]
      3. pow298.8%

        \[\leadsto x1 + \left(x1 + 6 \cdot \left(\color{blue}{\left(x1 \cdot x1\right)} \cdot {x1}^{\left(\frac{4}{2}\right)}\right)\right) \]
      4. metadata-eval98.8%

        \[\leadsto x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot {x1}^{\color{blue}{2}}\right)\right) \]
      5. pow298.8%

        \[\leadsto x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \color{blue}{\left(x1 \cdot x1\right)}\right)\right) \]
    7. Applied egg-rr98.8%

      \[\leadsto x1 + \left(x1 + 6 \cdot \color{blue}{\left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)}\right) \]

    if -5e102 < x1 < 4.9999999999999998e86

    1. Initial program 98.7%

      \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    2. Taylor expanded in x1 around inf 97.9%

      \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \color{blue}{3}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification98.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -5 \cdot 10^{+102} \lor \neg \left(x1 \leq 5 \cdot 10^{+86}\right):\\ \;\;\;\;x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(\left(x1 \cdot x1 + 1\right) \cdot \left(\left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} \cdot \left(x1 \cdot 2\right)\right) \cdot \left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} \cdot 4 - 6\right)\right) + 3 \cdot \left(x1 \cdot \left(x1 \cdot 3\right)\right)\right)\right)\right)\right)\\ \end{array} \]

Alternative 5: 96.6% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 \cdot \left(x1 \cdot 3\right)\\ t_1 := x1 \cdot x1 + 1\\ t_2 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\ \mathbf{if}\;x1 \leq -5.7 \cdot 10^{+102}:\\ \;\;\;\;x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 1.85 \cdot 10^{+53}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_0 \cdot t_2 + t_1 \cdot \left(\left(t_2 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x1 + 6 \cdot {x1}^{4}\right)\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (* x1 (* x1 3.0)))
        (t_1 (+ (* x1 x1) 1.0))
        (t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
   (if (<= x1 -5.7e+102)
     (+ x1 (+ x1 (* 6.0 (* (* x1 x1) (* x1 x1)))))
     (if (<= x1 1.85e+53)
       (+
        x1
        (+
         (* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))
         (+
          x1
          (+
           (* x1 (* x1 x1))
           (+
            (* t_0 t_2)
            (*
             t_1
             (+ (* (* t_2 (* x1 2.0)) (- t_2 3.0)) (* (* x1 x1) 6.0))))))))
       (+ x1 (+ x1 (* 6.0 (pow x1 4.0))))))))
double code(double x1, double x2) {
	double t_0 = x1 * (x1 * 3.0);
	double t_1 = (x1 * x1) + 1.0;
	double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
	double tmp;
	if (x1 <= -5.7e+102) {
		tmp = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
	} else if (x1 <= 1.85e+53) {
		tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * 6.0)))))));
	} else {
		tmp = x1 + (x1 + (6.0 * pow(x1, 4.0)));
	}
	return tmp;
}
real(8) function code(x1, x2)
    real(8), intent (in) :: x1
    real(8), intent (in) :: x2
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_0 = x1 * (x1 * 3.0d0)
    t_1 = (x1 * x1) + 1.0d0
    t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
    if (x1 <= (-5.7d+102)) then
        tmp = x1 + (x1 + (6.0d0 * ((x1 * x1) * (x1 * x1))))
    else if (x1 <= 1.85d+53) then
        tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((t_2 * (x1 * 2.0d0)) * (t_2 - 3.0d0)) + ((x1 * x1) * 6.0d0)))))))
    else
        tmp = x1 + (x1 + (6.0d0 * (x1 ** 4.0d0)))
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double t_0 = x1 * (x1 * 3.0);
	double t_1 = (x1 * x1) + 1.0;
	double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
	double tmp;
	if (x1 <= -5.7e+102) {
		tmp = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
	} else if (x1 <= 1.85e+53) {
		tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * 6.0)))))));
	} else {
		tmp = x1 + (x1 + (6.0 * Math.pow(x1, 4.0)));
	}
	return tmp;
}
def code(x1, x2):
	t_0 = x1 * (x1 * 3.0)
	t_1 = (x1 * x1) + 1.0
	t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1
	tmp = 0
	if x1 <= -5.7e+102:
		tmp = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))))
	elif x1 <= 1.85e+53:
		tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * 6.0)))))))
	else:
		tmp = x1 + (x1 + (6.0 * math.pow(x1, 4.0)))
	return tmp
function code(x1, x2)
	t_0 = Float64(x1 * Float64(x1 * 3.0))
	t_1 = Float64(Float64(x1 * x1) + 1.0)
	t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1)
	tmp = 0.0
	if (x1 <= -5.7e+102)
		tmp = Float64(x1 + Float64(x1 + Float64(6.0 * Float64(Float64(x1 * x1) * Float64(x1 * x1)))));
	elseif (x1 <= 1.85e+53)
		tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_0 * t_2) + Float64(t_1 * Float64(Float64(Float64(t_2 * Float64(x1 * 2.0)) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * 6.0))))))));
	else
		tmp = Float64(x1 + Float64(x1 + Float64(6.0 * (x1 ^ 4.0))));
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	t_0 = x1 * (x1 * 3.0);
	t_1 = (x1 * x1) + 1.0;
	t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
	tmp = 0.0;
	if (x1 <= -5.7e+102)
		tmp = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
	elseif (x1 <= 1.85e+53)
		tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * 6.0)))))));
	else
		tmp = x1 + (x1 + (6.0 * (x1 ^ 4.0)));
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[x1, -5.7e+102], N[(x1 + N[(x1 + N[(6.0 * N[(N[(x1 * x1), $MachinePrecision] * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.85e+53], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$0 * t$95$2), $MachinePrecision] + N[(t$95$1 * N[(N[(N[(t$95$2 * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\
\mathbf{if}\;x1 \leq -5.7 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 1.85 \cdot 10^{+53}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_0 \cdot t_2 + t_1 \cdot \left(\left(t_2 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 + 6 \cdot {x1}^{4}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x1 < -5.6999999999999999e102

    1. Initial program 2.4%

      \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    2. Taylor expanded in x1 around inf 23.8%

      \[\leadsto x1 + \left(\left(\color{blue}{6 \cdot {x1}^{4}} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    3. Step-by-step derivation
      1. *-commutative23.8%

        \[\leadsto x1 + \left(\left(\color{blue}{{x1}^{4} \cdot 6} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    4. Simplified23.8%

      \[\leadsto x1 + \left(\left(\color{blue}{{x1}^{4} \cdot 6} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    5. Taylor expanded in x1 around inf 97.6%

      \[\leadsto x1 + \color{blue}{\left(x1 + 6 \cdot {x1}^{4}\right)} \]
    6. Step-by-step derivation
      1. sqr-pow97.6%

        \[\leadsto x1 + \left(x1 + 6 \cdot \color{blue}{\left({x1}^{\left(\frac{4}{2}\right)} \cdot {x1}^{\left(\frac{4}{2}\right)}\right)}\right) \]
      2. metadata-eval97.6%

        \[\leadsto x1 + \left(x1 + 6 \cdot \left({x1}^{\color{blue}{2}} \cdot {x1}^{\left(\frac{4}{2}\right)}\right)\right) \]
      3. pow297.6%

        \[\leadsto x1 + \left(x1 + 6 \cdot \left(\color{blue}{\left(x1 \cdot x1\right)} \cdot {x1}^{\left(\frac{4}{2}\right)}\right)\right) \]
      4. metadata-eval97.6%

        \[\leadsto x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot {x1}^{\color{blue}{2}}\right)\right) \]
      5. pow297.6%

        \[\leadsto x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \color{blue}{\left(x1 \cdot x1\right)}\right)\right) \]
    7. Applied egg-rr97.6%

      \[\leadsto x1 + \left(x1 + 6 \cdot \color{blue}{\left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)}\right) \]

    if -5.6999999999999999e102 < x1 < 1.85e53

    1. Initial program 98.7%

      \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    2. Taylor expanded in x1 around inf 96.8%

      \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \color{blue}{3} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]

    if 1.85e53 < x1

    1. Initial program 41.8%

      \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    2. Taylor expanded in x1 around inf 40.6%

      \[\leadsto x1 + \left(\left(\color{blue}{6 \cdot {x1}^{4}} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    3. Step-by-step derivation
      1. *-commutative40.6%

        \[\leadsto x1 + \left(\left(\color{blue}{{x1}^{4} \cdot 6} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    4. Simplified40.6%

      \[\leadsto x1 + \left(\left(\color{blue}{{x1}^{4} \cdot 6} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    5. Taylor expanded in x1 around inf 96.6%

      \[\leadsto x1 + \color{blue}{\left(x1 + 6 \cdot {x1}^{4}\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification96.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -5.7 \cdot 10^{+102}:\\ \;\;\;\;x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 1.85 \cdot 10^{+53}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(\left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 \cdot x1 + 1\right) \cdot \left(\left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} \cdot \left(x1 \cdot 2\right)\right) \cdot \left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x1 + 6 \cdot {x1}^{4}\right)\\ \end{array} \]

Alternative 6: 98.9% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 \cdot \left(x1 \cdot x1\right)\\ t_1 := x1 \cdot \left(x1 \cdot 3\right)\\ t_2 := x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)\right)\\ t_3 := x1 \cdot x1 + 1\\ t_4 := \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_3}\\ t_5 := t_3 \cdot \left(\left(t_4 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t_4 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_4 \cdot 4 - 6\right)\right)\\ t_6 := 3 \cdot \left(x2 \cdot -2\right)\\ \mathbf{if}\;x1 \leq -5.7 \cdot 10^{+102}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x1 \leq -0.0165:\\ \;\;\;\;x1 + \left(\left(x1 + \left(t_0 + \left(t_5 + 3 \cdot t_1\right)\right)\right) + t_6\right)\\ \mathbf{elif}\;x1 \leq 2 \cdot 10^{-22}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_3} + \left(x1 + 4 \cdot \left(2 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 5 \cdot 10^{+85}:\\ \;\;\;\;x1 + \left(t_6 + \left(x1 + \left(t_0 + \left(t_5 + t_1 \cdot \left(3 + \frac{-1}{x1}\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (* x1 (* x1 x1)))
        (t_1 (* x1 (* x1 3.0)))
        (t_2 (+ x1 (+ x1 (* 6.0 (* (* x1 x1) (* x1 x1))))))
        (t_3 (+ (* x1 x1) 1.0))
        (t_4 (/ (- (+ t_1 (* 2.0 x2)) x1) t_3))
        (t_5
         (*
          t_3
          (+
           (* (* t_4 (* x1 2.0)) (- t_4 3.0))
           (* (* x1 x1) (- (* t_4 4.0) 6.0)))))
        (t_6 (* 3.0 (* x2 -2.0))))
   (if (<= x1 -5.7e+102)
     t_2
     (if (<= x1 -0.0165)
       (+ x1 (+ (+ x1 (+ t_0 (+ t_5 (* 3.0 t_1)))) t_6))
       (if (<= x1 2e-22)
         (+
          x1
          (+
           (* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_3))
           (+ x1 (* 4.0 (* 2.0 (* x2 (* x1 x2)))))))
         (if (<= x1 5e+85)
           (+ x1 (+ t_6 (+ x1 (+ t_0 (+ t_5 (* t_1 (+ 3.0 (/ -1.0 x1))))))))
           t_2))))))
double code(double x1, double x2) {
	double t_0 = x1 * (x1 * x1);
	double t_1 = x1 * (x1 * 3.0);
	double t_2 = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
	double t_3 = (x1 * x1) + 1.0;
	double t_4 = ((t_1 + (2.0 * x2)) - x1) / t_3;
	double t_5 = t_3 * (((t_4 * (x1 * 2.0)) * (t_4 - 3.0)) + ((x1 * x1) * ((t_4 * 4.0) - 6.0)));
	double t_6 = 3.0 * (x2 * -2.0);
	double tmp;
	if (x1 <= -5.7e+102) {
		tmp = t_2;
	} else if (x1 <= -0.0165) {
		tmp = x1 + ((x1 + (t_0 + (t_5 + (3.0 * t_1)))) + t_6);
	} else if (x1 <= 2e-22) {
		tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3)) + (x1 + (4.0 * (2.0 * (x2 * (x1 * x2))))));
	} else if (x1 <= 5e+85) {
		tmp = x1 + (t_6 + (x1 + (t_0 + (t_5 + (t_1 * (3.0 + (-1.0 / x1)))))));
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x1, x2)
    real(8), intent (in) :: x1
    real(8), intent (in) :: x2
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: t_4
    real(8) :: t_5
    real(8) :: t_6
    real(8) :: tmp
    t_0 = x1 * (x1 * x1)
    t_1 = x1 * (x1 * 3.0d0)
    t_2 = x1 + (x1 + (6.0d0 * ((x1 * x1) * (x1 * x1))))
    t_3 = (x1 * x1) + 1.0d0
    t_4 = ((t_1 + (2.0d0 * x2)) - x1) / t_3
    t_5 = t_3 * (((t_4 * (x1 * 2.0d0)) * (t_4 - 3.0d0)) + ((x1 * x1) * ((t_4 * 4.0d0) - 6.0d0)))
    t_6 = 3.0d0 * (x2 * (-2.0d0))
    if (x1 <= (-5.7d+102)) then
        tmp = t_2
    else if (x1 <= (-0.0165d0)) then
        tmp = x1 + ((x1 + (t_0 + (t_5 + (3.0d0 * t_1)))) + t_6)
    else if (x1 <= 2d-22) then
        tmp = x1 + ((3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_3)) + (x1 + (4.0d0 * (2.0d0 * (x2 * (x1 * x2))))))
    else if (x1 <= 5d+85) then
        tmp = x1 + (t_6 + (x1 + (t_0 + (t_5 + (t_1 * (3.0d0 + ((-1.0d0) / x1)))))))
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double t_0 = x1 * (x1 * x1);
	double t_1 = x1 * (x1 * 3.0);
	double t_2 = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
	double t_3 = (x1 * x1) + 1.0;
	double t_4 = ((t_1 + (2.0 * x2)) - x1) / t_3;
	double t_5 = t_3 * (((t_4 * (x1 * 2.0)) * (t_4 - 3.0)) + ((x1 * x1) * ((t_4 * 4.0) - 6.0)));
	double t_6 = 3.0 * (x2 * -2.0);
	double tmp;
	if (x1 <= -5.7e+102) {
		tmp = t_2;
	} else if (x1 <= -0.0165) {
		tmp = x1 + ((x1 + (t_0 + (t_5 + (3.0 * t_1)))) + t_6);
	} else if (x1 <= 2e-22) {
		tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3)) + (x1 + (4.0 * (2.0 * (x2 * (x1 * x2))))));
	} else if (x1 <= 5e+85) {
		tmp = x1 + (t_6 + (x1 + (t_0 + (t_5 + (t_1 * (3.0 + (-1.0 / x1)))))));
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x1, x2):
	t_0 = x1 * (x1 * x1)
	t_1 = x1 * (x1 * 3.0)
	t_2 = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))))
	t_3 = (x1 * x1) + 1.0
	t_4 = ((t_1 + (2.0 * x2)) - x1) / t_3
	t_5 = t_3 * (((t_4 * (x1 * 2.0)) * (t_4 - 3.0)) + ((x1 * x1) * ((t_4 * 4.0) - 6.0)))
	t_6 = 3.0 * (x2 * -2.0)
	tmp = 0
	if x1 <= -5.7e+102:
		tmp = t_2
	elif x1 <= -0.0165:
		tmp = x1 + ((x1 + (t_0 + (t_5 + (3.0 * t_1)))) + t_6)
	elif x1 <= 2e-22:
		tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3)) + (x1 + (4.0 * (2.0 * (x2 * (x1 * x2))))))
	elif x1 <= 5e+85:
		tmp = x1 + (t_6 + (x1 + (t_0 + (t_5 + (t_1 * (3.0 + (-1.0 / x1)))))))
	else:
		tmp = t_2
	return tmp
function code(x1, x2)
	t_0 = Float64(x1 * Float64(x1 * x1))
	t_1 = Float64(x1 * Float64(x1 * 3.0))
	t_2 = Float64(x1 + Float64(x1 + Float64(6.0 * Float64(Float64(x1 * x1) * Float64(x1 * x1)))))
	t_3 = Float64(Float64(x1 * x1) + 1.0)
	t_4 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_3)
	t_5 = Float64(t_3 * Float64(Float64(Float64(t_4 * Float64(x1 * 2.0)) * Float64(t_4 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_4 * 4.0) - 6.0))))
	t_6 = Float64(3.0 * Float64(x2 * -2.0))
	tmp = 0.0
	if (x1 <= -5.7e+102)
		tmp = t_2;
	elseif (x1 <= -0.0165)
		tmp = Float64(x1 + Float64(Float64(x1 + Float64(t_0 + Float64(t_5 + Float64(3.0 * t_1)))) + t_6));
	elseif (x1 <= 2e-22)
		tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_3)) + Float64(x1 + Float64(4.0 * Float64(2.0 * Float64(x2 * Float64(x1 * x2)))))));
	elseif (x1 <= 5e+85)
		tmp = Float64(x1 + Float64(t_6 + Float64(x1 + Float64(t_0 + Float64(t_5 + Float64(t_1 * Float64(3.0 + Float64(-1.0 / x1))))))));
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	t_0 = x1 * (x1 * x1);
	t_1 = x1 * (x1 * 3.0);
	t_2 = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
	t_3 = (x1 * x1) + 1.0;
	t_4 = ((t_1 + (2.0 * x2)) - x1) / t_3;
	t_5 = t_3 * (((t_4 * (x1 * 2.0)) * (t_4 - 3.0)) + ((x1 * x1) * ((t_4 * 4.0) - 6.0)));
	t_6 = 3.0 * (x2 * -2.0);
	tmp = 0.0;
	if (x1 <= -5.7e+102)
		tmp = t_2;
	elseif (x1 <= -0.0165)
		tmp = x1 + ((x1 + (t_0 + (t_5 + (3.0 * t_1)))) + t_6);
	elseif (x1 <= 2e-22)
		tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3)) + (x1 + (4.0 * (2.0 * (x2 * (x1 * x2))))));
	elseif (x1 <= 5e+85)
		tmp = x1 + (t_6 + (x1 + (t_0 + (t_5 + (t_1 * (3.0 + (-1.0 / x1)))))));
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 + N[(x1 + N[(6.0 * N[(N[(x1 * x1), $MachinePrecision] * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$3 * N[(N[(N[(t$95$4 * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision] * N[(t$95$4 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$4 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.7e+102], t$95$2, If[LessEqual[x1, -0.0165], N[(x1 + N[(N[(x1 + N[(t$95$0 + N[(t$95$5 + N[(3.0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$6), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2e-22], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(2.0 * N[(x2 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5e+85], N[(x1 + N[(t$95$6 + N[(x1 + N[(t$95$0 + N[(t$95$5 + N[(t$95$1 * N[(3.0 + N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)\right)\\
t_3 := x1 \cdot x1 + 1\\
t_4 := \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_3}\\
t_5 := t_3 \cdot \left(\left(t_4 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t_4 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_4 \cdot 4 - 6\right)\right)\\
t_6 := 3 \cdot \left(x2 \cdot -2\right)\\
\mathbf{if}\;x1 \leq -5.7 \cdot 10^{+102}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;x1 \leq -0.0165:\\
\;\;\;\;x1 + \left(\left(x1 + \left(t_0 + \left(t_5 + 3 \cdot t_1\right)\right)\right) + t_6\right)\\

\mathbf{elif}\;x1 \leq 2 \cdot 10^{-22}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_3} + \left(x1 + 4 \cdot \left(2 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 5 \cdot 10^{+85}:\\
\;\;\;\;x1 + \left(t_6 + \left(x1 + \left(t_0 + \left(t_5 + t_1 \cdot \left(3 + \frac{-1}{x1}\right)\right)\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x1 < -5.6999999999999999e102 or 5.0000000000000001e85 < x1

    1. Initial program 18.6%

      \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    2. Taylor expanded in x1 around inf 30.2%

      \[\leadsto x1 + \left(\left(\color{blue}{6 \cdot {x1}^{4}} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    3. Step-by-step derivation
      1. *-commutative30.2%

        \[\leadsto x1 + \left(\left(\color{blue}{{x1}^{4} \cdot 6} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    4. Simplified30.2%

      \[\leadsto x1 + \left(\left(\color{blue}{{x1}^{4} \cdot 6} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    5. Taylor expanded in x1 around inf 98.8%

      \[\leadsto x1 + \color{blue}{\left(x1 + 6 \cdot {x1}^{4}\right)} \]
    6. Step-by-step derivation
      1. sqr-pow98.8%

        \[\leadsto x1 + \left(x1 + 6 \cdot \color{blue}{\left({x1}^{\left(\frac{4}{2}\right)} \cdot {x1}^{\left(\frac{4}{2}\right)}\right)}\right) \]
      2. metadata-eval98.8%

        \[\leadsto x1 + \left(x1 + 6 \cdot \left({x1}^{\color{blue}{2}} \cdot {x1}^{\left(\frac{4}{2}\right)}\right)\right) \]
      3. pow298.8%

        \[\leadsto x1 + \left(x1 + 6 \cdot \left(\color{blue}{\left(x1 \cdot x1\right)} \cdot {x1}^{\left(\frac{4}{2}\right)}\right)\right) \]
      4. metadata-eval98.8%

        \[\leadsto x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot {x1}^{\color{blue}{2}}\right)\right) \]
      5. pow298.8%

        \[\leadsto x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \color{blue}{\left(x1 \cdot x1\right)}\right)\right) \]
    7. Applied egg-rr98.8%

      \[\leadsto x1 + \left(x1 + 6 \cdot \color{blue}{\left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)}\right) \]

    if -5.6999999999999999e102 < x1 < -0.016500000000000001

    1. Initial program 99.4%

      \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    2. Taylor expanded in x1 around 0 99.4%

      \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \color{blue}{\left(-2 \cdot x2\right)}\right) \]
    3. Step-by-step derivation
      1. *-commutative99.4%

        \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \color{blue}{\left(x2 \cdot -2\right)}\right) \]
    4. Simplified99.4%

      \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \color{blue}{\left(x2 \cdot -2\right)}\right) \]
    5. Taylor expanded in x1 around inf 99.4%

      \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \color{blue}{3}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \left(x2 \cdot -2\right)\right) \]

    if -0.016500000000000001 < x1 < 2.0000000000000001e-22

    1. Initial program 98.5%

      \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    2. Taylor expanded in x1 around 0 89.2%

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    3. Taylor expanded in x2 around inf 89.2%

      \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(2 \cdot \left(x1 \cdot {x2}^{2}\right)\right)} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    4. Step-by-step derivation
      1. *-commutative89.0%

        \[\leadsto x1 + \left(\left(4 \cdot \left(2 \cdot \color{blue}{\left({x2}^{2} \cdot x1\right)}\right) + x1\right) + \left(-6 \cdot x2 + -3 \cdot x1\right)\right) \]
      2. unpow289.0%

        \[\leadsto x1 + \left(\left(4 \cdot \left(2 \cdot \left(\color{blue}{\left(x2 \cdot x2\right)} \cdot x1\right)\right) + x1\right) + \left(-6 \cdot x2 + -3 \cdot x1\right)\right) \]
      3. associate-*l*98.3%

        \[\leadsto x1 + \left(\left(4 \cdot \left(2 \cdot \color{blue}{\left(x2 \cdot \left(x2 \cdot x1\right)\right)}\right) + x1\right) + \left(-6 \cdot x2 + -3 \cdot x1\right)\right) \]
    5. Simplified98.5%

      \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(2 \cdot \left(x2 \cdot \left(x2 \cdot x1\right)\right)\right)} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]

    if 2.0000000000000001e-22 < x1 < 5.0000000000000001e85

    1. Initial program 98.9%

      \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    2. Taylor expanded in x1 around 0 91.8%

      \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \color{blue}{\left(-2 \cdot x2\right)}\right) \]
    3. Step-by-step derivation
      1. *-commutative91.8%

        \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \color{blue}{\left(x2 \cdot -2\right)}\right) \]
    4. Simplified91.8%

      \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \color{blue}{\left(x2 \cdot -2\right)}\right) \]
    5. Taylor expanded in x1 around inf 98.9%

      \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \color{blue}{\left(3 - \frac{1}{x1}\right)}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \left(x2 \cdot -2\right)\right) \]
  3. Recombined 4 regimes into one program.
  4. Final simplification98.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -5.7 \cdot 10^{+102}:\\ \;\;\;\;x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)\right)\\ \mathbf{elif}\;x1 \leq -0.0165:\\ \;\;\;\;x1 + \left(\left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(\left(x1 \cdot x1 + 1\right) \cdot \left(\left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} \cdot \left(x1 \cdot 2\right)\right) \cdot \left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} \cdot 4 - 6\right)\right) + 3 \cdot \left(x1 \cdot \left(x1 \cdot 3\right)\right)\right)\right)\right) + 3 \cdot \left(x2 \cdot -2\right)\right)\\ \mathbf{elif}\;x1 \leq 2 \cdot 10^{-22}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + 4 \cdot \left(2 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 5 \cdot 10^{+85}:\\ \;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2\right) + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(\left(x1 \cdot x1 + 1\right) \cdot \left(\left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} \cdot \left(x1 \cdot 2\right)\right) \cdot \left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} \cdot 4 - 6\right)\right) + \left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \left(3 + \frac{-1}{x1}\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)\right)\\ \end{array} \]

Alternative 7: 98.5% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 \cdot \left(x1 \cdot 3\right)\\ t_1 := x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)\right)\\ t_2 := x1 \cdot x1 + 1\\ t_3 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_2}\\ t_4 := x1 + \left(\left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_2 \cdot \left(\left(t_3 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_3 \cdot 4 - 6\right)\right) + 3 \cdot t_0\right)\right)\right) + 3 \cdot \left(x2 \cdot -2\right)\right)\\ \mathbf{if}\;x1 \leq -5 \cdot 10^{+102}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x1 \leq -0.004:\\ \;\;\;\;t_4\\ \mathbf{elif}\;x1 \leq 1.16 \cdot 10^{-7}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_2} + \left(x1 + 4 \cdot \left(2 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 3.6 \cdot 10^{+86}:\\ \;\;\;\;t_4\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (* x1 (* x1 3.0)))
        (t_1 (+ x1 (+ x1 (* 6.0 (* (* x1 x1) (* x1 x1))))))
        (t_2 (+ (* x1 x1) 1.0))
        (t_3 (/ (- (+ t_0 (* 2.0 x2)) x1) t_2))
        (t_4
         (+
          x1
          (+
           (+
            x1
            (+
             (* x1 (* x1 x1))
             (+
              (*
               t_2
               (+
                (* (* t_3 (* x1 2.0)) (- t_3 3.0))
                (* (* x1 x1) (- (* t_3 4.0) 6.0))))
              (* 3.0 t_0))))
           (* 3.0 (* x2 -2.0))))))
   (if (<= x1 -5e+102)
     t_1
     (if (<= x1 -0.004)
       t_4
       (if (<= x1 1.16e-7)
         (+
          x1
          (+
           (* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_2))
           (+ x1 (* 4.0 (* 2.0 (* x2 (* x1 x2)))))))
         (if (<= x1 3.6e+86) t_4 t_1))))))
double code(double x1, double x2) {
	double t_0 = x1 * (x1 * 3.0);
	double t_1 = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
	double t_2 = (x1 * x1) + 1.0;
	double t_3 = ((t_0 + (2.0 * x2)) - x1) / t_2;
	double t_4 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_2 * (((t_3 * (x1 * 2.0)) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (3.0 * t_0)))) + (3.0 * (x2 * -2.0)));
	double tmp;
	if (x1 <= -5e+102) {
		tmp = t_1;
	} else if (x1 <= -0.004) {
		tmp = t_4;
	} else if (x1 <= 1.16e-7) {
		tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)) + (x1 + (4.0 * (2.0 * (x2 * (x1 * x2))))));
	} else if (x1 <= 3.6e+86) {
		tmp = t_4;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x1, x2)
    real(8), intent (in) :: x1
    real(8), intent (in) :: x2
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: t_4
    real(8) :: tmp
    t_0 = x1 * (x1 * 3.0d0)
    t_1 = x1 + (x1 + (6.0d0 * ((x1 * x1) * (x1 * x1))))
    t_2 = (x1 * x1) + 1.0d0
    t_3 = ((t_0 + (2.0d0 * x2)) - x1) / t_2
    t_4 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_2 * (((t_3 * (x1 * 2.0d0)) * (t_3 - 3.0d0)) + ((x1 * x1) * ((t_3 * 4.0d0) - 6.0d0)))) + (3.0d0 * t_0)))) + (3.0d0 * (x2 * (-2.0d0))))
    if (x1 <= (-5d+102)) then
        tmp = t_1
    else if (x1 <= (-0.004d0)) then
        tmp = t_4
    else if (x1 <= 1.16d-7) then
        tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_2)) + (x1 + (4.0d0 * (2.0d0 * (x2 * (x1 * x2))))))
    else if (x1 <= 3.6d+86) then
        tmp = t_4
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double t_0 = x1 * (x1 * 3.0);
	double t_1 = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
	double t_2 = (x1 * x1) + 1.0;
	double t_3 = ((t_0 + (2.0 * x2)) - x1) / t_2;
	double t_4 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_2 * (((t_3 * (x1 * 2.0)) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (3.0 * t_0)))) + (3.0 * (x2 * -2.0)));
	double tmp;
	if (x1 <= -5e+102) {
		tmp = t_1;
	} else if (x1 <= -0.004) {
		tmp = t_4;
	} else if (x1 <= 1.16e-7) {
		tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)) + (x1 + (4.0 * (2.0 * (x2 * (x1 * x2))))));
	} else if (x1 <= 3.6e+86) {
		tmp = t_4;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x1, x2):
	t_0 = x1 * (x1 * 3.0)
	t_1 = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))))
	t_2 = (x1 * x1) + 1.0
	t_3 = ((t_0 + (2.0 * x2)) - x1) / t_2
	t_4 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_2 * (((t_3 * (x1 * 2.0)) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (3.0 * t_0)))) + (3.0 * (x2 * -2.0)))
	tmp = 0
	if x1 <= -5e+102:
		tmp = t_1
	elif x1 <= -0.004:
		tmp = t_4
	elif x1 <= 1.16e-7:
		tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)) + (x1 + (4.0 * (2.0 * (x2 * (x1 * x2))))))
	elif x1 <= 3.6e+86:
		tmp = t_4
	else:
		tmp = t_1
	return tmp
function code(x1, x2)
	t_0 = Float64(x1 * Float64(x1 * 3.0))
	t_1 = Float64(x1 + Float64(x1 + Float64(6.0 * Float64(Float64(x1 * x1) * Float64(x1 * x1)))))
	t_2 = Float64(Float64(x1 * x1) + 1.0)
	t_3 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_2)
	t_4 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_2 * Float64(Float64(Float64(t_3 * Float64(x1 * 2.0)) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)))) + Float64(3.0 * t_0)))) + Float64(3.0 * Float64(x2 * -2.0))))
	tmp = 0.0
	if (x1 <= -5e+102)
		tmp = t_1;
	elseif (x1 <= -0.004)
		tmp = t_4;
	elseif (x1 <= 1.16e-7)
		tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_2)) + Float64(x1 + Float64(4.0 * Float64(2.0 * Float64(x2 * Float64(x1 * x2)))))));
	elseif (x1 <= 3.6e+86)
		tmp = t_4;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	t_0 = x1 * (x1 * 3.0);
	t_1 = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
	t_2 = (x1 * x1) + 1.0;
	t_3 = ((t_0 + (2.0 * x2)) - x1) / t_2;
	t_4 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_2 * (((t_3 * (x1 * 2.0)) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (3.0 * t_0)))) + (3.0 * (x2 * -2.0)));
	tmp = 0.0;
	if (x1 <= -5e+102)
		tmp = t_1;
	elseif (x1 <= -0.004)
		tmp = t_4;
	elseif (x1 <= 1.16e-7)
		tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)) + (x1 + (4.0 * (2.0 * (x2 * (x1 * x2))))));
	elseif (x1 <= 3.6e+86)
		tmp = t_4;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(x1 + N[(6.0 * N[(N[(x1 * x1), $MachinePrecision] * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 * N[(N[(N[(t$95$3 * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5e+102], t$95$1, If[LessEqual[x1, -0.004], t$95$4, If[LessEqual[x1, 1.16e-7], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(2.0 * N[(x2 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 3.6e+86], t$95$4, t$95$1]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_2}\\
t_4 := x1 + \left(\left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_2 \cdot \left(\left(t_3 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_3 \cdot 4 - 6\right)\right) + 3 \cdot t_0\right)\right)\right) + 3 \cdot \left(x2 \cdot -2\right)\right)\\
\mathbf{if}\;x1 \leq -5 \cdot 10^{+102}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x1 \leq -0.004:\\
\;\;\;\;t_4\\

\mathbf{elif}\;x1 \leq 1.16 \cdot 10^{-7}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_2} + \left(x1 + 4 \cdot \left(2 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 3.6 \cdot 10^{+86}:\\
\;\;\;\;t_4\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x1 < -5e102 or 3.60000000000000005e86 < x1

    1. Initial program 18.6%

      \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    2. Taylor expanded in x1 around inf 30.2%

      \[\leadsto x1 + \left(\left(\color{blue}{6 \cdot {x1}^{4}} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    3. Step-by-step derivation
      1. *-commutative30.2%

        \[\leadsto x1 + \left(\left(\color{blue}{{x1}^{4} \cdot 6} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    4. Simplified30.2%

      \[\leadsto x1 + \left(\left(\color{blue}{{x1}^{4} \cdot 6} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    5. Taylor expanded in x1 around inf 98.8%

      \[\leadsto x1 + \color{blue}{\left(x1 + 6 \cdot {x1}^{4}\right)} \]
    6. Step-by-step derivation
      1. sqr-pow98.8%

        \[\leadsto x1 + \left(x1 + 6 \cdot \color{blue}{\left({x1}^{\left(\frac{4}{2}\right)} \cdot {x1}^{\left(\frac{4}{2}\right)}\right)}\right) \]
      2. metadata-eval98.8%

        \[\leadsto x1 + \left(x1 + 6 \cdot \left({x1}^{\color{blue}{2}} \cdot {x1}^{\left(\frac{4}{2}\right)}\right)\right) \]
      3. pow298.8%

        \[\leadsto x1 + \left(x1 + 6 \cdot \left(\color{blue}{\left(x1 \cdot x1\right)} \cdot {x1}^{\left(\frac{4}{2}\right)}\right)\right) \]
      4. metadata-eval98.8%

        \[\leadsto x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot {x1}^{\color{blue}{2}}\right)\right) \]
      5. pow298.8%

        \[\leadsto x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \color{blue}{\left(x1 \cdot x1\right)}\right)\right) \]
    7. Applied egg-rr98.8%

      \[\leadsto x1 + \left(x1 + 6 \cdot \color{blue}{\left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)}\right) \]

    if -5e102 < x1 < -0.0040000000000000001 or 1.1600000000000001e-7 < x1 < 3.60000000000000005e86

    1. Initial program 99.0%

      \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    2. Taylor expanded in x1 around 0 97.3%

      \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \color{blue}{\left(-2 \cdot x2\right)}\right) \]
    3. Step-by-step derivation
      1. *-commutative97.3%

        \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \color{blue}{\left(x2 \cdot -2\right)}\right) \]
    4. Simplified97.3%

      \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \color{blue}{\left(x2 \cdot -2\right)}\right) \]
    5. Taylor expanded in x1 around inf 96.8%

      \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \color{blue}{3}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \left(x2 \cdot -2\right)\right) \]

    if -0.0040000000000000001 < x1 < 1.1600000000000001e-7

    1. Initial program 98.6%

      \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    2. Taylor expanded in x1 around 0 89.4%

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    3. Taylor expanded in x2 around inf 89.4%

      \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(2 \cdot \left(x1 \cdot {x2}^{2}\right)\right)} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    4. Step-by-step derivation
      1. *-commutative89.0%

        \[\leadsto x1 + \left(\left(4 \cdot \left(2 \cdot \color{blue}{\left({x2}^{2} \cdot x1\right)}\right) + x1\right) + \left(-6 \cdot x2 + -3 \cdot x1\right)\right) \]
      2. unpow289.0%

        \[\leadsto x1 + \left(\left(4 \cdot \left(2 \cdot \left(\color{blue}{\left(x2 \cdot x2\right)} \cdot x1\right)\right) + x1\right) + \left(-6 \cdot x2 + -3 \cdot x1\right)\right) \]
      3. associate-*l*98.1%

        \[\leadsto x1 + \left(\left(4 \cdot \left(2 \cdot \color{blue}{\left(x2 \cdot \left(x2 \cdot x1\right)\right)}\right) + x1\right) + \left(-6 \cdot x2 + -3 \cdot x1\right)\right) \]
    5. Simplified98.6%

      \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(2 \cdot \left(x2 \cdot \left(x2 \cdot x1\right)\right)\right)} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification98.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -5 \cdot 10^{+102}:\\ \;\;\;\;x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)\right)\\ \mathbf{elif}\;x1 \leq -0.004:\\ \;\;\;\;x1 + \left(\left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(\left(x1 \cdot x1 + 1\right) \cdot \left(\left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} \cdot \left(x1 \cdot 2\right)\right) \cdot \left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} \cdot 4 - 6\right)\right) + 3 \cdot \left(x1 \cdot \left(x1 \cdot 3\right)\right)\right)\right)\right) + 3 \cdot \left(x2 \cdot -2\right)\right)\\ \mathbf{elif}\;x1 \leq 1.16 \cdot 10^{-7}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + 4 \cdot \left(2 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 3.6 \cdot 10^{+86}:\\ \;\;\;\;x1 + \left(\left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(\left(x1 \cdot x1 + 1\right) \cdot \left(\left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} \cdot \left(x1 \cdot 2\right)\right) \cdot \left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} \cdot 4 - 6\right)\right) + 3 \cdot \left(x1 \cdot \left(x1 \cdot 3\right)\right)\right)\right)\right) + 3 \cdot \left(x2 \cdot -2\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)\right)\\ \end{array} \]

Alternative 8: 94.8% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 \cdot x1 + 1\\ t_1 := x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)\right)\\ t_2 := x1 \cdot \left(x1 \cdot 3\right)\\ t_3 := \frac{\left(t_2 + 2 \cdot x2\right) - x1}{t_0}\\ \mathbf{if}\;x1 \leq -33000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x1 \leq 1.16 \cdot 10^{-7}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(t_2 - 2 \cdot x2\right) - x1}{t_0} + \left(x1 + 4 \cdot \left(2 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 1.85 \cdot 10^{+53}:\\ \;\;\;\;x1 + \left(\left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_2 \cdot t_3 + t_0 \cdot \left(\left(t_3 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t_3 - 3\right) + \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right) + 3 \cdot \left(x2 \cdot -2\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (+ (* x1 x1) 1.0))
        (t_1 (+ x1 (+ x1 (* 6.0 (* (* x1 x1) (* x1 x1))))))
        (t_2 (* x1 (* x1 3.0)))
        (t_3 (/ (- (+ t_2 (* 2.0 x2)) x1) t_0)))
   (if (<= x1 -33000.0)
     t_1
     (if (<= x1 1.16e-7)
       (+
        x1
        (+
         (* 3.0 (/ (- (- t_2 (* 2.0 x2)) x1) t_0))
         (+ x1 (* 4.0 (* 2.0 (* x2 (* x1 x2)))))))
       (if (<= x1 1.85e+53)
         (+
          x1
          (+
           (+
            x1
            (+
             (* x1 (* x1 x1))
             (+
              (* t_2 t_3)
              (*
               t_0
               (+ (* (* t_3 (* x1 2.0)) (- t_3 3.0)) (* (* x1 x1) 6.0))))))
           (* 3.0 (* x2 -2.0))))
         t_1)))))
double code(double x1, double x2) {
	double t_0 = (x1 * x1) + 1.0;
	double t_1 = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
	double t_2 = x1 * (x1 * 3.0);
	double t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0;
	double tmp;
	if (x1 <= -33000.0) {
		tmp = t_1;
	} else if (x1 <= 1.16e-7) {
		tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (2.0 * (x2 * (x1 * x2))))));
	} else if (x1 <= 1.85e+53) {
		tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_2 * t_3) + (t_0 * (((t_3 * (x1 * 2.0)) * (t_3 - 3.0)) + ((x1 * x1) * 6.0)))))) + (3.0 * (x2 * -2.0)));
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x1, x2)
    real(8), intent (in) :: x1
    real(8), intent (in) :: x2
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_0 = (x1 * x1) + 1.0d0
    t_1 = x1 + (x1 + (6.0d0 * ((x1 * x1) * (x1 * x1))))
    t_2 = x1 * (x1 * 3.0d0)
    t_3 = ((t_2 + (2.0d0 * x2)) - x1) / t_0
    if (x1 <= (-33000.0d0)) then
        tmp = t_1
    else if (x1 <= 1.16d-7) then
        tmp = x1 + ((3.0d0 * (((t_2 - (2.0d0 * x2)) - x1) / t_0)) + (x1 + (4.0d0 * (2.0d0 * (x2 * (x1 * x2))))))
    else if (x1 <= 1.85d+53) then
        tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_2 * t_3) + (t_0 * (((t_3 * (x1 * 2.0d0)) * (t_3 - 3.0d0)) + ((x1 * x1) * 6.0d0)))))) + (3.0d0 * (x2 * (-2.0d0))))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double t_0 = (x1 * x1) + 1.0;
	double t_1 = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
	double t_2 = x1 * (x1 * 3.0);
	double t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0;
	double tmp;
	if (x1 <= -33000.0) {
		tmp = t_1;
	} else if (x1 <= 1.16e-7) {
		tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (2.0 * (x2 * (x1 * x2))))));
	} else if (x1 <= 1.85e+53) {
		tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_2 * t_3) + (t_0 * (((t_3 * (x1 * 2.0)) * (t_3 - 3.0)) + ((x1 * x1) * 6.0)))))) + (3.0 * (x2 * -2.0)));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x1, x2):
	t_0 = (x1 * x1) + 1.0
	t_1 = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))))
	t_2 = x1 * (x1 * 3.0)
	t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0
	tmp = 0
	if x1 <= -33000.0:
		tmp = t_1
	elif x1 <= 1.16e-7:
		tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (2.0 * (x2 * (x1 * x2))))))
	elif x1 <= 1.85e+53:
		tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_2 * t_3) + (t_0 * (((t_3 * (x1 * 2.0)) * (t_3 - 3.0)) + ((x1 * x1) * 6.0)))))) + (3.0 * (x2 * -2.0)))
	else:
		tmp = t_1
	return tmp
function code(x1, x2)
	t_0 = Float64(Float64(x1 * x1) + 1.0)
	t_1 = Float64(x1 + Float64(x1 + Float64(6.0 * Float64(Float64(x1 * x1) * Float64(x1 * x1)))))
	t_2 = Float64(x1 * Float64(x1 * 3.0))
	t_3 = Float64(Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) / t_0)
	tmp = 0.0
	if (x1 <= -33000.0)
		tmp = t_1;
	elseif (x1 <= 1.16e-7)
		tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_2 - Float64(2.0 * x2)) - x1) / t_0)) + Float64(x1 + Float64(4.0 * Float64(2.0 * Float64(x2 * Float64(x1 * x2)))))));
	elseif (x1 <= 1.85e+53)
		tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_2 * t_3) + Float64(t_0 * Float64(Float64(Float64(t_3 * Float64(x1 * 2.0)) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * 6.0)))))) + Float64(3.0 * Float64(x2 * -2.0))));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	t_0 = (x1 * x1) + 1.0;
	t_1 = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
	t_2 = x1 * (x1 * 3.0);
	t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0;
	tmp = 0.0;
	if (x1 <= -33000.0)
		tmp = t_1;
	elseif (x1 <= 1.16e-7)
		tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (2.0 * (x2 * (x1 * x2))))));
	elseif (x1 <= 1.85e+53)
		tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_2 * t_3) + (t_0 * (((t_3 * (x1 * 2.0)) * (t_3 - 3.0)) + ((x1 * x1) * 6.0)))))) + (3.0 * (x2 * -2.0)));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(x1 + N[(6.0 * N[(N[(x1 * x1), $MachinePrecision] * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, If[LessEqual[x1, -33000.0], t$95$1, If[LessEqual[x1, 1.16e-7], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$2 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(2.0 * N[(x2 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.85e+53], N[(x1 + N[(N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 * t$95$3), $MachinePrecision] + N[(t$95$0 * N[(N[(N[(t$95$3 * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)\right)\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := \frac{\left(t_2 + 2 \cdot x2\right) - x1}{t_0}\\
\mathbf{if}\;x1 \leq -33000:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x1 \leq 1.16 \cdot 10^{-7}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_2 - 2 \cdot x2\right) - x1}{t_0} + \left(x1 + 4 \cdot \left(2 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 1.85 \cdot 10^{+53}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_2 \cdot t_3 + t_0 \cdot \left(\left(t_3 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t_3 - 3\right) + \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right) + 3 \cdot \left(x2 \cdot -2\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x1 < -33000 or 1.85e53 < x1

    1. Initial program 35.6%

      \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    2. Taylor expanded in x1 around inf 39.5%

      \[\leadsto x1 + \left(\left(\color{blue}{6 \cdot {x1}^{4}} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    3. Step-by-step derivation
      1. *-commutative39.5%

        \[\leadsto x1 + \left(\left(\color{blue}{{x1}^{4} \cdot 6} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    4. Simplified39.5%

      \[\leadsto x1 + \left(\left(\color{blue}{{x1}^{4} \cdot 6} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    5. Taylor expanded in x1 around inf 93.6%

      \[\leadsto x1 + \color{blue}{\left(x1 + 6 \cdot {x1}^{4}\right)} \]
    6. Step-by-step derivation
      1. sqr-pow93.6%

        \[\leadsto x1 + \left(x1 + 6 \cdot \color{blue}{\left({x1}^{\left(\frac{4}{2}\right)} \cdot {x1}^{\left(\frac{4}{2}\right)}\right)}\right) \]
      2. metadata-eval93.6%

        \[\leadsto x1 + \left(x1 + 6 \cdot \left({x1}^{\color{blue}{2}} \cdot {x1}^{\left(\frac{4}{2}\right)}\right)\right) \]
      3. pow293.6%

        \[\leadsto x1 + \left(x1 + 6 \cdot \left(\color{blue}{\left(x1 \cdot x1\right)} \cdot {x1}^{\left(\frac{4}{2}\right)}\right)\right) \]
      4. metadata-eval93.6%

        \[\leadsto x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot {x1}^{\color{blue}{2}}\right)\right) \]
      5. pow293.6%

        \[\leadsto x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \color{blue}{\left(x1 \cdot x1\right)}\right)\right) \]
    7. Applied egg-rr93.6%

      \[\leadsto x1 + \left(x1 + 6 \cdot \color{blue}{\left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)}\right) \]

    if -33000 < x1 < 1.1600000000000001e-7

    1. Initial program 98.6%

      \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    2. Taylor expanded in x1 around 0 89.4%

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    3. Taylor expanded in x2 around inf 89.4%

      \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(2 \cdot \left(x1 \cdot {x2}^{2}\right)\right)} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    4. Step-by-step derivation
      1. *-commutative89.0%

        \[\leadsto x1 + \left(\left(4 \cdot \left(2 \cdot \color{blue}{\left({x2}^{2} \cdot x1\right)}\right) + x1\right) + \left(-6 \cdot x2 + -3 \cdot x1\right)\right) \]
      2. unpow289.0%

        \[\leadsto x1 + \left(\left(4 \cdot \left(2 \cdot \left(\color{blue}{\left(x2 \cdot x2\right)} \cdot x1\right)\right) + x1\right) + \left(-6 \cdot x2 + -3 \cdot x1\right)\right) \]
      3. associate-*l*98.1%

        \[\leadsto x1 + \left(\left(4 \cdot \left(2 \cdot \color{blue}{\left(x2 \cdot \left(x2 \cdot x1\right)\right)}\right) + x1\right) + \left(-6 \cdot x2 + -3 \cdot x1\right)\right) \]
    5. Simplified98.6%

      \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(2 \cdot \left(x2 \cdot \left(x2 \cdot x1\right)\right)\right)} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]

    if 1.1600000000000001e-7 < x1 < 1.85e53

    1. Initial program 98.9%

      \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    2. Taylor expanded in x1 around 0 94.5%

      \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \color{blue}{\left(-2 \cdot x2\right)}\right) \]
    3. Step-by-step derivation
      1. *-commutative94.5%

        \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \color{blue}{\left(x2 \cdot -2\right)}\right) \]
    4. Simplified94.5%

      \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \color{blue}{\left(x2 \cdot -2\right)}\right) \]
    5. Taylor expanded in x1 around inf 86.9%

      \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \color{blue}{6 \cdot {x1}^{2}}\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \left(x2 \cdot -2\right)\right) \]
    6. Step-by-step derivation
      1. *-commutative86.9%

        \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \color{blue}{{x1}^{2} \cdot 6}\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \left(x2 \cdot -2\right)\right) \]
      2. unpow286.9%

        \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \color{blue}{\left(x1 \cdot x1\right)} \cdot 6\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \left(x2 \cdot -2\right)\right) \]
    7. Simplified86.9%

      \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \color{blue}{\left(x1 \cdot x1\right) \cdot 6}\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \left(x2 \cdot -2\right)\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification95.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -33000:\\ \;\;\;\;x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 1.16 \cdot 10^{-7}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + 4 \cdot \left(2 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 1.85 \cdot 10^{+53}:\\ \;\;\;\;x1 + \left(\left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(\left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 \cdot x1 + 1\right) \cdot \left(\left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} \cdot \left(x1 \cdot 2\right)\right) \cdot \left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right) + 3 \cdot \left(x2 \cdot -2\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)\right)\\ \end{array} \]

Alternative 9: 94.8% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 \cdot x1 + 1\\ t_1 := x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)\right)\\ t_2 := x1 \cdot \left(x1 \cdot 3\right)\\ t_3 := \frac{\left(t_2 + 2 \cdot x2\right) - x1}{t_0}\\ \mathbf{if}\;x1 \leq -52000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x1 \leq 1.16 \cdot 10^{-7}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(t_2 - 2 \cdot x2\right) - x1}{t_0} + \left(x1 + 4 \cdot \left(2 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 1.85 \cdot 10^{+53}:\\ \;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2\right) + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_0 \cdot \left(\left(t_3 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t_3 - 3\right) + \left(x1 \cdot x1\right) \cdot 6\right) + \left(x1 \cdot x1\right) \cdot 9\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (+ (* x1 x1) 1.0))
        (t_1 (+ x1 (+ x1 (* 6.0 (* (* x1 x1) (* x1 x1))))))
        (t_2 (* x1 (* x1 3.0)))
        (t_3 (/ (- (+ t_2 (* 2.0 x2)) x1) t_0)))
   (if (<= x1 -52000.0)
     t_1
     (if (<= x1 1.16e-7)
       (+
        x1
        (+
         (* 3.0 (/ (- (- t_2 (* 2.0 x2)) x1) t_0))
         (+ x1 (* 4.0 (* 2.0 (* x2 (* x1 x2)))))))
       (if (<= x1 1.85e+53)
         (+
          x1
          (+
           (* 3.0 (* x2 -2.0))
           (+
            x1
            (+
             (* x1 (* x1 x1))
             (+
              (* t_0 (+ (* (* t_3 (* x1 2.0)) (- t_3 3.0)) (* (* x1 x1) 6.0)))
              (* (* x1 x1) 9.0))))))
         t_1)))))
double code(double x1, double x2) {
	double t_0 = (x1 * x1) + 1.0;
	double t_1 = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
	double t_2 = x1 * (x1 * 3.0);
	double t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0;
	double tmp;
	if (x1 <= -52000.0) {
		tmp = t_1;
	} else if (x1 <= 1.16e-7) {
		tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (2.0 * (x2 * (x1 * x2))))));
	} else if (x1 <= 1.85e+53) {
		tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (((t_3 * (x1 * 2.0)) * (t_3 - 3.0)) + ((x1 * x1) * 6.0))) + ((x1 * x1) * 9.0)))));
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x1, x2)
    real(8), intent (in) :: x1
    real(8), intent (in) :: x2
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_0 = (x1 * x1) + 1.0d0
    t_1 = x1 + (x1 + (6.0d0 * ((x1 * x1) * (x1 * x1))))
    t_2 = x1 * (x1 * 3.0d0)
    t_3 = ((t_2 + (2.0d0 * x2)) - x1) / t_0
    if (x1 <= (-52000.0d0)) then
        tmp = t_1
    else if (x1 <= 1.16d-7) then
        tmp = x1 + ((3.0d0 * (((t_2 - (2.0d0 * x2)) - x1) / t_0)) + (x1 + (4.0d0 * (2.0d0 * (x2 * (x1 * x2))))))
    else if (x1 <= 1.85d+53) then
        tmp = x1 + ((3.0d0 * (x2 * (-2.0d0))) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (((t_3 * (x1 * 2.0d0)) * (t_3 - 3.0d0)) + ((x1 * x1) * 6.0d0))) + ((x1 * x1) * 9.0d0)))))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double t_0 = (x1 * x1) + 1.0;
	double t_1 = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
	double t_2 = x1 * (x1 * 3.0);
	double t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0;
	double tmp;
	if (x1 <= -52000.0) {
		tmp = t_1;
	} else if (x1 <= 1.16e-7) {
		tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (2.0 * (x2 * (x1 * x2))))));
	} else if (x1 <= 1.85e+53) {
		tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (((t_3 * (x1 * 2.0)) * (t_3 - 3.0)) + ((x1 * x1) * 6.0))) + ((x1 * x1) * 9.0)))));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x1, x2):
	t_0 = (x1 * x1) + 1.0
	t_1 = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))))
	t_2 = x1 * (x1 * 3.0)
	t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0
	tmp = 0
	if x1 <= -52000.0:
		tmp = t_1
	elif x1 <= 1.16e-7:
		tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (2.0 * (x2 * (x1 * x2))))))
	elif x1 <= 1.85e+53:
		tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (((t_3 * (x1 * 2.0)) * (t_3 - 3.0)) + ((x1 * x1) * 6.0))) + ((x1 * x1) * 9.0)))))
	else:
		tmp = t_1
	return tmp
function code(x1, x2)
	t_0 = Float64(Float64(x1 * x1) + 1.0)
	t_1 = Float64(x1 + Float64(x1 + Float64(6.0 * Float64(Float64(x1 * x1) * Float64(x1 * x1)))))
	t_2 = Float64(x1 * Float64(x1 * 3.0))
	t_3 = Float64(Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) / t_0)
	tmp = 0.0
	if (x1 <= -52000.0)
		tmp = t_1;
	elseif (x1 <= 1.16e-7)
		tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_2 - Float64(2.0 * x2)) - x1) / t_0)) + Float64(x1 + Float64(4.0 * Float64(2.0 * Float64(x2 * Float64(x1 * x2)))))));
	elseif (x1 <= 1.85e+53)
		tmp = Float64(x1 + Float64(Float64(3.0 * Float64(x2 * -2.0)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_0 * Float64(Float64(Float64(t_3 * Float64(x1 * 2.0)) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * 6.0))) + Float64(Float64(x1 * x1) * 9.0))))));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	t_0 = (x1 * x1) + 1.0;
	t_1 = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
	t_2 = x1 * (x1 * 3.0);
	t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0;
	tmp = 0.0;
	if (x1 <= -52000.0)
		tmp = t_1;
	elseif (x1 <= 1.16e-7)
		tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (2.0 * (x2 * (x1 * x2))))));
	elseif (x1 <= 1.85e+53)
		tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (((t_3 * (x1 * 2.0)) * (t_3 - 3.0)) + ((x1 * x1) * 6.0))) + ((x1 * x1) * 9.0)))));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(x1 + N[(6.0 * N[(N[(x1 * x1), $MachinePrecision] * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, If[LessEqual[x1, -52000.0], t$95$1, If[LessEqual[x1, 1.16e-7], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$2 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(2.0 * N[(x2 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.85e+53], N[(x1 + N[(N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$0 * N[(N[(N[(t$95$3 * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)\right)\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := \frac{\left(t_2 + 2 \cdot x2\right) - x1}{t_0}\\
\mathbf{if}\;x1 \leq -52000:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x1 \leq 1.16 \cdot 10^{-7}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_2 - 2 \cdot x2\right) - x1}{t_0} + \left(x1 + 4 \cdot \left(2 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 1.85 \cdot 10^{+53}:\\
\;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2\right) + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_0 \cdot \left(\left(t_3 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t_3 - 3\right) + \left(x1 \cdot x1\right) \cdot 6\right) + \left(x1 \cdot x1\right) \cdot 9\right)\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x1 < -52000 or 1.85e53 < x1

    1. Initial program 35.6%

      \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    2. Taylor expanded in x1 around inf 39.5%

      \[\leadsto x1 + \left(\left(\color{blue}{6 \cdot {x1}^{4}} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    3. Step-by-step derivation
      1. *-commutative39.5%

        \[\leadsto x1 + \left(\left(\color{blue}{{x1}^{4} \cdot 6} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    4. Simplified39.5%

      \[\leadsto x1 + \left(\left(\color{blue}{{x1}^{4} \cdot 6} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    5. Taylor expanded in x1 around inf 93.6%

      \[\leadsto x1 + \color{blue}{\left(x1 + 6 \cdot {x1}^{4}\right)} \]
    6. Step-by-step derivation
      1. sqr-pow93.6%

        \[\leadsto x1 + \left(x1 + 6 \cdot \color{blue}{\left({x1}^{\left(\frac{4}{2}\right)} \cdot {x1}^{\left(\frac{4}{2}\right)}\right)}\right) \]
      2. metadata-eval93.6%

        \[\leadsto x1 + \left(x1 + 6 \cdot \left({x1}^{\color{blue}{2}} \cdot {x1}^{\left(\frac{4}{2}\right)}\right)\right) \]
      3. pow293.6%

        \[\leadsto x1 + \left(x1 + 6 \cdot \left(\color{blue}{\left(x1 \cdot x1\right)} \cdot {x1}^{\left(\frac{4}{2}\right)}\right)\right) \]
      4. metadata-eval93.6%

        \[\leadsto x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot {x1}^{\color{blue}{2}}\right)\right) \]
      5. pow293.6%

        \[\leadsto x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \color{blue}{\left(x1 \cdot x1\right)}\right)\right) \]
    7. Applied egg-rr93.6%

      \[\leadsto x1 + \left(x1 + 6 \cdot \color{blue}{\left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)}\right) \]

    if -52000 < x1 < 1.1600000000000001e-7

    1. Initial program 98.6%

      \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    2. Taylor expanded in x1 around 0 89.4%

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    3. Taylor expanded in x2 around inf 89.4%

      \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(2 \cdot \left(x1 \cdot {x2}^{2}\right)\right)} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    4. Step-by-step derivation
      1. *-commutative89.0%

        \[\leadsto x1 + \left(\left(4 \cdot \left(2 \cdot \color{blue}{\left({x2}^{2} \cdot x1\right)}\right) + x1\right) + \left(-6 \cdot x2 + -3 \cdot x1\right)\right) \]
      2. unpow289.0%

        \[\leadsto x1 + \left(\left(4 \cdot \left(2 \cdot \left(\color{blue}{\left(x2 \cdot x2\right)} \cdot x1\right)\right) + x1\right) + \left(-6 \cdot x2 + -3 \cdot x1\right)\right) \]
      3. associate-*l*98.1%

        \[\leadsto x1 + \left(\left(4 \cdot \left(2 \cdot \color{blue}{\left(x2 \cdot \left(x2 \cdot x1\right)\right)}\right) + x1\right) + \left(-6 \cdot x2 + -3 \cdot x1\right)\right) \]
    5. Simplified98.6%

      \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(2 \cdot \left(x2 \cdot \left(x2 \cdot x1\right)\right)\right)} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]

    if 1.1600000000000001e-7 < x1 < 1.85e53

    1. Initial program 98.9%

      \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    2. Taylor expanded in x1 around 0 94.5%

      \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \color{blue}{\left(-2 \cdot x2\right)}\right) \]
    3. Step-by-step derivation
      1. *-commutative94.5%

        \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \color{blue}{\left(x2 \cdot -2\right)}\right) \]
    4. Simplified94.5%

      \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \color{blue}{\left(x2 \cdot -2\right)}\right) \]
    5. Taylor expanded in x1 around inf 86.9%

      \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \color{blue}{6 \cdot {x1}^{2}}\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \left(x2 \cdot -2\right)\right) \]
    6. Step-by-step derivation
      1. *-commutative86.9%

        \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \color{blue}{{x1}^{2} \cdot 6}\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \left(x2 \cdot -2\right)\right) \]
      2. unpow286.9%

        \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \color{blue}{\left(x1 \cdot x1\right)} \cdot 6\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \left(x2 \cdot -2\right)\right) \]
    7. Simplified86.9%

      \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \color{blue}{\left(x1 \cdot x1\right) \cdot 6}\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \left(x2 \cdot -2\right)\right) \]
    8. Taylor expanded in x1 around inf 86.9%

      \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot 6\right) \cdot \left(x1 \cdot x1 + 1\right) + \color{blue}{9 \cdot {x1}^{2}}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \left(x2 \cdot -2\right)\right) \]
    9. Step-by-step derivation
      1. *-commutative86.9%

        \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot 6\right) \cdot \left(x1 \cdot x1 + 1\right) + \color{blue}{{x1}^{2} \cdot 9}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \left(x2 \cdot -2\right)\right) \]
      2. unpow286.9%

        \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot 6\right) \cdot \left(x1 \cdot x1 + 1\right) + \color{blue}{\left(x1 \cdot x1\right)} \cdot 9\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \left(x2 \cdot -2\right)\right) \]
    10. Simplified86.9%

      \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot 6\right) \cdot \left(x1 \cdot x1 + 1\right) + \color{blue}{\left(x1 \cdot x1\right) \cdot 9}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \left(x2 \cdot -2\right)\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification95.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -52000:\\ \;\;\;\;x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 1.16 \cdot 10^{-7}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + 4 \cdot \left(2 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 1.85 \cdot 10^{+53}:\\ \;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2\right) + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(\left(x1 \cdot x1 + 1\right) \cdot \left(\left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} \cdot \left(x1 \cdot 2\right)\right) \cdot \left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot 6\right) + \left(x1 \cdot x1\right) \cdot 9\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)\right)\\ \end{array} \]

Alternative 10: 92.7% accurate, 3.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x1 \leq -16800000000 \lor \neg \left(x1 \leq 9.5 \cdot 10^{+36}\right):\\ \;\;\;\;x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + 4 \cdot \left(2 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (if (or (<= x1 -16800000000.0) (not (<= x1 9.5e+36)))
   (+ x1 (+ x1 (* 6.0 (* (* x1 x1) (* x1 x1)))))
   (+
    x1
    (+
     (* 3.0 (/ (- (- (* x1 (* x1 3.0)) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)))
     (+ x1 (* 4.0 (* 2.0 (* x2 (* x1 x2)))))))))
double code(double x1, double x2) {
	double tmp;
	if ((x1 <= -16800000000.0) || !(x1 <= 9.5e+36)) {
		tmp = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
	} else {
		tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (2.0 * (x2 * (x1 * x2))))));
	}
	return tmp;
}
real(8) function code(x1, x2)
    real(8), intent (in) :: x1
    real(8), intent (in) :: x2
    real(8) :: tmp
    if ((x1 <= (-16800000000.0d0)) .or. (.not. (x1 <= 9.5d+36))) then
        tmp = x1 + (x1 + (6.0d0 * ((x1 * x1) * (x1 * x1))))
    else
        tmp = x1 + ((3.0d0 * ((((x1 * (x1 * 3.0d0)) - (2.0d0 * x2)) - x1) / ((x1 * x1) + 1.0d0))) + (x1 + (4.0d0 * (2.0d0 * (x2 * (x1 * x2))))))
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double tmp;
	if ((x1 <= -16800000000.0) || !(x1 <= 9.5e+36)) {
		tmp = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
	} else {
		tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (2.0 * (x2 * (x1 * x2))))));
	}
	return tmp;
}
def code(x1, x2):
	tmp = 0
	if (x1 <= -16800000000.0) or not (x1 <= 9.5e+36):
		tmp = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))))
	else:
		tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (2.0 * (x2 * (x1 * x2))))))
	return tmp
function code(x1, x2)
	tmp = 0.0
	if ((x1 <= -16800000000.0) || !(x1 <= 9.5e+36))
		tmp = Float64(x1 + Float64(x1 + Float64(6.0 * Float64(Float64(x1 * x1) * Float64(x1 * x1)))));
	else
		tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(Float64(x1 * Float64(x1 * 3.0)) - Float64(2.0 * x2)) - x1) / Float64(Float64(x1 * x1) + 1.0))) + Float64(x1 + Float64(4.0 * Float64(2.0 * Float64(x2 * Float64(x1 * x2)))))));
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	tmp = 0.0;
	if ((x1 <= -16800000000.0) || ~((x1 <= 9.5e+36)))
		tmp = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
	else
		tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (2.0 * (x2 * (x1 * x2))))));
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := If[Or[LessEqual[x1, -16800000000.0], N[Not[LessEqual[x1, 9.5e+36]], $MachinePrecision]], N[(x1 + N[(x1 + N[(6.0 * N[(N[(x1 * x1), $MachinePrecision] * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(3.0 * N[(N[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision] - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(2.0 * N[(x2 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -16800000000 \lor \neg \left(x1 \leq 9.5 \cdot 10^{+36}\right):\\
\;\;\;\;x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + 4 \cdot \left(2 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x1 < -1.68e10 or 9.49999999999999974e36 < x1

    1. Initial program 37.8%

      \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    2. Taylor expanded in x1 around inf 40.3%

      \[\leadsto x1 + \left(\left(\color{blue}{6 \cdot {x1}^{4}} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    3. Step-by-step derivation
      1. *-commutative40.3%

        \[\leadsto x1 + \left(\left(\color{blue}{{x1}^{4} \cdot 6} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    4. Simplified40.3%

      \[\leadsto x1 + \left(\left(\color{blue}{{x1}^{4} \cdot 6} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    5. Taylor expanded in x1 around inf 92.6%

      \[\leadsto x1 + \color{blue}{\left(x1 + 6 \cdot {x1}^{4}\right)} \]
    6. Step-by-step derivation
      1. sqr-pow92.5%

        \[\leadsto x1 + \left(x1 + 6 \cdot \color{blue}{\left({x1}^{\left(\frac{4}{2}\right)} \cdot {x1}^{\left(\frac{4}{2}\right)}\right)}\right) \]
      2. metadata-eval92.5%

        \[\leadsto x1 + \left(x1 + 6 \cdot \left({x1}^{\color{blue}{2}} \cdot {x1}^{\left(\frac{4}{2}\right)}\right)\right) \]
      3. pow292.5%

        \[\leadsto x1 + \left(x1 + 6 \cdot \left(\color{blue}{\left(x1 \cdot x1\right)} \cdot {x1}^{\left(\frac{4}{2}\right)}\right)\right) \]
      4. metadata-eval92.5%

        \[\leadsto x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot {x1}^{\color{blue}{2}}\right)\right) \]
      5. pow292.5%

        \[\leadsto x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \color{blue}{\left(x1 \cdot x1\right)}\right)\right) \]
    7. Applied egg-rr92.5%

      \[\leadsto x1 + \left(x1 + 6 \cdot \color{blue}{\left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)}\right) \]

    if -1.68e10 < x1 < 9.49999999999999974e36

    1. Initial program 98.6%

      \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    2. Taylor expanded in x1 around 0 87.0%

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    3. Taylor expanded in x2 around inf 87.0%

      \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(2 \cdot \left(x1 \cdot {x2}^{2}\right)\right)} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    4. Step-by-step derivation
      1. *-commutative86.4%

        \[\leadsto x1 + \left(\left(4 \cdot \left(2 \cdot \color{blue}{\left({x2}^{2} \cdot x1\right)}\right) + x1\right) + \left(-6 \cdot x2 + -3 \cdot x1\right)\right) \]
      2. unpow286.4%

        \[\leadsto x1 + \left(\left(4 \cdot \left(2 \cdot \left(\color{blue}{\left(x2 \cdot x2\right)} \cdot x1\right)\right) + x1\right) + \left(-6 \cdot x2 + -3 \cdot x1\right)\right) \]
      3. associate-*l*94.9%

        \[\leadsto x1 + \left(\left(4 \cdot \left(2 \cdot \color{blue}{\left(x2 \cdot \left(x2 \cdot x1\right)\right)}\right) + x1\right) + \left(-6 \cdot x2 + -3 \cdot x1\right)\right) \]
    5. Simplified95.5%

      \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(2 \cdot \left(x2 \cdot \left(x2 \cdot x1\right)\right)\right)} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification94.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -16800000000 \lor \neg \left(x1 \leq 9.5 \cdot 10^{+36}\right):\\ \;\;\;\;x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + 4 \cdot \left(2 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\right)\\ \end{array} \]

Alternative 11: 88.9% accurate, 4.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)\right)\\ t_1 := x1 + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right) + x2 \cdot -6\right)\\ \mathbf{if}\;x1 \leq -7800000:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x1 \leq -4.2 \cdot 10^{-198}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x1 \leq 1.75 \cdot 10^{-234}:\\ \;\;\;\;x2 \cdot -6 - x1\\ \mathbf{elif}\;x1 \leq 8.2 \cdot 10^{+27}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (+ x1 (+ x1 (* 6.0 (* (* x1 x1) (* x1 x1))))))
        (t_1
         (+
          x1
          (+ (* x1 (- (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) 2.0)) (* x2 -6.0)))))
   (if (<= x1 -7800000.0)
     t_0
     (if (<= x1 -4.2e-198)
       t_1
       (if (<= x1 1.75e-234)
         (- (* x2 -6.0) x1)
         (if (<= x1 8.2e+27) t_1 t_0))))))
double code(double x1, double x2) {
	double t_0 = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
	double t_1 = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0));
	double tmp;
	if (x1 <= -7800000.0) {
		tmp = t_0;
	} else if (x1 <= -4.2e-198) {
		tmp = t_1;
	} else if (x1 <= 1.75e-234) {
		tmp = (x2 * -6.0) - x1;
	} else if (x1 <= 8.2e+27) {
		tmp = t_1;
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(x1, x2)
    real(8), intent (in) :: x1
    real(8), intent (in) :: x2
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = x1 + (x1 + (6.0d0 * ((x1 * x1) * (x1 * x1))))
    t_1 = x1 + ((x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) - 2.0d0)) + (x2 * (-6.0d0)))
    if (x1 <= (-7800000.0d0)) then
        tmp = t_0
    else if (x1 <= (-4.2d-198)) then
        tmp = t_1
    else if (x1 <= 1.75d-234) then
        tmp = (x2 * (-6.0d0)) - x1
    else if (x1 <= 8.2d+27) then
        tmp = t_1
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double t_0 = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
	double t_1 = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0));
	double tmp;
	if (x1 <= -7800000.0) {
		tmp = t_0;
	} else if (x1 <= -4.2e-198) {
		tmp = t_1;
	} else if (x1 <= 1.75e-234) {
		tmp = (x2 * -6.0) - x1;
	} else if (x1 <= 8.2e+27) {
		tmp = t_1;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x1, x2):
	t_0 = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))))
	t_1 = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0))
	tmp = 0
	if x1 <= -7800000.0:
		tmp = t_0
	elif x1 <= -4.2e-198:
		tmp = t_1
	elif x1 <= 1.75e-234:
		tmp = (x2 * -6.0) - x1
	elif x1 <= 8.2e+27:
		tmp = t_1
	else:
		tmp = t_0
	return tmp
function code(x1, x2)
	t_0 = Float64(x1 + Float64(x1 + Float64(6.0 * Float64(Float64(x1 * x1) * Float64(x1 * x1)))))
	t_1 = Float64(x1 + Float64(Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 2.0)) + Float64(x2 * -6.0)))
	tmp = 0.0
	if (x1 <= -7800000.0)
		tmp = t_0;
	elseif (x1 <= -4.2e-198)
		tmp = t_1;
	elseif (x1 <= 1.75e-234)
		tmp = Float64(Float64(x2 * -6.0) - x1);
	elseif (x1 <= 8.2e+27)
		tmp = t_1;
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	t_0 = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
	t_1 = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0));
	tmp = 0.0;
	if (x1 <= -7800000.0)
		tmp = t_0;
	elseif (x1 <= -4.2e-198)
		tmp = t_1;
	elseif (x1 <= 1.75e-234)
		tmp = (x2 * -6.0) - x1;
	elseif (x1 <= 8.2e+27)
		tmp = t_1;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(x1 + N[(6.0 * N[(N[(x1 * x1), $MachinePrecision] * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -7800000.0], t$95$0, If[LessEqual[x1, -4.2e-198], t$95$1, If[LessEqual[x1, 1.75e-234], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision], If[LessEqual[x1, 8.2e+27], t$95$1, t$95$0]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)\right)\\
t_1 := x1 + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right) + x2 \cdot -6\right)\\
\mathbf{if}\;x1 \leq -7800000:\\
\;\;\;\;t_0\\

\mathbf{elif}\;x1 \leq -4.2 \cdot 10^{-198}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x1 \leq 1.75 \cdot 10^{-234}:\\
\;\;\;\;x2 \cdot -6 - x1\\

\mathbf{elif}\;x1 \leq 8.2 \cdot 10^{+27}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x1 < -7.8e6 or 8.2000000000000005e27 < x1

    1. Initial program 39.9%

      \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    2. Taylor expanded in x1 around inf 40.7%

      \[\leadsto x1 + \left(\left(\color{blue}{6 \cdot {x1}^{4}} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    3. Step-by-step derivation
      1. *-commutative40.7%

        \[\leadsto x1 + \left(\left(\color{blue}{{x1}^{4} \cdot 6} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    4. Simplified40.7%

      \[\leadsto x1 + \left(\left(\color{blue}{{x1}^{4} \cdot 6} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    5. Taylor expanded in x1 around inf 91.2%

      \[\leadsto x1 + \color{blue}{\left(x1 + 6 \cdot {x1}^{4}\right)} \]
    6. Step-by-step derivation
      1. sqr-pow91.1%

        \[\leadsto x1 + \left(x1 + 6 \cdot \color{blue}{\left({x1}^{\left(\frac{4}{2}\right)} \cdot {x1}^{\left(\frac{4}{2}\right)}\right)}\right) \]
      2. metadata-eval91.1%

        \[\leadsto x1 + \left(x1 + 6 \cdot \left({x1}^{\color{blue}{2}} \cdot {x1}^{\left(\frac{4}{2}\right)}\right)\right) \]
      3. pow291.1%

        \[\leadsto x1 + \left(x1 + 6 \cdot \left(\color{blue}{\left(x1 \cdot x1\right)} \cdot {x1}^{\left(\frac{4}{2}\right)}\right)\right) \]
      4. metadata-eval91.1%

        \[\leadsto x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot {x1}^{\color{blue}{2}}\right)\right) \]
      5. pow291.1%

        \[\leadsto x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \color{blue}{\left(x1 \cdot x1\right)}\right)\right) \]
    7. Applied egg-rr91.1%

      \[\leadsto x1 + \left(x1 + 6 \cdot \color{blue}{\left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)}\right) \]

    if -7.8e6 < x1 < -4.19999999999999986e-198 or 1.7500000000000001e-234 < x1 < 8.2000000000000005e27

    1. Initial program 99.3%

      \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    2. Taylor expanded in x1 around 0 91.2%

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    3. Taylor expanded in x1 around 0 90.9%

      \[\leadsto x1 + \color{blue}{\left(-6 \cdot x2 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right)\right)} \]

    if -4.19999999999999986e-198 < x1 < 1.7500000000000001e-234

    1. Initial program 96.8%

      \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    2. Taylor expanded in x1 around inf 91.7%

      \[\leadsto x1 + \left(\left(\color{blue}{6 \cdot {x1}^{4}} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    3. Step-by-step derivation
      1. *-commutative91.7%

        \[\leadsto x1 + \left(\left(\color{blue}{{x1}^{4} \cdot 6} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    4. Simplified91.7%

      \[\leadsto x1 + \left(\left(\color{blue}{{x1}^{4} \cdot 6} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    5. Taylor expanded in x1 around 0 91.7%

      \[\leadsto x1 + \color{blue}{\left(-6 \cdot x2 + -2 \cdot x1\right)} \]
    6. Step-by-step derivation
      1. *-commutative91.7%

        \[\leadsto x1 + \left(\color{blue}{x2 \cdot -6} + -2 \cdot x1\right) \]
      2. fma-def91.9%

        \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(x2, -6, -2 \cdot x1\right)} \]
      3. *-commutative91.9%

        \[\leadsto x1 + \mathsf{fma}\left(x2, -6, \color{blue}{x1 \cdot -2}\right) \]
    7. Simplified91.9%

      \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(x2, -6, x1 \cdot -2\right)} \]
    8. Taylor expanded in x1 around 0 91.8%

      \[\leadsto \color{blue}{-6 \cdot x2 + -1 \cdot x1} \]
    9. Step-by-step derivation
      1. *-commutative91.8%

        \[\leadsto \color{blue}{x2 \cdot -6} + -1 \cdot x1 \]
      2. mul-1-neg91.8%

        \[\leadsto x2 \cdot -6 + \color{blue}{\left(-x1\right)} \]
      3. unsub-neg91.8%

        \[\leadsto \color{blue}{x2 \cdot -6 - x1} \]
    10. Simplified91.8%

      \[\leadsto \color{blue}{x2 \cdot -6 - x1} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification91.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -7800000:\\ \;\;\;\;x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)\right)\\ \mathbf{elif}\;x1 \leq -4.2 \cdot 10^{-198}:\\ \;\;\;\;x1 + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right) + x2 \cdot -6\right)\\ \mathbf{elif}\;x1 \leq 1.75 \cdot 10^{-234}:\\ \;\;\;\;x2 \cdot -6 - x1\\ \mathbf{elif}\;x1 \leq 8.2 \cdot 10^{+27}:\\ \;\;\;\;x1 + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right) + x2 \cdot -6\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)\right)\\ \end{array} \]

Alternative 12: 92.6% accurate, 5.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x1 \leq -52000000 \lor \neg \left(x1 \leq 8.2 \cdot 10^{+27}\right):\\ \;\;\;\;x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(2 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\right)\right) + \left(x1 \cdot -3 + x2 \cdot -6\right)\right)\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (if (or (<= x1 -52000000.0) (not (<= x1 8.2e+27)))
   (+ x1 (+ x1 (* 6.0 (* (* x1 x1) (* x1 x1)))))
   (+
    x1
    (+ (+ x1 (* 4.0 (* 2.0 (* x2 (* x1 x2))))) (+ (* x1 -3.0) (* x2 -6.0))))))
double code(double x1, double x2) {
	double tmp;
	if ((x1 <= -52000000.0) || !(x1 <= 8.2e+27)) {
		tmp = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
	} else {
		tmp = x1 + ((x1 + (4.0 * (2.0 * (x2 * (x1 * x2))))) + ((x1 * -3.0) + (x2 * -6.0)));
	}
	return tmp;
}
real(8) function code(x1, x2)
    real(8), intent (in) :: x1
    real(8), intent (in) :: x2
    real(8) :: tmp
    if ((x1 <= (-52000000.0d0)) .or. (.not. (x1 <= 8.2d+27))) then
        tmp = x1 + (x1 + (6.0d0 * ((x1 * x1) * (x1 * x1))))
    else
        tmp = x1 + ((x1 + (4.0d0 * (2.0d0 * (x2 * (x1 * x2))))) + ((x1 * (-3.0d0)) + (x2 * (-6.0d0))))
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double tmp;
	if ((x1 <= -52000000.0) || !(x1 <= 8.2e+27)) {
		tmp = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
	} else {
		tmp = x1 + ((x1 + (4.0 * (2.0 * (x2 * (x1 * x2))))) + ((x1 * -3.0) + (x2 * -6.0)));
	}
	return tmp;
}
def code(x1, x2):
	tmp = 0
	if (x1 <= -52000000.0) or not (x1 <= 8.2e+27):
		tmp = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))))
	else:
		tmp = x1 + ((x1 + (4.0 * (2.0 * (x2 * (x1 * x2))))) + ((x1 * -3.0) + (x2 * -6.0)))
	return tmp
function code(x1, x2)
	tmp = 0.0
	if ((x1 <= -52000000.0) || !(x1 <= 8.2e+27))
		tmp = Float64(x1 + Float64(x1 + Float64(6.0 * Float64(Float64(x1 * x1) * Float64(x1 * x1)))));
	else
		tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(2.0 * Float64(x2 * Float64(x1 * x2))))) + Float64(Float64(x1 * -3.0) + Float64(x2 * -6.0))));
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	tmp = 0.0;
	if ((x1 <= -52000000.0) || ~((x1 <= 8.2e+27)))
		tmp = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
	else
		tmp = x1 + ((x1 + (4.0 * (2.0 * (x2 * (x1 * x2))))) + ((x1 * -3.0) + (x2 * -6.0)));
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := If[Or[LessEqual[x1, -52000000.0], N[Not[LessEqual[x1, 8.2e+27]], $MachinePrecision]], N[(x1 + N[(x1 + N[(6.0 * N[(N[(x1 * x1), $MachinePrecision] * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(4.0 * N[(2.0 * N[(x2 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * -3.0), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -52000000 \lor \neg \left(x1 \leq 8.2 \cdot 10^{+27}\right):\\
\;\;\;\;x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(2 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\right)\right) + \left(x1 \cdot -3 + x2 \cdot -6\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x1 < -5.2e7 or 8.2000000000000005e27 < x1

    1. Initial program 39.9%

      \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    2. Taylor expanded in x1 around inf 40.7%

      \[\leadsto x1 + \left(\left(\color{blue}{6 \cdot {x1}^{4}} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    3. Step-by-step derivation
      1. *-commutative40.7%

        \[\leadsto x1 + \left(\left(\color{blue}{{x1}^{4} \cdot 6} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    4. Simplified40.7%

      \[\leadsto x1 + \left(\left(\color{blue}{{x1}^{4} \cdot 6} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    5. Taylor expanded in x1 around inf 91.2%

      \[\leadsto x1 + \color{blue}{\left(x1 + 6 \cdot {x1}^{4}\right)} \]
    6. Step-by-step derivation
      1. sqr-pow91.1%

        \[\leadsto x1 + \left(x1 + 6 \cdot \color{blue}{\left({x1}^{\left(\frac{4}{2}\right)} \cdot {x1}^{\left(\frac{4}{2}\right)}\right)}\right) \]
      2. metadata-eval91.1%

        \[\leadsto x1 + \left(x1 + 6 \cdot \left({x1}^{\color{blue}{2}} \cdot {x1}^{\left(\frac{4}{2}\right)}\right)\right) \]
      3. pow291.1%

        \[\leadsto x1 + \left(x1 + 6 \cdot \left(\color{blue}{\left(x1 \cdot x1\right)} \cdot {x1}^{\left(\frac{4}{2}\right)}\right)\right) \]
      4. metadata-eval91.1%

        \[\leadsto x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot {x1}^{\color{blue}{2}}\right)\right) \]
      5. pow291.1%

        \[\leadsto x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \color{blue}{\left(x1 \cdot x1\right)}\right)\right) \]
    7. Applied egg-rr91.1%

      \[\leadsto x1 + \left(x1 + 6 \cdot \color{blue}{\left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)}\right) \]

    if -5.2e7 < x1 < 8.2000000000000005e27

    1. Initial program 98.6%

      \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    2. Taylor expanded in x1 around 0 88.0%

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    3. Taylor expanded in x1 around 0 87.5%

      \[\leadsto x1 + \left(\left(4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right) + x1\right) + \color{blue}{\left(-6 \cdot x2 + -3 \cdot x1\right)}\right) \]
    4. Taylor expanded in x2 around inf 87.5%

      \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(2 \cdot \left(x1 \cdot {x2}^{2}\right)\right)} + x1\right) + \left(-6 \cdot x2 + -3 \cdot x1\right)\right) \]
    5. Step-by-step derivation
      1. *-commutative87.5%

        \[\leadsto x1 + \left(\left(4 \cdot \left(2 \cdot \color{blue}{\left({x2}^{2} \cdot x1\right)}\right) + x1\right) + \left(-6 \cdot x2 + -3 \cdot x1\right)\right) \]
      2. unpow287.5%

        \[\leadsto x1 + \left(\left(4 \cdot \left(2 \cdot \left(\color{blue}{\left(x2 \cdot x2\right)} \cdot x1\right)\right) + x1\right) + \left(-6 \cdot x2 + -3 \cdot x1\right)\right) \]
      3. associate-*l*96.2%

        \[\leadsto x1 + \left(\left(4 \cdot \left(2 \cdot \color{blue}{\left(x2 \cdot \left(x2 \cdot x1\right)\right)}\right) + x1\right) + \left(-6 \cdot x2 + -3 \cdot x1\right)\right) \]
    6. Simplified96.2%

      \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(2 \cdot \left(x2 \cdot \left(x2 \cdot x1\right)\right)\right)} + x1\right) + \left(-6 \cdot x2 + -3 \cdot x1\right)\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification93.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -52000000 \lor \neg \left(x1 \leq 8.2 \cdot 10^{+27}\right):\\ \;\;\;\;x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(2 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\right)\right) + \left(x1 \cdot -3 + x2 \cdot -6\right)\right)\\ \end{array} \]

Alternative 13: 80.0% accurate, 6.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)\right)\\ \mathbf{if}\;x1 \leq -1.75:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x1 \leq -4.8 \cdot 10^{-76}:\\ \;\;\;\;x1 + x1 \cdot \left(8 \cdot \left(x2 \cdot x2\right)\right)\\ \mathbf{elif}\;x1 \leq 1.16 \cdot 10^{-7}:\\ \;\;\;\;x2 \cdot -6 - x1\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (+ x1 (+ x1 (* 6.0 (* (* x1 x1) (* x1 x1)))))))
   (if (<= x1 -1.75)
     t_0
     (if (<= x1 -4.8e-76)
       (+ x1 (* x1 (* 8.0 (* x2 x2))))
       (if (<= x1 1.16e-7) (- (* x2 -6.0) x1) t_0)))))
double code(double x1, double x2) {
	double t_0 = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
	double tmp;
	if (x1 <= -1.75) {
		tmp = t_0;
	} else if (x1 <= -4.8e-76) {
		tmp = x1 + (x1 * (8.0 * (x2 * x2)));
	} else if (x1 <= 1.16e-7) {
		tmp = (x2 * -6.0) - x1;
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(x1, x2)
    real(8), intent (in) :: x1
    real(8), intent (in) :: x2
    real(8) :: t_0
    real(8) :: tmp
    t_0 = x1 + (x1 + (6.0d0 * ((x1 * x1) * (x1 * x1))))
    if (x1 <= (-1.75d0)) then
        tmp = t_0
    else if (x1 <= (-4.8d-76)) then
        tmp = x1 + (x1 * (8.0d0 * (x2 * x2)))
    else if (x1 <= 1.16d-7) then
        tmp = (x2 * (-6.0d0)) - x1
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double t_0 = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
	double tmp;
	if (x1 <= -1.75) {
		tmp = t_0;
	} else if (x1 <= -4.8e-76) {
		tmp = x1 + (x1 * (8.0 * (x2 * x2)));
	} else if (x1 <= 1.16e-7) {
		tmp = (x2 * -6.0) - x1;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x1, x2):
	t_0 = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))))
	tmp = 0
	if x1 <= -1.75:
		tmp = t_0
	elif x1 <= -4.8e-76:
		tmp = x1 + (x1 * (8.0 * (x2 * x2)))
	elif x1 <= 1.16e-7:
		tmp = (x2 * -6.0) - x1
	else:
		tmp = t_0
	return tmp
function code(x1, x2)
	t_0 = Float64(x1 + Float64(x1 + Float64(6.0 * Float64(Float64(x1 * x1) * Float64(x1 * x1)))))
	tmp = 0.0
	if (x1 <= -1.75)
		tmp = t_0;
	elseif (x1 <= -4.8e-76)
		tmp = Float64(x1 + Float64(x1 * Float64(8.0 * Float64(x2 * x2))));
	elseif (x1 <= 1.16e-7)
		tmp = Float64(Float64(x2 * -6.0) - x1);
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	t_0 = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
	tmp = 0.0;
	if (x1 <= -1.75)
		tmp = t_0;
	elseif (x1 <= -4.8e-76)
		tmp = x1 + (x1 * (8.0 * (x2 * x2)));
	elseif (x1 <= 1.16e-7)
		tmp = (x2 * -6.0) - x1;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(x1 + N[(6.0 * N[(N[(x1 * x1), $MachinePrecision] * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.75], t$95$0, If[LessEqual[x1, -4.8e-76], N[(x1 + N[(x1 * N[(8.0 * N[(x2 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.16e-7], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision], t$95$0]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)\right)\\
\mathbf{if}\;x1 \leq -1.75:\\
\;\;\;\;t_0\\

\mathbf{elif}\;x1 \leq -4.8 \cdot 10^{-76}:\\
\;\;\;\;x1 + x1 \cdot \left(8 \cdot \left(x2 \cdot x2\right)\right)\\

\mathbf{elif}\;x1 \leq 1.16 \cdot 10^{-7}:\\
\;\;\;\;x2 \cdot -6 - x1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x1 < -1.75 or 1.1600000000000001e-7 < x1

    1. Initial program 43.3%

      \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    2. Taylor expanded in x1 around inf 39.0%

      \[\leadsto x1 + \left(\left(\color{blue}{6 \cdot {x1}^{4}} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    3. Step-by-step derivation
      1. *-commutative39.0%

        \[\leadsto x1 + \left(\left(\color{blue}{{x1}^{4} \cdot 6} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    4. Simplified39.0%

      \[\leadsto x1 + \left(\left(\color{blue}{{x1}^{4} \cdot 6} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    5. Taylor expanded in x1 around inf 86.7%

      \[\leadsto x1 + \color{blue}{\left(x1 + 6 \cdot {x1}^{4}\right)} \]
    6. Step-by-step derivation
      1. sqr-pow86.6%

        \[\leadsto x1 + \left(x1 + 6 \cdot \color{blue}{\left({x1}^{\left(\frac{4}{2}\right)} \cdot {x1}^{\left(\frac{4}{2}\right)}\right)}\right) \]
      2. metadata-eval86.6%

        \[\leadsto x1 + \left(x1 + 6 \cdot \left({x1}^{\color{blue}{2}} \cdot {x1}^{\left(\frac{4}{2}\right)}\right)\right) \]
      3. pow286.6%

        \[\leadsto x1 + \left(x1 + 6 \cdot \left(\color{blue}{\left(x1 \cdot x1\right)} \cdot {x1}^{\left(\frac{4}{2}\right)}\right)\right) \]
      4. metadata-eval86.6%

        \[\leadsto x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot {x1}^{\color{blue}{2}}\right)\right) \]
      5. pow286.6%

        \[\leadsto x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \color{blue}{\left(x1 \cdot x1\right)}\right)\right) \]
    7. Applied egg-rr86.6%

      \[\leadsto x1 + \left(x1 + 6 \cdot \color{blue}{\left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)}\right) \]

    if -1.75 < x1 < -4.80000000000000026e-76

    1. Initial program 99.6%

      \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    2. Taylor expanded in x1 around 0 95.3%

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    3. Taylor expanded in x2 around inf 56.7%

      \[\leadsto x1 + \color{blue}{8 \cdot \left(x1 \cdot {x2}^{2}\right)} \]
    4. Step-by-step derivation
      1. *-commutative56.7%

        \[\leadsto x1 + \color{blue}{\left(x1 \cdot {x2}^{2}\right) \cdot 8} \]
      2. associate-*l*56.7%

        \[\leadsto x1 + \color{blue}{x1 \cdot \left({x2}^{2} \cdot 8\right)} \]
      3. unpow256.7%

        \[\leadsto x1 + x1 \cdot \left(\color{blue}{\left(x2 \cdot x2\right)} \cdot 8\right) \]
    5. Simplified56.7%

      \[\leadsto x1 + \color{blue}{x1 \cdot \left(\left(x2 \cdot x2\right) \cdot 8\right)} \]

    if -4.80000000000000026e-76 < x1 < 1.1600000000000001e-7

    1. Initial program 98.4%

      \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    2. Taylor expanded in x1 around inf 80.1%

      \[\leadsto x1 + \left(\left(\color{blue}{6 \cdot {x1}^{4}} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    3. Step-by-step derivation
      1. *-commutative80.1%

        \[\leadsto x1 + \left(\left(\color{blue}{{x1}^{4} \cdot 6} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    4. Simplified80.1%

      \[\leadsto x1 + \left(\left(\color{blue}{{x1}^{4} \cdot 6} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    5. Taylor expanded in x1 around 0 80.3%

      \[\leadsto x1 + \color{blue}{\left(-6 \cdot x2 + -2 \cdot x1\right)} \]
    6. Step-by-step derivation
      1. *-commutative80.3%

        \[\leadsto x1 + \left(\color{blue}{x2 \cdot -6} + -2 \cdot x1\right) \]
      2. fma-def80.4%

        \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(x2, -6, -2 \cdot x1\right)} \]
      3. *-commutative80.4%

        \[\leadsto x1 + \mathsf{fma}\left(x2, -6, \color{blue}{x1 \cdot -2}\right) \]
    7. Simplified80.4%

      \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(x2, -6, x1 \cdot -2\right)} \]
    8. Taylor expanded in x1 around 0 80.4%

      \[\leadsto \color{blue}{-6 \cdot x2 + -1 \cdot x1} \]
    9. Step-by-step derivation
      1. *-commutative80.4%

        \[\leadsto \color{blue}{x2 \cdot -6} + -1 \cdot x1 \]
      2. mul-1-neg80.4%

        \[\leadsto x2 \cdot -6 + \color{blue}{\left(-x1\right)} \]
      3. unsub-neg80.4%

        \[\leadsto \color{blue}{x2 \cdot -6 - x1} \]
    10. Simplified80.4%

      \[\leadsto \color{blue}{x2 \cdot -6 - x1} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification81.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -1.75:\\ \;\;\;\;x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)\right)\\ \mathbf{elif}\;x1 \leq -4.8 \cdot 10^{-76}:\\ \;\;\;\;x1 + x1 \cdot \left(8 \cdot \left(x2 \cdot x2\right)\right)\\ \mathbf{elif}\;x1 \leq 1.16 \cdot 10^{-7}:\\ \;\;\;\;x2 \cdot -6 - x1\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)\right)\\ \end{array} \]

Alternative 14: 80.8% accurate, 6.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)\right)\\ \mathbf{if}\;x1 \leq -3900000:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x1 \leq -4 \cdot 10^{-117}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + \left(x1 \cdot 8\right) \cdot \left(x2 \cdot x2\right)\right)\\ \mathbf{elif}\;x1 \leq 1.16 \cdot 10^{-7}:\\ \;\;\;\;x2 \cdot -6 - x1\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (+ x1 (+ x1 (* 6.0 (* (* x1 x1) (* x1 x1)))))))
   (if (<= x1 -3900000.0)
     t_0
     (if (<= x1 -4e-117)
       (+ x1 (+ (* x2 -6.0) (* (* x1 8.0) (* x2 x2))))
       (if (<= x1 1.16e-7) (- (* x2 -6.0) x1) t_0)))))
double code(double x1, double x2) {
	double t_0 = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
	double tmp;
	if (x1 <= -3900000.0) {
		tmp = t_0;
	} else if (x1 <= -4e-117) {
		tmp = x1 + ((x2 * -6.0) + ((x1 * 8.0) * (x2 * x2)));
	} else if (x1 <= 1.16e-7) {
		tmp = (x2 * -6.0) - x1;
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(x1, x2)
    real(8), intent (in) :: x1
    real(8), intent (in) :: x2
    real(8) :: t_0
    real(8) :: tmp
    t_0 = x1 + (x1 + (6.0d0 * ((x1 * x1) * (x1 * x1))))
    if (x1 <= (-3900000.0d0)) then
        tmp = t_0
    else if (x1 <= (-4d-117)) then
        tmp = x1 + ((x2 * (-6.0d0)) + ((x1 * 8.0d0) * (x2 * x2)))
    else if (x1 <= 1.16d-7) then
        tmp = (x2 * (-6.0d0)) - x1
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double t_0 = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
	double tmp;
	if (x1 <= -3900000.0) {
		tmp = t_0;
	} else if (x1 <= -4e-117) {
		tmp = x1 + ((x2 * -6.0) + ((x1 * 8.0) * (x2 * x2)));
	} else if (x1 <= 1.16e-7) {
		tmp = (x2 * -6.0) - x1;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x1, x2):
	t_0 = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))))
	tmp = 0
	if x1 <= -3900000.0:
		tmp = t_0
	elif x1 <= -4e-117:
		tmp = x1 + ((x2 * -6.0) + ((x1 * 8.0) * (x2 * x2)))
	elif x1 <= 1.16e-7:
		tmp = (x2 * -6.0) - x1
	else:
		tmp = t_0
	return tmp
function code(x1, x2)
	t_0 = Float64(x1 + Float64(x1 + Float64(6.0 * Float64(Float64(x1 * x1) * Float64(x1 * x1)))))
	tmp = 0.0
	if (x1 <= -3900000.0)
		tmp = t_0;
	elseif (x1 <= -4e-117)
		tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(Float64(x1 * 8.0) * Float64(x2 * x2))));
	elseif (x1 <= 1.16e-7)
		tmp = Float64(Float64(x2 * -6.0) - x1);
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	t_0 = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
	tmp = 0.0;
	if (x1 <= -3900000.0)
		tmp = t_0;
	elseif (x1 <= -4e-117)
		tmp = x1 + ((x2 * -6.0) + ((x1 * 8.0) * (x2 * x2)));
	elseif (x1 <= 1.16e-7)
		tmp = (x2 * -6.0) - x1;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(x1 + N[(6.0 * N[(N[(x1 * x1), $MachinePrecision] * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -3900000.0], t$95$0, If[LessEqual[x1, -4e-117], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(N[(x1 * 8.0), $MachinePrecision] * N[(x2 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.16e-7], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision], t$95$0]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)\right)\\
\mathbf{if}\;x1 \leq -3900000:\\
\;\;\;\;t_0\\

\mathbf{elif}\;x1 \leq -4 \cdot 10^{-117}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + \left(x1 \cdot 8\right) \cdot \left(x2 \cdot x2\right)\right)\\

\mathbf{elif}\;x1 \leq 1.16 \cdot 10^{-7}:\\
\;\;\;\;x2 \cdot -6 - x1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x1 < -3.9e6 or 1.1600000000000001e-7 < x1

    1. Initial program 43.3%

      \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    2. Taylor expanded in x1 around inf 39.0%

      \[\leadsto x1 + \left(\left(\color{blue}{6 \cdot {x1}^{4}} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    3. Step-by-step derivation
      1. *-commutative39.0%

        \[\leadsto x1 + \left(\left(\color{blue}{{x1}^{4} \cdot 6} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    4. Simplified39.0%

      \[\leadsto x1 + \left(\left(\color{blue}{{x1}^{4} \cdot 6} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    5. Taylor expanded in x1 around inf 86.7%

      \[\leadsto x1 + \color{blue}{\left(x1 + 6 \cdot {x1}^{4}\right)} \]
    6. Step-by-step derivation
      1. sqr-pow86.6%

        \[\leadsto x1 + \left(x1 + 6 \cdot \color{blue}{\left({x1}^{\left(\frac{4}{2}\right)} \cdot {x1}^{\left(\frac{4}{2}\right)}\right)}\right) \]
      2. metadata-eval86.6%

        \[\leadsto x1 + \left(x1 + 6 \cdot \left({x1}^{\color{blue}{2}} \cdot {x1}^{\left(\frac{4}{2}\right)}\right)\right) \]
      3. pow286.6%

        \[\leadsto x1 + \left(x1 + 6 \cdot \left(\color{blue}{\left(x1 \cdot x1\right)} \cdot {x1}^{\left(\frac{4}{2}\right)}\right)\right) \]
      4. metadata-eval86.6%

        \[\leadsto x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot {x1}^{\color{blue}{2}}\right)\right) \]
      5. pow286.6%

        \[\leadsto x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \color{blue}{\left(x1 \cdot x1\right)}\right)\right) \]
    7. Applied egg-rr86.6%

      \[\leadsto x1 + \left(x1 + 6 \cdot \color{blue}{\left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)}\right) \]

    if -3.9e6 < x1 < -4.00000000000000012e-117

    1. Initial program 99.7%

      \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    2. Taylor expanded in x1 around 0 96.5%

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    3. Taylor expanded in x1 around 0 95.6%

      \[\leadsto x1 + \color{blue}{\left(-6 \cdot x2 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right)\right)} \]
    4. Taylor expanded in x2 around inf 73.1%

      \[\leadsto x1 + \left(-6 \cdot x2 + \color{blue}{8 \cdot \left(x1 \cdot {x2}^{2}\right)}\right) \]
    5. Step-by-step derivation
      1. associate-*r*73.1%

        \[\leadsto x1 + \left(-6 \cdot x2 + \color{blue}{\left(8 \cdot x1\right) \cdot {x2}^{2}}\right) \]
      2. unpow273.1%

        \[\leadsto x1 + \left(-6 \cdot x2 + \left(8 \cdot x1\right) \cdot \color{blue}{\left(x2 \cdot x2\right)}\right) \]
    6. Simplified73.1%

      \[\leadsto x1 + \left(-6 \cdot x2 + \color{blue}{\left(8 \cdot x1\right) \cdot \left(x2 \cdot x2\right)}\right) \]

    if -4.00000000000000012e-117 < x1 < 1.1600000000000001e-7

    1. Initial program 98.3%

      \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    2. Taylor expanded in x1 around inf 81.4%

      \[\leadsto x1 + \left(\left(\color{blue}{6 \cdot {x1}^{4}} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    3. Step-by-step derivation
      1. *-commutative81.4%

        \[\leadsto x1 + \left(\left(\color{blue}{{x1}^{4} \cdot 6} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    4. Simplified81.4%

      \[\leadsto x1 + \left(\left(\color{blue}{{x1}^{4} \cdot 6} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    5. Taylor expanded in x1 around 0 81.6%

      \[\leadsto x1 + \color{blue}{\left(-6 \cdot x2 + -2 \cdot x1\right)} \]
    6. Step-by-step derivation
      1. *-commutative81.6%

        \[\leadsto x1 + \left(\color{blue}{x2 \cdot -6} + -2 \cdot x1\right) \]
      2. fma-def81.6%

        \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(x2, -6, -2 \cdot x1\right)} \]
      3. *-commutative81.6%

        \[\leadsto x1 + \mathsf{fma}\left(x2, -6, \color{blue}{x1 \cdot -2}\right) \]
    7. Simplified81.6%

      \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(x2, -6, x1 \cdot -2\right)} \]
    8. Taylor expanded in x1 around 0 81.7%

      \[\leadsto \color{blue}{-6 \cdot x2 + -1 \cdot x1} \]
    9. Step-by-step derivation
      1. *-commutative81.7%

        \[\leadsto \color{blue}{x2 \cdot -6} + -1 \cdot x1 \]
      2. mul-1-neg81.7%

        \[\leadsto x2 \cdot -6 + \color{blue}{\left(-x1\right)} \]
      3. unsub-neg81.7%

        \[\leadsto \color{blue}{x2 \cdot -6 - x1} \]
    10. Simplified81.7%

      \[\leadsto \color{blue}{x2 \cdot -6 - x1} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification83.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -3900000:\\ \;\;\;\;x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)\right)\\ \mathbf{elif}\;x1 \leq -4 \cdot 10^{-117}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + \left(x1 \cdot 8\right) \cdot \left(x2 \cdot x2\right)\right)\\ \mathbf{elif}\;x1 \leq 1.16 \cdot 10^{-7}:\\ \;\;\;\;x2 \cdot -6 - x1\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)\right)\\ \end{array} \]

Alternative 15: 48.0% accurate, 9.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x2 \leq -2.8 \cdot 10^{+32} \lor \neg \left(x2 \leq 1.46 \cdot 10^{+128}\right):\\ \;\;\;\;x1 + x1 \cdot \left(8 \cdot \left(x2 \cdot x2\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x2 \cdot -6 - x1\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (if (or (<= x2 -2.8e+32) (not (<= x2 1.46e+128)))
   (+ x1 (* x1 (* 8.0 (* x2 x2))))
   (- (* x2 -6.0) x1)))
double code(double x1, double x2) {
	double tmp;
	if ((x2 <= -2.8e+32) || !(x2 <= 1.46e+128)) {
		tmp = x1 + (x1 * (8.0 * (x2 * x2)));
	} else {
		tmp = (x2 * -6.0) - x1;
	}
	return tmp;
}
real(8) function code(x1, x2)
    real(8), intent (in) :: x1
    real(8), intent (in) :: x2
    real(8) :: tmp
    if ((x2 <= (-2.8d+32)) .or. (.not. (x2 <= 1.46d+128))) then
        tmp = x1 + (x1 * (8.0d0 * (x2 * x2)))
    else
        tmp = (x2 * (-6.0d0)) - x1
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double tmp;
	if ((x2 <= -2.8e+32) || !(x2 <= 1.46e+128)) {
		tmp = x1 + (x1 * (8.0 * (x2 * x2)));
	} else {
		tmp = (x2 * -6.0) - x1;
	}
	return tmp;
}
def code(x1, x2):
	tmp = 0
	if (x2 <= -2.8e+32) or not (x2 <= 1.46e+128):
		tmp = x1 + (x1 * (8.0 * (x2 * x2)))
	else:
		tmp = (x2 * -6.0) - x1
	return tmp
function code(x1, x2)
	tmp = 0.0
	if ((x2 <= -2.8e+32) || !(x2 <= 1.46e+128))
		tmp = Float64(x1 + Float64(x1 * Float64(8.0 * Float64(x2 * x2))));
	else
		tmp = Float64(Float64(x2 * -6.0) - x1);
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	tmp = 0.0;
	if ((x2 <= -2.8e+32) || ~((x2 <= 1.46e+128)))
		tmp = x1 + (x1 * (8.0 * (x2 * x2)));
	else
		tmp = (x2 * -6.0) - x1;
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := If[Or[LessEqual[x2, -2.8e+32], N[Not[LessEqual[x2, 1.46e+128]], $MachinePrecision]], N[(x1 + N[(x1 * N[(8.0 * N[(x2 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -2.8 \cdot 10^{+32} \lor \neg \left(x2 \leq 1.46 \cdot 10^{+128}\right):\\
\;\;\;\;x1 + x1 \cdot \left(8 \cdot \left(x2 \cdot x2\right)\right)\\

\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 - x1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x2 < -2.8e32 or 1.4599999999999999e128 < x2

    1. Initial program 69.9%

      \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    2. Taylor expanded in x1 around 0 50.9%

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    3. Taylor expanded in x2 around inf 64.4%

      \[\leadsto x1 + \color{blue}{8 \cdot \left(x1 \cdot {x2}^{2}\right)} \]
    4. Step-by-step derivation
      1. *-commutative64.4%

        \[\leadsto x1 + \color{blue}{\left(x1 \cdot {x2}^{2}\right) \cdot 8} \]
      2. associate-*l*64.4%

        \[\leadsto x1 + \color{blue}{x1 \cdot \left({x2}^{2} \cdot 8\right)} \]
      3. unpow264.4%

        \[\leadsto x1 + x1 \cdot \left(\color{blue}{\left(x2 \cdot x2\right)} \cdot 8\right) \]
    5. Simplified64.4%

      \[\leadsto x1 + \color{blue}{x1 \cdot \left(\left(x2 \cdot x2\right) \cdot 8\right)} \]

    if -2.8e32 < x2 < 1.4599999999999999e128

    1. Initial program 72.7%

      \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    2. Taylor expanded in x1 around inf 73.9%

      \[\leadsto x1 + \left(\left(\color{blue}{6 \cdot {x1}^{4}} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    3. Step-by-step derivation
      1. *-commutative73.9%

        \[\leadsto x1 + \left(\left(\color{blue}{{x1}^{4} \cdot 6} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    4. Simplified73.9%

      \[\leadsto x1 + \left(\left(\color{blue}{{x1}^{4} \cdot 6} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    5. Taylor expanded in x1 around 0 52.6%

      \[\leadsto x1 + \color{blue}{\left(-6 \cdot x2 + -2 \cdot x1\right)} \]
    6. Step-by-step derivation
      1. *-commutative52.6%

        \[\leadsto x1 + \left(\color{blue}{x2 \cdot -6} + -2 \cdot x1\right) \]
      2. fma-def52.6%

        \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(x2, -6, -2 \cdot x1\right)} \]
      3. *-commutative52.6%

        \[\leadsto x1 + \mathsf{fma}\left(x2, -6, \color{blue}{x1 \cdot -2}\right) \]
    7. Simplified52.6%

      \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(x2, -6, x1 \cdot -2\right)} \]
    8. Taylor expanded in x1 around 0 52.6%

      \[\leadsto \color{blue}{-6 \cdot x2 + -1 \cdot x1} \]
    9. Step-by-step derivation
      1. *-commutative52.6%

        \[\leadsto \color{blue}{x2 \cdot -6} + -1 \cdot x1 \]
      2. mul-1-neg52.6%

        \[\leadsto x2 \cdot -6 + \color{blue}{\left(-x1\right)} \]
      3. unsub-neg52.6%

        \[\leadsto \color{blue}{x2 \cdot -6 - x1} \]
    10. Simplified52.6%

      \[\leadsto \color{blue}{x2 \cdot -6 - x1} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification56.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x2 \leq -2.8 \cdot 10^{+32} \lor \neg \left(x2 \leq 1.46 \cdot 10^{+128}\right):\\ \;\;\;\;x1 + x1 \cdot \left(8 \cdot \left(x2 \cdot x2\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x2 \cdot -6 - x1\\ \end{array} \]

Alternative 16: 30.9% accurate, 13.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x2 \leq -1.85 \cdot 10^{-195}:\\ \;\;\;\;x2 \cdot -6\\ \mathbf{elif}\;x2 \leq 8 \cdot 10^{-85}:\\ \;\;\;\;-x1\\ \mathbf{else}:\\ \;\;\;\;x1 + x2 \cdot -6\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (if (<= x2 -1.85e-195)
   (* x2 -6.0)
   (if (<= x2 8e-85) (- x1) (+ x1 (* x2 -6.0)))))
double code(double x1, double x2) {
	double tmp;
	if (x2 <= -1.85e-195) {
		tmp = x2 * -6.0;
	} else if (x2 <= 8e-85) {
		tmp = -x1;
	} else {
		tmp = x1 + (x2 * -6.0);
	}
	return tmp;
}
real(8) function code(x1, x2)
    real(8), intent (in) :: x1
    real(8), intent (in) :: x2
    real(8) :: tmp
    if (x2 <= (-1.85d-195)) then
        tmp = x2 * (-6.0d0)
    else if (x2 <= 8d-85) then
        tmp = -x1
    else
        tmp = x1 + (x2 * (-6.0d0))
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double tmp;
	if (x2 <= -1.85e-195) {
		tmp = x2 * -6.0;
	} else if (x2 <= 8e-85) {
		tmp = -x1;
	} else {
		tmp = x1 + (x2 * -6.0);
	}
	return tmp;
}
def code(x1, x2):
	tmp = 0
	if x2 <= -1.85e-195:
		tmp = x2 * -6.0
	elif x2 <= 8e-85:
		tmp = -x1
	else:
		tmp = x1 + (x2 * -6.0)
	return tmp
function code(x1, x2)
	tmp = 0.0
	if (x2 <= -1.85e-195)
		tmp = Float64(x2 * -6.0);
	elseif (x2 <= 8e-85)
		tmp = Float64(-x1);
	else
		tmp = Float64(x1 + Float64(x2 * -6.0));
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	tmp = 0.0;
	if (x2 <= -1.85e-195)
		tmp = x2 * -6.0;
	elseif (x2 <= 8e-85)
		tmp = -x1;
	else
		tmp = x1 + (x2 * -6.0);
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := If[LessEqual[x2, -1.85e-195], N[(x2 * -6.0), $MachinePrecision], If[LessEqual[x2, 8e-85], (-x1), N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -1.85 \cdot 10^{-195}:\\
\;\;\;\;x2 \cdot -6\\

\mathbf{elif}\;x2 \leq 8 \cdot 10^{-85}:\\
\;\;\;\;-x1\\

\mathbf{else}:\\
\;\;\;\;x1 + x2 \cdot -6\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x2 < -1.84999999999999981e-195

    1. Initial program 64.7%

      \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    2. Taylor expanded in x1 around 0 47.4%

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    3. Taylor expanded in x1 around 0 29.5%

      \[\leadsto x1 + \color{blue}{-6 \cdot x2} \]
    4. Step-by-step derivation
      1. *-commutative29.5%

        \[\leadsto x1 + \color{blue}{x2 \cdot -6} \]
    5. Simplified29.5%

      \[\leadsto x1 + \color{blue}{x2 \cdot -6} \]
    6. Taylor expanded in x1 around 0 29.6%

      \[\leadsto \color{blue}{-6 \cdot x2} \]
    7. Step-by-step derivation
      1. *-commutative29.6%

        \[\leadsto \color{blue}{x2 \cdot -6} \]
    8. Simplified29.6%

      \[\leadsto \color{blue}{x2 \cdot -6} \]

    if -1.84999999999999981e-195 < x2 < 7.9999999999999998e-85

    1. Initial program 75.7%

      \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    2. Taylor expanded in x1 around 0 52.2%

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    3. Taylor expanded in x1 around 0 52.8%

      \[\leadsto x1 + \color{blue}{\left(-6 \cdot x2 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right)\right)} \]
    4. Taylor expanded in x2 around 0 38.9%

      \[\leadsto \color{blue}{x1 + -2 \cdot x1} \]
    5. Step-by-step derivation
      1. distribute-rgt1-in38.9%

        \[\leadsto \color{blue}{\left(-2 + 1\right) \cdot x1} \]
      2. metadata-eval38.9%

        \[\leadsto \color{blue}{-1} \cdot x1 \]
      3. mul-1-neg38.9%

        \[\leadsto \color{blue}{-x1} \]
    6. Simplified38.9%

      \[\leadsto \color{blue}{-x1} \]

    if 7.9999999999999998e-85 < x2

    1. Initial program 76.5%

      \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    2. Taylor expanded in x1 around 0 58.2%

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    3. Taylor expanded in x1 around 0 32.7%

      \[\leadsto x1 + \color{blue}{-6 \cdot x2} \]
    4. Step-by-step derivation
      1. *-commutative32.7%

        \[\leadsto x1 + \color{blue}{x2 \cdot -6} \]
    5. Simplified32.7%

      \[\leadsto x1 + \color{blue}{x2 \cdot -6} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification33.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x2 \leq -1.85 \cdot 10^{-195}:\\ \;\;\;\;x2 \cdot -6\\ \mathbf{elif}\;x2 \leq 8 \cdot 10^{-85}:\\ \;\;\;\;-x1\\ \mathbf{else}:\\ \;\;\;\;x1 + x2 \cdot -6\\ \end{array} \]

Alternative 17: 30.6% accurate, 17.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x2 \leq -8.2 \cdot 10^{-199}:\\ \;\;\;\;x2 \cdot -6\\ \mathbf{elif}\;x2 \leq 7.6 \cdot 10^{-85}:\\ \;\;\;\;-x1\\ \mathbf{else}:\\ \;\;\;\;x2 \cdot -6\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (if (<= x2 -8.2e-199) (* x2 -6.0) (if (<= x2 7.6e-85) (- x1) (* x2 -6.0))))
double code(double x1, double x2) {
	double tmp;
	if (x2 <= -8.2e-199) {
		tmp = x2 * -6.0;
	} else if (x2 <= 7.6e-85) {
		tmp = -x1;
	} else {
		tmp = x2 * -6.0;
	}
	return tmp;
}
real(8) function code(x1, x2)
    real(8), intent (in) :: x1
    real(8), intent (in) :: x2
    real(8) :: tmp
    if (x2 <= (-8.2d-199)) then
        tmp = x2 * (-6.0d0)
    else if (x2 <= 7.6d-85) then
        tmp = -x1
    else
        tmp = x2 * (-6.0d0)
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double tmp;
	if (x2 <= -8.2e-199) {
		tmp = x2 * -6.0;
	} else if (x2 <= 7.6e-85) {
		tmp = -x1;
	} else {
		tmp = x2 * -6.0;
	}
	return tmp;
}
def code(x1, x2):
	tmp = 0
	if x2 <= -8.2e-199:
		tmp = x2 * -6.0
	elif x2 <= 7.6e-85:
		tmp = -x1
	else:
		tmp = x2 * -6.0
	return tmp
function code(x1, x2)
	tmp = 0.0
	if (x2 <= -8.2e-199)
		tmp = Float64(x2 * -6.0);
	elseif (x2 <= 7.6e-85)
		tmp = Float64(-x1);
	else
		tmp = Float64(x2 * -6.0);
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	tmp = 0.0;
	if (x2 <= -8.2e-199)
		tmp = x2 * -6.0;
	elseif (x2 <= 7.6e-85)
		tmp = -x1;
	else
		tmp = x2 * -6.0;
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := If[LessEqual[x2, -8.2e-199], N[(x2 * -6.0), $MachinePrecision], If[LessEqual[x2, 7.6e-85], (-x1), N[(x2 * -6.0), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -8.2 \cdot 10^{-199}:\\
\;\;\;\;x2 \cdot -6\\

\mathbf{elif}\;x2 \leq 7.6 \cdot 10^{-85}:\\
\;\;\;\;-x1\\

\mathbf{else}:\\
\;\;\;\;x2 \cdot -6\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x2 < -8.20000000000000043e-199 or 7.5999999999999997e-85 < x2

    1. Initial program 70.1%

      \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    2. Taylor expanded in x1 around 0 52.4%

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    3. Taylor expanded in x1 around 0 31.0%

      \[\leadsto x1 + \color{blue}{-6 \cdot x2} \]
    4. Step-by-step derivation
      1. *-commutative31.0%

        \[\leadsto x1 + \color{blue}{x2 \cdot -6} \]
    5. Simplified31.0%

      \[\leadsto x1 + \color{blue}{x2 \cdot -6} \]
    6. Taylor expanded in x1 around 0 31.0%

      \[\leadsto \color{blue}{-6 \cdot x2} \]
    7. Step-by-step derivation
      1. *-commutative31.0%

        \[\leadsto \color{blue}{x2 \cdot -6} \]
    8. Simplified31.0%

      \[\leadsto \color{blue}{x2 \cdot -6} \]

    if -8.20000000000000043e-199 < x2 < 7.5999999999999997e-85

    1. Initial program 75.7%

      \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    2. Taylor expanded in x1 around 0 52.2%

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    3. Taylor expanded in x1 around 0 52.8%

      \[\leadsto x1 + \color{blue}{\left(-6 \cdot x2 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right)\right)} \]
    4. Taylor expanded in x2 around 0 38.9%

      \[\leadsto \color{blue}{x1 + -2 \cdot x1} \]
    5. Step-by-step derivation
      1. distribute-rgt1-in38.9%

        \[\leadsto \color{blue}{\left(-2 + 1\right) \cdot x1} \]
      2. metadata-eval38.9%

        \[\leadsto \color{blue}{-1} \cdot x1 \]
      3. mul-1-neg38.9%

        \[\leadsto \color{blue}{-x1} \]
    6. Simplified38.9%

      \[\leadsto \color{blue}{-x1} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification33.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x2 \leq -8.2 \cdot 10^{-199}:\\ \;\;\;\;x2 \cdot -6\\ \mathbf{elif}\;x2 \leq 7.6 \cdot 10^{-85}:\\ \;\;\;\;-x1\\ \mathbf{else}:\\ \;\;\;\;x2 \cdot -6\\ \end{array} \]

Alternative 18: 38.0% accurate, 25.4× speedup?

\[\begin{array}{l} \\ x2 \cdot -6 - x1 \end{array} \]
(FPCore (x1 x2) :precision binary64 (- (* x2 -6.0) x1))
double code(double x1, double x2) {
	return (x2 * -6.0) - x1;
}
real(8) function code(x1, x2)
    real(8), intent (in) :: x1
    real(8), intent (in) :: x2
    code = (x2 * (-6.0d0)) - x1
end function
public static double code(double x1, double x2) {
	return (x2 * -6.0) - x1;
}
def code(x1, x2):
	return (x2 * -6.0) - x1
function code(x1, x2)
	return Float64(Float64(x2 * -6.0) - x1)
end
function tmp = code(x1, x2)
	tmp = (x2 * -6.0) - x1;
end
code[x1_, x2_] := N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision]
\begin{array}{l}

\\
x2 \cdot -6 - x1
\end{array}
Derivation
  1. Initial program 71.8%

    \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
  2. Taylor expanded in x1 around inf 56.7%

    \[\leadsto x1 + \left(\left(\color{blue}{6 \cdot {x1}^{4}} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
  3. Step-by-step derivation
    1. *-commutative56.7%

      \[\leadsto x1 + \left(\left(\color{blue}{{x1}^{4} \cdot 6} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
  4. Simplified56.7%

    \[\leadsto x1 + \left(\left(\color{blue}{{x1}^{4} \cdot 6} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
  5. Taylor expanded in x1 around 0 39.7%

    \[\leadsto x1 + \color{blue}{\left(-6 \cdot x2 + -2 \cdot x1\right)} \]
  6. Step-by-step derivation
    1. *-commutative39.7%

      \[\leadsto x1 + \left(\color{blue}{x2 \cdot -6} + -2 \cdot x1\right) \]
    2. fma-def39.8%

      \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(x2, -6, -2 \cdot x1\right)} \]
    3. *-commutative39.8%

      \[\leadsto x1 + \mathsf{fma}\left(x2, -6, \color{blue}{x1 \cdot -2}\right) \]
  7. Simplified39.8%

    \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(x2, -6, x1 \cdot -2\right)} \]
  8. Taylor expanded in x1 around 0 39.8%

    \[\leadsto \color{blue}{-6 \cdot x2 + -1 \cdot x1} \]
  9. Step-by-step derivation
    1. *-commutative39.8%

      \[\leadsto \color{blue}{x2 \cdot -6} + -1 \cdot x1 \]
    2. mul-1-neg39.8%

      \[\leadsto x2 \cdot -6 + \color{blue}{\left(-x1\right)} \]
    3. unsub-neg39.8%

      \[\leadsto \color{blue}{x2 \cdot -6 - x1} \]
  10. Simplified39.8%

    \[\leadsto \color{blue}{x2 \cdot -6 - x1} \]
  11. Final simplification39.8%

    \[\leadsto x2 \cdot -6 - x1 \]

Alternative 19: 13.8% accurate, 63.5× speedup?

\[\begin{array}{l} \\ -x1 \end{array} \]
(FPCore (x1 x2) :precision binary64 (- x1))
double code(double x1, double x2) {
	return -x1;
}
real(8) function code(x1, x2)
    real(8), intent (in) :: x1
    real(8), intent (in) :: x2
    code = -x1
end function
public static double code(double x1, double x2) {
	return -x1;
}
def code(x1, x2):
	return -x1
function code(x1, x2)
	return Float64(-x1)
end
function tmp = code(x1, x2)
	tmp = -x1;
end
code[x1_, x2_] := (-x1)
\begin{array}{l}

\\
-x1
\end{array}
Derivation
  1. Initial program 71.8%

    \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
  2. Taylor expanded in x1 around 0 52.3%

    \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
  3. Taylor expanded in x1 around 0 59.4%

    \[\leadsto x1 + \color{blue}{\left(-6 \cdot x2 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right)\right)} \]
  4. Taylor expanded in x2 around 0 15.0%

    \[\leadsto \color{blue}{x1 + -2 \cdot x1} \]
  5. Step-by-step derivation
    1. distribute-rgt1-in15.0%

      \[\leadsto \color{blue}{\left(-2 + 1\right) \cdot x1} \]
    2. metadata-eval15.0%

      \[\leadsto \color{blue}{-1} \cdot x1 \]
    3. mul-1-neg15.0%

      \[\leadsto \color{blue}{-x1} \]
  6. Simplified15.0%

    \[\leadsto \color{blue}{-x1} \]
  7. Final simplification15.0%

    \[\leadsto -x1 \]

Alternative 20: 3.2% accurate, 127.0× speedup?

\[\begin{array}{l} \\ x1 \end{array} \]
(FPCore (x1 x2) :precision binary64 x1)
double code(double x1, double x2) {
	return x1;
}
real(8) function code(x1, x2)
    real(8), intent (in) :: x1
    real(8), intent (in) :: x2
    code = x1
end function
public static double code(double x1, double x2) {
	return x1;
}
def code(x1, x2):
	return x1
function code(x1, x2)
	return x1
end
function tmp = code(x1, x2)
	tmp = x1;
end
code[x1_, x2_] := x1
\begin{array}{l}

\\
x1
\end{array}
Derivation
  1. Initial program 71.8%

    \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
  2. Taylor expanded in x1 around 0 52.3%

    \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
  3. Taylor expanded in x1 around 0 25.9%

    \[\leadsto x1 + \color{blue}{-6 \cdot x2} \]
  4. Step-by-step derivation
    1. *-commutative25.9%

      \[\leadsto x1 + \color{blue}{x2 \cdot -6} \]
  5. Simplified25.9%

    \[\leadsto x1 + \color{blue}{x2 \cdot -6} \]
  6. Taylor expanded in x1 around inf 3.3%

    \[\leadsto \color{blue}{x1} \]
  7. Final simplification3.3%

    \[\leadsto x1 \]

Reproduce

?
herbie shell --seed 2023271 
(FPCore (x1 x2)
  :name "Rosa's FloatVsDoubleBenchmark"
  :precision binary64
  (+ x1 (+ (+ (+ (+ (* (+ (* (* (* 2.0 x1) (/ (- (+ (* (* 3.0 x1) x1) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0))) (- (/ (- (+ (* (* 3.0 x1) x1) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)) 3.0)) (* (* x1 x1) (- (* 4.0 (/ (- (+ (* (* 3.0 x1) x1) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0))) 6.0))) (+ (* x1 x1) 1.0)) (* (* (* 3.0 x1) x1) (/ (- (+ (* (* 3.0 x1) x1) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)))) (* (* x1 x1) x1)) x1) (* 3.0 (/ (- (- (* (* 3.0 x1) x1) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0))))))