Rosa's FloatVsDoubleBenchmark

Percentage Accurate: 70.7% → 99.4%
Time: 2.2min
Alternatives: 24
Speedup: 1.7×

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 24 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.7% 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.4% accurate, 0.1× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\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.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. Applied egg-rr91.1%

      \[\leadsto x1 + \left(\left(\color{blue}{\mathsf{fma}\left(x1, x1 \cdot x1, \mathsf{fma}\left(3 \cdot x1, x1 \cdot \frac{3 \cdot \left(x1 \cdot x1\right) - \mathsf{fma}\left(x2, -2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, \mathsf{fma}\left(x1, x1, 1\right) \cdot \mathsf{fma}\left(\frac{3 \cdot \left(x1 \cdot x1\right) - \mathsf{fma}\left(x2, -2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)} + -3, \frac{x1 \cdot \left(2 \cdot \left(3 \cdot \left(x1 \cdot x1\right) - \mathsf{fma}\left(x2, -2, x1\right)\right)\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, \left(x1 \cdot x1\right) \cdot \mathsf{fma}\left(\frac{3 \cdot \left(x1 \cdot x1\right) - \mathsf{fma}\left(x2, -2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, 4, -6\right)\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. Simplified99.4%

      \[\leadsto x1 + \left(\left(\color{blue}{\left({x1}^{3} + \mathsf{fma}\left(3 \cdot x1, x1 \cdot \frac{3 \cdot \left(x1 \cdot x1\right) - \mathsf{fma}\left(x2, -2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, \mathsf{fma}\left(x1, x1, 1\right) \cdot \mathsf{fma}\left(-3 + \frac{3 \cdot \left(x1 \cdot x1\right) - \mathsf{fma}\left(x2, -2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, \frac{x1}{\frac{\mathsf{fma}\left(x1, x1, 1\right)}{2 \cdot \left(3 \cdot \left(x1 \cdot x1\right) - \mathsf{fma}\left(x2, -2, x1\right)\right)}}, x1 \cdot \left(x1 \cdot \mathsf{fma}\left(\frac{3 \cdot \left(x1 \cdot x1\right) - \mathsf{fma}\left(x2, -2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, 4, -6\right)\right)\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 +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 10.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. *-commutative10.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. Simplified10.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.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 + \left(\left(x1 + \left(\left(\left(x1 \cdot x1 + 1\right) \cdot \left(\left(\left(x1 \cdot 2\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\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}^{3} + \mathsf{fma}\left(x1 \cdot 3, x1 \cdot \frac{3 \cdot \left(x1 \cdot x1\right) - \mathsf{fma}\left(x2, -2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, \mathsf{fma}\left(x1, x1, 1\right) \cdot \mathsf{fma}\left(\frac{3 \cdot \left(x1 \cdot x1\right) - \mathsf{fma}\left(x2, -2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)} + -3, \frac{x1}{\frac{\mathsf{fma}\left(x1, x1, 1\right)}{2 \cdot \left(3 \cdot \left(x1 \cdot x1\right) - \mathsf{fma}\left(x2, -2, x1\right)\right)}}, x1 \cdot \left(x1 \cdot \mathsf{fma}\left(\frac{3 \cdot \left(x1 \cdot x1\right) - \mathsf{fma}\left(x2, -2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, 4, -6\right)\right)\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\right)\\ \end{array} \]

Alternative 2: 99.4% accurate, 0.5× 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}\\ t_3 := x1 + \left(\left(x1 + \left(\left(t_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_2 \cdot 4 - 6\right)\right) + t_0 \cdot t_2\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1}\right)\\ \mathbf{if}\;t_3 \leq \infty:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\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))
        (t_3
         (+
          x1
          (+
           (+
            x1
            (+
             (+
              (*
               t_1
               (+
                (* (* (* x1 2.0) t_2) (- t_2 3.0))
                (* (* x1 x1) (- (* t_2 4.0) 6.0))))
              (* t_0 t_2))
             (* x1 (* x1 x1))))
           (* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
   (if (<= t_3 INFINITY) t_3 (+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) 9.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 t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
	double tmp;
	if (t_3 <= ((double) INFINITY)) {
		tmp = t_3;
	} else {
		tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + 9.0);
	}
	return tmp;
}
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 t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
	double tmp;
	if (t_3 <= Double.POSITIVE_INFINITY) {
		tmp = t_3;
	} else {
		tmp = x1 + ((x1 + (6.0 * Math.pow(x1, 4.0))) + 9.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
	t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))
	tmp = 0
	if t_3 <= math.inf:
		tmp = t_3
	else:
		tmp = x1 + ((x1 + (6.0 * math.pow(x1, 4.0))) + 9.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)
	t_3 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(t_0 * t_2)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1))))
	tmp = 0.0
	if (t_3 <= Inf)
		tmp = t_3;
	else
		tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + 9.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;
	t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
	tmp = 0.0;
	if (t_3 <= Inf)
		tmp = t_3;
	else
		tmp = x1 + ((x1 + (6.0 * (x1 ^ 4.0))) + 9.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]}, Block[{t$95$3 = N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $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$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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]}, If[LessEqual[t$95$3, Infinity], t$95$3, N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $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}\\
t_3 := x1 + \left(\left(x1 + \left(\left(t_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_2 \cdot 4 - 6\right)\right) + t_0 \cdot t_2\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1}\right)\\
\mathbf{if}\;t_3 \leq \infty:\\
\;\;\;\;t_3\\

\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\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.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) \]

    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 10.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. *-commutative10.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. Simplified10.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.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 + \left(\left(x1 + \left(\left(\left(x1 \cdot x1 + 1\right) \cdot \left(\left(\left(x1 \cdot 2\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\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(\left(x1 \cdot 2\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\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(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\right)\\ \end{array} \]

Alternative 3: 95.1% 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 -9 \cdot 10^{+52} \lor \neg \left(x1 \leq 1.3 \cdot 10^{+67}\right):\\ \;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\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_0 \cdot t_2 + t_1 \cdot \left(\left(t_2 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2 - x1\right)\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(2 \cdot x2 + 3 \cdot \left(x1 \cdot x1\right)\right) - x1}{t_1} - 6\right)\right)\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 -9e+52) (not (<= x1 1.3e+67)))
     (+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) 9.0))
     (+
      x1
      (+
       (* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))
       (+
        x1
        (+
         (* x1 (* x1 x1))
         (+
          (* t_0 t_2)
          (*
           t_1
           (+
            (* (- t_2 3.0) (* (* x1 2.0) (- (* 2.0 x2) x1)))
            (*
             (* x1 x1)
             (-
              (* 4.0 (/ (- (+ (* 2.0 x2) (* 3.0 (* x1 x1))) x1) t_1))
              6.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 <= -9e+52) || !(x1 <= 1.3e+67)) {
		tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + 9.0);
	} else {
		tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((t_2 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1))) + ((x1 * x1) * ((4.0 * ((((2.0 * x2) + (3.0 * (x1 * x1))) - x1) / t_1)) - 6.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 <= (-9d+52)) .or. (.not. (x1 <= 1.3d+67))) then
        tmp = x1 + ((x1 + (6.0d0 * (x1 ** 4.0d0))) + 9.0d0)
    else
        tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((t_2 - 3.0d0) * ((x1 * 2.0d0) * ((2.0d0 * x2) - x1))) + ((x1 * x1) * ((4.0d0 * ((((2.0d0 * x2) + (3.0d0 * (x1 * x1))) - x1) / t_1)) - 6.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 <= -9e+52) || !(x1 <= 1.3e+67)) {
		tmp = x1 + ((x1 + (6.0 * Math.pow(x1, 4.0))) + 9.0);
	} else {
		tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((t_2 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1))) + ((x1 * x1) * ((4.0 * ((((2.0 * x2) + (3.0 * (x1 * x1))) - x1) / t_1)) - 6.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 <= -9e+52) or not (x1 <= 1.3e+67):
		tmp = x1 + ((x1 + (6.0 * math.pow(x1, 4.0))) + 9.0)
	else:
		tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((t_2 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1))) + ((x1 * x1) * ((4.0 * ((((2.0 * x2) + (3.0 * (x1 * x1))) - x1) / t_1)) - 6.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 <= -9e+52) || !(x1 <= 1.3e+67))
		tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + 9.0));
	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_0 * t_2) + Float64(t_1 * Float64(Float64(Float64(t_2 - 3.0) * Float64(Float64(x1 * 2.0) * Float64(Float64(2.0 * x2) - x1))) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * Float64(Float64(Float64(Float64(2.0 * x2) + Float64(3.0 * Float64(x1 * x1))) - x1) / t_1)) - 6.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 <= -9e+52) || ~((x1 <= 1.3e+67)))
		tmp = x1 + ((x1 + (6.0 * (x1 ^ 4.0))) + 9.0);
	else
		tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((t_2 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1))) + ((x1 * x1) * ((4.0 * ((((2.0 * x2) + (3.0 * (x1 * x1))) - x1) / t_1)) - 6.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, -9e+52], N[Not[LessEqual[x1, 1.3e+67]], $MachinePrecision]], N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $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$0 * t$95$2), $MachinePrecision] + N[(t$95$1 * N[(N[(N[(t$95$2 - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * N[(N[(N[(N[(2.0 * x2), $MachinePrecision] + N[(3.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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 -9 \cdot 10^{+52} \lor \neg \left(x1 \leq 1.3 \cdot 10^{+67}\right):\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\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_0 \cdot t_2 + t_1 \cdot \left(\left(t_2 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2 - x1\right)\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(2 \cdot x2 + 3 \cdot \left(x1 \cdot x1\right)\right) - x1}{t_1} - 6\right)\right)\right)\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x1 < -8.9999999999999999e52 or 1.3e67 < x1

    1. Initial program 34.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 inf 39.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. *-commutative39.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. Simplified39.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 97.4%

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

    if -8.9999999999999999e52 < x1 < 1.3e67

    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 94.9%

      \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \color{blue}{\left(-1 \cdot x1 + 2 \cdot x2\right)}\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) \]
    3. Taylor expanded in x1 around 0 94.9%

      \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \left(-1 \cdot x1 + 2 \cdot x2\right)\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(\color{blue}{3 \cdot {x1}^{2}} + 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) \]
    4. Step-by-step derivation
      1. unpow294.9%

        \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \left(-1 \cdot x1 + 2 \cdot x2\right)\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(3 \cdot \color{blue}{\left(x1 \cdot x1\right)} + 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) \]
    5. Simplified94.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -9 \cdot 10^{+52} \lor \neg \left(x1 \leq 1.3 \cdot 10^{+67}\right):\\ \;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\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 \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} - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2 - x1\right)\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(2 \cdot x2 + 3 \cdot \left(x1 \cdot x1\right)\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right)\right)\right)\right)\right)\\ \end{array} \]

Alternative 4: 95.5% 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 -4 \cdot 10^{+101} \lor \neg \left(x1 \leq 2.6 \cdot 10^{+67}\right):\\ \;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\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_0 \cdot t_2 + t_1 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(t_2 \cdot 4 - 6\right) + \left(t_2 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2 - x1\right)\right)\right)\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 -4e+101) (not (<= x1 2.6e+67)))
     (+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) 9.0))
     (+
      x1
      (+
       (* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))
       (+
        x1
        (+
         (* x1 (* x1 x1))
         (+
          (* t_0 t_2)
          (*
           t_1
           (+
            (* (* x1 x1) (- (* t_2 4.0) 6.0))
            (* (- t_2 3.0) (* (* x1 2.0) (- (* 2.0 x2) x1)))))))))))))
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 <= -4e+101) || !(x1 <= 2.6e+67)) {
		tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + 9.0);
	} else {
		tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((x1 * x1) * ((t_2 * 4.0) - 6.0)) + ((t_2 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1)))))))));
	}
	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 <= (-4d+101)) .or. (.not. (x1 <= 2.6d+67))) then
        tmp = x1 + ((x1 + (6.0d0 * (x1 ** 4.0d0))) + 9.0d0)
    else
        tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((x1 * x1) * ((t_2 * 4.0d0) - 6.0d0)) + ((t_2 - 3.0d0) * ((x1 * 2.0d0) * ((2.0d0 * x2) - x1)))))))))
    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 <= -4e+101) || !(x1 <= 2.6e+67)) {
		tmp = x1 + ((x1 + (6.0 * Math.pow(x1, 4.0))) + 9.0);
	} else {
		tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((x1 * x1) * ((t_2 * 4.0) - 6.0)) + ((t_2 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1)))))))));
	}
	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 <= -4e+101) or not (x1 <= 2.6e+67):
		tmp = x1 + ((x1 + (6.0 * math.pow(x1, 4.0))) + 9.0)
	else:
		tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((x1 * x1) * ((t_2 * 4.0) - 6.0)) + ((t_2 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1)))))))))
	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 <= -4e+101) || !(x1 <= 2.6e+67))
		tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + 9.0));
	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_0 * t_2) + Float64(t_1 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)) + Float64(Float64(t_2 - 3.0) * Float64(Float64(x1 * 2.0) * Float64(Float64(2.0 * x2) - x1))))))))));
	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 <= -4e+101) || ~((x1 <= 2.6e+67)))
		tmp = x1 + ((x1 + (6.0 * (x1 ^ 4.0))) + 9.0);
	else
		tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((x1 * x1) * ((t_2 * 4.0) - 6.0)) + ((t_2 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1)))))))));
	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, -4e+101], N[Not[LessEqual[x1, 2.6e+67]], $MachinePrecision]], N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $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$0 * t$95$2), $MachinePrecision] + N[(t$95$1 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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 -4 \cdot 10^{+101} \lor \neg \left(x1 \leq 2.6 \cdot 10^{+67}\right):\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\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_0 \cdot t_2 + t_1 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(t_2 \cdot 4 - 6\right) + \left(t_2 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2 - x1\right)\right)\right)\right)\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x1 < -3.9999999999999999e101 or 2.6e67 < x1

    1. Initial program 27.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 33.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. *-commutative33.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. Simplified33.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 97.1%

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

    if -3.9999999999999999e101 < x1 < 2.6e67

    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 0 95.2%

      \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \color{blue}{\left(-1 \cdot x1 + 2 \cdot x2\right)}\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) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification96.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -4 \cdot 10^{+101} \lor \neg \left(x1 \leq 2.6 \cdot 10^{+67}\right):\\ \;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\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 \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(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) + \left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2 - x1\right)\right)\right)\right)\right)\right)\right)\\ \end{array} \]

Alternative 5: 96.9% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 \cdot \left(x1 \cdot 3\right)\\ t_1 := x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\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(\left(t_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_3\right) \cdot \left(t_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_3 \cdot 4 - 6\right)\right) + t_0 \cdot t_3\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 9\right)\\ \mathbf{if}\;x1 \leq -1.22 \cdot 10^{+53}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x1 \leq -0.0011:\\ \;\;\;\;t_4\\ \mathbf{elif}\;x1 \leq 1.1 \cdot 10^{-27}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_2} + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2\right) + x1 \cdot -3\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 4.2 \cdot 10^{+69}:\\ \;\;\;\;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 (pow x1 4.0))) 9.0)))
        (t_2 (+ (* x1 x1) 1.0))
        (t_3 (/ (- (+ t_0 (* 2.0 x2)) x1) t_2))
        (t_4
         (+
          x1
          (+
           (+
            x1
            (+
             (+
              (*
               t_2
               (+
                (* (* (* x1 2.0) t_3) (- t_3 3.0))
                (* (* x1 x1) (- (* t_3 4.0) 6.0))))
              (* t_0 t_3))
             (* x1 (* x1 x1))))
           9.0))))
   (if (<= x1 -1.22e+53)
     t_1
     (if (<= x1 -0.0011)
       t_4
       (if (<= x1 1.1e-27)
         (+
          x1
          (+
           (* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_2))
           (+ x1 (* 4.0 (* x2 (+ (* x1 (* 2.0 x2)) (* x1 -3.0)))))))
         (if (<= x1 4.2e+69) t_4 t_1))))))
double code(double x1, double x2) {
	double t_0 = x1 * (x1 * 3.0);
	double t_1 = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + 9.0);
	double t_2 = (x1 * x1) + 1.0;
	double t_3 = ((t_0 + (2.0 * x2)) - x1) / t_2;
	double t_4 = x1 + ((x1 + (((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_0 * t_3)) + (x1 * (x1 * x1)))) + 9.0);
	double tmp;
	if (x1 <= -1.22e+53) {
		tmp = t_1;
	} else if (x1 <= -0.0011) {
		tmp = t_4;
	} else if (x1 <= 1.1e-27) {
		tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)) + (x1 + (4.0 * (x2 * ((x1 * (2.0 * x2)) + (x1 * -3.0))))));
	} else if (x1 <= 4.2e+69) {
		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 ** 4.0d0))) + 9.0d0)
    t_2 = (x1 * x1) + 1.0d0
    t_3 = ((t_0 + (2.0d0 * x2)) - x1) / t_2
    t_4 = x1 + ((x1 + (((t_2 * ((((x1 * 2.0d0) * t_3) * (t_3 - 3.0d0)) + ((x1 * x1) * ((t_3 * 4.0d0) - 6.0d0)))) + (t_0 * t_3)) + (x1 * (x1 * x1)))) + 9.0d0)
    if (x1 <= (-1.22d+53)) then
        tmp = t_1
    else if (x1 <= (-0.0011d0)) then
        tmp = t_4
    else if (x1 <= 1.1d-27) then
        tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_2)) + (x1 + (4.0d0 * (x2 * ((x1 * (2.0d0 * x2)) + (x1 * (-3.0d0)))))))
    else if (x1 <= 4.2d+69) 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 * Math.pow(x1, 4.0))) + 9.0);
	double t_2 = (x1 * x1) + 1.0;
	double t_3 = ((t_0 + (2.0 * x2)) - x1) / t_2;
	double t_4 = x1 + ((x1 + (((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_0 * t_3)) + (x1 * (x1 * x1)))) + 9.0);
	double tmp;
	if (x1 <= -1.22e+53) {
		tmp = t_1;
	} else if (x1 <= -0.0011) {
		tmp = t_4;
	} else if (x1 <= 1.1e-27) {
		tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)) + (x1 + (4.0 * (x2 * ((x1 * (2.0 * x2)) + (x1 * -3.0))))));
	} else if (x1 <= 4.2e+69) {
		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 * math.pow(x1, 4.0))) + 9.0)
	t_2 = (x1 * x1) + 1.0
	t_3 = ((t_0 + (2.0 * x2)) - x1) / t_2
	t_4 = x1 + ((x1 + (((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_0 * t_3)) + (x1 * (x1 * x1)))) + 9.0)
	tmp = 0
	if x1 <= -1.22e+53:
		tmp = t_1
	elif x1 <= -0.0011:
		tmp = t_4
	elif x1 <= 1.1e-27:
		tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)) + (x1 + (4.0 * (x2 * ((x1 * (2.0 * x2)) + (x1 * -3.0))))))
	elif x1 <= 4.2e+69:
		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(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + 9.0))
	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(Float64(t_2 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)))) + Float64(t_0 * t_3)) + Float64(x1 * Float64(x1 * x1)))) + 9.0))
	tmp = 0.0
	if (x1 <= -1.22e+53)
		tmp = t_1;
	elseif (x1 <= -0.0011)
		tmp = t_4;
	elseif (x1 <= 1.1e-27)
		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(x2 * Float64(Float64(x1 * Float64(2.0 * x2)) + Float64(x1 * -3.0)))))));
	elseif (x1 <= 4.2e+69)
		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 ^ 4.0))) + 9.0);
	t_2 = (x1 * x1) + 1.0;
	t_3 = ((t_0 + (2.0 * x2)) - x1) / t_2;
	t_4 = x1 + ((x1 + (((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_0 * t_3)) + (x1 * (x1 * x1)))) + 9.0);
	tmp = 0.0;
	if (x1 <= -1.22e+53)
		tmp = t_1;
	elseif (x1 <= -0.0011)
		tmp = t_4;
	elseif (x1 <= 1.1e-27)
		tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)) + (x1 + (4.0 * (x2 * ((x1 * (2.0 * x2)) + (x1 * -3.0))))));
	elseif (x1 <= 4.2e+69)
		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[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $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[(N[(t$95$2 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $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$0 * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.22e+53], t$95$1, If[LessEqual[x1, -0.0011], t$95$4, If[LessEqual[x1, 1.1e-27], 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[(x2 * N[(N[(x1 * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] + N[(x1 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.2e+69], 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(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\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(\left(t_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_3\right) \cdot \left(t_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_3 \cdot 4 - 6\right)\right) + t_0 \cdot t_3\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 9\right)\\
\mathbf{if}\;x1 \leq -1.22 \cdot 10^{+53}:\\
\;\;\;\;t_1\\

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

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

\mathbf{elif}\;x1 \leq 4.2 \cdot 10^{+69}:\\
\;\;\;\;t_4\\

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


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

    1. Initial program 32.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 39.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. *-commutative39.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. Simplified39.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 inf 98.1%

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

    if -1.21999999999999999e53 < x1 < -0.00110000000000000007 or 1.09999999999999993e-27 < x1 < 4.2000000000000003e69

    1. Initial program 96.2%

      \[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.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}{3}\right) \]

    if -0.00110000000000000007 < x1 < 1.09999999999999993e-27

    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 87.7%

      \[\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. Step-by-step derivation
      1. associate-*r*99.3%

        \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(\left(x1 \cdot x2\right) \cdot \left(2 \cdot x2 - 3\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) \]
      2. sub-neg99.3%

        \[\leadsto x1 + \left(\left(4 \cdot \left(\left(x1 \cdot x2\right) \cdot \color{blue}{\left(2 \cdot x2 + \left(-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. metadata-eval99.3%

        \[\leadsto x1 + \left(\left(4 \cdot \left(\left(x1 \cdot x2\right) \cdot \left(2 \cdot x2 + \color{blue}{-3}\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. distribute-rgt-in99.3%

        \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(\left(2 \cdot x2\right) \cdot \left(x1 \cdot x2\right) + -3 \cdot \left(x1 \cdot x2\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) \]
      5. *-commutative99.3%

        \[\leadsto x1 + \left(\left(4 \cdot \left(\color{blue}{\left(x2 \cdot 2\right)} \cdot \left(x1 \cdot x2\right) + -3 \cdot \left(x1 \cdot x2\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. Applied egg-rr99.3%

      \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(\left(x2 \cdot 2\right) \cdot \left(x1 \cdot x2\right) + -3 \cdot \left(x1 \cdot x2\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) \]
    5. Step-by-step derivation
      1. *-commutative99.3%

        \[\leadsto x1 + \left(\left(4 \cdot \left(\color{blue}{\left(2 \cdot x2\right)} \cdot \left(x1 \cdot x2\right) + -3 \cdot \left(x1 \cdot x2\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) \]
      2. associate-*r*99.3%

        \[\leadsto x1 + \left(\left(4 \cdot \left(\color{blue}{\left(\left(2 \cdot x2\right) \cdot x1\right) \cdot x2} + -3 \cdot \left(x1 \cdot x2\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. associate-*r*99.3%

        \[\leadsto x1 + \left(\left(4 \cdot \left(\left(\left(2 \cdot x2\right) \cdot x1\right) \cdot x2 + \color{blue}{\left(-3 \cdot x1\right) \cdot x2}\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. distribute-rgt-out99.3%

        \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(x2 \cdot \left(\left(2 \cdot x2\right) \cdot x1 + -3 \cdot x1\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) \]
      5. *-commutative99.3%

        \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(\color{blue}{x1 \cdot \left(2 \cdot x2\right)} + -3 \cdot x1\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) \]
      6. *-commutative99.3%

        \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2\right) + \color{blue}{x1 \cdot -3}\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) \]
    6. Applied egg-rr99.3%

      \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2\right) + x1 \cdot -3\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 -1.22 \cdot 10^{+53}:\\ \;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\right)\\ \mathbf{elif}\;x1 \leq -0.0011:\\ \;\;\;\;x1 + \left(\left(x1 + \left(\left(\left(x1 \cdot x1 + 1\right) \cdot \left(\left(\left(x1 \cdot 2\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\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) + 9\right)\\ \mathbf{elif}\;x1 \leq 1.1 \cdot 10^{-27}:\\ \;\;\;\;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(x2 \cdot \left(x1 \cdot \left(2 \cdot x2\right) + x1 \cdot -3\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 4.2 \cdot 10^{+69}:\\ \;\;\;\;x1 + \left(\left(x1 + \left(\left(\left(x1 \cdot x1 + 1\right) \cdot \left(\left(\left(x1 \cdot 2\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\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) + 9\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\right)\\ \end{array} \]

Alternative 6: 93.0% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\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}\\ t_4 := 3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_2}\\ \mathbf{if}\;x1 \leq -2.6 \cdot 10^{+34}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x1 \leq 58000000000:\\ \;\;\;\;x1 + \left(t_4 + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2\right) + x1 \cdot -3\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 4.2 \cdot 10^{+69}:\\ \;\;\;\;x1 + \left(t_4 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_1 \cdot t_3 + t_2 \cdot \left(x1 \cdot 2 + \left(x1 \cdot x1\right) \cdot \left(t_3 \cdot 4 - 6\right)\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) 9.0)))
        (t_1 (* x1 (* x1 3.0)))
        (t_2 (+ (* x1 x1) 1.0))
        (t_3 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2))
        (t_4 (* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2))))
   (if (<= x1 -2.6e+34)
     t_0
     (if (<= x1 58000000000.0)
       (+ x1 (+ t_4 (+ x1 (* 4.0 (* x2 (+ (* x1 (* 2.0 x2)) (* x1 -3.0)))))))
       (if (<= x1 4.2e+69)
         (+
          x1
          (+
           t_4
           (+
            x1
            (+
             (* x1 (* x1 x1))
             (+
              (* t_1 t_3)
              (* t_2 (+ (* x1 2.0) (* (* x1 x1) (- (* t_3 4.0) 6.0)))))))))
         t_0)))))
double code(double x1, double x2) {
	double t_0 = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + 9.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 t_4 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2);
	double tmp;
	if (x1 <= -2.6e+34) {
		tmp = t_0;
	} else if (x1 <= 58000000000.0) {
		tmp = x1 + (t_4 + (x1 + (4.0 * (x2 * ((x1 * (2.0 * x2)) + (x1 * -3.0))))));
	} else if (x1 <= 4.2e+69) {
		tmp = x1 + (t_4 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * t_3) + (t_2 * ((x1 * 2.0) + ((x1 * x1) * ((t_3 * 4.0) - 6.0))))))));
	} 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) :: t_2
    real(8) :: t_3
    real(8) :: t_4
    real(8) :: tmp
    t_0 = x1 + ((x1 + (6.0d0 * (x1 ** 4.0d0))) + 9.0d0)
    t_1 = x1 * (x1 * 3.0d0)
    t_2 = (x1 * x1) + 1.0d0
    t_3 = ((t_1 + (2.0d0 * x2)) - x1) / t_2
    t_4 = 3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_2)
    if (x1 <= (-2.6d+34)) then
        tmp = t_0
    else if (x1 <= 58000000000.0d0) then
        tmp = x1 + (t_4 + (x1 + (4.0d0 * (x2 * ((x1 * (2.0d0 * x2)) + (x1 * (-3.0d0)))))))
    else if (x1 <= 4.2d+69) then
        tmp = x1 + (t_4 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * t_3) + (t_2 * ((x1 * 2.0d0) + ((x1 * x1) * ((t_3 * 4.0d0) - 6.0d0))))))))
    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 * Math.pow(x1, 4.0))) + 9.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 t_4 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2);
	double tmp;
	if (x1 <= -2.6e+34) {
		tmp = t_0;
	} else if (x1 <= 58000000000.0) {
		tmp = x1 + (t_4 + (x1 + (4.0 * (x2 * ((x1 * (2.0 * x2)) + (x1 * -3.0))))));
	} else if (x1 <= 4.2e+69) {
		tmp = x1 + (t_4 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * t_3) + (t_2 * ((x1 * 2.0) + ((x1 * x1) * ((t_3 * 4.0) - 6.0))))))));
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x1, x2):
	t_0 = x1 + ((x1 + (6.0 * math.pow(x1, 4.0))) + 9.0)
	t_1 = x1 * (x1 * 3.0)
	t_2 = (x1 * x1) + 1.0
	t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2
	t_4 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)
	tmp = 0
	if x1 <= -2.6e+34:
		tmp = t_0
	elif x1 <= 58000000000.0:
		tmp = x1 + (t_4 + (x1 + (4.0 * (x2 * ((x1 * (2.0 * x2)) + (x1 * -3.0))))))
	elif x1 <= 4.2e+69:
		tmp = x1 + (t_4 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * t_3) + (t_2 * ((x1 * 2.0) + ((x1 * x1) * ((t_3 * 4.0) - 6.0))))))))
	else:
		tmp = t_0
	return tmp
function code(x1, x2)
	t_0 = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + 9.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)
	t_4 = Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2))
	tmp = 0.0
	if (x1 <= -2.6e+34)
		tmp = t_0;
	elseif (x1 <= 58000000000.0)
		tmp = Float64(x1 + Float64(t_4 + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(Float64(x1 * Float64(2.0 * x2)) + Float64(x1 * -3.0)))))));
	elseif (x1 <= 4.2e+69)
		tmp = Float64(x1 + Float64(t_4 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_1 * t_3) + Float64(t_2 * Float64(Float64(x1 * 2.0) + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)))))))));
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	t_0 = x1 + ((x1 + (6.0 * (x1 ^ 4.0))) + 9.0);
	t_1 = x1 * (x1 * 3.0);
	t_2 = (x1 * x1) + 1.0;
	t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
	t_4 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2);
	tmp = 0.0;
	if (x1 <= -2.6e+34)
		tmp = t_0;
	elseif (x1 <= 58000000000.0)
		tmp = x1 + (t_4 + (x1 + (4.0 * (x2 * ((x1 * (2.0 * x2)) + (x1 * -3.0))))));
	elseif (x1 <= 4.2e+69)
		tmp = x1 + (t_4 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * t_3) + (t_2 * ((x1 * 2.0) + ((x1 * x1) * ((t_3 * 4.0) - 6.0))))))));
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.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]}, Block[{t$95$4 = N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -2.6e+34], t$95$0, If[LessEqual[x1, 58000000000.0], N[(x1 + N[(t$95$4 + N[(x1 + N[(4.0 * N[(x2 * N[(N[(x1 * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] + N[(x1 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.2e+69], N[(x1 + N[(t$95$4 + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 * t$95$3), $MachinePrecision] + N[(t$95$2 * N[(N[(x1 * 2.0), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\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}\\
t_4 := 3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_2}\\
\mathbf{if}\;x1 \leq -2.6 \cdot 10^{+34}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;x1 \leq 58000000000:\\
\;\;\;\;x1 + \left(t_4 + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2\right) + x1 \cdot -3\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 4.2 \cdot 10^{+69}:\\
\;\;\;\;x1 + \left(t_4 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_1 \cdot t_3 + t_2 \cdot \left(x1 \cdot 2 + \left(x1 \cdot x1\right) \cdot \left(t_3 \cdot 4 - 6\right)\right)\right)\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x1 < -2.59999999999999997e34 or 4.2000000000000003e69 < x1

    1. Initial program 36.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 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.3%

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

    if -2.59999999999999997e34 < x1 < 5.8e10

    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 84.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. Step-by-step derivation
      1. associate-*r*94.8%

        \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(\left(x1 \cdot x2\right) \cdot \left(2 \cdot x2 - 3\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) \]
      2. sub-neg94.8%

        \[\leadsto x1 + \left(\left(4 \cdot \left(\left(x1 \cdot x2\right) \cdot \color{blue}{\left(2 \cdot x2 + \left(-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. metadata-eval94.8%

        \[\leadsto x1 + \left(\left(4 \cdot \left(\left(x1 \cdot x2\right) \cdot \left(2 \cdot x2 + \color{blue}{-3}\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. distribute-rgt-in94.8%

        \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(\left(2 \cdot x2\right) \cdot \left(x1 \cdot x2\right) + -3 \cdot \left(x1 \cdot x2\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) \]
      5. *-commutative94.8%

        \[\leadsto x1 + \left(\left(4 \cdot \left(\color{blue}{\left(x2 \cdot 2\right)} \cdot \left(x1 \cdot x2\right) + -3 \cdot \left(x1 \cdot x2\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. Applied egg-rr94.8%

      \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(\left(x2 \cdot 2\right) \cdot \left(x1 \cdot x2\right) + -3 \cdot \left(x1 \cdot x2\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) \]
    5. Step-by-step derivation
      1. *-commutative94.8%

        \[\leadsto x1 + \left(\left(4 \cdot \left(\color{blue}{\left(2 \cdot x2\right)} \cdot \left(x1 \cdot x2\right) + -3 \cdot \left(x1 \cdot x2\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) \]
      2. associate-*r*94.8%

        \[\leadsto x1 + \left(\left(4 \cdot \left(\color{blue}{\left(\left(2 \cdot x2\right) \cdot x1\right) \cdot x2} + -3 \cdot \left(x1 \cdot x2\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. associate-*r*94.8%

        \[\leadsto x1 + \left(\left(4 \cdot \left(\left(\left(2 \cdot x2\right) \cdot x1\right) \cdot x2 + \color{blue}{\left(-3 \cdot x1\right) \cdot x2}\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. distribute-rgt-out94.8%

        \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(x2 \cdot \left(\left(2 \cdot x2\right) \cdot x1 + -3 \cdot x1\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) \]
      5. *-commutative94.8%

        \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(\color{blue}{x1 \cdot \left(2 \cdot x2\right)} + -3 \cdot x1\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) \]
      6. *-commutative94.8%

        \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2\right) + \color{blue}{x1 \cdot -3}\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) \]
    6. Applied egg-rr94.8%

      \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2\right) + x1 \cdot -3\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 5.8e10 < x1 < 4.2000000000000003e69

    1. Initial program 99.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 78.4%

      \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \color{blue}{\left(-1 \cdot x1 + 2 \cdot x2\right)}\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) \]
    3. Taylor expanded in x1 around inf 88.7%

      \[\leadsto x1 + \left(\left(\left(\left(\left(\color{blue}{2 \cdot x1} + \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) \]
    4. Step-by-step derivation
      1. *-commutative88.7%

        \[\leadsto x1 + \left(\left(\left(\left(\left(\color{blue}{x1 \cdot 2} + \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) \]
    5. Simplified88.7%

      \[\leadsto x1 + \left(\left(\left(\left(\left(\color{blue}{x1 \cdot 2} + \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) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification95.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -2.6 \cdot 10^{+34}:\\ \;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\right)\\ \mathbf{elif}\;x1 \leq 58000000000:\\ \;\;\;\;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(x2 \cdot \left(x1 \cdot \left(2 \cdot x2\right) + x1 \cdot -3\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 4.2 \cdot 10^{+69}:\\ \;\;\;\;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(x1 \cdot 2 + \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)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\right)\\ \end{array} \]

Alternative 7: 78.8% accurate, 1.3× 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 := 3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_0}\\ t_4 := t_1 \cdot t_2\\ t_5 := x1 + x2 \cdot 6\\ t_6 := x1 \cdot \left(x1 \cdot x1\right)\\ t_7 := \left(x1 \cdot x1\right) \cdot \left(t_2 \cdot 4 - 6\right)\\ \mathbf{if}\;x1 \leq -6 \cdot 10^{+124}:\\ \;\;\;\;\frac{x1}{\frac{t_5}{x1}} - \frac{36}{\frac{t_5}{x2 \cdot x2}}\\ \mathbf{elif}\;x1 \leq -0.47:\\ \;\;\;\;x1 + \left(9 + \left(x1 + \left(t_6 + \left(t_4 + t_0 \cdot \left(t_7 + \left(t_2 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2 - x1\right)\right)\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 30500000:\\ \;\;\;\;x1 + \left(t_3 + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2\right) + x1 \cdot -3\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;x1 + \left(t_3 + \left(x1 + \left(t_6 + \left(t_4 + t_0 \cdot \left(x1 \cdot 2 + t_7\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{36 \cdot \left(x2 \cdot x2\right) - x1 \cdot x1}{x2 \cdot -6 - x1}\\ \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 (* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_0)))
        (t_4 (* t_1 t_2))
        (t_5 (+ x1 (* x2 6.0)))
        (t_6 (* x1 (* x1 x1)))
        (t_7 (* (* x1 x1) (- (* t_2 4.0) 6.0))))
   (if (<= x1 -6e+124)
     (- (/ x1 (/ t_5 x1)) (/ 36.0 (/ t_5 (* x2 x2))))
     (if (<= x1 -0.47)
       (+
        x1
        (+
         9.0
         (+
          x1
          (+
           t_6
           (+
            t_4
            (*
             t_0
             (+ t_7 (* (- t_2 3.0) (* (* x1 2.0) (- (* 2.0 x2) x1))))))))))
       (if (<= x1 30500000.0)
         (+ x1 (+ t_3 (+ x1 (* 4.0 (* x2 (+ (* x1 (* 2.0 x2)) (* x1 -3.0)))))))
         (if (<= x1 1.35e+154)
           (+ x1 (+ t_3 (+ x1 (+ t_6 (+ t_4 (* t_0 (+ (* x1 2.0) t_7)))))))
           (/ (- (* 36.0 (* x2 x2)) (* x1 x1)) (- (* x2 -6.0) 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 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0);
	double t_4 = t_1 * t_2;
	double t_5 = x1 + (x2 * 6.0);
	double t_6 = x1 * (x1 * x1);
	double t_7 = (x1 * x1) * ((t_2 * 4.0) - 6.0);
	double tmp;
	if (x1 <= -6e+124) {
		tmp = (x1 / (t_5 / x1)) - (36.0 / (t_5 / (x2 * x2)));
	} else if (x1 <= -0.47) {
		tmp = x1 + (9.0 + (x1 + (t_6 + (t_4 + (t_0 * (t_7 + ((t_2 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1)))))))));
	} else if (x1 <= 30500000.0) {
		tmp = x1 + (t_3 + (x1 + (4.0 * (x2 * ((x1 * (2.0 * x2)) + (x1 * -3.0))))));
	} else if (x1 <= 1.35e+154) {
		tmp = x1 + (t_3 + (x1 + (t_6 + (t_4 + (t_0 * ((x1 * 2.0) + t_7))))));
	} else {
		tmp = ((36.0 * (x2 * x2)) - (x1 * x1)) / ((x2 * -6.0) - x1);
	}
	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) :: t_7
    real(8) :: tmp
    t_0 = (x1 * x1) + 1.0d0
    t_1 = x1 * (x1 * 3.0d0)
    t_2 = ((t_1 + (2.0d0 * x2)) - x1) / t_0
    t_3 = 3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_0)
    t_4 = t_1 * t_2
    t_5 = x1 + (x2 * 6.0d0)
    t_6 = x1 * (x1 * x1)
    t_7 = (x1 * x1) * ((t_2 * 4.0d0) - 6.0d0)
    if (x1 <= (-6d+124)) then
        tmp = (x1 / (t_5 / x1)) - (36.0d0 / (t_5 / (x2 * x2)))
    else if (x1 <= (-0.47d0)) then
        tmp = x1 + (9.0d0 + (x1 + (t_6 + (t_4 + (t_0 * (t_7 + ((t_2 - 3.0d0) * ((x1 * 2.0d0) * ((2.0d0 * x2) - x1)))))))))
    else if (x1 <= 30500000.0d0) then
        tmp = x1 + (t_3 + (x1 + (4.0d0 * (x2 * ((x1 * (2.0d0 * x2)) + (x1 * (-3.0d0)))))))
    else if (x1 <= 1.35d+154) then
        tmp = x1 + (t_3 + (x1 + (t_6 + (t_4 + (t_0 * ((x1 * 2.0d0) + t_7))))))
    else
        tmp = ((36.0d0 * (x2 * x2)) - (x1 * x1)) / ((x2 * (-6.0d0)) - x1)
    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 * 3.0);
	double t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0;
	double t_3 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0);
	double t_4 = t_1 * t_2;
	double t_5 = x1 + (x2 * 6.0);
	double t_6 = x1 * (x1 * x1);
	double t_7 = (x1 * x1) * ((t_2 * 4.0) - 6.0);
	double tmp;
	if (x1 <= -6e+124) {
		tmp = (x1 / (t_5 / x1)) - (36.0 / (t_5 / (x2 * x2)));
	} else if (x1 <= -0.47) {
		tmp = x1 + (9.0 + (x1 + (t_6 + (t_4 + (t_0 * (t_7 + ((t_2 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1)))))))));
	} else if (x1 <= 30500000.0) {
		tmp = x1 + (t_3 + (x1 + (4.0 * (x2 * ((x1 * (2.0 * x2)) + (x1 * -3.0))))));
	} else if (x1 <= 1.35e+154) {
		tmp = x1 + (t_3 + (x1 + (t_6 + (t_4 + (t_0 * ((x1 * 2.0) + t_7))))));
	} else {
		tmp = ((36.0 * (x2 * x2)) - (x1 * x1)) / ((x2 * -6.0) - 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 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)
	t_4 = t_1 * t_2
	t_5 = x1 + (x2 * 6.0)
	t_6 = x1 * (x1 * x1)
	t_7 = (x1 * x1) * ((t_2 * 4.0) - 6.0)
	tmp = 0
	if x1 <= -6e+124:
		tmp = (x1 / (t_5 / x1)) - (36.0 / (t_5 / (x2 * x2)))
	elif x1 <= -0.47:
		tmp = x1 + (9.0 + (x1 + (t_6 + (t_4 + (t_0 * (t_7 + ((t_2 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1)))))))))
	elif x1 <= 30500000.0:
		tmp = x1 + (t_3 + (x1 + (4.0 * (x2 * ((x1 * (2.0 * x2)) + (x1 * -3.0))))))
	elif x1 <= 1.35e+154:
		tmp = x1 + (t_3 + (x1 + (t_6 + (t_4 + (t_0 * ((x1 * 2.0) + t_7))))))
	else:
		tmp = ((36.0 * (x2 * x2)) - (x1 * x1)) / ((x2 * -6.0) - 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(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_0))
	t_4 = Float64(t_1 * t_2)
	t_5 = Float64(x1 + Float64(x2 * 6.0))
	t_6 = Float64(x1 * Float64(x1 * x1))
	t_7 = Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0))
	tmp = 0.0
	if (x1 <= -6e+124)
		tmp = Float64(Float64(x1 / Float64(t_5 / x1)) - Float64(36.0 / Float64(t_5 / Float64(x2 * x2))));
	elseif (x1 <= -0.47)
		tmp = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(t_6 + Float64(t_4 + Float64(t_0 * Float64(t_7 + Float64(Float64(t_2 - 3.0) * Float64(Float64(x1 * 2.0) * Float64(Float64(2.0 * x2) - x1))))))))));
	elseif (x1 <= 30500000.0)
		tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(Float64(x1 * Float64(2.0 * x2)) + Float64(x1 * -3.0)))))));
	elseif (x1 <= 1.35e+154)
		tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(t_6 + Float64(t_4 + Float64(t_0 * Float64(Float64(x1 * 2.0) + t_7)))))));
	else
		tmp = Float64(Float64(Float64(36.0 * Float64(x2 * x2)) - Float64(x1 * x1)) / Float64(Float64(x2 * -6.0) - 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 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0);
	t_4 = t_1 * t_2;
	t_5 = x1 + (x2 * 6.0);
	t_6 = x1 * (x1 * x1);
	t_7 = (x1 * x1) * ((t_2 * 4.0) - 6.0);
	tmp = 0.0;
	if (x1 <= -6e+124)
		tmp = (x1 / (t_5 / x1)) - (36.0 / (t_5 / (x2 * x2)));
	elseif (x1 <= -0.47)
		tmp = x1 + (9.0 + (x1 + (t_6 + (t_4 + (t_0 * (t_7 + ((t_2 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1)))))))));
	elseif (x1 <= 30500000.0)
		tmp = x1 + (t_3 + (x1 + (4.0 * (x2 * ((x1 * (2.0 * x2)) + (x1 * -3.0))))));
	elseif (x1 <= 1.35e+154)
		tmp = x1 + (t_3 + (x1 + (t_6 + (t_4 + (t_0 * ((x1 * 2.0) + t_7))))));
	else
		tmp = ((36.0 * (x2 * x2)) - (x1 * x1)) / ((x2 * -6.0) - 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[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$1 * t$95$2), $MachinePrecision]}, Block[{t$95$5 = N[(x1 + N[(x2 * 6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -6e+124], N[(N[(x1 / N[(t$95$5 / x1), $MachinePrecision]), $MachinePrecision] - N[(36.0 / N[(t$95$5 / N[(x2 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -0.47], N[(x1 + N[(9.0 + N[(x1 + N[(t$95$6 + N[(t$95$4 + N[(t$95$0 * N[(t$95$7 + N[(N[(t$95$2 - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 30500000.0], N[(x1 + N[(t$95$3 + N[(x1 + N[(4.0 * N[(x2 * N[(N[(x1 * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] + N[(x1 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 + N[(t$95$3 + N[(x1 + N[(t$95$6 + N[(t$95$4 + N[(t$95$0 * N[(N[(x1 * 2.0), $MachinePrecision] + t$95$7), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(36.0 * N[(x2 * x2), $MachinePrecision]), $MachinePrecision] - N[(x1 * x1), $MachinePrecision]), $MachinePrecision] / N[(N[(x2 * -6.0), $MachinePrecision] - x1), $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 := 3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_0}\\
t_4 := t_1 \cdot t_2\\
t_5 := x1 + x2 \cdot 6\\
t_6 := x1 \cdot \left(x1 \cdot x1\right)\\
t_7 := \left(x1 \cdot x1\right) \cdot \left(t_2 \cdot 4 - 6\right)\\
\mathbf{if}\;x1 \leq -6 \cdot 10^{+124}:\\
\;\;\;\;\frac{x1}{\frac{t_5}{x1}} - \frac{36}{\frac{t_5}{x2 \cdot x2}}\\

\mathbf{elif}\;x1 \leq -0.47:\\
\;\;\;\;x1 + \left(9 + \left(x1 + \left(t_6 + \left(t_4 + t_0 \cdot \left(t_7 + \left(t_2 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2 - x1\right)\right)\right)\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 30500000:\\
\;\;\;\;x1 + \left(t_3 + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2\right) + x1 \cdot -3\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(t_3 + \left(x1 + \left(t_6 + \left(t_4 + t_0 \cdot \left(x1 \cdot 2 + t_7\right)\right)\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{36 \cdot \left(x2 \cdot x2\right) - x1 \cdot x1}{x2 \cdot -6 - x1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if x1 < -5.9999999999999999e124

    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 0 0.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 1.1%

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

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

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

        \[\leadsto \color{blue}{\frac{x1 \cdot x1 - \left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6}} \]
      2. div-sub7.0%

        \[\leadsto \color{blue}{\frac{x1 \cdot x1}{x1 - x2 \cdot -6} - \frac{\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6}} \]
      3. *-commutative7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 - \color{blue}{-6 \cdot x2}} - \frac{\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6} \]
      4. cancel-sign-sub-inv7.0%

        \[\leadsto \frac{x1 \cdot x1}{\color{blue}{x1 + \left(--6\right) \cdot x2}} - \frac{\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6} \]
      5. metadata-eval7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 + \color{blue}{6} \cdot x2} - \frac{\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6} \]
      6. *-commutative7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{\color{blue}{\left(-6 \cdot x2\right)} \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6} \]
      7. *-commutative7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{\left(-6 \cdot x2\right) \cdot \color{blue}{\left(-6 \cdot x2\right)}}{x1 - x2 \cdot -6} \]
      8. swap-sqr7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{\color{blue}{\left(-6 \cdot -6\right) \cdot \left(x2 \cdot x2\right)}}{x1 - x2 \cdot -6} \]
      9. metadata-eval7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{\color{blue}{36} \cdot \left(x2 \cdot x2\right)}{x1 - x2 \cdot -6} \]
      10. *-commutative7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{36 \cdot \left(x2 \cdot x2\right)}{x1 - \color{blue}{-6 \cdot x2}} \]
      11. cancel-sign-sub-inv7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{36 \cdot \left(x2 \cdot x2\right)}{\color{blue}{x1 + \left(--6\right) \cdot x2}} \]
      12. metadata-eval7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{36 \cdot \left(x2 \cdot x2\right)}{x1 + \color{blue}{6} \cdot x2} \]
    7. Applied egg-rr7.0%

      \[\leadsto \color{blue}{\frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{36 \cdot \left(x2 \cdot x2\right)}{x1 + 6 \cdot x2}} \]
    8. Step-by-step derivation
      1. associate-/l*28.0%

        \[\leadsto \color{blue}{\frac{x1}{\frac{x1 + 6 \cdot x2}{x1}}} - \frac{36 \cdot \left(x2 \cdot x2\right)}{x1 + 6 \cdot x2} \]
      2. unpow228.0%

        \[\leadsto \frac{x1}{\frac{x1 + 6 \cdot x2}{x1}} - \frac{36 \cdot \color{blue}{{x2}^{2}}}{x1 + 6 \cdot x2} \]
      3. associate-/l*28.0%

        \[\leadsto \frac{x1}{\frac{x1 + 6 \cdot x2}{x1}} - \color{blue}{\frac{36}{\frac{x1 + 6 \cdot x2}{{x2}^{2}}}} \]
      4. unpow228.0%

        \[\leadsto \frac{x1}{\frac{x1 + 6 \cdot x2}{x1}} - \frac{36}{\frac{x1 + 6 \cdot x2}{\color{blue}{x2 \cdot x2}}} \]
    9. Simplified28.0%

      \[\leadsto \color{blue}{\frac{x1}{\frac{x1 + 6 \cdot x2}{x1}} - \frac{36}{\frac{x1 + 6 \cdot x2}{x2 \cdot x2}}} \]

    if -5.9999999999999999e124 < x1 < -0.46999999999999997

    1. Initial program 92.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 79.7%

      \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \color{blue}{\left(-1 \cdot x1 + 2 \cdot x2\right)}\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) \]
    3. Taylor expanded in x1 around inf 79.7%

      \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \left(-1 \cdot x1 + 2 \cdot x2\right)\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}{3}\right) \]

    if -0.46999999999999997 < x1 < 3.05e7

    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 87.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. Step-by-step derivation
      1. associate-*r*98.5%

        \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(\left(x1 \cdot x2\right) \cdot \left(2 \cdot x2 - 3\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) \]
      2. sub-neg98.5%

        \[\leadsto x1 + \left(\left(4 \cdot \left(\left(x1 \cdot x2\right) \cdot \color{blue}{\left(2 \cdot x2 + \left(-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. metadata-eval98.5%

        \[\leadsto x1 + \left(\left(4 \cdot \left(\left(x1 \cdot x2\right) \cdot \left(2 \cdot x2 + \color{blue}{-3}\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. distribute-rgt-in98.5%

        \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(\left(2 \cdot x2\right) \cdot \left(x1 \cdot x2\right) + -3 \cdot \left(x1 \cdot x2\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) \]
      5. *-commutative98.5%

        \[\leadsto x1 + \left(\left(4 \cdot \left(\color{blue}{\left(x2 \cdot 2\right)} \cdot \left(x1 \cdot x2\right) + -3 \cdot \left(x1 \cdot x2\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. Applied egg-rr98.5%

      \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(\left(x2 \cdot 2\right) \cdot \left(x1 \cdot x2\right) + -3 \cdot \left(x1 \cdot x2\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) \]
    5. Step-by-step derivation
      1. *-commutative98.5%

        \[\leadsto x1 + \left(\left(4 \cdot \left(\color{blue}{\left(2 \cdot x2\right)} \cdot \left(x1 \cdot x2\right) + -3 \cdot \left(x1 \cdot x2\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) \]
      2. associate-*r*98.5%

        \[\leadsto x1 + \left(\left(4 \cdot \left(\color{blue}{\left(\left(2 \cdot x2\right) \cdot x1\right) \cdot x2} + -3 \cdot \left(x1 \cdot x2\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. associate-*r*98.5%

        \[\leadsto x1 + \left(\left(4 \cdot \left(\left(\left(2 \cdot x2\right) \cdot x1\right) \cdot x2 + \color{blue}{\left(-3 \cdot x1\right) \cdot x2}\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. distribute-rgt-out98.5%

        \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(x2 \cdot \left(\left(2 \cdot x2\right) \cdot x1 + -3 \cdot x1\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) \]
      5. *-commutative98.5%

        \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(\color{blue}{x1 \cdot \left(2 \cdot x2\right)} + -3 \cdot x1\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) \]
      6. *-commutative98.5%

        \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2\right) + \color{blue}{x1 \cdot -3}\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) \]
    6. Applied egg-rr98.5%

      \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2\right) + x1 \cdot -3\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 3.05e7 < x1 < 1.35000000000000003e154

    1. Initial program 97.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 84.9%

      \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \color{blue}{\left(-1 \cdot x1 + 2 \cdot x2\right)}\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) \]
    3. Taylor expanded in x1 around inf 93.5%

      \[\leadsto x1 + \left(\left(\left(\left(\left(\color{blue}{2 \cdot x1} + \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) \]
    4. Step-by-step derivation
      1. *-commutative93.5%

        \[\leadsto x1 + \left(\left(\left(\left(\left(\color{blue}{x1 \cdot 2} + \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) \]
    5. Simplified93.5%

      \[\leadsto x1 + \left(\left(\left(\left(\left(\color{blue}{x1 \cdot 2} + \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 1.35000000000000003e154 < x1

    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 0 0.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 6.8%

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

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

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

        \[\leadsto \color{blue}{x2 \cdot -6 + x1} \]
      2. flip-+74.1%

        \[\leadsto \color{blue}{\frac{\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right) - x1 \cdot x1}{x2 \cdot -6 - x1}} \]
      3. *-commutative74.1%

        \[\leadsto \frac{\color{blue}{\left(-6 \cdot x2\right)} \cdot \left(x2 \cdot -6\right) - x1 \cdot x1}{x2 \cdot -6 - x1} \]
      4. *-commutative74.1%

        \[\leadsto \frac{\left(-6 \cdot x2\right) \cdot \color{blue}{\left(-6 \cdot x2\right)} - x1 \cdot x1}{x2 \cdot -6 - x1} \]
      5. swap-sqr74.1%

        \[\leadsto \frac{\color{blue}{\left(-6 \cdot -6\right) \cdot \left(x2 \cdot x2\right)} - x1 \cdot x1}{x2 \cdot -6 - x1} \]
      6. metadata-eval74.1%

        \[\leadsto \frac{\color{blue}{36} \cdot \left(x2 \cdot x2\right) - x1 \cdot x1}{x2 \cdot -6 - x1} \]
    7. Applied egg-rr74.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -6 \cdot 10^{+124}:\\ \;\;\;\;\frac{x1}{\frac{x1 + x2 \cdot 6}{x1}} - \frac{36}{\frac{x1 + x2 \cdot 6}{x2 \cdot x2}}\\ \mathbf{elif}\;x1 \leq -0.47:\\ \;\;\;\;x1 + \left(9 + \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(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) + \left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2 - x1\right)\right)\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 30500000:\\ \;\;\;\;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(x2 \cdot \left(x1 \cdot \left(2 \cdot x2\right) + x1 \cdot -3\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;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(x1 \cdot 2 + \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)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{36 \cdot \left(x2 \cdot x2\right) - x1 \cdot x1}{x2 \cdot -6 - x1}\\ \end{array} \]

Alternative 8: 78.4% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 + x2 \cdot 6\\ 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 := x1 + \left(t_3 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_1 \cdot t_4 + t_2 \cdot \left(x1 \cdot 2 + \left(x1 \cdot x1\right) \cdot \left(t_4 \cdot 4 - 6\right)\right)\right)\right)\right)\right)\\ \mathbf{if}\;x1 \leq -1.22 \cdot 10^{+125}:\\ \;\;\;\;\frac{x1}{\frac{t_0}{x1}} - \frac{36}{\frac{t_0}{x2 \cdot x2}}\\ \mathbf{elif}\;x1 \leq -22000000000000:\\ \;\;\;\;t_5\\ \mathbf{elif}\;x1 \leq 1450000000:\\ \;\;\;\;x1 + \left(t_3 + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2\right) + x1 \cdot -3\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;t_5\\ \mathbf{else}:\\ \;\;\;\;\frac{36 \cdot \left(x2 \cdot x2\right) - x1 \cdot x1}{x2 \cdot -6 - x1}\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (+ x1 (* x2 6.0)))
        (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
         (+
          x1
          (+
           t_3
           (+
            x1
            (+
             (* x1 (* x1 x1))
             (+
              (* t_1 t_4)
              (* t_2 (+ (* x1 2.0) (* (* x1 x1) (- (* t_4 4.0) 6.0)))))))))))
   (if (<= x1 -1.22e+125)
     (- (/ x1 (/ t_0 x1)) (/ 36.0 (/ t_0 (* x2 x2))))
     (if (<= x1 -22000000000000.0)
       t_5
       (if (<= x1 1450000000.0)
         (+ x1 (+ t_3 (+ x1 (* 4.0 (* x2 (+ (* x1 (* 2.0 x2)) (* x1 -3.0)))))))
         (if (<= x1 1.35e+154)
           t_5
           (/ (- (* 36.0 (* x2 x2)) (* x1 x1)) (- (* x2 -6.0) x1))))))))
double code(double x1, double x2) {
	double t_0 = x1 + (x2 * 6.0);
	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 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * t_4) + (t_2 * ((x1 * 2.0) + ((x1 * x1) * ((t_4 * 4.0) - 6.0))))))));
	double tmp;
	if (x1 <= -1.22e+125) {
		tmp = (x1 / (t_0 / x1)) - (36.0 / (t_0 / (x2 * x2)));
	} else if (x1 <= -22000000000000.0) {
		tmp = t_5;
	} else if (x1 <= 1450000000.0) {
		tmp = x1 + (t_3 + (x1 + (4.0 * (x2 * ((x1 * (2.0 * x2)) + (x1 * -3.0))))));
	} else if (x1 <= 1.35e+154) {
		tmp = t_5;
	} else {
		tmp = ((36.0 * (x2 * x2)) - (x1 * x1)) / ((x2 * -6.0) - x1);
	}
	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) :: tmp
    t_0 = x1 + (x2 * 6.0d0)
    t_1 = x1 * (x1 * 3.0d0)
    t_2 = (x1 * x1) + 1.0d0
    t_3 = 3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_2)
    t_4 = ((t_1 + (2.0d0 * x2)) - x1) / t_2
    t_5 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * t_4) + (t_2 * ((x1 * 2.0d0) + ((x1 * x1) * ((t_4 * 4.0d0) - 6.0d0))))))))
    if (x1 <= (-1.22d+125)) then
        tmp = (x1 / (t_0 / x1)) - (36.0d0 / (t_0 / (x2 * x2)))
    else if (x1 <= (-22000000000000.0d0)) then
        tmp = t_5
    else if (x1 <= 1450000000.0d0) then
        tmp = x1 + (t_3 + (x1 + (4.0d0 * (x2 * ((x1 * (2.0d0 * x2)) + (x1 * (-3.0d0)))))))
    else if (x1 <= 1.35d+154) then
        tmp = t_5
    else
        tmp = ((36.0d0 * (x2 * x2)) - (x1 * x1)) / ((x2 * (-6.0d0)) - x1)
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double t_0 = x1 + (x2 * 6.0);
	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 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * t_4) + (t_2 * ((x1 * 2.0) + ((x1 * x1) * ((t_4 * 4.0) - 6.0))))))));
	double tmp;
	if (x1 <= -1.22e+125) {
		tmp = (x1 / (t_0 / x1)) - (36.0 / (t_0 / (x2 * x2)));
	} else if (x1 <= -22000000000000.0) {
		tmp = t_5;
	} else if (x1 <= 1450000000.0) {
		tmp = x1 + (t_3 + (x1 + (4.0 * (x2 * ((x1 * (2.0 * x2)) + (x1 * -3.0))))));
	} else if (x1 <= 1.35e+154) {
		tmp = t_5;
	} else {
		tmp = ((36.0 * (x2 * x2)) - (x1 * x1)) / ((x2 * -6.0) - x1);
	}
	return tmp;
}
def code(x1, x2):
	t_0 = x1 + (x2 * 6.0)
	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 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * t_4) + (t_2 * ((x1 * 2.0) + ((x1 * x1) * ((t_4 * 4.0) - 6.0))))))))
	tmp = 0
	if x1 <= -1.22e+125:
		tmp = (x1 / (t_0 / x1)) - (36.0 / (t_0 / (x2 * x2)))
	elif x1 <= -22000000000000.0:
		tmp = t_5
	elif x1 <= 1450000000.0:
		tmp = x1 + (t_3 + (x1 + (4.0 * (x2 * ((x1 * (2.0 * x2)) + (x1 * -3.0))))))
	elif x1 <= 1.35e+154:
		tmp = t_5
	else:
		tmp = ((36.0 * (x2 * x2)) - (x1 * x1)) / ((x2 * -6.0) - x1)
	return tmp
function code(x1, x2)
	t_0 = Float64(x1 + Float64(x2 * 6.0))
	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(x1 + Float64(t_3 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_1 * t_4) + Float64(t_2 * Float64(Float64(x1 * 2.0) + Float64(Float64(x1 * x1) * Float64(Float64(t_4 * 4.0) - 6.0)))))))))
	tmp = 0.0
	if (x1 <= -1.22e+125)
		tmp = Float64(Float64(x1 / Float64(t_0 / x1)) - Float64(36.0 / Float64(t_0 / Float64(x2 * x2))));
	elseif (x1 <= -22000000000000.0)
		tmp = t_5;
	elseif (x1 <= 1450000000.0)
		tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(Float64(x1 * Float64(2.0 * x2)) + Float64(x1 * -3.0)))))));
	elseif (x1 <= 1.35e+154)
		tmp = t_5;
	else
		tmp = Float64(Float64(Float64(36.0 * Float64(x2 * x2)) - Float64(x1 * x1)) / Float64(Float64(x2 * -6.0) - x1));
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	t_0 = x1 + (x2 * 6.0);
	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 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * t_4) + (t_2 * ((x1 * 2.0) + ((x1 * x1) * ((t_4 * 4.0) - 6.0))))))));
	tmp = 0.0;
	if (x1 <= -1.22e+125)
		tmp = (x1 / (t_0 / x1)) - (36.0 / (t_0 / (x2 * x2)));
	elseif (x1 <= -22000000000000.0)
		tmp = t_5;
	elseif (x1 <= 1450000000.0)
		tmp = x1 + (t_3 + (x1 + (4.0 * (x2 * ((x1 * (2.0 * x2)) + (x1 * -3.0))))));
	elseif (x1 <= 1.35e+154)
		tmp = t_5;
	else
		tmp = ((36.0 * (x2 * x2)) - (x1 * x1)) / ((x2 * -6.0) - x1);
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(x2 * 6.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[(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[(x1 + N[(t$95$3 + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 * t$95$4), $MachinePrecision] + N[(t$95$2 * N[(N[(x1 * 2.0), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$4 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.22e+125], N[(N[(x1 / N[(t$95$0 / x1), $MachinePrecision]), $MachinePrecision] - N[(36.0 / N[(t$95$0 / N[(x2 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -22000000000000.0], t$95$5, If[LessEqual[x1, 1450000000.0], N[(x1 + N[(t$95$3 + N[(x1 + N[(4.0 * N[(x2 * N[(N[(x1 * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] + N[(x1 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], t$95$5, N[(N[(N[(36.0 * N[(x2 * x2), $MachinePrecision]), $MachinePrecision] - N[(x1 * x1), $MachinePrecision]), $MachinePrecision] / N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x1 + x2 \cdot 6\\
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 := x1 + \left(t_3 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_1 \cdot t_4 + t_2 \cdot \left(x1 \cdot 2 + \left(x1 \cdot x1\right) \cdot \left(t_4 \cdot 4 - 6\right)\right)\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -1.22 \cdot 10^{+125}:\\
\;\;\;\;\frac{x1}{\frac{t_0}{x1}} - \frac{36}{\frac{t_0}{x2 \cdot x2}}\\

\mathbf{elif}\;x1 \leq -22000000000000:\\
\;\;\;\;t_5\\

\mathbf{elif}\;x1 \leq 1450000000:\\
\;\;\;\;x1 + \left(t_3 + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2\right) + x1 \cdot -3\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;t_5\\

\mathbf{else}:\\
\;\;\;\;\frac{36 \cdot \left(x2 \cdot x2\right) - x1 \cdot x1}{x2 \cdot -6 - x1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x1 < -1.22e125

    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 0 0.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 1.1%

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

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

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

        \[\leadsto \color{blue}{\frac{x1 \cdot x1 - \left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6}} \]
      2. div-sub7.0%

        \[\leadsto \color{blue}{\frac{x1 \cdot x1}{x1 - x2 \cdot -6} - \frac{\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6}} \]
      3. *-commutative7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 - \color{blue}{-6 \cdot x2}} - \frac{\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6} \]
      4. cancel-sign-sub-inv7.0%

        \[\leadsto \frac{x1 \cdot x1}{\color{blue}{x1 + \left(--6\right) \cdot x2}} - \frac{\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6} \]
      5. metadata-eval7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 + \color{blue}{6} \cdot x2} - \frac{\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6} \]
      6. *-commutative7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{\color{blue}{\left(-6 \cdot x2\right)} \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6} \]
      7. *-commutative7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{\left(-6 \cdot x2\right) \cdot \color{blue}{\left(-6 \cdot x2\right)}}{x1 - x2 \cdot -6} \]
      8. swap-sqr7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{\color{blue}{\left(-6 \cdot -6\right) \cdot \left(x2 \cdot x2\right)}}{x1 - x2 \cdot -6} \]
      9. metadata-eval7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{\color{blue}{36} \cdot \left(x2 \cdot x2\right)}{x1 - x2 \cdot -6} \]
      10. *-commutative7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{36 \cdot \left(x2 \cdot x2\right)}{x1 - \color{blue}{-6 \cdot x2}} \]
      11. cancel-sign-sub-inv7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{36 \cdot \left(x2 \cdot x2\right)}{\color{blue}{x1 + \left(--6\right) \cdot x2}} \]
      12. metadata-eval7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{36 \cdot \left(x2 \cdot x2\right)}{x1 + \color{blue}{6} \cdot x2} \]
    7. Applied egg-rr7.0%

      \[\leadsto \color{blue}{\frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{36 \cdot \left(x2 \cdot x2\right)}{x1 + 6 \cdot x2}} \]
    8. Step-by-step derivation
      1. associate-/l*28.0%

        \[\leadsto \color{blue}{\frac{x1}{\frac{x1 + 6 \cdot x2}{x1}}} - \frac{36 \cdot \left(x2 \cdot x2\right)}{x1 + 6 \cdot x2} \]
      2. unpow228.0%

        \[\leadsto \frac{x1}{\frac{x1 + 6 \cdot x2}{x1}} - \frac{36 \cdot \color{blue}{{x2}^{2}}}{x1 + 6 \cdot x2} \]
      3. associate-/l*28.0%

        \[\leadsto \frac{x1}{\frac{x1 + 6 \cdot x2}{x1}} - \color{blue}{\frac{36}{\frac{x1 + 6 \cdot x2}{{x2}^{2}}}} \]
      4. unpow228.0%

        \[\leadsto \frac{x1}{\frac{x1 + 6 \cdot x2}{x1}} - \frac{36}{\frac{x1 + 6 \cdot x2}{\color{blue}{x2 \cdot x2}}} \]
    9. Simplified28.0%

      \[\leadsto \color{blue}{\frac{x1}{\frac{x1 + 6 \cdot x2}{x1}} - \frac{36}{\frac{x1 + 6 \cdot x2}{x2 \cdot x2}}} \]

    if -1.22e125 < x1 < -2.2e13 or 1.45e9 < x1 < 1.35000000000000003e154

    1. Initial program 94.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 85.6%

      \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \color{blue}{\left(-1 \cdot x1 + 2 \cdot x2\right)}\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) \]
    3. Taylor expanded in x1 around inf 89.3%

      \[\leadsto x1 + \left(\left(\left(\left(\left(\color{blue}{2 \cdot x1} + \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) \]
    4. Step-by-step derivation
      1. *-commutative89.3%

        \[\leadsto x1 + \left(\left(\left(\left(\left(\color{blue}{x1 \cdot 2} + \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) \]
    5. Simplified89.3%

      \[\leadsto x1 + \left(\left(\left(\left(\left(\color{blue}{x1 \cdot 2} + \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 -2.2e13 < x1 < 1.45e9

    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 85.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. Step-by-step derivation
      1. associate-*r*96.2%

        \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(\left(x1 \cdot x2\right) \cdot \left(2 \cdot x2 - 3\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) \]
      2. sub-neg96.2%

        \[\leadsto x1 + \left(\left(4 \cdot \left(\left(x1 \cdot x2\right) \cdot \color{blue}{\left(2 \cdot x2 + \left(-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. metadata-eval96.2%

        \[\leadsto x1 + \left(\left(4 \cdot \left(\left(x1 \cdot x2\right) \cdot \left(2 \cdot x2 + \color{blue}{-3}\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. distribute-rgt-in96.2%

        \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(\left(2 \cdot x2\right) \cdot \left(x1 \cdot x2\right) + -3 \cdot \left(x1 \cdot x2\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) \]
      5. *-commutative96.2%

        \[\leadsto x1 + \left(\left(4 \cdot \left(\color{blue}{\left(x2 \cdot 2\right)} \cdot \left(x1 \cdot x2\right) + -3 \cdot \left(x1 \cdot x2\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. Applied egg-rr96.2%

      \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(\left(x2 \cdot 2\right) \cdot \left(x1 \cdot x2\right) + -3 \cdot \left(x1 \cdot x2\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) \]
    5. Step-by-step derivation
      1. *-commutative96.2%

        \[\leadsto x1 + \left(\left(4 \cdot \left(\color{blue}{\left(2 \cdot x2\right)} \cdot \left(x1 \cdot x2\right) + -3 \cdot \left(x1 \cdot x2\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) \]
      2. associate-*r*96.2%

        \[\leadsto x1 + \left(\left(4 \cdot \left(\color{blue}{\left(\left(2 \cdot x2\right) \cdot x1\right) \cdot x2} + -3 \cdot \left(x1 \cdot x2\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. associate-*r*96.2%

        \[\leadsto x1 + \left(\left(4 \cdot \left(\left(\left(2 \cdot x2\right) \cdot x1\right) \cdot x2 + \color{blue}{\left(-3 \cdot x1\right) \cdot x2}\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. distribute-rgt-out96.2%

        \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(x2 \cdot \left(\left(2 \cdot x2\right) \cdot x1 + -3 \cdot x1\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) \]
      5. *-commutative96.2%

        \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(\color{blue}{x1 \cdot \left(2 \cdot x2\right)} + -3 \cdot x1\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) \]
      6. *-commutative96.2%

        \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2\right) + \color{blue}{x1 \cdot -3}\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) \]
    6. Applied egg-rr96.2%

      \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2\right) + x1 \cdot -3\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.35000000000000003e154 < x1

    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 0 0.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 6.8%

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

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

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

        \[\leadsto \color{blue}{x2 \cdot -6 + x1} \]
      2. flip-+74.1%

        \[\leadsto \color{blue}{\frac{\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right) - x1 \cdot x1}{x2 \cdot -6 - x1}} \]
      3. *-commutative74.1%

        \[\leadsto \frac{\color{blue}{\left(-6 \cdot x2\right)} \cdot \left(x2 \cdot -6\right) - x1 \cdot x1}{x2 \cdot -6 - x1} \]
      4. *-commutative74.1%

        \[\leadsto \frac{\left(-6 \cdot x2\right) \cdot \color{blue}{\left(-6 \cdot x2\right)} - x1 \cdot x1}{x2 \cdot -6 - x1} \]
      5. swap-sqr74.1%

        \[\leadsto \frac{\color{blue}{\left(-6 \cdot -6\right) \cdot \left(x2 \cdot x2\right)} - x1 \cdot x1}{x2 \cdot -6 - x1} \]
      6. metadata-eval74.1%

        \[\leadsto \frac{\color{blue}{36} \cdot \left(x2 \cdot x2\right) - x1 \cdot x1}{x2 \cdot -6 - x1} \]
    7. Applied egg-rr74.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -1.22 \cdot 10^{+125}:\\ \;\;\;\;\frac{x1}{\frac{x1 + x2 \cdot 6}{x1}} - \frac{36}{\frac{x1 + x2 \cdot 6}{x2 \cdot x2}}\\ \mathbf{elif}\;x1 \leq -22000000000000:\\ \;\;\;\;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(x1 \cdot 2 + \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)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 1450000000:\\ \;\;\;\;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(x2 \cdot \left(x1 \cdot \left(2 \cdot x2\right) + x1 \cdot -3\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;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(x1 \cdot 2 + \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)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{36 \cdot \left(x2 \cdot x2\right) - x1 \cdot x1}{x2 \cdot -6 - x1}\\ \end{array} \]

Alternative 9: 76.7% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 \cdot x1 + 1\\ t_1 := x1 + x2 \cdot 6\\ t_2 := x1 \cdot \left(x1 \cdot 3\right)\\ t_3 := \frac{\left(t_2 + 2 \cdot x2\right) - x1}{t_0}\\ t_4 := x1 + \left(9 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_2 \cdot t_3 + t_0 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(t_3 \cdot 4 - 6\right) + 4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\right)\right)\right)\\ \mathbf{if}\;x1 \leq -9.8 \cdot 10^{+124}:\\ \;\;\;\;\frac{x1}{\frac{t_1}{x1}} - \frac{36}{\frac{t_1}{x2 \cdot x2}}\\ \mathbf{elif}\;x1 \leq -4.4 \cdot 10^{-27}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;x1 \leq 4.8 \cdot 10^{+21}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(t_2 - 2 \cdot x2\right) - x1}{t_0} + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2\right) + x1 \cdot -3\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;t_4\\ \mathbf{else}:\\ \;\;\;\;\frac{36 \cdot \left(x2 \cdot x2\right) - x1 \cdot x1}{x2 \cdot -6 - x1}\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (+ (* x1 x1) 1.0))
        (t_1 (+ x1 (* x2 6.0)))
        (t_2 (* x1 (* x1 3.0)))
        (t_3 (/ (- (+ t_2 (* 2.0 x2)) x1) t_0))
        (t_4
         (+
          x1
          (+
           9.0
           (+
            x1
            (+
             (* x1 (* x1 x1))
             (+
              (* t_2 t_3)
              (*
               t_0
               (+
                (* (* x1 x1) (- (* t_3 4.0) 6.0))
                (* 4.0 (* x1 (* x2 (- (* 2.0 x2) 3.0)))))))))))))
   (if (<= x1 -9.8e+124)
     (- (/ x1 (/ t_1 x1)) (/ 36.0 (/ t_1 (* x2 x2))))
     (if (<= x1 -4.4e-27)
       t_4
       (if (<= x1 4.8e+21)
         (+
          x1
          (+
           (* 3.0 (/ (- (- t_2 (* 2.0 x2)) x1) t_0))
           (+ x1 (* 4.0 (* x2 (+ (* x1 (* 2.0 x2)) (* x1 -3.0)))))))
         (if (<= x1 1.35e+154)
           t_4
           (/ (- (* 36.0 (* x2 x2)) (* x1 x1)) (- (* x2 -6.0) x1))))))))
double code(double x1, double x2) {
	double t_0 = (x1 * x1) + 1.0;
	double t_1 = x1 + (x2 * 6.0);
	double t_2 = x1 * (x1 * 3.0);
	double t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0;
	double t_4 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_2 * t_3) + (t_0 * (((x1 * x1) * ((t_3 * 4.0) - 6.0)) + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))))))));
	double tmp;
	if (x1 <= -9.8e+124) {
		tmp = (x1 / (t_1 / x1)) - (36.0 / (t_1 / (x2 * x2)));
	} else if (x1 <= -4.4e-27) {
		tmp = t_4;
	} else if (x1 <= 4.8e+21) {
		tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x2 * ((x1 * (2.0 * x2)) + (x1 * -3.0))))));
	} else if (x1 <= 1.35e+154) {
		tmp = t_4;
	} else {
		tmp = ((36.0 * (x2 * x2)) - (x1 * x1)) / ((x2 * -6.0) - x1);
	}
	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) + 1.0d0
    t_1 = x1 + (x2 * 6.0d0)
    t_2 = x1 * (x1 * 3.0d0)
    t_3 = ((t_2 + (2.0d0 * x2)) - x1) / t_0
    t_4 = x1 + (9.0d0 + (x1 + ((x1 * (x1 * x1)) + ((t_2 * t_3) + (t_0 * (((x1 * x1) * ((t_3 * 4.0d0) - 6.0d0)) + (4.0d0 * (x1 * (x2 * ((2.0d0 * x2) - 3.0d0))))))))))
    if (x1 <= (-9.8d+124)) then
        tmp = (x1 / (t_1 / x1)) - (36.0d0 / (t_1 / (x2 * x2)))
    else if (x1 <= (-4.4d-27)) then
        tmp = t_4
    else if (x1 <= 4.8d+21) then
        tmp = x1 + ((3.0d0 * (((t_2 - (2.0d0 * x2)) - x1) / t_0)) + (x1 + (4.0d0 * (x2 * ((x1 * (2.0d0 * x2)) + (x1 * (-3.0d0)))))))
    else if (x1 <= 1.35d+154) then
        tmp = t_4
    else
        tmp = ((36.0d0 * (x2 * x2)) - (x1 * x1)) / ((x2 * (-6.0d0)) - x1)
    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 + (x2 * 6.0);
	double t_2 = x1 * (x1 * 3.0);
	double t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0;
	double t_4 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_2 * t_3) + (t_0 * (((x1 * x1) * ((t_3 * 4.0) - 6.0)) + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))))))));
	double tmp;
	if (x1 <= -9.8e+124) {
		tmp = (x1 / (t_1 / x1)) - (36.0 / (t_1 / (x2 * x2)));
	} else if (x1 <= -4.4e-27) {
		tmp = t_4;
	} else if (x1 <= 4.8e+21) {
		tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x2 * ((x1 * (2.0 * x2)) + (x1 * -3.0))))));
	} else if (x1 <= 1.35e+154) {
		tmp = t_4;
	} else {
		tmp = ((36.0 * (x2 * x2)) - (x1 * x1)) / ((x2 * -6.0) - x1);
	}
	return tmp;
}
def code(x1, x2):
	t_0 = (x1 * x1) + 1.0
	t_1 = x1 + (x2 * 6.0)
	t_2 = x1 * (x1 * 3.0)
	t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0
	t_4 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_2 * t_3) + (t_0 * (((x1 * x1) * ((t_3 * 4.0) - 6.0)) + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))))))))
	tmp = 0
	if x1 <= -9.8e+124:
		tmp = (x1 / (t_1 / x1)) - (36.0 / (t_1 / (x2 * x2)))
	elif x1 <= -4.4e-27:
		tmp = t_4
	elif x1 <= 4.8e+21:
		tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x2 * ((x1 * (2.0 * x2)) + (x1 * -3.0))))))
	elif x1 <= 1.35e+154:
		tmp = t_4
	else:
		tmp = ((36.0 * (x2 * x2)) - (x1 * x1)) / ((x2 * -6.0) - x1)
	return tmp
function code(x1, x2)
	t_0 = Float64(Float64(x1 * x1) + 1.0)
	t_1 = Float64(x1 + Float64(x2 * 6.0))
	t_2 = Float64(x1 * Float64(x1 * 3.0))
	t_3 = Float64(Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) / t_0)
	t_4 = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_2 * t_3) + Float64(t_0 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)) + Float64(4.0 * Float64(x1 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)))))))))))
	tmp = 0.0
	if (x1 <= -9.8e+124)
		tmp = Float64(Float64(x1 / Float64(t_1 / x1)) - Float64(36.0 / Float64(t_1 / Float64(x2 * x2))));
	elseif (x1 <= -4.4e-27)
		tmp = t_4;
	elseif (x1 <= 4.8e+21)
		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(x2 * Float64(Float64(x1 * Float64(2.0 * x2)) + Float64(x1 * -3.0)))))));
	elseif (x1 <= 1.35e+154)
		tmp = t_4;
	else
		tmp = Float64(Float64(Float64(36.0 * Float64(x2 * x2)) - Float64(x1 * x1)) / Float64(Float64(x2 * -6.0) - x1));
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	t_0 = (x1 * x1) + 1.0;
	t_1 = x1 + (x2 * 6.0);
	t_2 = x1 * (x1 * 3.0);
	t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0;
	t_4 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_2 * t_3) + (t_0 * (((x1 * x1) * ((t_3 * 4.0) - 6.0)) + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))))))));
	tmp = 0.0;
	if (x1 <= -9.8e+124)
		tmp = (x1 / (t_1 / x1)) - (36.0 / (t_1 / (x2 * x2)));
	elseif (x1 <= -4.4e-27)
		tmp = t_4;
	elseif (x1 <= 4.8e+21)
		tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x2 * ((x1 * (2.0 * x2)) + (x1 * -3.0))))));
	elseif (x1 <= 1.35e+154)
		tmp = t_4;
	else
		tmp = ((36.0 * (x2 * x2)) - (x1 * x1)) / ((x2 * -6.0) - 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[(x2 * 6.0), $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]}, Block[{t$95$4 = N[(x1 + N[(9.0 + 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[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(4.0 * N[(x1 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -9.8e+124], N[(N[(x1 / N[(t$95$1 / x1), $MachinePrecision]), $MachinePrecision] - N[(36.0 / N[(t$95$1 / N[(x2 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -4.4e-27], t$95$4, If[LessEqual[x1, 4.8e+21], 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[(x2 * N[(N[(x1 * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] + N[(x1 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], t$95$4, N[(N[(N[(36.0 * N[(x2 * x2), $MachinePrecision]), $MachinePrecision] - N[(x1 * x1), $MachinePrecision]), $MachinePrecision] / N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x1 \leq -4.4 \cdot 10^{-27}:\\
\;\;\;\;t_4\\

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

\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;t_4\\

\mathbf{else}:\\
\;\;\;\;\frac{36 \cdot \left(x2 \cdot x2\right) - x1 \cdot x1}{x2 \cdot -6 - x1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x1 < -9.80000000000000069e124

    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 0 0.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 1.1%

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

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

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

        \[\leadsto \color{blue}{\frac{x1 \cdot x1 - \left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6}} \]
      2. div-sub7.0%

        \[\leadsto \color{blue}{\frac{x1 \cdot x1}{x1 - x2 \cdot -6} - \frac{\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6}} \]
      3. *-commutative7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 - \color{blue}{-6 \cdot x2}} - \frac{\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6} \]
      4. cancel-sign-sub-inv7.0%

        \[\leadsto \frac{x1 \cdot x1}{\color{blue}{x1 + \left(--6\right) \cdot x2}} - \frac{\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6} \]
      5. metadata-eval7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 + \color{blue}{6} \cdot x2} - \frac{\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6} \]
      6. *-commutative7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{\color{blue}{\left(-6 \cdot x2\right)} \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6} \]
      7. *-commutative7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{\left(-6 \cdot x2\right) \cdot \color{blue}{\left(-6 \cdot x2\right)}}{x1 - x2 \cdot -6} \]
      8. swap-sqr7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{\color{blue}{\left(-6 \cdot -6\right) \cdot \left(x2 \cdot x2\right)}}{x1 - x2 \cdot -6} \]
      9. metadata-eval7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{\color{blue}{36} \cdot \left(x2 \cdot x2\right)}{x1 - x2 \cdot -6} \]
      10. *-commutative7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{36 \cdot \left(x2 \cdot x2\right)}{x1 - \color{blue}{-6 \cdot x2}} \]
      11. cancel-sign-sub-inv7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{36 \cdot \left(x2 \cdot x2\right)}{\color{blue}{x1 + \left(--6\right) \cdot x2}} \]
      12. metadata-eval7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{36 \cdot \left(x2 \cdot x2\right)}{x1 + \color{blue}{6} \cdot x2} \]
    7. Applied egg-rr7.0%

      \[\leadsto \color{blue}{\frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{36 \cdot \left(x2 \cdot x2\right)}{x1 + 6 \cdot x2}} \]
    8. Step-by-step derivation
      1. associate-/l*28.0%

        \[\leadsto \color{blue}{\frac{x1}{\frac{x1 + 6 \cdot x2}{x1}}} - \frac{36 \cdot \left(x2 \cdot x2\right)}{x1 + 6 \cdot x2} \]
      2. unpow228.0%

        \[\leadsto \frac{x1}{\frac{x1 + 6 \cdot x2}{x1}} - \frac{36 \cdot \color{blue}{{x2}^{2}}}{x1 + 6 \cdot x2} \]
      3. associate-/l*28.0%

        \[\leadsto \frac{x1}{\frac{x1 + 6 \cdot x2}{x1}} - \color{blue}{\frac{36}{\frac{x1 + 6 \cdot x2}{{x2}^{2}}}} \]
      4. unpow228.0%

        \[\leadsto \frac{x1}{\frac{x1 + 6 \cdot x2}{x1}} - \frac{36}{\frac{x1 + 6 \cdot x2}{\color{blue}{x2 \cdot x2}}} \]
    9. Simplified28.0%

      \[\leadsto \color{blue}{\frac{x1}{\frac{x1 + 6 \cdot x2}{x1}} - \frac{36}{\frac{x1 + 6 \cdot x2}{x2 \cdot x2}}} \]

    if -9.80000000000000069e124 < x1 < -4.39999999999999974e-27 or 4.8e21 < x1 < 1.35000000000000003e154

    1. Initial program 95.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 84.3%

      \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \color{blue}{\left(-1 \cdot x1 + 2 \cdot x2\right)}\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) \]
    3. Taylor expanded in x1 around 0 81.8%

      \[\leadsto x1 + \left(\left(\left(\left(\left(\color{blue}{4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\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) \]
    4. Taylor expanded in x1 around inf 81.8%

      \[\leadsto x1 + \left(\left(\left(\left(\left(4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\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}{3}\right) \]

    if -4.39999999999999974e-27 < x1 < 4.8e21

    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 0 86.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. Step-by-step derivation
      1. associate-*r*97.7%

        \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(\left(x1 \cdot x2\right) \cdot \left(2 \cdot x2 - 3\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) \]
      2. sub-neg97.7%

        \[\leadsto x1 + \left(\left(4 \cdot \left(\left(x1 \cdot x2\right) \cdot \color{blue}{\left(2 \cdot x2 + \left(-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. metadata-eval97.7%

        \[\leadsto x1 + \left(\left(4 \cdot \left(\left(x1 \cdot x2\right) \cdot \left(2 \cdot x2 + \color{blue}{-3}\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. distribute-rgt-in97.7%

        \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(\left(2 \cdot x2\right) \cdot \left(x1 \cdot x2\right) + -3 \cdot \left(x1 \cdot x2\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) \]
      5. *-commutative97.7%

        \[\leadsto x1 + \left(\left(4 \cdot \left(\color{blue}{\left(x2 \cdot 2\right)} \cdot \left(x1 \cdot x2\right) + -3 \cdot \left(x1 \cdot x2\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. Applied egg-rr97.7%

      \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(\left(x2 \cdot 2\right) \cdot \left(x1 \cdot x2\right) + -3 \cdot \left(x1 \cdot x2\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) \]
    5. Step-by-step derivation
      1. *-commutative97.7%

        \[\leadsto x1 + \left(\left(4 \cdot \left(\color{blue}{\left(2 \cdot x2\right)} \cdot \left(x1 \cdot x2\right) + -3 \cdot \left(x1 \cdot x2\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) \]
      2. associate-*r*97.7%

        \[\leadsto x1 + \left(\left(4 \cdot \left(\color{blue}{\left(\left(2 \cdot x2\right) \cdot x1\right) \cdot x2} + -3 \cdot \left(x1 \cdot x2\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. associate-*r*97.7%

        \[\leadsto x1 + \left(\left(4 \cdot \left(\left(\left(2 \cdot x2\right) \cdot x1\right) \cdot x2 + \color{blue}{\left(-3 \cdot x1\right) \cdot x2}\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. distribute-rgt-out97.7%

        \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(x2 \cdot \left(\left(2 \cdot x2\right) \cdot x1 + -3 \cdot x1\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) \]
      5. *-commutative97.7%

        \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(\color{blue}{x1 \cdot \left(2 \cdot x2\right)} + -3 \cdot x1\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) \]
      6. *-commutative97.7%

        \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2\right) + \color{blue}{x1 \cdot -3}\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) \]
    6. Applied egg-rr97.7%

      \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2\right) + x1 \cdot -3\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.35000000000000003e154 < x1

    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 0 0.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 6.8%

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

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

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

        \[\leadsto \color{blue}{x2 \cdot -6 + x1} \]
      2. flip-+74.1%

        \[\leadsto \color{blue}{\frac{\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right) - x1 \cdot x1}{x2 \cdot -6 - x1}} \]
      3. *-commutative74.1%

        \[\leadsto \frac{\color{blue}{\left(-6 \cdot x2\right)} \cdot \left(x2 \cdot -6\right) - x1 \cdot x1}{x2 \cdot -6 - x1} \]
      4. *-commutative74.1%

        \[\leadsto \frac{\left(-6 \cdot x2\right) \cdot \color{blue}{\left(-6 \cdot x2\right)} - x1 \cdot x1}{x2 \cdot -6 - x1} \]
      5. swap-sqr74.1%

        \[\leadsto \frac{\color{blue}{\left(-6 \cdot -6\right) \cdot \left(x2 \cdot x2\right)} - x1 \cdot x1}{x2 \cdot -6 - x1} \]
      6. metadata-eval74.1%

        \[\leadsto \frac{\color{blue}{36} \cdot \left(x2 \cdot x2\right) - x1 \cdot x1}{x2 \cdot -6 - x1} \]
    7. Applied egg-rr74.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -9.8 \cdot 10^{+124}:\\ \;\;\;\;\frac{x1}{\frac{x1 + x2 \cdot 6}{x1}} - \frac{36}{\frac{x1 + x2 \cdot 6}{x2 \cdot x2}}\\ \mathbf{elif}\;x1 \leq -4.4 \cdot 10^{-27}:\\ \;\;\;\;x1 + \left(9 + \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(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) + 4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 4.8 \cdot 10^{+21}:\\ \;\;\;\;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(x2 \cdot \left(x1 \cdot \left(2 \cdot x2\right) + x1 \cdot -3\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;x1 + \left(9 + \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(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) + 4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{36 \cdot \left(x2 \cdot x2\right) - x1 \cdot x1}{x2 \cdot -6 - x1}\\ \end{array} \]

Alternative 10: 76.5% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 + x2 \cdot 6\\ 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 := x1 + \left(t_3 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_1 \cdot \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_2} + t_2 \cdot \left(x1 \cdot \left(x1 \cdot 6\right)\right)\right)\right)\right)\right)\\ \mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\ \;\;\;\;\frac{x1}{\frac{t_0}{x1}} - \frac{36}{\frac{t_0}{x2 \cdot x2}}\\ \mathbf{elif}\;x1 \leq -5.2 \cdot 10^{+16}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;x1 \leq 16200000000:\\ \;\;\;\;x1 + \left(t_3 + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2\right) + x1 \cdot -3\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;t_4\\ \mathbf{else}:\\ \;\;\;\;\frac{36 \cdot \left(x2 \cdot x2\right) - x1 \cdot x1}{x2 \cdot -6 - x1}\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (+ x1 (* x2 6.0)))
        (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
         (+
          x1
          (+
           t_3
           (+
            x1
            (+
             (* x1 (* x1 x1))
             (+
              (* t_1 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2))
              (* t_2 (* x1 (* x1 6.0))))))))))
   (if (<= x1 -5.6e+102)
     (- (/ x1 (/ t_0 x1)) (/ 36.0 (/ t_0 (* x2 x2))))
     (if (<= x1 -5.2e+16)
       t_4
       (if (<= x1 16200000000.0)
         (+ x1 (+ t_3 (+ x1 (* 4.0 (* x2 (+ (* x1 (* 2.0 x2)) (* x1 -3.0)))))))
         (if (<= x1 1.35e+154)
           t_4
           (/ (- (* 36.0 (* x2 x2)) (* x1 x1)) (- (* x2 -6.0) x1))))))))
double code(double x1, double x2) {
	double t_0 = x1 + (x2 * 6.0);
	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 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_1 + (2.0 * x2)) - x1) / t_2)) + (t_2 * (x1 * (x1 * 6.0)))))));
	double tmp;
	if (x1 <= -5.6e+102) {
		tmp = (x1 / (t_0 / x1)) - (36.0 / (t_0 / (x2 * x2)));
	} else if (x1 <= -5.2e+16) {
		tmp = t_4;
	} else if (x1 <= 16200000000.0) {
		tmp = x1 + (t_3 + (x1 + (4.0 * (x2 * ((x1 * (2.0 * x2)) + (x1 * -3.0))))));
	} else if (x1 <= 1.35e+154) {
		tmp = t_4;
	} else {
		tmp = ((36.0 * (x2 * x2)) - (x1 * x1)) / ((x2 * -6.0) - x1);
	}
	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 + (x2 * 6.0d0)
    t_1 = x1 * (x1 * 3.0d0)
    t_2 = (x1 * x1) + 1.0d0
    t_3 = 3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_2)
    t_4 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_1 + (2.0d0 * x2)) - x1) / t_2)) + (t_2 * (x1 * (x1 * 6.0d0)))))))
    if (x1 <= (-5.6d+102)) then
        tmp = (x1 / (t_0 / x1)) - (36.0d0 / (t_0 / (x2 * x2)))
    else if (x1 <= (-5.2d+16)) then
        tmp = t_4
    else if (x1 <= 16200000000.0d0) then
        tmp = x1 + (t_3 + (x1 + (4.0d0 * (x2 * ((x1 * (2.0d0 * x2)) + (x1 * (-3.0d0)))))))
    else if (x1 <= 1.35d+154) then
        tmp = t_4
    else
        tmp = ((36.0d0 * (x2 * x2)) - (x1 * x1)) / ((x2 * (-6.0d0)) - x1)
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double t_0 = x1 + (x2 * 6.0);
	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 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_1 + (2.0 * x2)) - x1) / t_2)) + (t_2 * (x1 * (x1 * 6.0)))))));
	double tmp;
	if (x1 <= -5.6e+102) {
		tmp = (x1 / (t_0 / x1)) - (36.0 / (t_0 / (x2 * x2)));
	} else if (x1 <= -5.2e+16) {
		tmp = t_4;
	} else if (x1 <= 16200000000.0) {
		tmp = x1 + (t_3 + (x1 + (4.0 * (x2 * ((x1 * (2.0 * x2)) + (x1 * -3.0))))));
	} else if (x1 <= 1.35e+154) {
		tmp = t_4;
	} else {
		tmp = ((36.0 * (x2 * x2)) - (x1 * x1)) / ((x2 * -6.0) - x1);
	}
	return tmp;
}
def code(x1, x2):
	t_0 = x1 + (x2 * 6.0)
	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 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_1 + (2.0 * x2)) - x1) / t_2)) + (t_2 * (x1 * (x1 * 6.0)))))))
	tmp = 0
	if x1 <= -5.6e+102:
		tmp = (x1 / (t_0 / x1)) - (36.0 / (t_0 / (x2 * x2)))
	elif x1 <= -5.2e+16:
		tmp = t_4
	elif x1 <= 16200000000.0:
		tmp = x1 + (t_3 + (x1 + (4.0 * (x2 * ((x1 * (2.0 * x2)) + (x1 * -3.0))))))
	elif x1 <= 1.35e+154:
		tmp = t_4
	else:
		tmp = ((36.0 * (x2 * x2)) - (x1 * x1)) / ((x2 * -6.0) - x1)
	return tmp
function code(x1, x2)
	t_0 = Float64(x1 + Float64(x2 * 6.0))
	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(x1 + Float64(t_3 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_1 * Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2)) + Float64(t_2 * Float64(x1 * Float64(x1 * 6.0))))))))
	tmp = 0.0
	if (x1 <= -5.6e+102)
		tmp = Float64(Float64(x1 / Float64(t_0 / x1)) - Float64(36.0 / Float64(t_0 / Float64(x2 * x2))));
	elseif (x1 <= -5.2e+16)
		tmp = t_4;
	elseif (x1 <= 16200000000.0)
		tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(Float64(x1 * Float64(2.0 * x2)) + Float64(x1 * -3.0)))))));
	elseif (x1 <= 1.35e+154)
		tmp = t_4;
	else
		tmp = Float64(Float64(Float64(36.0 * Float64(x2 * x2)) - Float64(x1 * x1)) / Float64(Float64(x2 * -6.0) - x1));
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	t_0 = x1 + (x2 * 6.0);
	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 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_1 + (2.0 * x2)) - x1) / t_2)) + (t_2 * (x1 * (x1 * 6.0)))))));
	tmp = 0.0;
	if (x1 <= -5.6e+102)
		tmp = (x1 / (t_0 / x1)) - (36.0 / (t_0 / (x2 * x2)));
	elseif (x1 <= -5.2e+16)
		tmp = t_4;
	elseif (x1 <= 16200000000.0)
		tmp = x1 + (t_3 + (x1 + (4.0 * (x2 * ((x1 * (2.0 * x2)) + (x1 * -3.0))))));
	elseif (x1 <= 1.35e+154)
		tmp = t_4;
	else
		tmp = ((36.0 * (x2 * x2)) - (x1 * x1)) / ((x2 * -6.0) - x1);
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(x2 * 6.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[(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[(x1 + N[(t$95$3 + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 * N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 * N[(x1 * N[(x1 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(N[(x1 / N[(t$95$0 / x1), $MachinePrecision]), $MachinePrecision] - N[(36.0 / N[(t$95$0 / N[(x2 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -5.2e+16], t$95$4, If[LessEqual[x1, 16200000000.0], N[(x1 + N[(t$95$3 + N[(x1 + N[(4.0 * N[(x2 * N[(N[(x1 * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] + N[(x1 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], t$95$4, N[(N[(N[(36.0 * N[(x2 * x2), $MachinePrecision]), $MachinePrecision] - N[(x1 * x1), $MachinePrecision]), $MachinePrecision] / N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x1 + x2 \cdot 6\\
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 := x1 + \left(t_3 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_1 \cdot \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_2} + t_2 \cdot \left(x1 \cdot \left(x1 \cdot 6\right)\right)\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;\frac{x1}{\frac{t_0}{x1}} - \frac{36}{\frac{t_0}{x2 \cdot x2}}\\

\mathbf{elif}\;x1 \leq -5.2 \cdot 10^{+16}:\\
\;\;\;\;t_4\\

\mathbf{elif}\;x1 \leq 16200000000:\\
\;\;\;\;x1 + \left(t_3 + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2\right) + x1 \cdot -3\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;t_4\\

\mathbf{else}:\\
\;\;\;\;\frac{36 \cdot \left(x2 \cdot x2\right) - x1 \cdot x1}{x2 \cdot -6 - x1}\\


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

    1. Initial program 2.2%

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

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

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

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

        \[\leadsto \color{blue}{\frac{x1 \cdot x1 - \left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6}} \]
      2. div-sub6.5%

        \[\leadsto \color{blue}{\frac{x1 \cdot x1}{x1 - x2 \cdot -6} - \frac{\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6}} \]
      3. *-commutative6.5%

        \[\leadsto \frac{x1 \cdot x1}{x1 - \color{blue}{-6 \cdot x2}} - \frac{\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6} \]
      4. cancel-sign-sub-inv6.5%

        \[\leadsto \frac{x1 \cdot x1}{\color{blue}{x1 + \left(--6\right) \cdot x2}} - \frac{\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6} \]
      5. metadata-eval6.5%

        \[\leadsto \frac{x1 \cdot x1}{x1 + \color{blue}{6} \cdot x2} - \frac{\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6} \]
      6. *-commutative6.5%

        \[\leadsto \frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{\color{blue}{\left(-6 \cdot x2\right)} \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6} \]
      7. *-commutative6.5%

        \[\leadsto \frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{\left(-6 \cdot x2\right) \cdot \color{blue}{\left(-6 \cdot x2\right)}}{x1 - x2 \cdot -6} \]
      8. swap-sqr6.5%

        \[\leadsto \frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{\color{blue}{\left(-6 \cdot -6\right) \cdot \left(x2 \cdot x2\right)}}{x1 - x2 \cdot -6} \]
      9. metadata-eval6.5%

        \[\leadsto \frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{\color{blue}{36} \cdot \left(x2 \cdot x2\right)}{x1 - x2 \cdot -6} \]
      10. *-commutative6.5%

        \[\leadsto \frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{36 \cdot \left(x2 \cdot x2\right)}{x1 - \color{blue}{-6 \cdot x2}} \]
      11. cancel-sign-sub-inv6.5%

        \[\leadsto \frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{36 \cdot \left(x2 \cdot x2\right)}{\color{blue}{x1 + \left(--6\right) \cdot x2}} \]
      12. metadata-eval6.5%

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

      \[\leadsto \color{blue}{\frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{36 \cdot \left(x2 \cdot x2\right)}{x1 + 6 \cdot x2}} \]
    8. Step-by-step derivation
      1. associate-/l*26.2%

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

        \[\leadsto \frac{x1}{\frac{x1 + 6 \cdot x2}{x1}} - \frac{36 \cdot \color{blue}{{x2}^{2}}}{x1 + 6 \cdot x2} \]
      3. associate-/l*26.2%

        \[\leadsto \frac{x1}{\frac{x1 + 6 \cdot x2}{x1}} - \color{blue}{\frac{36}{\frac{x1 + 6 \cdot x2}{{x2}^{2}}}} \]
      4. unpow226.2%

        \[\leadsto \frac{x1}{\frac{x1 + 6 \cdot x2}{x1}} - \frac{36}{\frac{x1 + 6 \cdot x2}{\color{blue}{x2 \cdot x2}}} \]
    9. Simplified26.2%

      \[\leadsto \color{blue}{\frac{x1}{\frac{x1 + 6 \cdot x2}{x1}} - \frac{36}{\frac{x1 + 6 \cdot x2}{x2 \cdot x2}}} \]

    if -5.60000000000000037e102 < x1 < -5.2e16 or 1.62e10 < x1 < 1.35000000000000003e154

    1. Initial program 97.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 88.2%

      \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \color{blue}{\left(-1 \cdot x1 + 2 \cdot x2\right)}\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) \]
    3. Taylor expanded in x1 around 0 85.1%

      \[\leadsto x1 + \left(\left(\left(\left(\left(\color{blue}{4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\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) \]
    4. Taylor expanded in x1 around inf 81.4%

      \[\leadsto x1 + \left(\left(\left(\left(\color{blue}{\left(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 \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    5. Step-by-step derivation
      1. *-commutative81.4%

        \[\leadsto x1 + \left(\left(\left(\left(\color{blue}{\left({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 \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
      2. unpow281.4%

        \[\leadsto x1 + \left(\left(\left(\left(\left(\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 \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
      3. associate-*r*81.5%

        \[\leadsto x1 + \left(\left(\left(\left(\color{blue}{\left(x1 \cdot \left(x1 \cdot 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) \]
    6. Simplified81.5%

      \[\leadsto x1 + \left(\left(\left(\left(\color{blue}{\left(x1 \cdot \left(x1 \cdot 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 -5.2e16 < x1 < 1.62e10

    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 85.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. Step-by-step derivation
      1. associate-*r*96.2%

        \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(\left(x1 \cdot x2\right) \cdot \left(2 \cdot x2 - 3\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) \]
      2. sub-neg96.2%

        \[\leadsto x1 + \left(\left(4 \cdot \left(\left(x1 \cdot x2\right) \cdot \color{blue}{\left(2 \cdot x2 + \left(-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. metadata-eval96.2%

        \[\leadsto x1 + \left(\left(4 \cdot \left(\left(x1 \cdot x2\right) \cdot \left(2 \cdot x2 + \color{blue}{-3}\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. distribute-rgt-in96.2%

        \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(\left(2 \cdot x2\right) \cdot \left(x1 \cdot x2\right) + -3 \cdot \left(x1 \cdot x2\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) \]
      5. *-commutative96.2%

        \[\leadsto x1 + \left(\left(4 \cdot \left(\color{blue}{\left(x2 \cdot 2\right)} \cdot \left(x1 \cdot x2\right) + -3 \cdot \left(x1 \cdot x2\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. Applied egg-rr96.2%

      \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(\left(x2 \cdot 2\right) \cdot \left(x1 \cdot x2\right) + -3 \cdot \left(x1 \cdot x2\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) \]
    5. Step-by-step derivation
      1. *-commutative96.2%

        \[\leadsto x1 + \left(\left(4 \cdot \left(\color{blue}{\left(2 \cdot x2\right)} \cdot \left(x1 \cdot x2\right) + -3 \cdot \left(x1 \cdot x2\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) \]
      2. associate-*r*96.2%

        \[\leadsto x1 + \left(\left(4 \cdot \left(\color{blue}{\left(\left(2 \cdot x2\right) \cdot x1\right) \cdot x2} + -3 \cdot \left(x1 \cdot x2\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. associate-*r*96.2%

        \[\leadsto x1 + \left(\left(4 \cdot \left(\left(\left(2 \cdot x2\right) \cdot x1\right) \cdot x2 + \color{blue}{\left(-3 \cdot x1\right) \cdot x2}\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. distribute-rgt-out96.2%

        \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(x2 \cdot \left(\left(2 \cdot x2\right) \cdot x1 + -3 \cdot x1\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) \]
      5. *-commutative96.2%

        \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(\color{blue}{x1 \cdot \left(2 \cdot x2\right)} + -3 \cdot x1\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) \]
      6. *-commutative96.2%

        \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2\right) + \color{blue}{x1 \cdot -3}\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) \]
    6. Applied egg-rr96.2%

      \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2\right) + x1 \cdot -3\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.35000000000000003e154 < x1

    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 0 0.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 6.8%

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

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

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

        \[\leadsto \color{blue}{x2 \cdot -6 + x1} \]
      2. flip-+74.1%

        \[\leadsto \color{blue}{\frac{\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right) - x1 \cdot x1}{x2 \cdot -6 - x1}} \]
      3. *-commutative74.1%

        \[\leadsto \frac{\color{blue}{\left(-6 \cdot x2\right)} \cdot \left(x2 \cdot -6\right) - x1 \cdot x1}{x2 \cdot -6 - x1} \]
      4. *-commutative74.1%

        \[\leadsto \frac{\left(-6 \cdot x2\right) \cdot \color{blue}{\left(-6 \cdot x2\right)} - x1 \cdot x1}{x2 \cdot -6 - x1} \]
      5. swap-sqr74.1%

        \[\leadsto \frac{\color{blue}{\left(-6 \cdot -6\right) \cdot \left(x2 \cdot x2\right)} - x1 \cdot x1}{x2 \cdot -6 - x1} \]
      6. metadata-eval74.1%

        \[\leadsto \frac{\color{blue}{36} \cdot \left(x2 \cdot x2\right) - x1 \cdot x1}{x2 \cdot -6 - x1} \]
    7. Applied egg-rr74.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\ \;\;\;\;\frac{x1}{\frac{x1 + x2 \cdot 6}{x1}} - \frac{36}{\frac{x1 + x2 \cdot 6}{x2 \cdot x2}}\\ \mathbf{elif}\;x1 \leq -5.2 \cdot 10^{+16}:\\ \;\;\;\;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(x1 \cdot \left(x1 \cdot 6\right)\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 16200000000:\\ \;\;\;\;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(x2 \cdot \left(x1 \cdot \left(2 \cdot x2\right) + x1 \cdot -3\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;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(x1 \cdot \left(x1 \cdot 6\right)\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{36 \cdot \left(x2 \cdot x2\right) - x1 \cdot x1}{x2 \cdot -6 - x1}\\ \end{array} \]

Alternative 11: 63.2% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 36 \cdot \left(x2 \cdot x2\right)\\ t_1 := x1 + x2 \cdot 6\\ \mathbf{if}\;x1 \leq -9 \cdot 10^{+124}:\\ \;\;\;\;\frac{x1}{\frac{t_1}{x1}} - \frac{36}{\frac{t_1}{x2 \cdot x2}}\\ \mathbf{elif}\;x1 \leq -1.45 \cdot 10^{-165}:\\ \;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 10^{-285}:\\ \;\;\;\;x1 + \left(x1 \cdot -2 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\ \mathbf{elif}\;x1 \leq 3.4 \cdot 10^{+114}:\\ \;\;\;\;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(x1 \cdot \left(x2 \cdot x2\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;\frac{\left(x1 \cdot x1\right) \cdot t_1 - t_1 \cdot t_0}{t_1 \cdot t_1}\\ \mathbf{else}:\\ \;\;\;\;\frac{t_0 - x1 \cdot x1}{x2 \cdot -6 - x1}\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (* 36.0 (* x2 x2))) (t_1 (+ x1 (* x2 6.0))))
   (if (<= x1 -9e+124)
     (- (/ x1 (/ t_1 x1)) (/ 36.0 (/ t_1 (* x2 x2))))
     (if (<= x1 -1.45e-165)
       (+ (* x2 -6.0) (* x1 (+ -1.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0))))))
       (if (<= x1 1e-285)
         (+ x1 (+ (* x1 -2.0) (* x2 (- (* x1 -12.0) 6.0))))
         (if (<= x1 3.4e+114)
           (+
            x1
            (+
             (*
              3.0
              (/ (- (- (* x1 (* x1 3.0)) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)))
             (+ x1 (* 4.0 (* 2.0 (* x1 (* x2 x2)))))))
           (if (<= x1 1.35e+154)
             (/ (- (* (* x1 x1) t_1) (* t_1 t_0)) (* t_1 t_1))
             (/ (- t_0 (* x1 x1)) (- (* x2 -6.0) x1)))))))))
double code(double x1, double x2) {
	double t_0 = 36.0 * (x2 * x2);
	double t_1 = x1 + (x2 * 6.0);
	double tmp;
	if (x1 <= -9e+124) {
		tmp = (x1 / (t_1 / x1)) - (36.0 / (t_1 / (x2 * x2)));
	} else if (x1 <= -1.45e-165) {
		tmp = (x2 * -6.0) + (x1 * (-1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
	} else if (x1 <= 1e-285) {
		tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
	} else if (x1 <= 3.4e+114) {
		tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (2.0 * (x1 * (x2 * x2))))));
	} else if (x1 <= 1.35e+154) {
		tmp = (((x1 * x1) * t_1) - (t_1 * t_0)) / (t_1 * t_1);
	} else {
		tmp = (t_0 - (x1 * x1)) / ((x2 * -6.0) - x1);
	}
	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 = 36.0d0 * (x2 * x2)
    t_1 = x1 + (x2 * 6.0d0)
    if (x1 <= (-9d+124)) then
        tmp = (x1 / (t_1 / x1)) - (36.0d0 / (t_1 / (x2 * x2)))
    else if (x1 <= (-1.45d-165)) then
        tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0)))))
    else if (x1 <= 1d-285) then
        tmp = x1 + ((x1 * (-2.0d0)) + (x2 * ((x1 * (-12.0d0)) - 6.0d0)))
    else if (x1 <= 3.4d+114) then
        tmp = x1 + ((3.0d0 * ((((x1 * (x1 * 3.0d0)) - (2.0d0 * x2)) - x1) / ((x1 * x1) + 1.0d0))) + (x1 + (4.0d0 * (2.0d0 * (x1 * (x2 * x2))))))
    else if (x1 <= 1.35d+154) then
        tmp = (((x1 * x1) * t_1) - (t_1 * t_0)) / (t_1 * t_1)
    else
        tmp = (t_0 - (x1 * x1)) / ((x2 * (-6.0d0)) - x1)
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double t_0 = 36.0 * (x2 * x2);
	double t_1 = x1 + (x2 * 6.0);
	double tmp;
	if (x1 <= -9e+124) {
		tmp = (x1 / (t_1 / x1)) - (36.0 / (t_1 / (x2 * x2)));
	} else if (x1 <= -1.45e-165) {
		tmp = (x2 * -6.0) + (x1 * (-1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
	} else if (x1 <= 1e-285) {
		tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
	} else if (x1 <= 3.4e+114) {
		tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (2.0 * (x1 * (x2 * x2))))));
	} else if (x1 <= 1.35e+154) {
		tmp = (((x1 * x1) * t_1) - (t_1 * t_0)) / (t_1 * t_1);
	} else {
		tmp = (t_0 - (x1 * x1)) / ((x2 * -6.0) - x1);
	}
	return tmp;
}
def code(x1, x2):
	t_0 = 36.0 * (x2 * x2)
	t_1 = x1 + (x2 * 6.0)
	tmp = 0
	if x1 <= -9e+124:
		tmp = (x1 / (t_1 / x1)) - (36.0 / (t_1 / (x2 * x2)))
	elif x1 <= -1.45e-165:
		tmp = (x2 * -6.0) + (x1 * (-1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))))
	elif x1 <= 1e-285:
		tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)))
	elif x1 <= 3.4e+114:
		tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (2.0 * (x1 * (x2 * x2))))))
	elif x1 <= 1.35e+154:
		tmp = (((x1 * x1) * t_1) - (t_1 * t_0)) / (t_1 * t_1)
	else:
		tmp = (t_0 - (x1 * x1)) / ((x2 * -6.0) - x1)
	return tmp
function code(x1, x2)
	t_0 = Float64(36.0 * Float64(x2 * x2))
	t_1 = Float64(x1 + Float64(x2 * 6.0))
	tmp = 0.0
	if (x1 <= -9e+124)
		tmp = Float64(Float64(x1 / Float64(t_1 / x1)) - Float64(36.0 / Float64(t_1 / Float64(x2 * x2))));
	elseif (x1 <= -1.45e-165)
		tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))))));
	elseif (x1 <= 1e-285)
		tmp = Float64(x1 + Float64(Float64(x1 * -2.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0))));
	elseif (x1 <= 3.4e+114)
		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(x1 * Float64(x2 * x2)))))));
	elseif (x1 <= 1.35e+154)
		tmp = Float64(Float64(Float64(Float64(x1 * x1) * t_1) - Float64(t_1 * t_0)) / Float64(t_1 * t_1));
	else
		tmp = Float64(Float64(t_0 - Float64(x1 * x1)) / Float64(Float64(x2 * -6.0) - x1));
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	t_0 = 36.0 * (x2 * x2);
	t_1 = x1 + (x2 * 6.0);
	tmp = 0.0;
	if (x1 <= -9e+124)
		tmp = (x1 / (t_1 / x1)) - (36.0 / (t_1 / (x2 * x2)));
	elseif (x1 <= -1.45e-165)
		tmp = (x2 * -6.0) + (x1 * (-1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
	elseif (x1 <= 1e-285)
		tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
	elseif (x1 <= 3.4e+114)
		tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (2.0 * (x1 * (x2 * x2))))));
	elseif (x1 <= 1.35e+154)
		tmp = (((x1 * x1) * t_1) - (t_1 * t_0)) / (t_1 * t_1);
	else
		tmp = (t_0 - (x1 * x1)) / ((x2 * -6.0) - x1);
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := Block[{t$95$0 = N[(36.0 * N[(x2 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(x2 * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -9e+124], N[(N[(x1 / N[(t$95$1 / x1), $MachinePrecision]), $MachinePrecision] - N[(36.0 / N[(t$95$1 / N[(x2 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -1.45e-165], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1e-285], N[(x1 + N[(N[(x1 * -2.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 3.4e+114], 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[(x1 * N[(x2 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(N[(N[(N[(x1 * x1), $MachinePrecision] * t$95$1), $MachinePrecision] - N[(t$95$1 * t$95$0), $MachinePrecision]), $MachinePrecision] / N[(t$95$1 * t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision] / N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 36 \cdot \left(x2 \cdot x2\right)\\
t_1 := x1 + x2 \cdot 6\\
\mathbf{if}\;x1 \leq -9 \cdot 10^{+124}:\\
\;\;\;\;\frac{x1}{\frac{t_1}{x1}} - \frac{36}{\frac{t_1}{x2 \cdot x2}}\\

\mathbf{elif}\;x1 \leq -1.45 \cdot 10^{-165}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 10^{-285}:\\
\;\;\;\;x1 + \left(x1 \cdot -2 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\

\mathbf{elif}\;x1 \leq 3.4 \cdot 10^{+114}:\\
\;\;\;\;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(x1 \cdot \left(x2 \cdot x2\right)\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;\frac{\left(x1 \cdot x1\right) \cdot t_1 - t_1 \cdot t_0}{t_1 \cdot t_1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if x1 < -9.0000000000000008e124

    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 0 0.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 1.1%

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

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

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

        \[\leadsto \color{blue}{\frac{x1 \cdot x1 - \left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6}} \]
      2. div-sub7.0%

        \[\leadsto \color{blue}{\frac{x1 \cdot x1}{x1 - x2 \cdot -6} - \frac{\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6}} \]
      3. *-commutative7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 - \color{blue}{-6 \cdot x2}} - \frac{\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6} \]
      4. cancel-sign-sub-inv7.0%

        \[\leadsto \frac{x1 \cdot x1}{\color{blue}{x1 + \left(--6\right) \cdot x2}} - \frac{\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6} \]
      5. metadata-eval7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 + \color{blue}{6} \cdot x2} - \frac{\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6} \]
      6. *-commutative7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{\color{blue}{\left(-6 \cdot x2\right)} \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6} \]
      7. *-commutative7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{\left(-6 \cdot x2\right) \cdot \color{blue}{\left(-6 \cdot x2\right)}}{x1 - x2 \cdot -6} \]
      8. swap-sqr7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{\color{blue}{\left(-6 \cdot -6\right) \cdot \left(x2 \cdot x2\right)}}{x1 - x2 \cdot -6} \]
      9. metadata-eval7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{\color{blue}{36} \cdot \left(x2 \cdot x2\right)}{x1 - x2 \cdot -6} \]
      10. *-commutative7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{36 \cdot \left(x2 \cdot x2\right)}{x1 - \color{blue}{-6 \cdot x2}} \]
      11. cancel-sign-sub-inv7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{36 \cdot \left(x2 \cdot x2\right)}{\color{blue}{x1 + \left(--6\right) \cdot x2}} \]
      12. metadata-eval7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{36 \cdot \left(x2 \cdot x2\right)}{x1 + \color{blue}{6} \cdot x2} \]
    7. Applied egg-rr7.0%

      \[\leadsto \color{blue}{\frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{36 \cdot \left(x2 \cdot x2\right)}{x1 + 6 \cdot x2}} \]
    8. Step-by-step derivation
      1. associate-/l*28.0%

        \[\leadsto \color{blue}{\frac{x1}{\frac{x1 + 6 \cdot x2}{x1}}} - \frac{36 \cdot \left(x2 \cdot x2\right)}{x1 + 6 \cdot x2} \]
      2. unpow228.0%

        \[\leadsto \frac{x1}{\frac{x1 + 6 \cdot x2}{x1}} - \frac{36 \cdot \color{blue}{{x2}^{2}}}{x1 + 6 \cdot x2} \]
      3. associate-/l*28.0%

        \[\leadsto \frac{x1}{\frac{x1 + 6 \cdot x2}{x1}} - \color{blue}{\frac{36}{\frac{x1 + 6 \cdot x2}{{x2}^{2}}}} \]
      4. unpow228.0%

        \[\leadsto \frac{x1}{\frac{x1 + 6 \cdot x2}{x1}} - \frac{36}{\frac{x1 + 6 \cdot x2}{\color{blue}{x2 \cdot x2}}} \]
    9. Simplified28.0%

      \[\leadsto \color{blue}{\frac{x1}{\frac{x1 + 6 \cdot x2}{x1}} - \frac{36}{\frac{x1 + 6 \cdot x2}{x2 \cdot x2}}} \]

    if -9.0000000000000008e124 < x1 < -1.45e-165

    1. Initial program 95.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 56.1%

      \[\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 57.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. Step-by-step derivation
      1. fma-def57.4%

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

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

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

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

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

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

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

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

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

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

    if -1.45e-165 < x1 < 1.00000000000000007e-285

    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 78.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 78.7%

      \[\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. Step-by-step derivation
      1. fma-def78.9%

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

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

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

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

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

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

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

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

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

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

    if 1.00000000000000007e-285 < x1 < 3.4000000000000001e114

    1. Initial program 98.2%

      \[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 76.7%

      \[\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 76.7%

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

        \[\leadsto x1 + \left(\left(4 \cdot \left(2 \cdot \left(x1 \cdot \color{blue}{\left(x2 \cdot x2\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) \]
    5. Simplified76.7%

      \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(2 \cdot \left(x1 \cdot \left(x2 \cdot x2\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 3.4000000000000001e114 < x1 < 1.35000000000000003e154

    1. Initial program 93.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 16.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 x1 around 0 3.9%

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

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

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

        \[\leadsto \color{blue}{\frac{x1 \cdot x1 - \left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6}} \]
      2. div-sub3.9%

        \[\leadsto \color{blue}{\frac{x1 \cdot x1}{x1 - x2 \cdot -6} - \frac{\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6}} \]
      3. frac-sub80.0%

        \[\leadsto \color{blue}{\frac{\left(x1 \cdot x1\right) \cdot \left(x1 - x2 \cdot -6\right) - \left(x1 - x2 \cdot -6\right) \cdot \left(\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)\right)}{\left(x1 - x2 \cdot -6\right) \cdot \left(x1 - x2 \cdot -6\right)}} \]
      4. *-commutative80.0%

        \[\leadsto \frac{\left(x1 \cdot x1\right) \cdot \left(x1 - \color{blue}{-6 \cdot x2}\right) - \left(x1 - x2 \cdot -6\right) \cdot \left(\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)\right)}{\left(x1 - x2 \cdot -6\right) \cdot \left(x1 - x2 \cdot -6\right)} \]
      5. cancel-sign-sub-inv80.0%

        \[\leadsto \frac{\left(x1 \cdot x1\right) \cdot \color{blue}{\left(x1 + \left(--6\right) \cdot x2\right)} - \left(x1 - x2 \cdot -6\right) \cdot \left(\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)\right)}{\left(x1 - x2 \cdot -6\right) \cdot \left(x1 - x2 \cdot -6\right)} \]
      6. metadata-eval80.0%

        \[\leadsto \frac{\left(x1 \cdot x1\right) \cdot \left(x1 + \color{blue}{6} \cdot x2\right) - \left(x1 - x2 \cdot -6\right) \cdot \left(\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)\right)}{\left(x1 - x2 \cdot -6\right) \cdot \left(x1 - x2 \cdot -6\right)} \]
      7. *-commutative80.0%

        \[\leadsto \frac{\left(x1 \cdot x1\right) \cdot \left(x1 + 6 \cdot x2\right) - \left(x1 - \color{blue}{-6 \cdot x2}\right) \cdot \left(\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)\right)}{\left(x1 - x2 \cdot -6\right) \cdot \left(x1 - x2 \cdot -6\right)} \]
      8. cancel-sign-sub-inv80.0%

        \[\leadsto \frac{\left(x1 \cdot x1\right) \cdot \left(x1 + 6 \cdot x2\right) - \color{blue}{\left(x1 + \left(--6\right) \cdot x2\right)} \cdot \left(\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)\right)}{\left(x1 - x2 \cdot -6\right) \cdot \left(x1 - x2 \cdot -6\right)} \]
      9. metadata-eval80.0%

        \[\leadsto \frac{\left(x1 \cdot x1\right) \cdot \left(x1 + 6 \cdot x2\right) - \left(x1 + \color{blue}{6} \cdot x2\right) \cdot \left(\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)\right)}{\left(x1 - x2 \cdot -6\right) \cdot \left(x1 - x2 \cdot -6\right)} \]
      10. *-commutative80.0%

        \[\leadsto \frac{\left(x1 \cdot x1\right) \cdot \left(x1 + 6 \cdot x2\right) - \left(x1 + 6 \cdot x2\right) \cdot \left(\color{blue}{\left(-6 \cdot x2\right)} \cdot \left(x2 \cdot -6\right)\right)}{\left(x1 - x2 \cdot -6\right) \cdot \left(x1 - x2 \cdot -6\right)} \]
      11. *-commutative80.0%

        \[\leadsto \frac{\left(x1 \cdot x1\right) \cdot \left(x1 + 6 \cdot x2\right) - \left(x1 + 6 \cdot x2\right) \cdot \left(\left(-6 \cdot x2\right) \cdot \color{blue}{\left(-6 \cdot x2\right)}\right)}{\left(x1 - x2 \cdot -6\right) \cdot \left(x1 - x2 \cdot -6\right)} \]
      12. swap-sqr80.0%

        \[\leadsto \frac{\left(x1 \cdot x1\right) \cdot \left(x1 + 6 \cdot x2\right) - \left(x1 + 6 \cdot x2\right) \cdot \color{blue}{\left(\left(-6 \cdot -6\right) \cdot \left(x2 \cdot x2\right)\right)}}{\left(x1 - x2 \cdot -6\right) \cdot \left(x1 - x2 \cdot -6\right)} \]
      13. metadata-eval80.0%

        \[\leadsto \frac{\left(x1 \cdot x1\right) \cdot \left(x1 + 6 \cdot x2\right) - \left(x1 + 6 \cdot x2\right) \cdot \left(\color{blue}{36} \cdot \left(x2 \cdot x2\right)\right)}{\left(x1 - x2 \cdot -6\right) \cdot \left(x1 - x2 \cdot -6\right)} \]
    7. Applied egg-rr80.0%

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

    if 1.35000000000000003e154 < x1

    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 0 0.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 6.8%

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

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

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

        \[\leadsto \color{blue}{x2 \cdot -6 + x1} \]
      2. flip-+74.1%

        \[\leadsto \color{blue}{\frac{\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right) - x1 \cdot x1}{x2 \cdot -6 - x1}} \]
      3. *-commutative74.1%

        \[\leadsto \frac{\color{blue}{\left(-6 \cdot x2\right)} \cdot \left(x2 \cdot -6\right) - x1 \cdot x1}{x2 \cdot -6 - x1} \]
      4. *-commutative74.1%

        \[\leadsto \frac{\left(-6 \cdot x2\right) \cdot \color{blue}{\left(-6 \cdot x2\right)} - x1 \cdot x1}{x2 \cdot -6 - x1} \]
      5. swap-sqr74.1%

        \[\leadsto \frac{\color{blue}{\left(-6 \cdot -6\right) \cdot \left(x2 \cdot x2\right)} - x1 \cdot x1}{x2 \cdot -6 - x1} \]
      6. metadata-eval74.1%

        \[\leadsto \frac{\color{blue}{36} \cdot \left(x2 \cdot x2\right) - x1 \cdot x1}{x2 \cdot -6 - x1} \]
    7. Applied egg-rr74.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -9 \cdot 10^{+124}:\\ \;\;\;\;\frac{x1}{\frac{x1 + x2 \cdot 6}{x1}} - \frac{36}{\frac{x1 + x2 \cdot 6}{x2 \cdot x2}}\\ \mathbf{elif}\;x1 \leq -1.45 \cdot 10^{-165}:\\ \;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 10^{-285}:\\ \;\;\;\;x1 + \left(x1 \cdot -2 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\ \mathbf{elif}\;x1 \leq 3.4 \cdot 10^{+114}:\\ \;\;\;\;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(x1 \cdot \left(x2 \cdot x2\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;\frac{\left(x1 \cdot x1\right) \cdot \left(x1 + x2 \cdot 6\right) - \left(x1 + x2 \cdot 6\right) \cdot \left(36 \cdot \left(x2 \cdot x2\right)\right)}{\left(x1 + x2 \cdot 6\right) \cdot \left(x1 + x2 \cdot 6\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{36 \cdot \left(x2 \cdot x2\right) - x1 \cdot x1}{x2 \cdot -6 - x1}\\ \end{array} \]

Alternative 12: 62.2% accurate, 3.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 + x2 \cdot 6\\ \mathbf{if}\;x1 \leq -2.6 \cdot 10^{+125}:\\ \;\;\;\;\frac{x1}{\frac{t_0}{x1}} - \frac{36}{\frac{t_0}{x2 \cdot x2}}\\ \mathbf{elif}\;x1 \leq -8.4 \cdot 10^{-166}:\\ \;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 4.9 \cdot 10^{-285}:\\ \;\;\;\;x1 + \left(x1 \cdot -2 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\ \mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;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(x1 \cdot \left(x2 \cdot x2\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{36 \cdot \left(x2 \cdot x2\right) - x1 \cdot x1}{x2 \cdot -6 - x1}\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (+ x1 (* x2 6.0))))
   (if (<= x1 -2.6e+125)
     (- (/ x1 (/ t_0 x1)) (/ 36.0 (/ t_0 (* x2 x2))))
     (if (<= x1 -8.4e-166)
       (+ (* x2 -6.0) (* x1 (+ -1.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0))))))
       (if (<= x1 4.9e-285)
         (+ x1 (+ (* x1 -2.0) (* x2 (- (* x1 -12.0) 6.0))))
         (if (<= x1 1.35e+154)
           (+
            x1
            (+
             (*
              3.0
              (/ (- (- (* x1 (* x1 3.0)) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)))
             (+ x1 (* 4.0 (* 2.0 (* x1 (* x2 x2)))))))
           (/ (- (* 36.0 (* x2 x2)) (* x1 x1)) (- (* x2 -6.0) x1))))))))
double code(double x1, double x2) {
	double t_0 = x1 + (x2 * 6.0);
	double tmp;
	if (x1 <= -2.6e+125) {
		tmp = (x1 / (t_0 / x1)) - (36.0 / (t_0 / (x2 * x2)));
	} else if (x1 <= -8.4e-166) {
		tmp = (x2 * -6.0) + (x1 * (-1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
	} else if (x1 <= 4.9e-285) {
		tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
	} else if (x1 <= 1.35e+154) {
		tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (2.0 * (x1 * (x2 * x2))))));
	} else {
		tmp = ((36.0 * (x2 * x2)) - (x1 * x1)) / ((x2 * -6.0) - x1);
	}
	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 + (x2 * 6.0d0)
    if (x1 <= (-2.6d+125)) then
        tmp = (x1 / (t_0 / x1)) - (36.0d0 / (t_0 / (x2 * x2)))
    else if (x1 <= (-8.4d-166)) then
        tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0)))))
    else if (x1 <= 4.9d-285) then
        tmp = x1 + ((x1 * (-2.0d0)) + (x2 * ((x1 * (-12.0d0)) - 6.0d0)))
    else if (x1 <= 1.35d+154) then
        tmp = x1 + ((3.0d0 * ((((x1 * (x1 * 3.0d0)) - (2.0d0 * x2)) - x1) / ((x1 * x1) + 1.0d0))) + (x1 + (4.0d0 * (2.0d0 * (x1 * (x2 * x2))))))
    else
        tmp = ((36.0d0 * (x2 * x2)) - (x1 * x1)) / ((x2 * (-6.0d0)) - x1)
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double t_0 = x1 + (x2 * 6.0);
	double tmp;
	if (x1 <= -2.6e+125) {
		tmp = (x1 / (t_0 / x1)) - (36.0 / (t_0 / (x2 * x2)));
	} else if (x1 <= -8.4e-166) {
		tmp = (x2 * -6.0) + (x1 * (-1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
	} else if (x1 <= 4.9e-285) {
		tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
	} else if (x1 <= 1.35e+154) {
		tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (2.0 * (x1 * (x2 * x2))))));
	} else {
		tmp = ((36.0 * (x2 * x2)) - (x1 * x1)) / ((x2 * -6.0) - x1);
	}
	return tmp;
}
def code(x1, x2):
	t_0 = x1 + (x2 * 6.0)
	tmp = 0
	if x1 <= -2.6e+125:
		tmp = (x1 / (t_0 / x1)) - (36.0 / (t_0 / (x2 * x2)))
	elif x1 <= -8.4e-166:
		tmp = (x2 * -6.0) + (x1 * (-1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))))
	elif x1 <= 4.9e-285:
		tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)))
	elif x1 <= 1.35e+154:
		tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (2.0 * (x1 * (x2 * x2))))))
	else:
		tmp = ((36.0 * (x2 * x2)) - (x1 * x1)) / ((x2 * -6.0) - x1)
	return tmp
function code(x1, x2)
	t_0 = Float64(x1 + Float64(x2 * 6.0))
	tmp = 0.0
	if (x1 <= -2.6e+125)
		tmp = Float64(Float64(x1 / Float64(t_0 / x1)) - Float64(36.0 / Float64(t_0 / Float64(x2 * x2))));
	elseif (x1 <= -8.4e-166)
		tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))))));
	elseif (x1 <= 4.9e-285)
		tmp = Float64(x1 + Float64(Float64(x1 * -2.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0))));
	elseif (x1 <= 1.35e+154)
		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(x1 * Float64(x2 * x2)))))));
	else
		tmp = Float64(Float64(Float64(36.0 * Float64(x2 * x2)) - Float64(x1 * x1)) / Float64(Float64(x2 * -6.0) - x1));
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	t_0 = x1 + (x2 * 6.0);
	tmp = 0.0;
	if (x1 <= -2.6e+125)
		tmp = (x1 / (t_0 / x1)) - (36.0 / (t_0 / (x2 * x2)));
	elseif (x1 <= -8.4e-166)
		tmp = (x2 * -6.0) + (x1 * (-1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
	elseif (x1 <= 4.9e-285)
		tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
	elseif (x1 <= 1.35e+154)
		tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (2.0 * (x1 * (x2 * x2))))));
	else
		tmp = ((36.0 * (x2 * x2)) - (x1 * x1)) / ((x2 * -6.0) - x1);
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(x2 * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -2.6e+125], N[(N[(x1 / N[(t$95$0 / x1), $MachinePrecision]), $MachinePrecision] - N[(36.0 / N[(t$95$0 / N[(x2 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -8.4e-166], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.9e-285], N[(x1 + N[(N[(x1 * -2.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], 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[(x1 * N[(x2 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(36.0 * N[(x2 * x2), $MachinePrecision]), $MachinePrecision] - N[(x1 * x1), $MachinePrecision]), $MachinePrecision] / N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x1 + x2 \cdot 6\\
\mathbf{if}\;x1 \leq -2.6 \cdot 10^{+125}:\\
\;\;\;\;\frac{x1}{\frac{t_0}{x1}} - \frac{36}{\frac{t_0}{x2 \cdot x2}}\\

\mathbf{elif}\;x1 \leq -8.4 \cdot 10^{-166}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 4.9 \cdot 10^{-285}:\\
\;\;\;\;x1 + \left(x1 \cdot -2 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\

\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;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(x1 \cdot \left(x2 \cdot x2\right)\right)\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{36 \cdot \left(x2 \cdot x2\right) - x1 \cdot x1}{x2 \cdot -6 - x1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if x1 < -2.60000000000000003e125

    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 0 0.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 1.1%

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

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

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

        \[\leadsto \color{blue}{\frac{x1 \cdot x1 - \left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6}} \]
      2. div-sub7.0%

        \[\leadsto \color{blue}{\frac{x1 \cdot x1}{x1 - x2 \cdot -6} - \frac{\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6}} \]
      3. *-commutative7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 - \color{blue}{-6 \cdot x2}} - \frac{\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6} \]
      4. cancel-sign-sub-inv7.0%

        \[\leadsto \frac{x1 \cdot x1}{\color{blue}{x1 + \left(--6\right) \cdot x2}} - \frac{\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6} \]
      5. metadata-eval7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 + \color{blue}{6} \cdot x2} - \frac{\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6} \]
      6. *-commutative7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{\color{blue}{\left(-6 \cdot x2\right)} \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6} \]
      7. *-commutative7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{\left(-6 \cdot x2\right) \cdot \color{blue}{\left(-6 \cdot x2\right)}}{x1 - x2 \cdot -6} \]
      8. swap-sqr7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{\color{blue}{\left(-6 \cdot -6\right) \cdot \left(x2 \cdot x2\right)}}{x1 - x2 \cdot -6} \]
      9. metadata-eval7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{\color{blue}{36} \cdot \left(x2 \cdot x2\right)}{x1 - x2 \cdot -6} \]
      10. *-commutative7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{36 \cdot \left(x2 \cdot x2\right)}{x1 - \color{blue}{-6 \cdot x2}} \]
      11. cancel-sign-sub-inv7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{36 \cdot \left(x2 \cdot x2\right)}{\color{blue}{x1 + \left(--6\right) \cdot x2}} \]
      12. metadata-eval7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{36 \cdot \left(x2 \cdot x2\right)}{x1 + \color{blue}{6} \cdot x2} \]
    7. Applied egg-rr7.0%

      \[\leadsto \color{blue}{\frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{36 \cdot \left(x2 \cdot x2\right)}{x1 + 6 \cdot x2}} \]
    8. Step-by-step derivation
      1. associate-/l*28.0%

        \[\leadsto \color{blue}{\frac{x1}{\frac{x1 + 6 \cdot x2}{x1}}} - \frac{36 \cdot \left(x2 \cdot x2\right)}{x1 + 6 \cdot x2} \]
      2. unpow228.0%

        \[\leadsto \frac{x1}{\frac{x1 + 6 \cdot x2}{x1}} - \frac{36 \cdot \color{blue}{{x2}^{2}}}{x1 + 6 \cdot x2} \]
      3. associate-/l*28.0%

        \[\leadsto \frac{x1}{\frac{x1 + 6 \cdot x2}{x1}} - \color{blue}{\frac{36}{\frac{x1 + 6 \cdot x2}{{x2}^{2}}}} \]
      4. unpow228.0%

        \[\leadsto \frac{x1}{\frac{x1 + 6 \cdot x2}{x1}} - \frac{36}{\frac{x1 + 6 \cdot x2}{\color{blue}{x2 \cdot x2}}} \]
    9. Simplified28.0%

      \[\leadsto \color{blue}{\frac{x1}{\frac{x1 + 6 \cdot x2}{x1}} - \frac{36}{\frac{x1 + 6 \cdot x2}{x2 \cdot x2}}} \]

    if -2.60000000000000003e125 < x1 < -8.3999999999999998e-166

    1. Initial program 95.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 56.1%

      \[\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 57.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. Step-by-step derivation
      1. fma-def57.4%

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

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

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

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

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

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

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

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

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

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

    if -8.3999999999999998e-166 < x1 < 4.89999999999999975e-285

    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 78.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 78.7%

      \[\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. Step-by-step derivation
      1. fma-def78.9%

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

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

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

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

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

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

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

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

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

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

    if 4.89999999999999975e-285 < x1 < 1.35000000000000003e154

    1. Initial program 97.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 67.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 67.9%

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

        \[\leadsto x1 + \left(\left(4 \cdot \left(2 \cdot \left(x1 \cdot \color{blue}{\left(x2 \cdot x2\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) \]
    5. Simplified67.9%

      \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(2 \cdot \left(x1 \cdot \left(x2 \cdot x2\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.35000000000000003e154 < x1

    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 0 0.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 6.8%

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

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

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

        \[\leadsto \color{blue}{x2 \cdot -6 + x1} \]
      2. flip-+74.1%

        \[\leadsto \color{blue}{\frac{\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right) - x1 \cdot x1}{x2 \cdot -6 - x1}} \]
      3. *-commutative74.1%

        \[\leadsto \frac{\color{blue}{\left(-6 \cdot x2\right)} \cdot \left(x2 \cdot -6\right) - x1 \cdot x1}{x2 \cdot -6 - x1} \]
      4. *-commutative74.1%

        \[\leadsto \frac{\left(-6 \cdot x2\right) \cdot \color{blue}{\left(-6 \cdot x2\right)} - x1 \cdot x1}{x2 \cdot -6 - x1} \]
      5. swap-sqr74.1%

        \[\leadsto \frac{\color{blue}{\left(-6 \cdot -6\right) \cdot \left(x2 \cdot x2\right)} - x1 \cdot x1}{x2 \cdot -6 - x1} \]
      6. metadata-eval74.1%

        \[\leadsto \frac{\color{blue}{36} \cdot \left(x2 \cdot x2\right) - x1 \cdot x1}{x2 \cdot -6 - x1} \]
    7. Applied egg-rr74.1%

      \[\leadsto \color{blue}{\frac{36 \cdot \left(x2 \cdot x2\right) - x1 \cdot x1}{x2 \cdot -6 - x1}} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification63.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -2.6 \cdot 10^{+125}:\\ \;\;\;\;\frac{x1}{\frac{x1 + x2 \cdot 6}{x1}} - \frac{36}{\frac{x1 + x2 \cdot 6}{x2 \cdot x2}}\\ \mathbf{elif}\;x1 \leq -8.4 \cdot 10^{-166}:\\ \;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 4.9 \cdot 10^{-285}:\\ \;\;\;\;x1 + \left(x1 \cdot -2 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\ \mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;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(x1 \cdot \left(x2 \cdot x2\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{36 \cdot \left(x2 \cdot x2\right) - x1 \cdot x1}{x2 \cdot -6 - x1}\\ \end{array} \]

Alternative 13: 68.0% accurate, 3.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 36 \cdot \left(x2 \cdot x2\right)\\ t_1 := x1 + x2 \cdot 6\\ \mathbf{if}\;x1 \leq -4.6 \cdot 10^{+124}:\\ \;\;\;\;\frac{x1}{\frac{t_1}{x1}} - \frac{36}{\frac{t_1}{x2 \cdot x2}}\\ \mathbf{elif}\;x1 \leq 3.4 \cdot 10^{+114}:\\ \;\;\;\;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(x2 \cdot \left(x1 \cdot \left(2 \cdot x2\right) + x1 \cdot -3\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;\frac{\left(x1 \cdot x1\right) \cdot t_1 - t_1 \cdot t_0}{t_1 \cdot t_1}\\ \mathbf{else}:\\ \;\;\;\;\frac{t_0 - x1 \cdot x1}{x2 \cdot -6 - x1}\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (* 36.0 (* x2 x2))) (t_1 (+ x1 (* x2 6.0))))
   (if (<= x1 -4.6e+124)
     (- (/ x1 (/ t_1 x1)) (/ 36.0 (/ t_1 (* x2 x2))))
     (if (<= x1 3.4e+114)
       (+
        x1
        (+
         (* 3.0 (/ (- (- (* x1 (* x1 3.0)) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)))
         (+ x1 (* 4.0 (* x2 (+ (* x1 (* 2.0 x2)) (* x1 -3.0)))))))
       (if (<= x1 1.35e+154)
         (/ (- (* (* x1 x1) t_1) (* t_1 t_0)) (* t_1 t_1))
         (/ (- t_0 (* x1 x1)) (- (* x2 -6.0) x1)))))))
double code(double x1, double x2) {
	double t_0 = 36.0 * (x2 * x2);
	double t_1 = x1 + (x2 * 6.0);
	double tmp;
	if (x1 <= -4.6e+124) {
		tmp = (x1 / (t_1 / x1)) - (36.0 / (t_1 / (x2 * x2)));
	} else if (x1 <= 3.4e+114) {
		tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x2 * ((x1 * (2.0 * x2)) + (x1 * -3.0))))));
	} else if (x1 <= 1.35e+154) {
		tmp = (((x1 * x1) * t_1) - (t_1 * t_0)) / (t_1 * t_1);
	} else {
		tmp = (t_0 - (x1 * x1)) / ((x2 * -6.0) - x1);
	}
	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 = 36.0d0 * (x2 * x2)
    t_1 = x1 + (x2 * 6.0d0)
    if (x1 <= (-4.6d+124)) then
        tmp = (x1 / (t_1 / x1)) - (36.0d0 / (t_1 / (x2 * x2)))
    else if (x1 <= 3.4d+114) then
        tmp = x1 + ((3.0d0 * ((((x1 * (x1 * 3.0d0)) - (2.0d0 * x2)) - x1) / ((x1 * x1) + 1.0d0))) + (x1 + (4.0d0 * (x2 * ((x1 * (2.0d0 * x2)) + (x1 * (-3.0d0)))))))
    else if (x1 <= 1.35d+154) then
        tmp = (((x1 * x1) * t_1) - (t_1 * t_0)) / (t_1 * t_1)
    else
        tmp = (t_0 - (x1 * x1)) / ((x2 * (-6.0d0)) - x1)
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double t_0 = 36.0 * (x2 * x2);
	double t_1 = x1 + (x2 * 6.0);
	double tmp;
	if (x1 <= -4.6e+124) {
		tmp = (x1 / (t_1 / x1)) - (36.0 / (t_1 / (x2 * x2)));
	} else if (x1 <= 3.4e+114) {
		tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x2 * ((x1 * (2.0 * x2)) + (x1 * -3.0))))));
	} else if (x1 <= 1.35e+154) {
		tmp = (((x1 * x1) * t_1) - (t_1 * t_0)) / (t_1 * t_1);
	} else {
		tmp = (t_0 - (x1 * x1)) / ((x2 * -6.0) - x1);
	}
	return tmp;
}
def code(x1, x2):
	t_0 = 36.0 * (x2 * x2)
	t_1 = x1 + (x2 * 6.0)
	tmp = 0
	if x1 <= -4.6e+124:
		tmp = (x1 / (t_1 / x1)) - (36.0 / (t_1 / (x2 * x2)))
	elif x1 <= 3.4e+114:
		tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x2 * ((x1 * (2.0 * x2)) + (x1 * -3.0))))))
	elif x1 <= 1.35e+154:
		tmp = (((x1 * x1) * t_1) - (t_1 * t_0)) / (t_1 * t_1)
	else:
		tmp = (t_0 - (x1 * x1)) / ((x2 * -6.0) - x1)
	return tmp
function code(x1, x2)
	t_0 = Float64(36.0 * Float64(x2 * x2))
	t_1 = Float64(x1 + Float64(x2 * 6.0))
	tmp = 0.0
	if (x1 <= -4.6e+124)
		tmp = Float64(Float64(x1 / Float64(t_1 / x1)) - Float64(36.0 / Float64(t_1 / Float64(x2 * x2))));
	elseif (x1 <= 3.4e+114)
		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(x2 * Float64(Float64(x1 * Float64(2.0 * x2)) + Float64(x1 * -3.0)))))));
	elseif (x1 <= 1.35e+154)
		tmp = Float64(Float64(Float64(Float64(x1 * x1) * t_1) - Float64(t_1 * t_0)) / Float64(t_1 * t_1));
	else
		tmp = Float64(Float64(t_0 - Float64(x1 * x1)) / Float64(Float64(x2 * -6.0) - x1));
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	t_0 = 36.0 * (x2 * x2);
	t_1 = x1 + (x2 * 6.0);
	tmp = 0.0;
	if (x1 <= -4.6e+124)
		tmp = (x1 / (t_1 / x1)) - (36.0 / (t_1 / (x2 * x2)));
	elseif (x1 <= 3.4e+114)
		tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x2 * ((x1 * (2.0 * x2)) + (x1 * -3.0))))));
	elseif (x1 <= 1.35e+154)
		tmp = (((x1 * x1) * t_1) - (t_1 * t_0)) / (t_1 * t_1);
	else
		tmp = (t_0 - (x1 * x1)) / ((x2 * -6.0) - x1);
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := Block[{t$95$0 = N[(36.0 * N[(x2 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(x2 * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -4.6e+124], N[(N[(x1 / N[(t$95$1 / x1), $MachinePrecision]), $MachinePrecision] - N[(36.0 / N[(t$95$1 / N[(x2 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 3.4e+114], 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[(x2 * N[(N[(x1 * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] + N[(x1 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(N[(N[(N[(x1 * x1), $MachinePrecision] * t$95$1), $MachinePrecision] - N[(t$95$1 * t$95$0), $MachinePrecision]), $MachinePrecision] / N[(t$95$1 * t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision] / N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 36 \cdot \left(x2 \cdot x2\right)\\
t_1 := x1 + x2 \cdot 6\\
\mathbf{if}\;x1 \leq -4.6 \cdot 10^{+124}:\\
\;\;\;\;\frac{x1}{\frac{t_1}{x1}} - \frac{36}{\frac{t_1}{x2 \cdot x2}}\\

\mathbf{elif}\;x1 \leq 3.4 \cdot 10^{+114}:\\
\;\;\;\;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(x2 \cdot \left(x1 \cdot \left(2 \cdot x2\right) + x1 \cdot -3\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;\frac{\left(x1 \cdot x1\right) \cdot t_1 - t_1 \cdot t_0}{t_1 \cdot t_1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x1 < -4.59999999999999969e124

    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 0 0.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 1.1%

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

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

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

        \[\leadsto \color{blue}{\frac{x1 \cdot x1 - \left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6}} \]
      2. div-sub7.0%

        \[\leadsto \color{blue}{\frac{x1 \cdot x1}{x1 - x2 \cdot -6} - \frac{\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6}} \]
      3. *-commutative7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 - \color{blue}{-6 \cdot x2}} - \frac{\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6} \]
      4. cancel-sign-sub-inv7.0%

        \[\leadsto \frac{x1 \cdot x1}{\color{blue}{x1 + \left(--6\right) \cdot x2}} - \frac{\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6} \]
      5. metadata-eval7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 + \color{blue}{6} \cdot x2} - \frac{\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6} \]
      6. *-commutative7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{\color{blue}{\left(-6 \cdot x2\right)} \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6} \]
      7. *-commutative7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{\left(-6 \cdot x2\right) \cdot \color{blue}{\left(-6 \cdot x2\right)}}{x1 - x2 \cdot -6} \]
      8. swap-sqr7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{\color{blue}{\left(-6 \cdot -6\right) \cdot \left(x2 \cdot x2\right)}}{x1 - x2 \cdot -6} \]
      9. metadata-eval7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{\color{blue}{36} \cdot \left(x2 \cdot x2\right)}{x1 - x2 \cdot -6} \]
      10. *-commutative7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{36 \cdot \left(x2 \cdot x2\right)}{x1 - \color{blue}{-6 \cdot x2}} \]
      11. cancel-sign-sub-inv7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{36 \cdot \left(x2 \cdot x2\right)}{\color{blue}{x1 + \left(--6\right) \cdot x2}} \]
      12. metadata-eval7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{36 \cdot \left(x2 \cdot x2\right)}{x1 + \color{blue}{6} \cdot x2} \]
    7. Applied egg-rr7.0%

      \[\leadsto \color{blue}{\frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{36 \cdot \left(x2 \cdot x2\right)}{x1 + 6 \cdot x2}} \]
    8. Step-by-step derivation
      1. associate-/l*28.0%

        \[\leadsto \color{blue}{\frac{x1}{\frac{x1 + 6 \cdot x2}{x1}}} - \frac{36 \cdot \left(x2 \cdot x2\right)}{x1 + 6 \cdot x2} \]
      2. unpow228.0%

        \[\leadsto \frac{x1}{\frac{x1 + 6 \cdot x2}{x1}} - \frac{36 \cdot \color{blue}{{x2}^{2}}}{x1 + 6 \cdot x2} \]
      3. associate-/l*28.0%

        \[\leadsto \frac{x1}{\frac{x1 + 6 \cdot x2}{x1}} - \color{blue}{\frac{36}{\frac{x1 + 6 \cdot x2}{{x2}^{2}}}} \]
      4. unpow228.0%

        \[\leadsto \frac{x1}{\frac{x1 + 6 \cdot x2}{x1}} - \frac{36}{\frac{x1 + 6 \cdot x2}{\color{blue}{x2 \cdot x2}}} \]
    9. Simplified28.0%

      \[\leadsto \color{blue}{\frac{x1}{\frac{x1 + 6 \cdot x2}{x1}} - \frac{36}{\frac{x1 + 6 \cdot x2}{x2 \cdot x2}}} \]

    if -4.59999999999999969e124 < x1 < 3.4000000000000001e114

    1. Initial program 97.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 70.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. Step-by-step derivation
      1. associate-*r*78.0%

        \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(\left(x1 \cdot x2\right) \cdot \left(2 \cdot x2 - 3\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) \]
      2. sub-neg78.0%

        \[\leadsto x1 + \left(\left(4 \cdot \left(\left(x1 \cdot x2\right) \cdot \color{blue}{\left(2 \cdot x2 + \left(-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. metadata-eval78.0%

        \[\leadsto x1 + \left(\left(4 \cdot \left(\left(x1 \cdot x2\right) \cdot \left(2 \cdot x2 + \color{blue}{-3}\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. distribute-rgt-in76.2%

        \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(\left(2 \cdot x2\right) \cdot \left(x1 \cdot x2\right) + -3 \cdot \left(x1 \cdot x2\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) \]
      5. *-commutative76.2%

        \[\leadsto x1 + \left(\left(4 \cdot \left(\color{blue}{\left(x2 \cdot 2\right)} \cdot \left(x1 \cdot x2\right) + -3 \cdot \left(x1 \cdot x2\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. Applied egg-rr76.2%

      \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(\left(x2 \cdot 2\right) \cdot \left(x1 \cdot x2\right) + -3 \cdot \left(x1 \cdot x2\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) \]
    5. Step-by-step derivation
      1. *-commutative76.2%

        \[\leadsto x1 + \left(\left(4 \cdot \left(\color{blue}{\left(2 \cdot x2\right)} \cdot \left(x1 \cdot x2\right) + -3 \cdot \left(x1 \cdot x2\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) \]
      2. associate-*r*76.2%

        \[\leadsto x1 + \left(\left(4 \cdot \left(\color{blue}{\left(\left(2 \cdot x2\right) \cdot x1\right) \cdot x2} + -3 \cdot \left(x1 \cdot x2\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. associate-*r*76.2%

        \[\leadsto x1 + \left(\left(4 \cdot \left(\left(\left(2 \cdot x2\right) \cdot x1\right) \cdot x2 + \color{blue}{\left(-3 \cdot x1\right) \cdot x2}\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. distribute-rgt-out78.0%

        \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(x2 \cdot \left(\left(2 \cdot x2\right) \cdot x1 + -3 \cdot x1\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) \]
      5. *-commutative78.0%

        \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(\color{blue}{x1 \cdot \left(2 \cdot x2\right)} + -3 \cdot x1\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) \]
      6. *-commutative78.0%

        \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2\right) + \color{blue}{x1 \cdot -3}\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) \]
    6. Applied egg-rr78.0%

      \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2\right) + x1 \cdot -3\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 3.4000000000000001e114 < x1 < 1.35000000000000003e154

    1. Initial program 93.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 16.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 x1 around 0 3.9%

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

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

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

        \[\leadsto \color{blue}{\frac{x1 \cdot x1 - \left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6}} \]
      2. div-sub3.9%

        \[\leadsto \color{blue}{\frac{x1 \cdot x1}{x1 - x2 \cdot -6} - \frac{\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6}} \]
      3. frac-sub80.0%

        \[\leadsto \color{blue}{\frac{\left(x1 \cdot x1\right) \cdot \left(x1 - x2 \cdot -6\right) - \left(x1 - x2 \cdot -6\right) \cdot \left(\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)\right)}{\left(x1 - x2 \cdot -6\right) \cdot \left(x1 - x2 \cdot -6\right)}} \]
      4. *-commutative80.0%

        \[\leadsto \frac{\left(x1 \cdot x1\right) \cdot \left(x1 - \color{blue}{-6 \cdot x2}\right) - \left(x1 - x2 \cdot -6\right) \cdot \left(\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)\right)}{\left(x1 - x2 \cdot -6\right) \cdot \left(x1 - x2 \cdot -6\right)} \]
      5. cancel-sign-sub-inv80.0%

        \[\leadsto \frac{\left(x1 \cdot x1\right) \cdot \color{blue}{\left(x1 + \left(--6\right) \cdot x2\right)} - \left(x1 - x2 \cdot -6\right) \cdot \left(\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)\right)}{\left(x1 - x2 \cdot -6\right) \cdot \left(x1 - x2 \cdot -6\right)} \]
      6. metadata-eval80.0%

        \[\leadsto \frac{\left(x1 \cdot x1\right) \cdot \left(x1 + \color{blue}{6} \cdot x2\right) - \left(x1 - x2 \cdot -6\right) \cdot \left(\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)\right)}{\left(x1 - x2 \cdot -6\right) \cdot \left(x1 - x2 \cdot -6\right)} \]
      7. *-commutative80.0%

        \[\leadsto \frac{\left(x1 \cdot x1\right) \cdot \left(x1 + 6 \cdot x2\right) - \left(x1 - \color{blue}{-6 \cdot x2}\right) \cdot \left(\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)\right)}{\left(x1 - x2 \cdot -6\right) \cdot \left(x1 - x2 \cdot -6\right)} \]
      8. cancel-sign-sub-inv80.0%

        \[\leadsto \frac{\left(x1 \cdot x1\right) \cdot \left(x1 + 6 \cdot x2\right) - \color{blue}{\left(x1 + \left(--6\right) \cdot x2\right)} \cdot \left(\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)\right)}{\left(x1 - x2 \cdot -6\right) \cdot \left(x1 - x2 \cdot -6\right)} \]
      9. metadata-eval80.0%

        \[\leadsto \frac{\left(x1 \cdot x1\right) \cdot \left(x1 + 6 \cdot x2\right) - \left(x1 + \color{blue}{6} \cdot x2\right) \cdot \left(\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)\right)}{\left(x1 - x2 \cdot -6\right) \cdot \left(x1 - x2 \cdot -6\right)} \]
      10. *-commutative80.0%

        \[\leadsto \frac{\left(x1 \cdot x1\right) \cdot \left(x1 + 6 \cdot x2\right) - \left(x1 + 6 \cdot x2\right) \cdot \left(\color{blue}{\left(-6 \cdot x2\right)} \cdot \left(x2 \cdot -6\right)\right)}{\left(x1 - x2 \cdot -6\right) \cdot \left(x1 - x2 \cdot -6\right)} \]
      11. *-commutative80.0%

        \[\leadsto \frac{\left(x1 \cdot x1\right) \cdot \left(x1 + 6 \cdot x2\right) - \left(x1 + 6 \cdot x2\right) \cdot \left(\left(-6 \cdot x2\right) \cdot \color{blue}{\left(-6 \cdot x2\right)}\right)}{\left(x1 - x2 \cdot -6\right) \cdot \left(x1 - x2 \cdot -6\right)} \]
      12. swap-sqr80.0%

        \[\leadsto \frac{\left(x1 \cdot x1\right) \cdot \left(x1 + 6 \cdot x2\right) - \left(x1 + 6 \cdot x2\right) \cdot \color{blue}{\left(\left(-6 \cdot -6\right) \cdot \left(x2 \cdot x2\right)\right)}}{\left(x1 - x2 \cdot -6\right) \cdot \left(x1 - x2 \cdot -6\right)} \]
      13. metadata-eval80.0%

        \[\leadsto \frac{\left(x1 \cdot x1\right) \cdot \left(x1 + 6 \cdot x2\right) - \left(x1 + 6 \cdot x2\right) \cdot \left(\color{blue}{36} \cdot \left(x2 \cdot x2\right)\right)}{\left(x1 - x2 \cdot -6\right) \cdot \left(x1 - x2 \cdot -6\right)} \]
    7. Applied egg-rr80.0%

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

    if 1.35000000000000003e154 < x1

    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 0 0.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 6.8%

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

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

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

        \[\leadsto \color{blue}{x2 \cdot -6 + x1} \]
      2. flip-+74.1%

        \[\leadsto \color{blue}{\frac{\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right) - x1 \cdot x1}{x2 \cdot -6 - x1}} \]
      3. *-commutative74.1%

        \[\leadsto \frac{\color{blue}{\left(-6 \cdot x2\right)} \cdot \left(x2 \cdot -6\right) - x1 \cdot x1}{x2 \cdot -6 - x1} \]
      4. *-commutative74.1%

        \[\leadsto \frac{\left(-6 \cdot x2\right) \cdot \color{blue}{\left(-6 \cdot x2\right)} - x1 \cdot x1}{x2 \cdot -6 - x1} \]
      5. swap-sqr74.1%

        \[\leadsto \frac{\color{blue}{\left(-6 \cdot -6\right) \cdot \left(x2 \cdot x2\right)} - x1 \cdot x1}{x2 \cdot -6 - x1} \]
      6. metadata-eval74.1%

        \[\leadsto \frac{\color{blue}{36} \cdot \left(x2 \cdot x2\right) - x1 \cdot x1}{x2 \cdot -6 - x1} \]
    7. Applied egg-rr74.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -4.6 \cdot 10^{+124}:\\ \;\;\;\;\frac{x1}{\frac{x1 + x2 \cdot 6}{x1}} - \frac{36}{\frac{x1 + x2 \cdot 6}{x2 \cdot x2}}\\ \mathbf{elif}\;x1 \leq 3.4 \cdot 10^{+114}:\\ \;\;\;\;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(x2 \cdot \left(x1 \cdot \left(2 \cdot x2\right) + x1 \cdot -3\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;\frac{\left(x1 \cdot x1\right) \cdot \left(x1 + x2 \cdot 6\right) - \left(x1 + x2 \cdot 6\right) \cdot \left(36 \cdot \left(x2 \cdot x2\right)\right)}{\left(x1 + x2 \cdot 6\right) \cdot \left(x1 + x2 \cdot 6\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{36 \cdot \left(x2 \cdot x2\right) - x1 \cdot x1}{x2 \cdot -6 - x1}\\ \end{array} \]

Alternative 14: 62.2% accurate, 5.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x2 \cdot -6 + x1 \cdot \left(-1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\ t_1 := x1 + \left(x1 \cdot -2 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\ \mathbf{if}\;x1 \leq -5.5 \cdot 10^{+66}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x1 \leq -8.4 \cdot 10^{-166}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x1 \leq 4.9 \cdot 10^{-285}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x1 \leq 7.6 \cdot 10^{+147}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{36 \cdot \left(x2 \cdot x2\right) - x1 \cdot x1}{x2 \cdot -6 - x1}\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (+ (* x2 -6.0) (* x1 (+ -1.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0)))))))
        (t_1 (+ x1 (+ (* x1 -2.0) (* x2 (- (* x1 -12.0) 6.0))))))
   (if (<= x1 -5.5e+66)
     t_1
     (if (<= x1 -8.4e-166)
       t_0
       (if (<= x1 4.9e-285)
         t_1
         (if (<= x1 7.6e+147)
           t_0
           (/ (- (* 36.0 (* x2 x2)) (* x1 x1)) (- (* x2 -6.0) x1))))))))
double code(double x1, double x2) {
	double t_0 = (x2 * -6.0) + (x1 * (-1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
	double t_1 = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
	double tmp;
	if (x1 <= -5.5e+66) {
		tmp = t_1;
	} else if (x1 <= -8.4e-166) {
		tmp = t_0;
	} else if (x1 <= 4.9e-285) {
		tmp = t_1;
	} else if (x1 <= 7.6e+147) {
		tmp = t_0;
	} else {
		tmp = ((36.0 * (x2 * x2)) - (x1 * x1)) / ((x2 * -6.0) - x1);
	}
	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 = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0)))))
    t_1 = x1 + ((x1 * (-2.0d0)) + (x2 * ((x1 * (-12.0d0)) - 6.0d0)))
    if (x1 <= (-5.5d+66)) then
        tmp = t_1
    else if (x1 <= (-8.4d-166)) then
        tmp = t_0
    else if (x1 <= 4.9d-285) then
        tmp = t_1
    else if (x1 <= 7.6d+147) then
        tmp = t_0
    else
        tmp = ((36.0d0 * (x2 * x2)) - (x1 * x1)) / ((x2 * (-6.0d0)) - x1)
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double t_0 = (x2 * -6.0) + (x1 * (-1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
	double t_1 = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
	double tmp;
	if (x1 <= -5.5e+66) {
		tmp = t_1;
	} else if (x1 <= -8.4e-166) {
		tmp = t_0;
	} else if (x1 <= 4.9e-285) {
		tmp = t_1;
	} else if (x1 <= 7.6e+147) {
		tmp = t_0;
	} else {
		tmp = ((36.0 * (x2 * x2)) - (x1 * x1)) / ((x2 * -6.0) - x1);
	}
	return tmp;
}
def code(x1, x2):
	t_0 = (x2 * -6.0) + (x1 * (-1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))))
	t_1 = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)))
	tmp = 0
	if x1 <= -5.5e+66:
		tmp = t_1
	elif x1 <= -8.4e-166:
		tmp = t_0
	elif x1 <= 4.9e-285:
		tmp = t_1
	elif x1 <= 7.6e+147:
		tmp = t_0
	else:
		tmp = ((36.0 * (x2 * x2)) - (x1 * x1)) / ((x2 * -6.0) - x1)
	return tmp
function code(x1, x2)
	t_0 = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))))))
	t_1 = Float64(x1 + Float64(Float64(x1 * -2.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0))))
	tmp = 0.0
	if (x1 <= -5.5e+66)
		tmp = t_1;
	elseif (x1 <= -8.4e-166)
		tmp = t_0;
	elseif (x1 <= 4.9e-285)
		tmp = t_1;
	elseif (x1 <= 7.6e+147)
		tmp = t_0;
	else
		tmp = Float64(Float64(Float64(36.0 * Float64(x2 * x2)) - Float64(x1 * x1)) / Float64(Float64(x2 * -6.0) - x1));
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	t_0 = (x2 * -6.0) + (x1 * (-1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
	t_1 = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
	tmp = 0.0;
	if (x1 <= -5.5e+66)
		tmp = t_1;
	elseif (x1 <= -8.4e-166)
		tmp = t_0;
	elseif (x1 <= 4.9e-285)
		tmp = t_1;
	elseif (x1 <= 7.6e+147)
		tmp = t_0;
	else
		tmp = ((36.0 * (x2 * x2)) - (x1 * x1)) / ((x2 * -6.0) - x1);
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(N[(x1 * -2.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.5e+66], t$95$1, If[LessEqual[x1, -8.4e-166], t$95$0, If[LessEqual[x1, 4.9e-285], t$95$1, If[LessEqual[x1, 7.6e+147], t$95$0, N[(N[(N[(36.0 * N[(x2 * x2), $MachinePrecision]), $MachinePrecision] - N[(x1 * x1), $MachinePrecision]), $MachinePrecision] / N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x2 \cdot -6 + x1 \cdot \left(-1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
t_1 := x1 + \left(x1 \cdot -2 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\
\mathbf{if}\;x1 \leq -5.5 \cdot 10^{+66}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x1 \leq -8.4 \cdot 10^{-166}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;x1 \leq 4.9 \cdot 10^{-285}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x1 \leq 7.6 \cdot 10^{+147}:\\
\;\;\;\;t_0\\

\mathbf{else}:\\
\;\;\;\;\frac{36 \cdot \left(x2 \cdot x2\right) - x1 \cdot x1}{x2 \cdot -6 - x1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x1 < -5.5e66 or -8.3999999999999998e-166 < x1 < 4.89999999999999975e-285

    1. Initial program 43.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 28.7%

      \[\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 30.7%

      \[\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. Step-by-step derivation
      1. fma-def30.7%

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

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

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

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

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

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

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

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

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

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

    if -5.5e66 < x1 < -8.3999999999999998e-166 or 4.89999999999999975e-285 < x1 < 7.59999999999999941e147

    1. Initial program 98.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 68.6%

      \[\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 68.5%

      \[\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. Step-by-step derivation
      1. fma-def69.3%

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

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

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

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

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

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

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

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

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

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

    if 7.59999999999999941e147 < x1

    1. Initial program 12.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 0.6%

      \[\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 6.5%

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

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

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

        \[\leadsto \color{blue}{x2 \cdot -6 + x1} \]
      2. flip-+65.1%

        \[\leadsto \color{blue}{\frac{\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right) - x1 \cdot x1}{x2 \cdot -6 - x1}} \]
      3. *-commutative65.1%

        \[\leadsto \frac{\color{blue}{\left(-6 \cdot x2\right)} \cdot \left(x2 \cdot -6\right) - x1 \cdot x1}{x2 \cdot -6 - x1} \]
      4. *-commutative65.1%

        \[\leadsto \frac{\left(-6 \cdot x2\right) \cdot \color{blue}{\left(-6 \cdot x2\right)} - x1 \cdot x1}{x2 \cdot -6 - x1} \]
      5. swap-sqr65.1%

        \[\leadsto \frac{\color{blue}{\left(-6 \cdot -6\right) \cdot \left(x2 \cdot x2\right)} - x1 \cdot x1}{x2 \cdot -6 - x1} \]
      6. metadata-eval65.1%

        \[\leadsto \frac{\color{blue}{36} \cdot \left(x2 \cdot x2\right) - x1 \cdot x1}{x2 \cdot -6 - x1} \]
    7. Applied egg-rr65.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -5.5 \cdot 10^{+66}:\\ \;\;\;\;x1 + \left(x1 \cdot -2 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\ \mathbf{elif}\;x1 \leq -8.4 \cdot 10^{-166}:\\ \;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 4.9 \cdot 10^{-285}:\\ \;\;\;\;x1 + \left(x1 \cdot -2 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\ \mathbf{elif}\;x1 \leq 7.6 \cdot 10^{+147}:\\ \;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{36 \cdot \left(x2 \cdot x2\right) - x1 \cdot x1}{x2 \cdot -6 - x1}\\ \end{array} \]

Alternative 15: 61.8% accurate, 5.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x2 \cdot -6 + x1 \cdot \left(-1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\ t_1 := x1 + x2 \cdot 6\\ \mathbf{if}\;x1 \leq -5.4 \cdot 10^{+124}:\\ \;\;\;\;\frac{x1}{\frac{t_1}{x1}} - \frac{36}{\frac{t_1}{x2 \cdot x2}}\\ \mathbf{elif}\;x1 \leq -8.4 \cdot 10^{-166}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x1 \leq 4.9 \cdot 10^{-285}:\\ \;\;\;\;x1 + \left(x1 \cdot -2 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\ \mathbf{elif}\;x1 \leq 7.6 \cdot 10^{+147}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{36 \cdot \left(x2 \cdot x2\right) - x1 \cdot x1}{x2 \cdot -6 - x1}\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (+ (* x2 -6.0) (* x1 (+ -1.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0)))))))
        (t_1 (+ x1 (* x2 6.0))))
   (if (<= x1 -5.4e+124)
     (- (/ x1 (/ t_1 x1)) (/ 36.0 (/ t_1 (* x2 x2))))
     (if (<= x1 -8.4e-166)
       t_0
       (if (<= x1 4.9e-285)
         (+ x1 (+ (* x1 -2.0) (* x2 (- (* x1 -12.0) 6.0))))
         (if (<= x1 7.6e+147)
           t_0
           (/ (- (* 36.0 (* x2 x2)) (* x1 x1)) (- (* x2 -6.0) x1))))))))
double code(double x1, double x2) {
	double t_0 = (x2 * -6.0) + (x1 * (-1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
	double t_1 = x1 + (x2 * 6.0);
	double tmp;
	if (x1 <= -5.4e+124) {
		tmp = (x1 / (t_1 / x1)) - (36.0 / (t_1 / (x2 * x2)));
	} else if (x1 <= -8.4e-166) {
		tmp = t_0;
	} else if (x1 <= 4.9e-285) {
		tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
	} else if (x1 <= 7.6e+147) {
		tmp = t_0;
	} else {
		tmp = ((36.0 * (x2 * x2)) - (x1 * x1)) / ((x2 * -6.0) - x1);
	}
	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 = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0)))))
    t_1 = x1 + (x2 * 6.0d0)
    if (x1 <= (-5.4d+124)) then
        tmp = (x1 / (t_1 / x1)) - (36.0d0 / (t_1 / (x2 * x2)))
    else if (x1 <= (-8.4d-166)) then
        tmp = t_0
    else if (x1 <= 4.9d-285) then
        tmp = x1 + ((x1 * (-2.0d0)) + (x2 * ((x1 * (-12.0d0)) - 6.0d0)))
    else if (x1 <= 7.6d+147) then
        tmp = t_0
    else
        tmp = ((36.0d0 * (x2 * x2)) - (x1 * x1)) / ((x2 * (-6.0d0)) - x1)
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double t_0 = (x2 * -6.0) + (x1 * (-1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
	double t_1 = x1 + (x2 * 6.0);
	double tmp;
	if (x1 <= -5.4e+124) {
		tmp = (x1 / (t_1 / x1)) - (36.0 / (t_1 / (x2 * x2)));
	} else if (x1 <= -8.4e-166) {
		tmp = t_0;
	} else if (x1 <= 4.9e-285) {
		tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
	} else if (x1 <= 7.6e+147) {
		tmp = t_0;
	} else {
		tmp = ((36.0 * (x2 * x2)) - (x1 * x1)) / ((x2 * -6.0) - x1);
	}
	return tmp;
}
def code(x1, x2):
	t_0 = (x2 * -6.0) + (x1 * (-1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))))
	t_1 = x1 + (x2 * 6.0)
	tmp = 0
	if x1 <= -5.4e+124:
		tmp = (x1 / (t_1 / x1)) - (36.0 / (t_1 / (x2 * x2)))
	elif x1 <= -8.4e-166:
		tmp = t_0
	elif x1 <= 4.9e-285:
		tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)))
	elif x1 <= 7.6e+147:
		tmp = t_0
	else:
		tmp = ((36.0 * (x2 * x2)) - (x1 * x1)) / ((x2 * -6.0) - x1)
	return tmp
function code(x1, x2)
	t_0 = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))))))
	t_1 = Float64(x1 + Float64(x2 * 6.0))
	tmp = 0.0
	if (x1 <= -5.4e+124)
		tmp = Float64(Float64(x1 / Float64(t_1 / x1)) - Float64(36.0 / Float64(t_1 / Float64(x2 * x2))));
	elseif (x1 <= -8.4e-166)
		tmp = t_0;
	elseif (x1 <= 4.9e-285)
		tmp = Float64(x1 + Float64(Float64(x1 * -2.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0))));
	elseif (x1 <= 7.6e+147)
		tmp = t_0;
	else
		tmp = Float64(Float64(Float64(36.0 * Float64(x2 * x2)) - Float64(x1 * x1)) / Float64(Float64(x2 * -6.0) - x1));
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	t_0 = (x2 * -6.0) + (x1 * (-1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
	t_1 = x1 + (x2 * 6.0);
	tmp = 0.0;
	if (x1 <= -5.4e+124)
		tmp = (x1 / (t_1 / x1)) - (36.0 / (t_1 / (x2 * x2)));
	elseif (x1 <= -8.4e-166)
		tmp = t_0;
	elseif (x1 <= 4.9e-285)
		tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
	elseif (x1 <= 7.6e+147)
		tmp = t_0;
	else
		tmp = ((36.0 * (x2 * x2)) - (x1 * x1)) / ((x2 * -6.0) - x1);
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(x2 * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.4e+124], N[(N[(x1 / N[(t$95$1 / x1), $MachinePrecision]), $MachinePrecision] - N[(36.0 / N[(t$95$1 / N[(x2 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -8.4e-166], t$95$0, If[LessEqual[x1, 4.9e-285], N[(x1 + N[(N[(x1 * -2.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 7.6e+147], t$95$0, N[(N[(N[(36.0 * N[(x2 * x2), $MachinePrecision]), $MachinePrecision] - N[(x1 * x1), $MachinePrecision]), $MachinePrecision] / N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x1 \leq -8.4 \cdot 10^{-166}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;x1 \leq 4.9 \cdot 10^{-285}:\\
\;\;\;\;x1 + \left(x1 \cdot -2 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\

\mathbf{elif}\;x1 \leq 7.6 \cdot 10^{+147}:\\
\;\;\;\;t_0\\

\mathbf{else}:\\
\;\;\;\;\frac{36 \cdot \left(x2 \cdot x2\right) - x1 \cdot x1}{x2 \cdot -6 - x1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x1 < -5.39999999999999956e124

    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 0 0.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 1.1%

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

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

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

        \[\leadsto \color{blue}{\frac{x1 \cdot x1 - \left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6}} \]
      2. div-sub7.0%

        \[\leadsto \color{blue}{\frac{x1 \cdot x1}{x1 - x2 \cdot -6} - \frac{\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6}} \]
      3. *-commutative7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 - \color{blue}{-6 \cdot x2}} - \frac{\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6} \]
      4. cancel-sign-sub-inv7.0%

        \[\leadsto \frac{x1 \cdot x1}{\color{blue}{x1 + \left(--6\right) \cdot x2}} - \frac{\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6} \]
      5. metadata-eval7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 + \color{blue}{6} \cdot x2} - \frac{\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6} \]
      6. *-commutative7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{\color{blue}{\left(-6 \cdot x2\right)} \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6} \]
      7. *-commutative7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{\left(-6 \cdot x2\right) \cdot \color{blue}{\left(-6 \cdot x2\right)}}{x1 - x2 \cdot -6} \]
      8. swap-sqr7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{\color{blue}{\left(-6 \cdot -6\right) \cdot \left(x2 \cdot x2\right)}}{x1 - x2 \cdot -6} \]
      9. metadata-eval7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{\color{blue}{36} \cdot \left(x2 \cdot x2\right)}{x1 - x2 \cdot -6} \]
      10. *-commutative7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{36 \cdot \left(x2 \cdot x2\right)}{x1 - \color{blue}{-6 \cdot x2}} \]
      11. cancel-sign-sub-inv7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{36 \cdot \left(x2 \cdot x2\right)}{\color{blue}{x1 + \left(--6\right) \cdot x2}} \]
      12. metadata-eval7.0%

        \[\leadsto \frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{36 \cdot \left(x2 \cdot x2\right)}{x1 + \color{blue}{6} \cdot x2} \]
    7. Applied egg-rr7.0%

      \[\leadsto \color{blue}{\frac{x1 \cdot x1}{x1 + 6 \cdot x2} - \frac{36 \cdot \left(x2 \cdot x2\right)}{x1 + 6 \cdot x2}} \]
    8. Step-by-step derivation
      1. associate-/l*28.0%

        \[\leadsto \color{blue}{\frac{x1}{\frac{x1 + 6 \cdot x2}{x1}}} - \frac{36 \cdot \left(x2 \cdot x2\right)}{x1 + 6 \cdot x2} \]
      2. unpow228.0%

        \[\leadsto \frac{x1}{\frac{x1 + 6 \cdot x2}{x1}} - \frac{36 \cdot \color{blue}{{x2}^{2}}}{x1 + 6 \cdot x2} \]
      3. associate-/l*28.0%

        \[\leadsto \frac{x1}{\frac{x1 + 6 \cdot x2}{x1}} - \color{blue}{\frac{36}{\frac{x1 + 6 \cdot x2}{{x2}^{2}}}} \]
      4. unpow228.0%

        \[\leadsto \frac{x1}{\frac{x1 + 6 \cdot x2}{x1}} - \frac{36}{\frac{x1 + 6 \cdot x2}{\color{blue}{x2 \cdot x2}}} \]
    9. Simplified28.0%

      \[\leadsto \color{blue}{\frac{x1}{\frac{x1 + 6 \cdot x2}{x1}} - \frac{36}{\frac{x1 + 6 \cdot x2}{x2 \cdot x2}}} \]

    if -5.39999999999999956e124 < x1 < -8.3999999999999998e-166 or 4.89999999999999975e-285 < x1 < 7.59999999999999941e147

    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 0 65.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 65.2%

      \[\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. Step-by-step derivation
      1. fma-def66.0%

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

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

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

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

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

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

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

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

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

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

    if -8.3999999999999998e-166 < x1 < 4.89999999999999975e-285

    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 78.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 78.7%

      \[\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. Step-by-step derivation
      1. fma-def78.9%

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

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

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

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

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

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

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

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

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

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

    if 7.59999999999999941e147 < x1

    1. Initial program 12.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 0.6%

      \[\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 6.5%

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

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

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

        \[\leadsto \color{blue}{x2 \cdot -6 + x1} \]
      2. flip-+65.1%

        \[\leadsto \color{blue}{\frac{\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right) - x1 \cdot x1}{x2 \cdot -6 - x1}} \]
      3. *-commutative65.1%

        \[\leadsto \frac{\color{blue}{\left(-6 \cdot x2\right)} \cdot \left(x2 \cdot -6\right) - x1 \cdot x1}{x2 \cdot -6 - x1} \]
      4. *-commutative65.1%

        \[\leadsto \frac{\left(-6 \cdot x2\right) \cdot \color{blue}{\left(-6 \cdot x2\right)} - x1 \cdot x1}{x2 \cdot -6 - x1} \]
      5. swap-sqr65.1%

        \[\leadsto \frac{\color{blue}{\left(-6 \cdot -6\right) \cdot \left(x2 \cdot x2\right)} - x1 \cdot x1}{x2 \cdot -6 - x1} \]
      6. metadata-eval65.1%

        \[\leadsto \frac{\color{blue}{36} \cdot \left(x2 \cdot x2\right) - x1 \cdot x1}{x2 \cdot -6 - x1} \]
    7. Applied egg-rr65.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -5.4 \cdot 10^{+124}:\\ \;\;\;\;\frac{x1}{\frac{x1 + x2 \cdot 6}{x1}} - \frac{36}{\frac{x1 + x2 \cdot 6}{x2 \cdot x2}}\\ \mathbf{elif}\;x1 \leq -8.4 \cdot 10^{-166}:\\ \;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 4.9 \cdot 10^{-285}:\\ \;\;\;\;x1 + \left(x1 \cdot -2 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\ \mathbf{elif}\;x1 \leq 7.6 \cdot 10^{+147}:\\ \;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{36 \cdot \left(x2 \cdot x2\right) - x1 \cdot x1}{x2 \cdot -6 - x1}\\ \end{array} \]

Alternative 16: 58.3% accurate, 5.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 \cdot \left(-1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\ t_1 := x1 + \left(x1 \cdot -2 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\ \mathbf{if}\;x1 \leq -5.5 \cdot 10^{+66}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x1 \leq -5.6 \cdot 10^{-109}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x1 \leq 1.02 \cdot 10^{-104}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x1 \leq 5.5 \cdot 10^{+147}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{36 \cdot \left(x2 \cdot x2\right) - x1 \cdot x1}{x2 \cdot -6 - x1}\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (* x1 (+ -1.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0))))))
        (t_1 (+ x1 (+ (* x1 -2.0) (* x2 (- (* x1 -12.0) 6.0))))))
   (if (<= x1 -5.5e+66)
     t_1
     (if (<= x1 -5.6e-109)
       t_0
       (if (<= x1 1.02e-104)
         t_1
         (if (<= x1 5.5e+147)
           t_0
           (/ (- (* 36.0 (* x2 x2)) (* x1 x1)) (- (* x2 -6.0) x1))))))))
double code(double x1, double x2) {
	double t_0 = x1 * (-1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
	double t_1 = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
	double tmp;
	if (x1 <= -5.5e+66) {
		tmp = t_1;
	} else if (x1 <= -5.6e-109) {
		tmp = t_0;
	} else if (x1 <= 1.02e-104) {
		tmp = t_1;
	} else if (x1 <= 5.5e+147) {
		tmp = t_0;
	} else {
		tmp = ((36.0 * (x2 * x2)) - (x1 * x1)) / ((x2 * -6.0) - x1);
	}
	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 * ((-1.0d0) + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))))
    t_1 = x1 + ((x1 * (-2.0d0)) + (x2 * ((x1 * (-12.0d0)) - 6.0d0)))
    if (x1 <= (-5.5d+66)) then
        tmp = t_1
    else if (x1 <= (-5.6d-109)) then
        tmp = t_0
    else if (x1 <= 1.02d-104) then
        tmp = t_1
    else if (x1 <= 5.5d+147) then
        tmp = t_0
    else
        tmp = ((36.0d0 * (x2 * x2)) - (x1 * x1)) / ((x2 * (-6.0d0)) - x1)
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double t_0 = x1 * (-1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
	double t_1 = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
	double tmp;
	if (x1 <= -5.5e+66) {
		tmp = t_1;
	} else if (x1 <= -5.6e-109) {
		tmp = t_0;
	} else if (x1 <= 1.02e-104) {
		tmp = t_1;
	} else if (x1 <= 5.5e+147) {
		tmp = t_0;
	} else {
		tmp = ((36.0 * (x2 * x2)) - (x1 * x1)) / ((x2 * -6.0) - x1);
	}
	return tmp;
}
def code(x1, x2):
	t_0 = x1 * (-1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))
	t_1 = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)))
	tmp = 0
	if x1 <= -5.5e+66:
		tmp = t_1
	elif x1 <= -5.6e-109:
		tmp = t_0
	elif x1 <= 1.02e-104:
		tmp = t_1
	elif x1 <= 5.5e+147:
		tmp = t_0
	else:
		tmp = ((36.0 * (x2 * x2)) - (x1 * x1)) / ((x2 * -6.0) - x1)
	return tmp
function code(x1, x2)
	t_0 = Float64(x1 * Float64(-1.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)))))
	t_1 = Float64(x1 + Float64(Float64(x1 * -2.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0))))
	tmp = 0.0
	if (x1 <= -5.5e+66)
		tmp = t_1;
	elseif (x1 <= -5.6e-109)
		tmp = t_0;
	elseif (x1 <= 1.02e-104)
		tmp = t_1;
	elseif (x1 <= 5.5e+147)
		tmp = t_0;
	else
		tmp = Float64(Float64(Float64(36.0 * Float64(x2 * x2)) - Float64(x1 * x1)) / Float64(Float64(x2 * -6.0) - x1));
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	t_0 = x1 * (-1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
	t_1 = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
	tmp = 0.0;
	if (x1 <= -5.5e+66)
		tmp = t_1;
	elseif (x1 <= -5.6e-109)
		tmp = t_0;
	elseif (x1 <= 1.02e-104)
		tmp = t_1;
	elseif (x1 <= 5.5e+147)
		tmp = t_0;
	else
		tmp = ((36.0 * (x2 * x2)) - (x1 * x1)) / ((x2 * -6.0) - x1);
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(-1.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(N[(x1 * -2.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.5e+66], t$95$1, If[LessEqual[x1, -5.6e-109], t$95$0, If[LessEqual[x1, 1.02e-104], t$95$1, If[LessEqual[x1, 5.5e+147], t$95$0, N[(N[(N[(36.0 * N[(x2 * x2), $MachinePrecision]), $MachinePrecision] - N[(x1 * x1), $MachinePrecision]), $MachinePrecision] / N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x1 \cdot \left(-1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
t_1 := x1 + \left(x1 \cdot -2 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\
\mathbf{if}\;x1 \leq -5.5 \cdot 10^{+66}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x1 \leq -5.6 \cdot 10^{-109}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;x1 \leq 1.02 \cdot 10^{-104}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x1 \leq 5.5 \cdot 10^{+147}:\\
\;\;\;\;t_0\\

\mathbf{else}:\\
\;\;\;\;\frac{36 \cdot \left(x2 \cdot x2\right) - x1 \cdot x1}{x2 \cdot -6 - x1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x1 < -5.5e66 or -5.59999999999999958e-109 < x1 < 1.02000000000000001e-104

    1. Initial program 64.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 50.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 51.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. Step-by-step derivation
      1. fma-def52.0%

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

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

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

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

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

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

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

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

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

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

    if -5.5e66 < x1 < -5.59999999999999958e-109 or 1.02000000000000001e-104 < x1 < 5.4999999999999997e147

    1. Initial program 97.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 59.6%

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

      \[\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. Step-by-step derivation
      1. fma-def60.2%

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

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

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

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

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

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

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

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

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

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

    if 5.4999999999999997e147 < x1

    1. Initial program 12.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 0.6%

      \[\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 6.5%

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

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

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

        \[\leadsto \color{blue}{x2 \cdot -6 + x1} \]
      2. flip-+65.1%

        \[\leadsto \color{blue}{\frac{\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right) - x1 \cdot x1}{x2 \cdot -6 - x1}} \]
      3. *-commutative65.1%

        \[\leadsto \frac{\color{blue}{\left(-6 \cdot x2\right)} \cdot \left(x2 \cdot -6\right) - x1 \cdot x1}{x2 \cdot -6 - x1} \]
      4. *-commutative65.1%

        \[\leadsto \frac{\left(-6 \cdot x2\right) \cdot \color{blue}{\left(-6 \cdot x2\right)} - x1 \cdot x1}{x2 \cdot -6 - x1} \]
      5. swap-sqr65.1%

        \[\leadsto \frac{\color{blue}{\left(-6 \cdot -6\right) \cdot \left(x2 \cdot x2\right)} - x1 \cdot x1}{x2 \cdot -6 - x1} \]
      6. metadata-eval65.1%

        \[\leadsto \frac{\color{blue}{36} \cdot \left(x2 \cdot x2\right) - x1 \cdot x1}{x2 \cdot -6 - x1} \]
    7. Applied egg-rr65.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -5.5 \cdot 10^{+66}:\\ \;\;\;\;x1 + \left(x1 \cdot -2 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\ \mathbf{elif}\;x1 \leq -5.6 \cdot 10^{-109}:\\ \;\;\;\;x1 \cdot \left(-1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 1.02 \cdot 10^{-104}:\\ \;\;\;\;x1 + \left(x1 \cdot -2 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\ \mathbf{elif}\;x1 \leq 5.5 \cdot 10^{+147}:\\ \;\;\;\;x1 \cdot \left(-1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{36 \cdot \left(x2 \cdot x2\right) - x1 \cdot x1}{x2 \cdot -6 - x1}\\ \end{array} \]

Alternative 17: 41.1% accurate, 6.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(x2 \cdot x2\right) \cdot \left(x1 \cdot 8\right)\\ t_1 := x1 + x2 \cdot -6\\ \mathbf{if}\;x2 \leq -1.36 \cdot 10^{+216}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x2 \leq -2.35 \cdot 10^{+126}:\\ \;\;\;\;x2 \cdot -6\\ \mathbf{elif}\;x2 \leq -2.7 \cdot 10^{+57}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x2 \leq -2.8 \cdot 10^{-190}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x2 \leq 2.2 \cdot 10^{-243}:\\ \;\;\;\;-x1\\ \mathbf{elif}\;x2 \leq 2.2 \cdot 10^{+118}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (* (* x2 x2) (* x1 8.0))) (t_1 (+ x1 (* x2 -6.0))))
   (if (<= x2 -1.36e+216)
     t_0
     (if (<= x2 -2.35e+126)
       (* x2 -6.0)
       (if (<= x2 -2.7e+57)
         t_0
         (if (<= x2 -2.8e-190)
           t_1
           (if (<= x2 2.2e-243) (- x1) (if (<= x2 2.2e+118) t_1 t_0))))))))
double code(double x1, double x2) {
	double t_0 = (x2 * x2) * (x1 * 8.0);
	double t_1 = x1 + (x2 * -6.0);
	double tmp;
	if (x2 <= -1.36e+216) {
		tmp = t_0;
	} else if (x2 <= -2.35e+126) {
		tmp = x2 * -6.0;
	} else if (x2 <= -2.7e+57) {
		tmp = t_0;
	} else if (x2 <= -2.8e-190) {
		tmp = t_1;
	} else if (x2 <= 2.2e-243) {
		tmp = -x1;
	} else if (x2 <= 2.2e+118) {
		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 = (x2 * x2) * (x1 * 8.0d0)
    t_1 = x1 + (x2 * (-6.0d0))
    if (x2 <= (-1.36d+216)) then
        tmp = t_0
    else if (x2 <= (-2.35d+126)) then
        tmp = x2 * (-6.0d0)
    else if (x2 <= (-2.7d+57)) then
        tmp = t_0
    else if (x2 <= (-2.8d-190)) then
        tmp = t_1
    else if (x2 <= 2.2d-243) then
        tmp = -x1
    else if (x2 <= 2.2d+118) 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 = (x2 * x2) * (x1 * 8.0);
	double t_1 = x1 + (x2 * -6.0);
	double tmp;
	if (x2 <= -1.36e+216) {
		tmp = t_0;
	} else if (x2 <= -2.35e+126) {
		tmp = x2 * -6.0;
	} else if (x2 <= -2.7e+57) {
		tmp = t_0;
	} else if (x2 <= -2.8e-190) {
		tmp = t_1;
	} else if (x2 <= 2.2e-243) {
		tmp = -x1;
	} else if (x2 <= 2.2e+118) {
		tmp = t_1;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x1, x2):
	t_0 = (x2 * x2) * (x1 * 8.0)
	t_1 = x1 + (x2 * -6.0)
	tmp = 0
	if x2 <= -1.36e+216:
		tmp = t_0
	elif x2 <= -2.35e+126:
		tmp = x2 * -6.0
	elif x2 <= -2.7e+57:
		tmp = t_0
	elif x2 <= -2.8e-190:
		tmp = t_1
	elif x2 <= 2.2e-243:
		tmp = -x1
	elif x2 <= 2.2e+118:
		tmp = t_1
	else:
		tmp = t_0
	return tmp
function code(x1, x2)
	t_0 = Float64(Float64(x2 * x2) * Float64(x1 * 8.0))
	t_1 = Float64(x1 + Float64(x2 * -6.0))
	tmp = 0.0
	if (x2 <= -1.36e+216)
		tmp = t_0;
	elseif (x2 <= -2.35e+126)
		tmp = Float64(x2 * -6.0);
	elseif (x2 <= -2.7e+57)
		tmp = t_0;
	elseif (x2 <= -2.8e-190)
		tmp = t_1;
	elseif (x2 <= 2.2e-243)
		tmp = Float64(-x1);
	elseif (x2 <= 2.2e+118)
		tmp = t_1;
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	t_0 = (x2 * x2) * (x1 * 8.0);
	t_1 = x1 + (x2 * -6.0);
	tmp = 0.0;
	if (x2 <= -1.36e+216)
		tmp = t_0;
	elseif (x2 <= -2.35e+126)
		tmp = x2 * -6.0;
	elseif (x2 <= -2.7e+57)
		tmp = t_0;
	elseif (x2 <= -2.8e-190)
		tmp = t_1;
	elseif (x2 <= 2.2e-243)
		tmp = -x1;
	elseif (x2 <= 2.2e+118)
		tmp = t_1;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x2 * x2), $MachinePrecision] * N[(x1 * 8.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x2, -1.36e+216], t$95$0, If[LessEqual[x2, -2.35e+126], N[(x2 * -6.0), $MachinePrecision], If[LessEqual[x2, -2.7e+57], t$95$0, If[LessEqual[x2, -2.8e-190], t$95$1, If[LessEqual[x2, 2.2e-243], (-x1), If[LessEqual[x2, 2.2e+118], t$95$1, t$95$0]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left(x2 \cdot x2\right) \cdot \left(x1 \cdot 8\right)\\
t_1 := x1 + x2 \cdot -6\\
\mathbf{if}\;x2 \leq -1.36 \cdot 10^{+216}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;x2 \leq -2.35 \cdot 10^{+126}:\\
\;\;\;\;x2 \cdot -6\\

\mathbf{elif}\;x2 \leq -2.7 \cdot 10^{+57}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;x2 \leq -2.8 \cdot 10^{-190}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x2 \leq 2.2 \cdot 10^{-243}:\\
\;\;\;\;-x1\\

\mathbf{elif}\;x2 \leq 2.2 \cdot 10^{+118}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x2 < -1.36000000000000007e216 or -2.3499999999999999e126 < x2 < -2.6999999999999998e57 or 2.19999999999999986e118 < x2

    1. Initial program 64.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 52.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. Step-by-step derivation
      1. associate-*r*59.2%

        \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(\left(x1 \cdot x2\right) \cdot \left(2 \cdot x2 - 3\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) \]
      2. sub-neg59.2%

        \[\leadsto x1 + \left(\left(4 \cdot \left(\left(x1 \cdot x2\right) \cdot \color{blue}{\left(2 \cdot x2 + \left(-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. metadata-eval59.2%

        \[\leadsto x1 + \left(\left(4 \cdot \left(\left(x1 \cdot x2\right) \cdot \left(2 \cdot x2 + \color{blue}{-3}\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. distribute-rgt-in54.1%

        \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(\left(2 \cdot x2\right) \cdot \left(x1 \cdot x2\right) + -3 \cdot \left(x1 \cdot x2\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) \]
      5. *-commutative54.1%

        \[\leadsto x1 + \left(\left(4 \cdot \left(\color{blue}{\left(x2 \cdot 2\right)} \cdot \left(x1 \cdot x2\right) + -3 \cdot \left(x1 \cdot x2\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. Applied egg-rr54.1%

      \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(\left(x2 \cdot 2\right) \cdot \left(x1 \cdot x2\right) + -3 \cdot \left(x1 \cdot x2\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) \]
    5. Taylor expanded in x1 around inf 58.4%

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

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

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

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

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

    if -1.36000000000000007e216 < x2 < -2.3499999999999999e126

    1. Initial program 55.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 13.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 42.2%

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

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

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

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

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

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

    if -2.6999999999999998e57 < x2 < -2.80000000000000005e-190 or 2.1999999999999999e-243 < x2 < 2.19999999999999986e118

    1. Initial program 79.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 51.6%

      \[\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 37.6%

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

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

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

    if -2.80000000000000005e-190 < x2 < 2.1999999999999999e-243

    1. Initial program 64.2%

      \[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 44.7%

      \[\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 47.1%

      \[\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. Step-by-step derivation
      1. fma-def47.1%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-x1} \]
    8. Simplified40.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x2 \leq -1.36 \cdot 10^{+216}:\\ \;\;\;\;\left(x2 \cdot x2\right) \cdot \left(x1 \cdot 8\right)\\ \mathbf{elif}\;x2 \leq -2.35 \cdot 10^{+126}:\\ \;\;\;\;x2 \cdot -6\\ \mathbf{elif}\;x2 \leq -2.7 \cdot 10^{+57}:\\ \;\;\;\;\left(x2 \cdot x2\right) \cdot \left(x1 \cdot 8\right)\\ \mathbf{elif}\;x2 \leq -2.8 \cdot 10^{-190}:\\ \;\;\;\;x1 + x2 \cdot -6\\ \mathbf{elif}\;x2 \leq 2.2 \cdot 10^{-243}:\\ \;\;\;\;-x1\\ \mathbf{elif}\;x2 \leq 2.2 \cdot 10^{+118}:\\ \;\;\;\;x1 + x2 \cdot -6\\ \mathbf{else}:\\ \;\;\;\;\left(x2 \cdot x2\right) \cdot \left(x1 \cdot 8\right)\\ \end{array} \]

Alternative 18: 47.8% accurate, 6.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x1 \leq -1.45 \cdot 10^{+111}:\\ \;\;\;\;9 + \left(x1 \cdot 2 + -12 \cdot \left(x1 \cdot x2\right)\right)\\ \mathbf{elif}\;x1 \leq -4.6 \cdot 10^{-209} \lor \neg \left(x1 \leq 1.16 \cdot 10^{-160}\right):\\ \;\;\;\;x1 \cdot \left(-1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x2 \cdot -6\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (if (<= x1 -1.45e+111)
   (+ 9.0 (+ (* x1 2.0) (* -12.0 (* x1 x2))))
   (if (or (<= x1 -4.6e-209) (not (<= x1 1.16e-160)))
     (* x1 (+ -1.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0)))))
     (* x2 -6.0))))
double code(double x1, double x2) {
	double tmp;
	if (x1 <= -1.45e+111) {
		tmp = 9.0 + ((x1 * 2.0) + (-12.0 * (x1 * x2)));
	} else if ((x1 <= -4.6e-209) || !(x1 <= 1.16e-160)) {
		tmp = x1 * (-1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
	} 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 (x1 <= (-1.45d+111)) then
        tmp = 9.0d0 + ((x1 * 2.0d0) + ((-12.0d0) * (x1 * x2)))
    else if ((x1 <= (-4.6d-209)) .or. (.not. (x1 <= 1.16d-160))) then
        tmp = x1 * ((-1.0d0) + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))))
    else
        tmp = x2 * (-6.0d0)
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double tmp;
	if (x1 <= -1.45e+111) {
		tmp = 9.0 + ((x1 * 2.0) + (-12.0 * (x1 * x2)));
	} else if ((x1 <= -4.6e-209) || !(x1 <= 1.16e-160)) {
		tmp = x1 * (-1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
	} else {
		tmp = x2 * -6.0;
	}
	return tmp;
}
def code(x1, x2):
	tmp = 0
	if x1 <= -1.45e+111:
		tmp = 9.0 + ((x1 * 2.0) + (-12.0 * (x1 * x2)))
	elif (x1 <= -4.6e-209) or not (x1 <= 1.16e-160):
		tmp = x1 * (-1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))
	else:
		tmp = x2 * -6.0
	return tmp
function code(x1, x2)
	tmp = 0.0
	if (x1 <= -1.45e+111)
		tmp = Float64(9.0 + Float64(Float64(x1 * 2.0) + Float64(-12.0 * Float64(x1 * x2))));
	elseif ((x1 <= -4.6e-209) || !(x1 <= 1.16e-160))
		tmp = Float64(x1 * Float64(-1.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)))));
	else
		tmp = Float64(x2 * -6.0);
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	tmp = 0.0;
	if (x1 <= -1.45e+111)
		tmp = 9.0 + ((x1 * 2.0) + (-12.0 * (x1 * x2)));
	elseif ((x1 <= -4.6e-209) || ~((x1 <= 1.16e-160)))
		tmp = x1 * (-1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
	else
		tmp = x2 * -6.0;
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := If[LessEqual[x1, -1.45e+111], N[(9.0 + N[(N[(x1 * 2.0), $MachinePrecision] + N[(-12.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x1, -4.6e-209], N[Not[LessEqual[x1, 1.16e-160]], $MachinePrecision]], N[(x1 * N[(-1.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x2 * -6.0), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -1.45 \cdot 10^{+111}:\\
\;\;\;\;9 + \left(x1 \cdot 2 + -12 \cdot \left(x1 \cdot x2\right)\right)\\

\mathbf{elif}\;x1 \leq -4.6 \cdot 10^{-209} \lor \neg \left(x1 \leq 1.16 \cdot 10^{-160}\right):\\
\;\;\;\;x1 \cdot \left(-1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\

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


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

    1. Initial program 2.2%

      \[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 2.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. Step-by-step derivation
      1. associate-*r*2.2%

        \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(\left(x1 \cdot x2\right) \cdot \left(2 \cdot x2 - 3\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) \]
      2. sub-neg2.2%

        \[\leadsto x1 + \left(\left(4 \cdot \left(\left(x1 \cdot x2\right) \cdot \color{blue}{\left(2 \cdot x2 + \left(-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. metadata-eval2.2%

        \[\leadsto x1 + \left(\left(4 \cdot \left(\left(x1 \cdot x2\right) \cdot \left(2 \cdot x2 + \color{blue}{-3}\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. distribute-rgt-in2.2%

        \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(\left(2 \cdot x2\right) \cdot \left(x1 \cdot x2\right) + -3 \cdot \left(x1 \cdot x2\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) \]
      5. *-commutative2.2%

        \[\leadsto x1 + \left(\left(4 \cdot \left(\color{blue}{\left(x2 \cdot 2\right)} \cdot \left(x1 \cdot x2\right) + -3 \cdot \left(x1 \cdot x2\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. Applied egg-rr2.2%

      \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(\left(x2 \cdot 2\right) \cdot \left(x1 \cdot x2\right) + -3 \cdot \left(x1 \cdot x2\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) \]
    5. Taylor expanded in x1 around inf 2.3%

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

      \[\leadsto \color{blue}{9 + \left(-12 \cdot \left(x1 \cdot x2\right) + 2 \cdot x1\right)} \]

    if -1.45e111 < x1 < -4.5999999999999999e-209 or 1.16e-160 < x1

    1. Initial program 82.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 51.6%

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

      \[\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. Step-by-step derivation
      1. fma-def60.0%

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

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

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

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

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

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

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

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

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

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

    if -4.5999999999999999e-209 < x1 < 1.16e-160

    1. Initial program 99.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 81.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 x1 around 0 81.8%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -1.45 \cdot 10^{+111}:\\ \;\;\;\;9 + \left(x1 \cdot 2 + -12 \cdot \left(x1 \cdot x2\right)\right)\\ \mathbf{elif}\;x1 \leq -4.6 \cdot 10^{-209} \lor \neg \left(x1 \leq 1.16 \cdot 10^{-160}\right):\\ \;\;\;\;x1 \cdot \left(-1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x2 \cdot -6\\ \end{array} \]

Alternative 19: 54.7% accurate, 6.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -5 \cdot 10^{+66} \lor \neg \left(x1 \leq -2.3 \cdot 10^{-110}\right) \land x1 \leq 8.2 \cdot 10^{-105}:\\
\;\;\;\;x1 + \left(x1 \cdot -2 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x1 < -4.99999999999999991e66 or -2.3000000000000001e-110 < x1 < 8.20000000000000061e-105

    1. Initial program 64.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 50.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 51.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. Step-by-step derivation
      1. fma-def52.0%

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

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

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

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

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

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

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

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

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

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

    if -4.99999999999999991e66 < x1 < -2.3000000000000001e-110 or 8.20000000000000061e-105 < x1

    1. Initial program 77.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 45.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 55.1%

      \[\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. Step-by-step derivation
      1. fma-def55.9%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -5 \cdot 10^{+66} \lor \neg \left(x1 \leq -2.3 \cdot 10^{-110}\right) \land x1 \leq 8.2 \cdot 10^{-105}:\\ \;\;\;\;x1 + \left(x1 \cdot -2 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 \cdot \left(-1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\ \end{array} \]

Alternative 20: 42.6% accurate, 8.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x1 \leq -6.8 \cdot 10^{+100}:\\ \;\;\;\;9 + \left(x1 \cdot 2 + -12 \cdot \left(x1 \cdot x2\right)\right)\\ \mathbf{elif}\;x1 \leq -3.4 \cdot 10^{-110}:\\ \;\;\;\;\left(x2 \cdot x2\right) \cdot \left(x1 \cdot 8\right)\\ \mathbf{elif}\;x1 \leq 5.7 \cdot 10^{-158}:\\ \;\;\;\;x2 \cdot -6\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x1 \cdot \left(x2 \cdot x2\right)\right) \cdot 8\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (if (<= x1 -6.8e+100)
   (+ 9.0 (+ (* x1 2.0) (* -12.0 (* x1 x2))))
   (if (<= x1 -3.4e-110)
     (* (* x2 x2) (* x1 8.0))
     (if (<= x1 5.7e-158) (* x2 -6.0) (+ x1 (* (* x1 (* x2 x2)) 8.0))))))
double code(double x1, double x2) {
	double tmp;
	if (x1 <= -6.8e+100) {
		tmp = 9.0 + ((x1 * 2.0) + (-12.0 * (x1 * x2)));
	} else if (x1 <= -3.4e-110) {
		tmp = (x2 * x2) * (x1 * 8.0);
	} else if (x1 <= 5.7e-158) {
		tmp = x2 * -6.0;
	} else {
		tmp = x1 + ((x1 * (x2 * x2)) * 8.0);
	}
	return tmp;
}
real(8) function code(x1, x2)
    real(8), intent (in) :: x1
    real(8), intent (in) :: x2
    real(8) :: tmp
    if (x1 <= (-6.8d+100)) then
        tmp = 9.0d0 + ((x1 * 2.0d0) + ((-12.0d0) * (x1 * x2)))
    else if (x1 <= (-3.4d-110)) then
        tmp = (x2 * x2) * (x1 * 8.0d0)
    else if (x1 <= 5.7d-158) then
        tmp = x2 * (-6.0d0)
    else
        tmp = x1 + ((x1 * (x2 * x2)) * 8.0d0)
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double tmp;
	if (x1 <= -6.8e+100) {
		tmp = 9.0 + ((x1 * 2.0) + (-12.0 * (x1 * x2)));
	} else if (x1 <= -3.4e-110) {
		tmp = (x2 * x2) * (x1 * 8.0);
	} else if (x1 <= 5.7e-158) {
		tmp = x2 * -6.0;
	} else {
		tmp = x1 + ((x1 * (x2 * x2)) * 8.0);
	}
	return tmp;
}
def code(x1, x2):
	tmp = 0
	if x1 <= -6.8e+100:
		tmp = 9.0 + ((x1 * 2.0) + (-12.0 * (x1 * x2)))
	elif x1 <= -3.4e-110:
		tmp = (x2 * x2) * (x1 * 8.0)
	elif x1 <= 5.7e-158:
		tmp = x2 * -6.0
	else:
		tmp = x1 + ((x1 * (x2 * x2)) * 8.0)
	return tmp
function code(x1, x2)
	tmp = 0.0
	if (x1 <= -6.8e+100)
		tmp = Float64(9.0 + Float64(Float64(x1 * 2.0) + Float64(-12.0 * Float64(x1 * x2))));
	elseif (x1 <= -3.4e-110)
		tmp = Float64(Float64(x2 * x2) * Float64(x1 * 8.0));
	elseif (x1 <= 5.7e-158)
		tmp = Float64(x2 * -6.0);
	else
		tmp = Float64(x1 + Float64(Float64(x1 * Float64(x2 * x2)) * 8.0));
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	tmp = 0.0;
	if (x1 <= -6.8e+100)
		tmp = 9.0 + ((x1 * 2.0) + (-12.0 * (x1 * x2)));
	elseif (x1 <= -3.4e-110)
		tmp = (x2 * x2) * (x1 * 8.0);
	elseif (x1 <= 5.7e-158)
		tmp = x2 * -6.0;
	else
		tmp = x1 + ((x1 * (x2 * x2)) * 8.0);
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := If[LessEqual[x1, -6.8e+100], N[(9.0 + N[(N[(x1 * 2.0), $MachinePrecision] + N[(-12.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -3.4e-110], N[(N[(x2 * x2), $MachinePrecision] * N[(x1 * 8.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5.7e-158], N[(x2 * -6.0), $MachinePrecision], N[(x1 + N[(N[(x1 * N[(x2 * x2), $MachinePrecision]), $MachinePrecision] * 8.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -6.8 \cdot 10^{+100}:\\
\;\;\;\;9 + \left(x1 \cdot 2 + -12 \cdot \left(x1 \cdot x2\right)\right)\\

\mathbf{elif}\;x1 \leq -3.4 \cdot 10^{-110}:\\
\;\;\;\;\left(x2 \cdot x2\right) \cdot \left(x1 \cdot 8\right)\\

\mathbf{elif}\;x1 \leq 5.7 \cdot 10^{-158}:\\
\;\;\;\;x2 \cdot -6\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x1 < -6.79999999999999988e100

    1. Initial program 2.2%

      \[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 2.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. Step-by-step derivation
      1. associate-*r*2.2%

        \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(\left(x1 \cdot x2\right) \cdot \left(2 \cdot x2 - 3\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) \]
      2. sub-neg2.2%

        \[\leadsto x1 + \left(\left(4 \cdot \left(\left(x1 \cdot x2\right) \cdot \color{blue}{\left(2 \cdot x2 + \left(-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. metadata-eval2.2%

        \[\leadsto x1 + \left(\left(4 \cdot \left(\left(x1 \cdot x2\right) \cdot \left(2 \cdot x2 + \color{blue}{-3}\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. distribute-rgt-in2.2%

        \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(\left(2 \cdot x2\right) \cdot \left(x1 \cdot x2\right) + -3 \cdot \left(x1 \cdot x2\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) \]
      5. *-commutative2.2%

        \[\leadsto x1 + \left(\left(4 \cdot \left(\color{blue}{\left(x2 \cdot 2\right)} \cdot \left(x1 \cdot x2\right) + -3 \cdot \left(x1 \cdot x2\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. Applied egg-rr2.2%

      \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(\left(x2 \cdot 2\right) \cdot \left(x1 \cdot x2\right) + -3 \cdot \left(x1 \cdot x2\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) \]
    5. Taylor expanded in x1 around inf 2.3%

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

      \[\leadsto \color{blue}{9 + \left(-12 \cdot \left(x1 \cdot x2\right) + 2 \cdot x1\right)} \]

    if -6.79999999999999988e100 < x1 < -3.4000000000000001e-110

    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 53.1%

      \[\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. Step-by-step derivation
      1. associate-*r*57.2%

        \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(\left(x1 \cdot x2\right) \cdot \left(2 \cdot x2 - 3\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) \]
      2. sub-neg57.2%

        \[\leadsto x1 + \left(\left(4 \cdot \left(\left(x1 \cdot x2\right) \cdot \color{blue}{\left(2 \cdot x2 + \left(-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. metadata-eval57.2%

        \[\leadsto x1 + \left(\left(4 \cdot \left(\left(x1 \cdot x2\right) \cdot \left(2 \cdot x2 + \color{blue}{-3}\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. distribute-rgt-in54.9%

        \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(\left(2 \cdot x2\right) \cdot \left(x1 \cdot x2\right) + -3 \cdot \left(x1 \cdot x2\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) \]
      5. *-commutative54.9%

        \[\leadsto x1 + \left(\left(4 \cdot \left(\color{blue}{\left(x2 \cdot 2\right)} \cdot \left(x1 \cdot x2\right) + -3 \cdot \left(x1 \cdot x2\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. Applied egg-rr54.9%

      \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(\left(x2 \cdot 2\right) \cdot \left(x1 \cdot x2\right) + -3 \cdot \left(x1 \cdot x2\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) \]
    5. Taylor expanded in x1 around inf 33.5%

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

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

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

        \[\leadsto \left(8 \cdot x1\right) \cdot \color{blue}{\left(x2 \cdot x2\right)} \]
    8. Simplified31.2%

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

    if -3.4000000000000001e-110 < x1 < 5.69999999999999982e-158

    1. Initial program 99.2%

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

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

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

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

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

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

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

    if 5.69999999999999982e-158 < x1

    1. Initial program 71.2%

      \[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 43.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 x2 around inf 41.4%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -6.8 \cdot 10^{+100}:\\ \;\;\;\;9 + \left(x1 \cdot 2 + -12 \cdot \left(x1 \cdot x2\right)\right)\\ \mathbf{elif}\;x1 \leq -3.4 \cdot 10^{-110}:\\ \;\;\;\;\left(x2 \cdot x2\right) \cdot \left(x1 \cdot 8\right)\\ \mathbf{elif}\;x1 \leq 5.7 \cdot 10^{-158}:\\ \;\;\;\;x2 \cdot -6\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x1 \cdot \left(x2 \cdot x2\right)\right) \cdot 8\\ \end{array} \]

Alternative 21: 32.0% accurate, 13.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x2 \leq -2.8 \cdot 10^{-190}:\\ \;\;\;\;x2 \cdot -6\\ \mathbf{elif}\;x2 \leq 3 \cdot 10^{-243}:\\ \;\;\;\;-x1\\ \mathbf{else}:\\ \;\;\;\;x1 + x2 \cdot -6\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (if (<= x2 -2.8e-190)
   (* x2 -6.0)
   (if (<= x2 3e-243) (- x1) (+ x1 (* x2 -6.0)))))
double code(double x1, double x2) {
	double tmp;
	if (x2 <= -2.8e-190) {
		tmp = x2 * -6.0;
	} else if (x2 <= 3e-243) {
		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 <= (-2.8d-190)) then
        tmp = x2 * (-6.0d0)
    else if (x2 <= 3d-243) 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 <= -2.8e-190) {
		tmp = x2 * -6.0;
	} else if (x2 <= 3e-243) {
		tmp = -x1;
	} else {
		tmp = x1 + (x2 * -6.0);
	}
	return tmp;
}
def code(x1, x2):
	tmp = 0
	if x2 <= -2.8e-190:
		tmp = x2 * -6.0
	elif x2 <= 3e-243:
		tmp = -x1
	else:
		tmp = x1 + (x2 * -6.0)
	return tmp
function code(x1, x2)
	tmp = 0.0
	if (x2 <= -2.8e-190)
		tmp = Float64(x2 * -6.0);
	elseif (x2 <= 3e-243)
		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 <= -2.8e-190)
		tmp = x2 * -6.0;
	elseif (x2 <= 3e-243)
		tmp = -x1;
	else
		tmp = x1 + (x2 * -6.0);
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := If[LessEqual[x2, -2.8e-190], N[(x2 * -6.0), $MachinePrecision], If[LessEqual[x2, 3e-243], (-x1), N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;x2 \leq 3 \cdot 10^{-243}:\\
\;\;\;\;-x1\\

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


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

    1. Initial program 66.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 40.8%

      \[\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 27.8%

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

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

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

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

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

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

    if -2.80000000000000005e-190 < x2 < 3.0000000000000001e-243

    1. Initial program 64.2%

      \[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 44.7%

      \[\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 47.1%

      \[\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. Step-by-step derivation
      1. fma-def47.1%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-x1} \]
    8. Simplified40.5%

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

    if 3.0000000000000001e-243 < x2

    1. Initial program 77.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 55.7%

      \[\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} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification29.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x2 \leq -2.8 \cdot 10^{-190}:\\ \;\;\;\;x2 \cdot -6\\ \mathbf{elif}\;x2 \leq 3 \cdot 10^{-243}:\\ \;\;\;\;-x1\\ \mathbf{else}:\\ \;\;\;\;x1 + x2 \cdot -6\\ \end{array} \]

Alternative 22: 31.7% accurate, 17.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x2 \leq -2.35 \cdot 10^{-190}:\\ \;\;\;\;x2 \cdot -6\\ \mathbf{elif}\;x2 \leq 3 \cdot 10^{-243}:\\ \;\;\;\;-x1\\ \mathbf{else}:\\ \;\;\;\;x2 \cdot -6\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (if (<= x2 -2.35e-190) (* x2 -6.0) (if (<= x2 3e-243) (- x1) (* x2 -6.0))))
double code(double x1, double x2) {
	double tmp;
	if (x2 <= -2.35e-190) {
		tmp = x2 * -6.0;
	} else if (x2 <= 3e-243) {
		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 <= (-2.35d-190)) then
        tmp = x2 * (-6.0d0)
    else if (x2 <= 3d-243) 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 <= -2.35e-190) {
		tmp = x2 * -6.0;
	} else if (x2 <= 3e-243) {
		tmp = -x1;
	} else {
		tmp = x2 * -6.0;
	}
	return tmp;
}
def code(x1, x2):
	tmp = 0
	if x2 <= -2.35e-190:
		tmp = x2 * -6.0
	elif x2 <= 3e-243:
		tmp = -x1
	else:
		tmp = x2 * -6.0
	return tmp
function code(x1, x2)
	tmp = 0.0
	if (x2 <= -2.35e-190)
		tmp = Float64(x2 * -6.0);
	elseif (x2 <= 3e-243)
		tmp = Float64(-x1);
	else
		tmp = Float64(x2 * -6.0);
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	tmp = 0.0;
	if (x2 <= -2.35e-190)
		tmp = x2 * -6.0;
	elseif (x2 <= 3e-243)
		tmp = -x1;
	else
		tmp = x2 * -6.0;
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := If[LessEqual[x2, -2.35e-190], N[(x2 * -6.0), $MachinePrecision], If[LessEqual[x2, 3e-243], (-x1), N[(x2 * -6.0), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;x2 \leq 3 \cdot 10^{-243}:\\
\;\;\;\;-x1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x2 < -2.3500000000000002e-190 or 3.0000000000000001e-243 < x2

    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 48.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 26.8%

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

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

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

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

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

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

    if -2.3500000000000002e-190 < x2 < 3.0000000000000001e-243

    1. Initial program 64.2%

      \[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 44.7%

      \[\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 47.1%

      \[\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. Step-by-step derivation
      1. fma-def47.1%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-x1} \]
    8. Simplified40.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x2 \leq -2.35 \cdot 10^{-190}:\\ \;\;\;\;x2 \cdot -6\\ \mathbf{elif}\;x2 \leq 3 \cdot 10^{-243}:\\ \;\;\;\;-x1\\ \mathbf{else}:\\ \;\;\;\;x2 \cdot -6\\ \end{array} \]

Alternative 23: 13.6% 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 70.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 47.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 x1 around 0 53.5%

    \[\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. Step-by-step derivation
    1. fma-def53.9%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-x1} \]
  8. Simplified13.0%

    \[\leadsto \color{blue}{-x1} \]
  9. Final simplification13.0%

    \[\leadsto -x1 \]

Alternative 24: 3.5% accurate, 127.0× speedup?

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

\\
9
\end{array}
Derivation
  1. Initial program 70.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 47.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. Step-by-step derivation
    1. associate-*r*53.1%

      \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(\left(x1 \cdot x2\right) \cdot \left(2 \cdot x2 - 3\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) \]
    2. sub-neg53.1%

      \[\leadsto x1 + \left(\left(4 \cdot \left(\left(x1 \cdot x2\right) \cdot \color{blue}{\left(2 \cdot x2 + \left(-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. metadata-eval53.1%

      \[\leadsto x1 + \left(\left(4 \cdot \left(\left(x1 \cdot x2\right) \cdot \left(2 \cdot x2 + \color{blue}{-3}\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. distribute-rgt-in51.5%

      \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(\left(2 \cdot x2\right) \cdot \left(x1 \cdot x2\right) + -3 \cdot \left(x1 \cdot x2\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) \]
    5. *-commutative51.5%

      \[\leadsto x1 + \left(\left(4 \cdot \left(\color{blue}{\left(x2 \cdot 2\right)} \cdot \left(x1 \cdot x2\right) + -3 \cdot \left(x1 \cdot x2\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. Applied egg-rr51.5%

    \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(\left(x2 \cdot 2\right) \cdot \left(x1 \cdot x2\right) + -3 \cdot \left(x1 \cdot x2\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) \]
  5. Taylor expanded in x1 around inf 23.6%

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

    \[\leadsto \color{blue}{9} \]
  7. Final simplification3.4%

    \[\leadsto 9 \]

Reproduce

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