Rosa's FloatVsDoubleBenchmark

Percentage Accurate: 70.1% → 99.5%
Time: 43.6s
Alternatives: 27
Speedup: 4.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 27 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.1% 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.5% accurate, 0.1× speedup?

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

Alternative 2: 99.2% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 \cdot x1 + 1\\ t_1 := x1 \cdot \left(x1 \cdot 3\right)\\ t_2 := t_1 + 2 \cdot x2\\ t_3 := \frac{x1 - t_2}{t_0}\\ t_4 := t_0 \cdot \left(\left(\frac{t_2 - x1}{t_0} - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot t_3\right) + \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t_3\right)\right)\\ t_5 := x1 \cdot \left(x1 \cdot x1\right)\\ \mathbf{if}\;x1 + \left(3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_0} - \left(\left(\left(t_1 \cdot t_3 + t_4\right) - t_5\right) - x1\right)\right) \leq \infty:\\ \;\;\;\;x1 + \left(\left(x1 + \left(t_5 + \left(x1 \cdot \left(x1 \cdot 9\right) - t_4\right)\right)\right) + \left(x1 \cdot -3 + x2 \cdot -6\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 (+ (* x1 x1) 1.0))
        (t_1 (* x1 (* x1 3.0)))
        (t_2 (+ t_1 (* 2.0 x2)))
        (t_3 (/ (- x1 t_2) t_0))
        (t_4
         (*
          t_0
          (+
           (* (- (/ (- t_2 x1) t_0) 3.0) (* (* x1 2.0) t_3))
           (* (* x1 x1) (+ 6.0 (* 4.0 t_3))))))
        (t_5 (* x1 (* x1 x1))))
   (if (<=
        (+
         x1
         (-
          (* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_0))
          (- (- (+ (* t_1 t_3) t_4) t_5) x1)))
        INFINITY)
     (+
      x1
      (+ (+ x1 (+ t_5 (- (* x1 (* x1 9.0)) t_4))) (+ (* x1 -3.0) (* x2 -6.0))))
     (+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) 9.0)))))
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);
	double t_3 = (x1 - t_2) / t_0;
	double t_4 = t_0 * (((((t_2 - x1) / t_0) - 3.0) * ((x1 * 2.0) * t_3)) + ((x1 * x1) * (6.0 + (4.0 * t_3))));
	double t_5 = x1 * (x1 * x1);
	double tmp;
	if ((x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) - ((((t_1 * t_3) + t_4) - t_5) - x1))) <= ((double) INFINITY)) {
		tmp = x1 + ((x1 + (t_5 + ((x1 * (x1 * 9.0)) - t_4))) + ((x1 * -3.0) + (x2 * -6.0)));
	} 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) + 1.0;
	double t_1 = x1 * (x1 * 3.0);
	double t_2 = t_1 + (2.0 * x2);
	double t_3 = (x1 - t_2) / t_0;
	double t_4 = t_0 * (((((t_2 - x1) / t_0) - 3.0) * ((x1 * 2.0) * t_3)) + ((x1 * x1) * (6.0 + (4.0 * t_3))));
	double t_5 = x1 * (x1 * x1);
	double tmp;
	if ((x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) - ((((t_1 * t_3) + t_4) - t_5) - x1))) <= Double.POSITIVE_INFINITY) {
		tmp = x1 + ((x1 + (t_5 + ((x1 * (x1 * 9.0)) - t_4))) + ((x1 * -3.0) + (x2 * -6.0)));
	} else {
		tmp = x1 + ((x1 + (6.0 * Math.pow(x1, 4.0))) + 9.0);
	}
	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)
	t_3 = (x1 - t_2) / t_0
	t_4 = t_0 * (((((t_2 - x1) / t_0) - 3.0) * ((x1 * 2.0) * t_3)) + ((x1 * x1) * (6.0 + (4.0 * t_3))))
	t_5 = x1 * (x1 * x1)
	tmp = 0
	if (x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) - ((((t_1 * t_3) + t_4) - t_5) - x1))) <= math.inf:
		tmp = x1 + ((x1 + (t_5 + ((x1 * (x1 * 9.0)) - t_4))) + ((x1 * -3.0) + (x2 * -6.0)))
	else:
		tmp = x1 + ((x1 + (6.0 * math.pow(x1, 4.0))) + 9.0)
	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(t_1 + Float64(2.0 * x2))
	t_3 = Float64(Float64(x1 - t_2) / t_0)
	t_4 = Float64(t_0 * Float64(Float64(Float64(Float64(Float64(t_2 - x1) / t_0) - 3.0) * Float64(Float64(x1 * 2.0) * t_3)) + Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_3)))))
	t_5 = Float64(x1 * Float64(x1 * x1))
	tmp = 0.0
	if (Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_0)) - Float64(Float64(Float64(Float64(t_1 * t_3) + t_4) - t_5) - x1))) <= Inf)
		tmp = Float64(x1 + Float64(Float64(x1 + Float64(t_5 + Float64(Float64(x1 * Float64(x1 * 9.0)) - t_4))) + Float64(Float64(x1 * -3.0) + Float64(x2 * -6.0))));
	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) + 1.0;
	t_1 = x1 * (x1 * 3.0);
	t_2 = t_1 + (2.0 * x2);
	t_3 = (x1 - t_2) / t_0;
	t_4 = t_0 * (((((t_2 - x1) / t_0) - 3.0) * ((x1 * 2.0) * t_3)) + ((x1 * x1) * (6.0 + (4.0 * t_3))));
	t_5 = x1 * (x1 * x1);
	tmp = 0.0;
	if ((x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) - ((((t_1 * t_3) + t_4) - t_5) - x1))) <= Inf)
		tmp = x1 + ((x1 + (t_5 + ((x1 * (x1 * 9.0)) - t_4))) + ((x1 * -3.0) + (x2 * -6.0)));
	else
		tmp = x1 + ((x1 + (6.0 * (x1 ^ 4.0))) + 9.0);
	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[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 - t$95$2), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$0 * N[(N[(N[(N[(N[(t$95$2 - x1), $MachinePrecision] / t$95$0), $MachinePrecision] - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(N[(t$95$1 * t$95$3), $MachinePrecision] + t$95$4), $MachinePrecision] - t$95$5), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(N[(x1 + N[(t$95$5 + N[(N[(x1 * N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision] - t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * -3.0), $MachinePrecision] + N[(x2 * -6.0), $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 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := t_1 + 2 \cdot x2\\
t_3 := \frac{x1 - t_2}{t_0}\\
t_4 := t_0 \cdot \left(\left(\frac{t_2 - x1}{t_0} - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot t_3\right) + \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t_3\right)\right)\\
t_5 := x1 \cdot \left(x1 \cdot x1\right)\\
\mathbf{if}\;x1 + \left(3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_0} - \left(\left(\left(t_1 \cdot t_3 + t_4\right) - t_5\right) - x1\right)\right) \leq \infty:\\
\;\;\;\;x1 + \left(\left(x1 + \left(t_5 + \left(x1 \cdot \left(x1 \cdot 9\right) - t_4\right)\right)\right) + \left(x1 \cdot -3 + x2 \cdot -6\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. Taylor expanded in x1 around inf 98.9%

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

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

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

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

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

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

Alternative 3: 93.7% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;x1 \leq 6 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(t_4 + \left(t_0 - t_1 \cdot \left(\left(\frac{t_3 - x1}{t_1} - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot t_5\right) + \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t_5\right)\right)\right)\right)\right) + t_2\right)\\

\mathbf{else}:\\
\;\;\;\;x1 + \left(t_2 - \left(\left(\left(\left(x1 \cdot \left(x1 \cdot 6\right)\right) \cdot \left(-1 - x1 \cdot x1\right) - t_0\right) - t_4\right) - x1\right)\right)\\


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

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

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

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

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

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

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

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

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

      \[\leadsto x1 + \color{blue}{\left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \left(x1 + -3 \cdot x1\right)\right)} \]
    7. Step-by-step derivation
      1. flip-+5.4%

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

        \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \frac{x1 \cdot x1 - \color{blue}{\left(x1 \cdot -3\right)} \cdot \left(-3 \cdot x1\right)}{x1 - -3 \cdot x1}\right) \]
      3. *-commutative5.4%

        \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \frac{x1 \cdot x1 - \left(x1 \cdot -3\right) \cdot \color{blue}{\left(x1 \cdot -3\right)}}{x1 - -3 \cdot x1}\right) \]
      4. *-commutative5.4%

        \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \frac{x1 \cdot x1 - \left(x1 \cdot -3\right) \cdot \left(x1 \cdot -3\right)}{x1 - \color{blue}{x1 \cdot -3}}\right) \]
    8. Applied egg-rr5.4%

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

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

        \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \frac{x1 \cdot x1 - \left(x1 \cdot x1\right) \cdot \color{blue}{9}}{x1 - x1 \cdot -3}\right) \]
      3. associate-*r*5.4%

        \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \frac{x1 \cdot x1 - \color{blue}{x1 \cdot \left(x1 \cdot 9\right)}}{x1 - x1 \cdot -3}\right) \]
      4. distribute-lft-out--69.7%

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

        \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \frac{x1 \cdot \left(x1 - x1 \cdot 9\right)}{x1 - \color{blue}{-3 \cdot x1}}\right) \]
      6. cancel-sign-sub-inv69.7%

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

        \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \frac{x1 \cdot \left(x1 - x1 \cdot 9\right)}{x1 + \color{blue}{3} \cdot x1}\right) \]
      8. *-commutative69.7%

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

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

    if -5.60000000000000037e102 < x1 < 5.9999999999999996e102

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

    if 5.9999999999999996e102 < x1

    1. Initial program 21.6%

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

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

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

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

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

        \[\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) + \color{blue}{\left(x1 \cdot x1\right) \cdot 9}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + \left(-3 \cdot x1 + -6 \cdot x2\right)\right) \]
      3. associate-*l*21.6%

        \[\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) + \color{blue}{x1 \cdot \left(x1 \cdot 9\right)}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + \left(-3 \cdot x1 + -6 \cdot x2\right)\right) \]
    6. Simplified21.6%

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

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

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

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

        \[\leadsto x1 + \left(\left(\left(\left(\color{blue}{\left(x1 \cdot \left(x1 \cdot 6\right)\right)} \cdot \left(x1 \cdot x1 + 1\right) + x1 \cdot \left(x1 \cdot 9\right)\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + \left(-3 \cdot x1 + -6 \cdot x2\right)\right) \]
    9. Simplified100.0%

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

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

Alternative 4: 92.2% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;x1 \leq 0.6:\\
\;\;\;\;x1 + \left(t_6 + \left(x1 + \left(t_2 + \left(t_3 + t_4 \cdot \left(t_7 \cdot \left(3 + t_5\right) + \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 2 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(9 + \left(x1 + \left(t_2 - \left(t_4 \cdot \left(\left(\frac{t_1 - x1}{t_4} - 3\right) \cdot t_7 + \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t_5\right)\right) - 3 \cdot t_0\right)\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;x1 + \left(t_6 - \left(\left(\left(\left(x1 \cdot \left(x1 \cdot 6\right)\right) \cdot \left(-1 - x1 \cdot x1\right) - t_3\right) - t_2\right) - x1\right)\right)\\


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

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

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

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

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

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

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

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

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

      \[\leadsto x1 + \color{blue}{\left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \left(x1 + -3 \cdot x1\right)\right)} \]
    7. Step-by-step derivation
      1. flip-+5.4%

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

        \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \frac{x1 \cdot x1 - \color{blue}{\left(x1 \cdot -3\right)} \cdot \left(-3 \cdot x1\right)}{x1 - -3 \cdot x1}\right) \]
      3. *-commutative5.4%

        \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \frac{x1 \cdot x1 - \left(x1 \cdot -3\right) \cdot \color{blue}{\left(x1 \cdot -3\right)}}{x1 - -3 \cdot x1}\right) \]
      4. *-commutative5.4%

        \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \frac{x1 \cdot x1 - \left(x1 \cdot -3\right) \cdot \left(x1 \cdot -3\right)}{x1 - \color{blue}{x1 \cdot -3}}\right) \]
    8. Applied egg-rr5.4%

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

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

        \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \frac{x1 \cdot x1 - \left(x1 \cdot x1\right) \cdot \color{blue}{9}}{x1 - x1 \cdot -3}\right) \]
      3. associate-*r*5.4%

        \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \frac{x1 \cdot x1 - \color{blue}{x1 \cdot \left(x1 \cdot 9\right)}}{x1 - x1 \cdot -3}\right) \]
      4. distribute-lft-out--69.7%

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

        \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \frac{x1 \cdot \left(x1 - x1 \cdot 9\right)}{x1 - \color{blue}{-3 \cdot x1}}\right) \]
      6. cancel-sign-sub-inv69.7%

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

        \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \frac{x1 \cdot \left(x1 - x1 \cdot 9\right)}{x1 + \color{blue}{3} \cdot x1}\right) \]
      8. *-commutative69.7%

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

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

    if -5.60000000000000037e102 < x1 < 0.599999999999999978

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.599999999999999978 < x1 < 1.99999999999999995e102

    1. Initial program 99.4%

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

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

      \[\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 3\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + \color{blue}{9}\right) \]

    if 1.99999999999999995e102 < x1

    1. Initial program 21.6%

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

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

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

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

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

        \[\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) + \color{blue}{\left(x1 \cdot x1\right) \cdot 9}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + \left(-3 \cdot x1 + -6 \cdot x2\right)\right) \]
      3. associate-*l*21.6%

        \[\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) + \color{blue}{x1 \cdot \left(x1 \cdot 9\right)}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + \left(-3 \cdot x1 + -6 \cdot x2\right)\right) \]
    6. Simplified21.6%

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

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

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

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

        \[\leadsto x1 + \left(\left(\left(\left(\color{blue}{\left(x1 \cdot \left(x1 \cdot 6\right)\right)} \cdot \left(x1 \cdot x1 + 1\right) + x1 \cdot \left(x1 \cdot 9\right)\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + \left(-3 \cdot x1 + -6 \cdot x2\right)\right) \]
    9. Simplified100.0%

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

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

Alternative 5: 91.0% accurate, 1.6× speedup?

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

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

\mathbf{elif}\;x1 \leq 5.8 \cdot 10^{+49}:\\
\;\;\;\;x1 + \left(t_3 + \left(x1 + \left(t_0 + \left(t_1 + t_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_4\right) \cdot \left(3 + t_4\right) + \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;x1 + \left(t_3 - \left(\left(\left(\left(x1 \cdot \left(x1 \cdot 6\right)\right) \cdot \left(-1 - x1 \cdot x1\right) - t_1\right) - t_0\right) - x1\right)\right)\\


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

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

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

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

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

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

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

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

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

      \[\leadsto x1 + \color{blue}{\left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \left(x1 + -3 \cdot x1\right)\right)} \]
    7. Step-by-step derivation
      1. flip-+5.4%

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

        \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \frac{x1 \cdot x1 - \color{blue}{\left(x1 \cdot -3\right)} \cdot \left(-3 \cdot x1\right)}{x1 - -3 \cdot x1}\right) \]
      3. *-commutative5.4%

        \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \frac{x1 \cdot x1 - \left(x1 \cdot -3\right) \cdot \color{blue}{\left(x1 \cdot -3\right)}}{x1 - -3 \cdot x1}\right) \]
      4. *-commutative5.4%

        \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \frac{x1 \cdot x1 - \left(x1 \cdot -3\right) \cdot \left(x1 \cdot -3\right)}{x1 - \color{blue}{x1 \cdot -3}}\right) \]
    8. Applied egg-rr5.4%

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

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

        \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \frac{x1 \cdot x1 - \left(x1 \cdot x1\right) \cdot \color{blue}{9}}{x1 - x1 \cdot -3}\right) \]
      3. associate-*r*5.4%

        \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \frac{x1 \cdot x1 - \color{blue}{x1 \cdot \left(x1 \cdot 9\right)}}{x1 - x1 \cdot -3}\right) \]
      4. distribute-lft-out--69.7%

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

        \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \frac{x1 \cdot \left(x1 - x1 \cdot 9\right)}{x1 - \color{blue}{-3 \cdot x1}}\right) \]
      6. cancel-sign-sub-inv69.7%

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

        \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \frac{x1 \cdot \left(x1 - x1 \cdot 9\right)}{x1 + \color{blue}{3} \cdot x1}\right) \]
      8. *-commutative69.7%

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

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

    if -5.60000000000000037e102 < x1 < 5.8e49

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.8e49 < x1

    1. Initial program 41.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 41.9%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\ \;\;\;\;x1 + \left(x2 \cdot \left(x1 \cdot -12 - 6\right) + \frac{x1 \cdot \left(x1 - x1 \cdot 9\right)}{x1 + x1 \cdot 3}\right)\\ \mathbf{elif}\;x1 \leq 5.8 \cdot 10^{+49}:\\ \;\;\;\;x1 + \left(\left(x1 \cdot -3 + x2 \cdot -6\right) + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(x1 \cdot \left(x1 \cdot 9\right) + \left(x1 \cdot x1 + 1\right) \cdot \left(\left(\left(x1 \cdot 2\right) \cdot \frac{x1 - \left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right)}{x1 \cdot x1 + 1}\right) \cdot \left(3 + \frac{x1 - \left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right)}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(\left(x1 \cdot -3 + x2 \cdot -6\right) - \left(\left(\left(\left(x1 \cdot \left(x1 \cdot 6\right)\right) \cdot \left(-1 - x1 \cdot x1\right) - x1 \cdot \left(x1 \cdot 9\right)\right) - x1 \cdot \left(x1 \cdot x1\right)\right) - x1\right)\right)\\ \end{array} \]

Alternative 6: 88.8% accurate, 1.7× speedup?

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

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

\mathbf{elif}\;x1 \leq -1200:\\
\;\;\;\;x1 - \left(\left(\left(\left(t_3 \cdot \left(\frac{1}{x1} \cdot \left(\left(x1 \cdot 2\right) \cdot \left(3 + \frac{-1}{x1}\right)\right) + \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot \frac{x1 - \left(t_0 + 2 \cdot x2\right)}{t_3}\right)\right) - 3 \cdot t_0\right) - t_1\right) - x1\right) - t_2\right)\\

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

\mathbf{else}:\\
\;\;\;\;x1 + \left(t_2 - \left(\left(\left(\left(x1 \cdot \left(x1 \cdot 6\right)\right) \cdot \left(-1 - x1 \cdot x1\right) - x1 \cdot \left(x1 \cdot 9\right)\right) - t_1\right) - x1\right)\right)\\


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

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

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

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

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

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

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

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

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

      \[\leadsto x1 + \color{blue}{\left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \left(x1 + -3 \cdot x1\right)\right)} \]
    7. Step-by-step derivation
      1. flip-+5.4%

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

        \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \frac{x1 \cdot x1 - \color{blue}{\left(x1 \cdot -3\right)} \cdot \left(-3 \cdot x1\right)}{x1 - -3 \cdot x1}\right) \]
      3. *-commutative5.4%

        \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \frac{x1 \cdot x1 - \left(x1 \cdot -3\right) \cdot \color{blue}{\left(x1 \cdot -3\right)}}{x1 - -3 \cdot x1}\right) \]
      4. *-commutative5.4%

        \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \frac{x1 \cdot x1 - \left(x1 \cdot -3\right) \cdot \left(x1 \cdot -3\right)}{x1 - \color{blue}{x1 \cdot -3}}\right) \]
    8. Applied egg-rr5.4%

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

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

        \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \frac{x1 \cdot x1 - \left(x1 \cdot x1\right) \cdot \color{blue}{9}}{x1 - x1 \cdot -3}\right) \]
      3. associate-*r*5.4%

        \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \frac{x1 \cdot x1 - \color{blue}{x1 \cdot \left(x1 \cdot 9\right)}}{x1 - x1 \cdot -3}\right) \]
      4. distribute-lft-out--69.7%

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

        \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \frac{x1 \cdot \left(x1 - x1 \cdot 9\right)}{x1 - \color{blue}{-3 \cdot x1}}\right) \]
      6. cancel-sign-sub-inv69.7%

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

        \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \frac{x1 \cdot \left(x1 - x1 \cdot 9\right)}{x1 + \color{blue}{3} \cdot x1}\right) \]
      8. *-commutative69.7%

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

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

    if -5.60000000000000037e102 < x1 < -1200

    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 inf 99.5%

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

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

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

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

    if -1200 < x1 < 260

    1. Initial program 99.4%

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

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

    if 260 < x1

    1. Initial program 55.8%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 87.7% accurate, 2.3× speedup?

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

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

\mathbf{elif}\;x1 \leq -128000:\\
\;\;\;\;x1 + \left(\left(x1 + \left(t_3 + \left(t_0 \cdot t_1 - t_2 \cdot \frac{x1 - \left(t_2 + 2 \cdot x2\right)}{t_0}\right)\right)\right) + 3 \cdot \left(x2 \cdot -2\right)\right)\\

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

\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 \cdot -3 + x2 \cdot -6\right) - \left(\left(\left(t_1 \cdot \left(-1 - x1 \cdot x1\right) - x1 \cdot \left(x1 \cdot 9\right)\right) - t_3\right) - x1\right)\right)\\


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

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

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

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

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

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

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

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

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

      \[\leadsto x1 + \color{blue}{\left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \left(x1 + -3 \cdot x1\right)\right)} \]
    7. Step-by-step derivation
      1. flip-+5.4%

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

        \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \frac{x1 \cdot x1 - \color{blue}{\left(x1 \cdot -3\right)} \cdot \left(-3 \cdot x1\right)}{x1 - -3 \cdot x1}\right) \]
      3. *-commutative5.4%

        \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \frac{x1 \cdot x1 - \left(x1 \cdot -3\right) \cdot \color{blue}{\left(x1 \cdot -3\right)}}{x1 - -3 \cdot x1}\right) \]
      4. *-commutative5.4%

        \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \frac{x1 \cdot x1 - \left(x1 \cdot -3\right) \cdot \left(x1 \cdot -3\right)}{x1 - \color{blue}{x1 \cdot -3}}\right) \]
    8. Applied egg-rr5.4%

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

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

        \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \frac{x1 \cdot x1 - \left(x1 \cdot x1\right) \cdot \color{blue}{9}}{x1 - x1 \cdot -3}\right) \]
      3. associate-*r*5.4%

        \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \frac{x1 \cdot x1 - \color{blue}{x1 \cdot \left(x1 \cdot 9\right)}}{x1 - x1 \cdot -3}\right) \]
      4. distribute-lft-out--69.7%

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

        \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \frac{x1 \cdot \left(x1 - x1 \cdot 9\right)}{x1 - \color{blue}{-3 \cdot x1}}\right) \]
      6. cancel-sign-sub-inv69.7%

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

        \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \frac{x1 \cdot \left(x1 - x1 \cdot 9\right)}{x1 + \color{blue}{3} \cdot x1}\right) \]
      8. *-commutative69.7%

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

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

    if -5.60000000000000037e102 < x1 < -128000

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

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

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

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

      \[\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 \left(x2 \cdot -2\right)\right) \]
    6. Step-by-step derivation
      1. *-commutative85.3%

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

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

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

      \[\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 \left(x2 \cdot -2\right)\right) \]

    if -128000 < x1 < 260

    1. Initial program 99.4%

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

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

    if 260 < x1

    1. Initial program 55.8%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 87.7% accurate, 3.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(x2 \cdot \left(x1 \cdot -12 - 6\right) + \frac{x1 \cdot \left(x1 - x1 \cdot 9\right)}{x1 + x1 \cdot 3}\right)\\

\mathbf{elif}\;x1 \leq -48000 \lor \neg \left(x1 \leq 260\right):\\
\;\;\;\;x1 + \left(\left(x1 \cdot -3 + x2 \cdot -6\right) - \left(\left(\left(\left(x1 \cdot \left(x1 \cdot 6\right)\right) \cdot \left(-1 - x1 \cdot x1\right) - x1 \cdot \left(x1 \cdot 9\right)\right) - x1 \cdot \left(x1 \cdot x1\right)\right) - x1\right)\right)\\

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


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

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

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

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

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

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

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

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

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

      \[\leadsto x1 + \color{blue}{\left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \left(x1 + -3 \cdot x1\right)\right)} \]
    7. Step-by-step derivation
      1. flip-+5.4%

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

        \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \frac{x1 \cdot x1 - \color{blue}{\left(x1 \cdot -3\right)} \cdot \left(-3 \cdot x1\right)}{x1 - -3 \cdot x1}\right) \]
      3. *-commutative5.4%

        \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \frac{x1 \cdot x1 - \left(x1 \cdot -3\right) \cdot \color{blue}{\left(x1 \cdot -3\right)}}{x1 - -3 \cdot x1}\right) \]
      4. *-commutative5.4%

        \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \frac{x1 \cdot x1 - \left(x1 \cdot -3\right) \cdot \left(x1 \cdot -3\right)}{x1 - \color{blue}{x1 \cdot -3}}\right) \]
    8. Applied egg-rr5.4%

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

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

        \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \frac{x1 \cdot x1 - \left(x1 \cdot x1\right) \cdot \color{blue}{9}}{x1 - x1 \cdot -3}\right) \]
      3. associate-*r*5.4%

        \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \frac{x1 \cdot x1 - \color{blue}{x1 \cdot \left(x1 \cdot 9\right)}}{x1 - x1 \cdot -3}\right) \]
      4. distribute-lft-out--69.7%

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

        \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \frac{x1 \cdot \left(x1 - x1 \cdot 9\right)}{x1 - \color{blue}{-3 \cdot x1}}\right) \]
      6. cancel-sign-sub-inv69.7%

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

        \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \frac{x1 \cdot \left(x1 - x1 \cdot 9\right)}{x1 + \color{blue}{3} \cdot x1}\right) \]
      8. *-commutative69.7%

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

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

    if -5.60000000000000037e102 < x1 < -48000 or 260 < x1

    1. Initial program 66.3%

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

      \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \color{blue}{3}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    3. Taylor expanded in x1 around 0 66.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 3\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + \color{blue}{\left(-3 \cdot x1 + -6 \cdot x2\right)}\right) \]
    4. Taylor expanded in x1 around 0 66.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) + \color{blue}{9 \cdot {x1}^{2}}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + \left(-3 \cdot x1 + -6 \cdot x2\right)\right) \]
    5. Step-by-step derivation
      1. unpow266.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) + 9 \cdot \color{blue}{\left(x1 \cdot x1\right)}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + \left(-3 \cdot x1 + -6 \cdot x2\right)\right) \]
      2. *-commutative66.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) + \color{blue}{\left(x1 \cdot x1\right) \cdot 9}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + \left(-3 \cdot x1 + -6 \cdot x2\right)\right) \]
      3. associate-*l*66.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) + \color{blue}{x1 \cdot \left(x1 \cdot 9\right)}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + \left(-3 \cdot x1 + -6 \cdot x2\right)\right) \]
    6. Simplified66.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) + \color{blue}{x1 \cdot \left(x1 \cdot 9\right)}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + \left(-3 \cdot x1 + -6 \cdot x2\right)\right) \]
    7. Taylor expanded in x1 around inf 85.4%

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

        \[\leadsto x1 + \left(\left(\left(\left(\color{blue}{\left({x1}^{2} \cdot 6\right)} \cdot \left(x1 \cdot x1 + 1\right) + x1 \cdot \left(x1 \cdot 9\right)\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + \left(-3 \cdot x1 + -6 \cdot x2\right)\right) \]
      2. unpow285.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) + x1 \cdot \left(x1 \cdot 9\right)\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + \left(-3 \cdot x1 + -6 \cdot x2\right)\right) \]
      3. associate-*l*85.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) + x1 \cdot \left(x1 \cdot 9\right)\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + \left(-3 \cdot x1 + -6 \cdot x2\right)\right) \]
    9. Simplified85.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) + x1 \cdot \left(x1 \cdot 9\right)\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + \left(-3 \cdot x1 + -6 \cdot x2\right)\right) \]

    if -48000 < x1 < 260

    1. Initial program 99.4%

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

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

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

Alternative 9: 74.2% accurate, 3.2× speedup?

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

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

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

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

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

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


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

    1. Initial program 22.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 0.1%

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

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

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

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

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

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

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

      \[\leadsto x1 + \color{blue}{\left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \left(x1 + -3 \cdot x1\right)\right)} \]
    7. Step-by-step derivation
      1. flip-+5.0%

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

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

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

        \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \frac{x1 \cdot x1 - \left(x1 \cdot -3\right) \cdot \left(x1 \cdot -3\right)}{x1 - \color{blue}{x1 \cdot -3}}\right) \]
    8. Applied egg-rr5.0%

      \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \color{blue}{\frac{x1 \cdot x1 - \left(x1 \cdot -3\right) \cdot \left(x1 \cdot -3\right)}{x1 - x1 \cdot -3}}\right) \]
    9. Step-by-step derivation
      1. swap-sqr5.0%

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

        \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \frac{x1 \cdot x1 - \left(x1 \cdot x1\right) \cdot \color{blue}{9}}{x1 - x1 \cdot -3}\right) \]
      3. associate-*r*5.0%

        \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \frac{x1 \cdot x1 - \color{blue}{x1 \cdot \left(x1 \cdot 9\right)}}{x1 - x1 \cdot -3}\right) \]
      4. distribute-lft-out--55.0%

        \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \frac{\color{blue}{x1 \cdot \left(x1 - x1 \cdot 9\right)}}{x1 - x1 \cdot -3}\right) \]
      5. *-commutative55.0%

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

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

        \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \frac{x1 \cdot \left(x1 - x1 \cdot 9\right)}{x1 + \color{blue}{3} \cdot x1}\right) \]
      8. *-commutative55.0%

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

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

    if -9.5000000000000003e62 < x1 < 5.8000000000000001e100

    1. Initial program 99.4%

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

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

    if 5.8000000000000001e100 < x1 < 1.35000000000000003e154

    1. Initial program 100.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 100.0%

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

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

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

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

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

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

        \[\leadsto x1 + \left(\left(\color{blue}{\left(15 \cdot {x1}^{2} + {x1}^{3}\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. unpow288.9%

        \[\leadsto x1 + \left(\left(\left(15 \cdot \color{blue}{\left(x1 \cdot x1\right)} + {x1}^{3}\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. cube-mult88.9%

        \[\leadsto x1 + \left(\left(\left(15 \cdot \left(x1 \cdot x1\right) + \color{blue}{x1 \cdot \left(x1 \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) \]
      4. distribute-rgt-out88.9%

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

      \[\leadsto x1 + \left(\left(\color{blue}{\left(x1 \cdot x1\right) \cdot \left(15 + 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.99999999999999991e283

    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(x2 \cdot \left(x1 \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 75.6%

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

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

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

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

    if 1.99999999999999991e283 < 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(x2 \cdot \left(x1 \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 10.5%

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

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

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

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

      \[\leadsto \color{blue}{\frac{x1 \cdot x1 - \left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6}} \]
    8. Step-by-step derivation
      1. swap-sqr100.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -9.5 \cdot 10^{+62}:\\ \;\;\;\;x1 + \left(x2 \cdot \left(x1 \cdot -12 - 6\right) + \frac{x1 \cdot \left(x1 - x1 \cdot 9\right)}{x1 + x1 \cdot 3}\right)\\ \mathbf{elif}\;x1 \leq 5.8 \cdot 10^{+100}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - \left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(3 - 2 \cdot x2\right)\right)\right) - x1\right)\right)\\ \mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;x1 + \left(\left(x1 + \left(x1 \cdot x1\right) \cdot \left(x1 + 15\right)\right) - 3 \cdot \frac{x1 - \left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right)}{x1 \cdot x1 + 1}\right)\\ \mathbf{elif}\;x1 \leq 2 \cdot 10^{+283}:\\ \;\;\;\;x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}\\ \end{array} \]

Alternative 10: 73.9% accurate, 3.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x1 \leq -5.5 \cdot 10^{+70}:\\ \;\;\;\;x1 + \left(x2 \cdot \left(x1 \cdot -12 - 6\right) + \frac{x1 \cdot \left(x1 - x1 \cdot 9\right)}{x1 + x1 \cdot 3}\right)\\ \mathbf{elif}\;x1 \leq 5.8 \cdot 10^{+100}:\\ \;\;\;\;x1 + \left(\left(x1 \cdot -3 + x2 \cdot -6\right) - \left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(3 - 2 \cdot x2\right)\right)\right) - x1\right)\right)\\ \mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;x1 + \left(\left(x1 + \left(x1 \cdot x1\right) \cdot \left(x1 + 15\right)\right) - 3 \cdot \frac{x1 - \left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right)}{x1 \cdot x1 + 1}\right)\\ \mathbf{elif}\;x1 \leq 2.1 \cdot 10^{+283}:\\ \;\;\;\;x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (if (<= x1 -5.5e+70)
   (+
    x1
    (+
     (* x2 (- (* x1 -12.0) 6.0))
     (/ (* x1 (- x1 (* x1 9.0))) (+ x1 (* x1 3.0)))))
   (if (<= x1 5.8e+100)
     (+
      x1
      (-
       (+ (* x1 -3.0) (* x2 -6.0))
       (- (* 4.0 (* x2 (* x1 (- 3.0 (* 2.0 x2))))) x1)))
     (if (<= x1 1.35e+154)
       (+
        x1
        (-
         (+ x1 (* (* x1 x1) (+ x1 15.0)))
         (*
          3.0
          (/ (- x1 (- (* x1 (* x1 3.0)) (* 2.0 x2))) (+ (* x1 x1) 1.0)))))
       (if (<= x1 2.1e+283)
         (* x1 (+ 2.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0)))))
         (/ (- (* x1 x1) (* (* x2 x2) 36.0)) (- x1 (* x2 -6.0))))))))
double code(double x1, double x2) {
	double tmp;
	if (x1 <= -5.5e+70) {
		tmp = x1 + ((x2 * ((x1 * -12.0) - 6.0)) + ((x1 * (x1 - (x1 * 9.0))) / (x1 + (x1 * 3.0))));
	} else if (x1 <= 5.8e+100) {
		tmp = x1 + (((x1 * -3.0) + (x2 * -6.0)) - ((4.0 * (x2 * (x1 * (3.0 - (2.0 * x2))))) - x1));
	} else if (x1 <= 1.35e+154) {
		tmp = x1 + ((x1 + ((x1 * x1) * (x1 + 15.0))) - (3.0 * ((x1 - ((x1 * (x1 * 3.0)) - (2.0 * x2))) / ((x1 * x1) + 1.0))));
	} else if (x1 <= 2.1e+283) {
		tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
	} else {
		tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (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 (x1 <= (-5.5d+70)) then
        tmp = x1 + ((x2 * ((x1 * (-12.0d0)) - 6.0d0)) + ((x1 * (x1 - (x1 * 9.0d0))) / (x1 + (x1 * 3.0d0))))
    else if (x1 <= 5.8d+100) then
        tmp = x1 + (((x1 * (-3.0d0)) + (x2 * (-6.0d0))) - ((4.0d0 * (x2 * (x1 * (3.0d0 - (2.0d0 * x2))))) - x1))
    else if (x1 <= 1.35d+154) then
        tmp = x1 + ((x1 + ((x1 * x1) * (x1 + 15.0d0))) - (3.0d0 * ((x1 - ((x1 * (x1 * 3.0d0)) - (2.0d0 * x2))) / ((x1 * x1) + 1.0d0))))
    else if (x1 <= 2.1d+283) then
        tmp = x1 * (2.0d0 + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))))
    else
        tmp = ((x1 * x1) - ((x2 * x2) * 36.0d0)) / (x1 - (x2 * (-6.0d0)))
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double tmp;
	if (x1 <= -5.5e+70) {
		tmp = x1 + ((x2 * ((x1 * -12.0) - 6.0)) + ((x1 * (x1 - (x1 * 9.0))) / (x1 + (x1 * 3.0))));
	} else if (x1 <= 5.8e+100) {
		tmp = x1 + (((x1 * -3.0) + (x2 * -6.0)) - ((4.0 * (x2 * (x1 * (3.0 - (2.0 * x2))))) - x1));
	} else if (x1 <= 1.35e+154) {
		tmp = x1 + ((x1 + ((x1 * x1) * (x1 + 15.0))) - (3.0 * ((x1 - ((x1 * (x1 * 3.0)) - (2.0 * x2))) / ((x1 * x1) + 1.0))));
	} else if (x1 <= 2.1e+283) {
		tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
	} else {
		tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
	}
	return tmp;
}
def code(x1, x2):
	tmp = 0
	if x1 <= -5.5e+70:
		tmp = x1 + ((x2 * ((x1 * -12.0) - 6.0)) + ((x1 * (x1 - (x1 * 9.0))) / (x1 + (x1 * 3.0))))
	elif x1 <= 5.8e+100:
		tmp = x1 + (((x1 * -3.0) + (x2 * -6.0)) - ((4.0 * (x2 * (x1 * (3.0 - (2.0 * x2))))) - x1))
	elif x1 <= 1.35e+154:
		tmp = x1 + ((x1 + ((x1 * x1) * (x1 + 15.0))) - (3.0 * ((x1 - ((x1 * (x1 * 3.0)) - (2.0 * x2))) / ((x1 * x1) + 1.0))))
	elif x1 <= 2.1e+283:
		tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))
	else:
		tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0))
	return tmp
function code(x1, x2)
	tmp = 0.0
	if (x1 <= -5.5e+70)
		tmp = Float64(x1 + Float64(Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0)) + Float64(Float64(x1 * Float64(x1 - Float64(x1 * 9.0))) / Float64(x1 + Float64(x1 * 3.0)))));
	elseif (x1 <= 5.8e+100)
		tmp = Float64(x1 + Float64(Float64(Float64(x1 * -3.0) + Float64(x2 * -6.0)) - Float64(Float64(4.0 * Float64(x2 * Float64(x1 * Float64(3.0 - Float64(2.0 * x2))))) - x1)));
	elseif (x1 <= 1.35e+154)
		tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(x1 * x1) * Float64(x1 + 15.0))) - Float64(3.0 * Float64(Float64(x1 - Float64(Float64(x1 * Float64(x1 * 3.0)) - Float64(2.0 * x2))) / Float64(Float64(x1 * x1) + 1.0)))));
	elseif (x1 <= 2.1e+283)
		tmp = Float64(x1 * Float64(2.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)))));
	else
		tmp = Float64(Float64(Float64(x1 * x1) - Float64(Float64(x2 * x2) * 36.0)) / Float64(x1 - Float64(x2 * -6.0)));
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	tmp = 0.0;
	if (x1 <= -5.5e+70)
		tmp = x1 + ((x2 * ((x1 * -12.0) - 6.0)) + ((x1 * (x1 - (x1 * 9.0))) / (x1 + (x1 * 3.0))));
	elseif (x1 <= 5.8e+100)
		tmp = x1 + (((x1 * -3.0) + (x2 * -6.0)) - ((4.0 * (x2 * (x1 * (3.0 - (2.0 * x2))))) - x1));
	elseif (x1 <= 1.35e+154)
		tmp = x1 + ((x1 + ((x1 * x1) * (x1 + 15.0))) - (3.0 * ((x1 - ((x1 * (x1 * 3.0)) - (2.0 * x2))) / ((x1 * x1) + 1.0))));
	elseif (x1 <= 2.1e+283)
		tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
	else
		tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := If[LessEqual[x1, -5.5e+70], N[(x1 + N[(N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * N[(x1 - N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x1 + N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5.8e+100], N[(x1 + N[(N[(N[(x1 * -3.0), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision] - N[(N[(4.0 * N[(x2 * N[(x1 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 + N[(N[(x1 + N[(N[(x1 * x1), $MachinePrecision] * N[(x1 + 15.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(3.0 * N[(N[(x1 - N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision] - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2.1e+283], N[(x1 * N[(2.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x1 * x1), $MachinePrecision] - N[(N[(x2 * x2), $MachinePrecision] * 36.0), $MachinePrecision]), $MachinePrecision] / N[(x1 - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -5.5 \cdot 10^{+70}:\\
\;\;\;\;x1 + \left(x2 \cdot \left(x1 \cdot -12 - 6\right) + \frac{x1 \cdot \left(x1 - x1 \cdot 9\right)}{x1 + x1 \cdot 3}\right)\\

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

\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(x1 \cdot x1\right) \cdot \left(x1 + 15\right)\right) - 3 \cdot \frac{x1 - \left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right)}{x1 \cdot x1 + 1}\right)\\

\mathbf{elif}\;x1 \leq 2.1 \cdot 10^{+283}:\\
\;\;\;\;x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\

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


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

    1. Initial program 20.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 0.1%

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

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

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

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

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

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

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

      \[\leadsto x1 + \color{blue}{\left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \left(x1 + -3 \cdot x1\right)\right)} \]
    7. Step-by-step derivation
      1. flip-+5.1%

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

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

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

        \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \frac{x1 \cdot x1 - \left(x1 \cdot -3\right) \cdot \left(x1 \cdot -3\right)}{x1 - \color{blue}{x1 \cdot -3}}\right) \]
    8. Applied egg-rr5.1%

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

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

        \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \frac{x1 \cdot x1 - \left(x1 \cdot x1\right) \cdot \color{blue}{9}}{x1 - x1 \cdot -3}\right) \]
      3. associate-*r*5.1%

        \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \frac{x1 \cdot x1 - \color{blue}{x1 \cdot \left(x1 \cdot 9\right)}}{x1 - x1 \cdot -3}\right) \]
      4. distribute-lft-out--56.0%

        \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \frac{\color{blue}{x1 \cdot \left(x1 - x1 \cdot 9\right)}}{x1 - x1 \cdot -3}\right) \]
      5. *-commutative56.0%

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

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

        \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \frac{x1 \cdot \left(x1 - x1 \cdot 9\right)}{x1 + \color{blue}{3} \cdot x1}\right) \]
      8. *-commutative56.0%

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

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

    if -5.49999999999999986e70 < x1 < 5.8000000000000001e100

    1. Initial program 99.4%

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

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x2 \cdot \left(x1 \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 79.4%

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

    if 5.8000000000000001e100 < x1 < 1.35000000000000003e154

    1. Initial program 100.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 100.0%

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

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

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

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

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

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

        \[\leadsto x1 + \left(\left(\color{blue}{\left(15 \cdot {x1}^{2} + {x1}^{3}\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. unpow288.9%

        \[\leadsto x1 + \left(\left(\left(15 \cdot \color{blue}{\left(x1 \cdot x1\right)} + {x1}^{3}\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. cube-mult88.9%

        \[\leadsto x1 + \left(\left(\left(15 \cdot \left(x1 \cdot x1\right) + \color{blue}{x1 \cdot \left(x1 \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) \]
      4. distribute-rgt-out88.9%

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

      \[\leadsto x1 + \left(\left(\color{blue}{\left(x1 \cdot x1\right) \cdot \left(15 + 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 < 2.10000000000000013e283

    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(x2 \cdot \left(x1 \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 75.6%

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

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

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

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

    if 2.10000000000000013e283 < 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(x2 \cdot \left(x1 \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 10.5%

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

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

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

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

      \[\leadsto \color{blue}{\frac{x1 \cdot x1 - \left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6}} \]
    8. Step-by-step derivation
      1. swap-sqr100.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -5.5 \cdot 10^{+70}:\\ \;\;\;\;x1 + \left(x2 \cdot \left(x1 \cdot -12 - 6\right) + \frac{x1 \cdot \left(x1 - x1 \cdot 9\right)}{x1 + x1 \cdot 3}\right)\\ \mathbf{elif}\;x1 \leq 5.8 \cdot 10^{+100}:\\ \;\;\;\;x1 + \left(\left(x1 \cdot -3 + x2 \cdot -6\right) - \left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(3 - 2 \cdot x2\right)\right)\right) - x1\right)\right)\\ \mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;x1 + \left(\left(x1 + \left(x1 \cdot x1\right) \cdot \left(x1 + 15\right)\right) - 3 \cdot \frac{x1 - \left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right)}{x1 \cdot x1 + 1}\right)\\ \mathbf{elif}\;x1 \leq 2.1 \cdot 10^{+283}:\\ \;\;\;\;x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}\\ \end{array} \]

Alternative 11: 59.9% accurate, 4.7× speedup?

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

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

\mathbf{elif}\;x1 \leq -6 \cdot 10^{-231}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;x1 \leq 6.8 \cdot 10^{-196}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + \left(x1 + x1 \cdot -3\right)\right)\\

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

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


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

    1. Initial program 20.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 0.1%

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

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

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

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

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

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

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

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

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

    if -3.4000000000000001e70 < x1 < -6.0000000000000005e-231 or 6.8e-196 < x1 < 7.6000000000000004e283

    1. Initial program 84.5%

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

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x2 \cdot \left(x1 \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 64.7%

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

    if -6.0000000000000005e-231 < x1 < 6.8e-196

    1. Initial program 99.6%

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

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x2 \cdot \left(x1 \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 99.6%

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

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

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

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

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

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

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

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

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

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

    if 7.6000000000000004e283 < 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(x2 \cdot \left(x1 \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 10.5%

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

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

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

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

      \[\leadsto \color{blue}{\frac{x1 \cdot x1 - \left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6}} \]
    8. Step-by-step derivation
      1. swap-sqr100.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -3.4 \cdot 10^{+70}:\\ \;\;\;\;x1 \cdot \left(-1 + x2 \cdot -12\right)\\ \mathbf{elif}\;x1 \leq -6 \cdot 10^{-231}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right)\right)\\ \mathbf{elif}\;x1 \leq 6.8 \cdot 10^{-196}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + \left(x1 + x1 \cdot -3\right)\right)\\ \mathbf{elif}\;x1 \leq 7.6 \cdot 10^{+283}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}\\ \end{array} \]

Alternative 12: 67.2% accurate, 4.7× speedup?

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

\\
\begin{array}{l}
t_0 := x1 + \left(x2 \cdot -6 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right)\right)\\
\mathbf{if}\;x1 \leq -6.4 \cdot 10^{+68}:\\
\;\;\;\;x1 + \left(x2 \cdot \left(x1 \cdot -12 - 6\right) + \frac{x1 \cdot \left(x1 - x1 \cdot 9\right)}{x1 + x1 \cdot 3}\right)\\

\mathbf{elif}\;x1 \leq -1.9 \cdot 10^{-205}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;x1 \leq 1.55 \cdot 10^{-196}:\\
\;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2\right) + \left(x1 + 4 \cdot \left(x2 \cdot \left(\left(x1 \cdot 2\right) \cdot x2\right)\right)\right)\right)\\

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

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


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

    1. Initial program 20.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 0.1%

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

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

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

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

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

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

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

      \[\leadsto x1 + \color{blue}{\left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \left(x1 + -3 \cdot x1\right)\right)} \]
    7. Step-by-step derivation
      1. flip-+5.1%

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

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

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

        \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \frac{x1 \cdot x1 - \left(x1 \cdot -3\right) \cdot \left(x1 \cdot -3\right)}{x1 - \color{blue}{x1 \cdot -3}}\right) \]
    8. Applied egg-rr5.1%

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

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

        \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \frac{x1 \cdot x1 - \left(x1 \cdot x1\right) \cdot \color{blue}{9}}{x1 - x1 \cdot -3}\right) \]
      3. associate-*r*5.1%

        \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \frac{x1 \cdot x1 - \color{blue}{x1 \cdot \left(x1 \cdot 9\right)}}{x1 - x1 \cdot -3}\right) \]
      4. distribute-lft-out--56.0%

        \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \frac{\color{blue}{x1 \cdot \left(x1 - x1 \cdot 9\right)}}{x1 - x1 \cdot -3}\right) \]
      5. *-commutative56.0%

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

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

        \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \frac{x1 \cdot \left(x1 - x1 \cdot 9\right)}{x1 + \color{blue}{3} \cdot x1}\right) \]
      8. *-commutative56.0%

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

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

    if -6.39999999999999989e68 < x1 < -1.89999999999999996e-205 or 1.54999999999999996e-196 < x1 < 5.49999999999999986e283

    1. Initial program 84.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 57.4%

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x2 \cdot \left(x1 \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 64.9%

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

    if -1.89999999999999996e-205 < x1 < 1.54999999999999996e-196

    1. Initial program 99.6%

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

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x2 \cdot \left(x1 \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 93.7%

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

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

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

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

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

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

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

    if 5.49999999999999986e283 < 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(x2 \cdot \left(x1 \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 10.5%

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

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

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

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

      \[\leadsto \color{blue}{\frac{x1 \cdot x1 - \left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6}} \]
    8. Step-by-step derivation
      1. swap-sqr100.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -6.4 \cdot 10^{+68}:\\ \;\;\;\;x1 + \left(x2 \cdot \left(x1 \cdot -12 - 6\right) + \frac{x1 \cdot \left(x1 - x1 \cdot 9\right)}{x1 + x1 \cdot 3}\right)\\ \mathbf{elif}\;x1 \leq -1.9 \cdot 10^{-205}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right)\right)\\ \mathbf{elif}\;x1 \leq 1.55 \cdot 10^{-196}:\\ \;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2\right) + \left(x1 + 4 \cdot \left(x2 \cdot \left(\left(x1 \cdot 2\right) \cdot x2\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 5.5 \cdot 10^{+283}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}\\ \end{array} \]

Alternative 13: 70.7% accurate, 4.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x1 \leq -5.8 \cdot 10^{+70}:\\ \;\;\;\;x1 + \left(x2 \cdot \left(x1 \cdot -12 - 6\right) + \frac{x1 \cdot \left(x1 - x1 \cdot 9\right)}{x1 + x1 \cdot 3}\right)\\ \mathbf{elif}\;x1 \leq 2.4 \cdot 10^{+283}:\\ \;\;\;\;x1 + \left(\left(x1 \cdot -3 + x2 \cdot -6\right) - \left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(3 - 2 \cdot x2\right)\right)\right) - x1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (if (<= x1 -5.8e+70)
   (+
    x1
    (+
     (* x2 (- (* x1 -12.0) 6.0))
     (/ (* x1 (- x1 (* x1 9.0))) (+ x1 (* x1 3.0)))))
   (if (<= x1 2.4e+283)
     (+
      x1
      (-
       (+ (* x1 -3.0) (* x2 -6.0))
       (- (* 4.0 (* x2 (* x1 (- 3.0 (* 2.0 x2))))) x1)))
     (/ (- (* x1 x1) (* (* x2 x2) 36.0)) (- x1 (* x2 -6.0))))))
double code(double x1, double x2) {
	double tmp;
	if (x1 <= -5.8e+70) {
		tmp = x1 + ((x2 * ((x1 * -12.0) - 6.0)) + ((x1 * (x1 - (x1 * 9.0))) / (x1 + (x1 * 3.0))));
	} else if (x1 <= 2.4e+283) {
		tmp = x1 + (((x1 * -3.0) + (x2 * -6.0)) - ((4.0 * (x2 * (x1 * (3.0 - (2.0 * x2))))) - x1));
	} else {
		tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (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 (x1 <= (-5.8d+70)) then
        tmp = x1 + ((x2 * ((x1 * (-12.0d0)) - 6.0d0)) + ((x1 * (x1 - (x1 * 9.0d0))) / (x1 + (x1 * 3.0d0))))
    else if (x1 <= 2.4d+283) then
        tmp = x1 + (((x1 * (-3.0d0)) + (x2 * (-6.0d0))) - ((4.0d0 * (x2 * (x1 * (3.0d0 - (2.0d0 * x2))))) - x1))
    else
        tmp = ((x1 * x1) - ((x2 * x2) * 36.0d0)) / (x1 - (x2 * (-6.0d0)))
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double tmp;
	if (x1 <= -5.8e+70) {
		tmp = x1 + ((x2 * ((x1 * -12.0) - 6.0)) + ((x1 * (x1 - (x1 * 9.0))) / (x1 + (x1 * 3.0))));
	} else if (x1 <= 2.4e+283) {
		tmp = x1 + (((x1 * -3.0) + (x2 * -6.0)) - ((4.0 * (x2 * (x1 * (3.0 - (2.0 * x2))))) - x1));
	} else {
		tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
	}
	return tmp;
}
def code(x1, x2):
	tmp = 0
	if x1 <= -5.8e+70:
		tmp = x1 + ((x2 * ((x1 * -12.0) - 6.0)) + ((x1 * (x1 - (x1 * 9.0))) / (x1 + (x1 * 3.0))))
	elif x1 <= 2.4e+283:
		tmp = x1 + (((x1 * -3.0) + (x2 * -6.0)) - ((4.0 * (x2 * (x1 * (3.0 - (2.0 * x2))))) - x1))
	else:
		tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0))
	return tmp
function code(x1, x2)
	tmp = 0.0
	if (x1 <= -5.8e+70)
		tmp = Float64(x1 + Float64(Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0)) + Float64(Float64(x1 * Float64(x1 - Float64(x1 * 9.0))) / Float64(x1 + Float64(x1 * 3.0)))));
	elseif (x1 <= 2.4e+283)
		tmp = Float64(x1 + Float64(Float64(Float64(x1 * -3.0) + Float64(x2 * -6.0)) - Float64(Float64(4.0 * Float64(x2 * Float64(x1 * Float64(3.0 - Float64(2.0 * x2))))) - x1)));
	else
		tmp = Float64(Float64(Float64(x1 * x1) - Float64(Float64(x2 * x2) * 36.0)) / Float64(x1 - Float64(x2 * -6.0)));
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	tmp = 0.0;
	if (x1 <= -5.8e+70)
		tmp = x1 + ((x2 * ((x1 * -12.0) - 6.0)) + ((x1 * (x1 - (x1 * 9.0))) / (x1 + (x1 * 3.0))));
	elseif (x1 <= 2.4e+283)
		tmp = x1 + (((x1 * -3.0) + (x2 * -6.0)) - ((4.0 * (x2 * (x1 * (3.0 - (2.0 * x2))))) - x1));
	else
		tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := If[LessEqual[x1, -5.8e+70], N[(x1 + N[(N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * N[(x1 - N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x1 + N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2.4e+283], N[(x1 + N[(N[(N[(x1 * -3.0), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision] - N[(N[(4.0 * N[(x2 * N[(x1 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x1 * x1), $MachinePrecision] - N[(N[(x2 * x2), $MachinePrecision] * 36.0), $MachinePrecision]), $MachinePrecision] / N[(x1 - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -5.8 \cdot 10^{+70}:\\
\;\;\;\;x1 + \left(x2 \cdot \left(x1 \cdot -12 - 6\right) + \frac{x1 \cdot \left(x1 - x1 \cdot 9\right)}{x1 + x1 \cdot 3}\right)\\

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

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


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

    1. Initial program 20.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 0.1%

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

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

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

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

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

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

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

      \[\leadsto x1 + \color{blue}{\left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \left(x1 + -3 \cdot x1\right)\right)} \]
    7. Step-by-step derivation
      1. flip-+5.1%

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

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

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

        \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \frac{x1 \cdot x1 - \left(x1 \cdot -3\right) \cdot \left(x1 \cdot -3\right)}{x1 - \color{blue}{x1 \cdot -3}}\right) \]
    8. Applied egg-rr5.1%

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

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

        \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \frac{x1 \cdot x1 - \left(x1 \cdot x1\right) \cdot \color{blue}{9}}{x1 - x1 \cdot -3}\right) \]
      3. associate-*r*5.1%

        \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \frac{x1 \cdot x1 - \color{blue}{x1 \cdot \left(x1 \cdot 9\right)}}{x1 - x1 \cdot -3}\right) \]
      4. distribute-lft-out--56.0%

        \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \frac{\color{blue}{x1 \cdot \left(x1 - x1 \cdot 9\right)}}{x1 - x1 \cdot -3}\right) \]
      5. *-commutative56.0%

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

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

        \[\leadsto x1 + \left(x2 \cdot \left(-12 \cdot x1 - 6\right) + \frac{x1 \cdot \left(x1 - x1 \cdot 9\right)}{x1 + \color{blue}{3} \cdot x1}\right) \]
      8. *-commutative56.0%

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

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

    if -5.7999999999999997e70 < x1 < 2.39999999999999998e283

    1. Initial program 87.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 67.5%

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x2 \cdot \left(x1 \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 75.8%

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

    if 2.39999999999999998e283 < 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(x2 \cdot \left(x1 \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 10.5%

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

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

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

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

      \[\leadsto \color{blue}{\frac{x1 \cdot x1 - \left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6}} \]
    8. Step-by-step derivation
      1. swap-sqr100.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -5.8 \cdot 10^{+70}:\\ \;\;\;\;x1 + \left(x2 \cdot \left(x1 \cdot -12 - 6\right) + \frac{x1 \cdot \left(x1 - x1 \cdot 9\right)}{x1 + x1 \cdot 3}\right)\\ \mathbf{elif}\;x1 \leq 2.4 \cdot 10^{+283}:\\ \;\;\;\;x1 + \left(\left(x1 \cdot -3 + x2 \cdot -6\right) - \left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(3 - 2 \cdot x2\right)\right)\right) - x1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}\\ \end{array} \]

Alternative 14: 60.2% accurate, 5.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -8.2 \cdot 10^{-26} \lor \neg \left(x2 \leq 2 \cdot 10^{-15}\right):\\
\;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2\right) + \left(x1 + 4 \cdot \left(x2 \cdot \left(\left(x1 \cdot 2\right) \cdot x2\right)\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x2 < -8.1999999999999997e-26 or 2.0000000000000002e-15 < x2

    1. Initial program 71.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 54.5%

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x2 \cdot \left(x1 \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 66.4%

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

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

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

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

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

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

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

    if -8.1999999999999997e-26 < x2 < 2.0000000000000002e-15

    1. Initial program 72.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 48.5%

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x2 \cdot \left(x1 \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 49.9%

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

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

Alternative 15: 60.2% accurate, 5.5× speedup?

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

\\
\begin{array}{l}
t_0 := 3 \cdot \left(x2 \cdot -2\right)\\
\mathbf{if}\;x2 \leq -1.04 \cdot 10^{-25}:\\
\;\;\;\;x1 + \left(t_0 - \left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(3 - 2 \cdot x2\right)\right)\right) - x1\right)\right)\\

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

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


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

    1. Initial program 74.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 56.0%

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x2 \cdot \left(x1 \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 64.1%

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

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

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

    if -1.04000000000000004e-25 < x2 < 3.59999999999999989e-21

    1. Initial program 72.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 48.5%

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x2 \cdot \left(x1 \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 49.9%

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

    if 3.59999999999999989e-21 < x2

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x2 \leq -1.04 \cdot 10^{-25}:\\ \;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2\right) - \left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(3 - 2 \cdot x2\right)\right)\right) - x1\right)\right)\\ \mathbf{elif}\;x2 \leq 3.6 \cdot 10^{-21}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2\right) + \left(x1 + 4 \cdot \left(x2 \cdot \left(\left(x1 \cdot 2\right) \cdot x2\right)\right)\right)\right)\\ \end{array} \]

Alternative 16: 52.2% accurate, 6.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -1.9 \cdot 10^{+187} \lor \neg \left(x2 \leq 3.6 \cdot 10^{+127}\right):\\
\;\;\;\;x1 + \left(9 + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x2 < -1.9e187 or 3.59999999999999979e127 < x2

    1. Initial program 64.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 57.1%

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x2 \cdot \left(x1 \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 inf 72.0%

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

    if -1.9e187 < x2 < 3.59999999999999979e127

    1. Initial program 74.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 50.4%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x2 \leq -1.9 \cdot 10^{+187} \lor \neg \left(x2 \leq 3.6 \cdot 10^{+127}\right):\\ \;\;\;\;x1 + \left(9 + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 - \left(x2 \cdot \left(6 - x1 \cdot -12\right) - \left(x1 + x1 \cdot -3\right)\right)\\ \end{array} \]

Alternative 17: 53.2% accurate, 6.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x2 \leq -3.2 \cdot 10^{+187}:\\ \;\;\;\;x1 + \left(9 + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x2 \leq 9.8 \cdot 10^{-20}:\\ \;\;\;\;x1 - \left(x2 \cdot \left(6 - x1 \cdot -12\right) - \left(x1 + x1 \cdot -3\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x2 \cdot -6 - x1 \cdot \left(4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right) - 2\right)\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (if (<= x2 -3.2e+187)
   (+ x1 (+ 9.0 (+ x1 (* 4.0 (* x2 (* x1 (- (* 2.0 x2) 3.0)))))))
   (if (<= x2 9.8e-20)
     (- x1 (- (* x2 (- 6.0 (* x1 -12.0))) (+ x1 (* x1 -3.0))))
     (- (* x2 -6.0) (* x1 (- (* 4.0 (* x2 (- 3.0 (* 2.0 x2)))) 2.0))))))
double code(double x1, double x2) {
	double tmp;
	if (x2 <= -3.2e+187) {
		tmp = x1 + (9.0 + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))));
	} else if (x2 <= 9.8e-20) {
		tmp = x1 - ((x2 * (6.0 - (x1 * -12.0))) - (x1 + (x1 * -3.0)));
	} else {
		tmp = (x2 * -6.0) - (x1 * ((4.0 * (x2 * (3.0 - (2.0 * x2)))) - 2.0));
	}
	return tmp;
}
real(8) function code(x1, x2)
    real(8), intent (in) :: x1
    real(8), intent (in) :: x2
    real(8) :: tmp
    if (x2 <= (-3.2d+187)) then
        tmp = x1 + (9.0d0 + (x1 + (4.0d0 * (x2 * (x1 * ((2.0d0 * x2) - 3.0d0))))))
    else if (x2 <= 9.8d-20) then
        tmp = x1 - ((x2 * (6.0d0 - (x1 * (-12.0d0)))) - (x1 + (x1 * (-3.0d0))))
    else
        tmp = (x2 * (-6.0d0)) - (x1 * ((4.0d0 * (x2 * (3.0d0 - (2.0d0 * x2)))) - 2.0d0))
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double tmp;
	if (x2 <= -3.2e+187) {
		tmp = x1 + (9.0 + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))));
	} else if (x2 <= 9.8e-20) {
		tmp = x1 - ((x2 * (6.0 - (x1 * -12.0))) - (x1 + (x1 * -3.0)));
	} else {
		tmp = (x2 * -6.0) - (x1 * ((4.0 * (x2 * (3.0 - (2.0 * x2)))) - 2.0));
	}
	return tmp;
}
def code(x1, x2):
	tmp = 0
	if x2 <= -3.2e+187:
		tmp = x1 + (9.0 + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))))
	elif x2 <= 9.8e-20:
		tmp = x1 - ((x2 * (6.0 - (x1 * -12.0))) - (x1 + (x1 * -3.0)))
	else:
		tmp = (x2 * -6.0) - (x1 * ((4.0 * (x2 * (3.0 - (2.0 * x2)))) - 2.0))
	return tmp
function code(x1, x2)
	tmp = 0.0
	if (x2 <= -3.2e+187)
		tmp = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * Float64(Float64(2.0 * x2) - 3.0)))))));
	elseif (x2 <= 9.8e-20)
		tmp = Float64(x1 - Float64(Float64(x2 * Float64(6.0 - Float64(x1 * -12.0))) - Float64(x1 + Float64(x1 * -3.0))));
	else
		tmp = Float64(Float64(x2 * -6.0) - Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(3.0 - Float64(2.0 * x2)))) - 2.0)));
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	tmp = 0.0;
	if (x2 <= -3.2e+187)
		tmp = x1 + (9.0 + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))));
	elseif (x2 <= 9.8e-20)
		tmp = x1 - ((x2 * (6.0 - (x1 * -12.0))) - (x1 + (x1 * -3.0)));
	else
		tmp = (x2 * -6.0) - (x1 * ((4.0 * (x2 * (3.0 - (2.0 * x2)))) - 2.0));
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := If[LessEqual[x2, -3.2e+187], N[(x1 + N[(9.0 + N[(x1 + N[(4.0 * N[(x2 * N[(x1 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x2, 9.8e-20], N[(x1 - N[(N[(x2 * N[(6.0 - N[(x1 * -12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x1 + N[(x1 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] - N[(x1 * N[(N[(4.0 * N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -3.2 \cdot 10^{+187}:\\
\;\;\;\;x1 + \left(9 + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x2 < -3.19999999999999993e187

    1. Initial program 68.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 64.0%

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x2 \cdot \left(x1 \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 inf 75.7%

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

    if -3.19999999999999993e187 < x2 < 9.8000000000000003e-20

    1. Initial program 74.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 49.6%

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

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

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

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

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

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

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

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

    if 9.8000000000000003e-20 < x2

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x2 \leq -3.2 \cdot 10^{+187}:\\ \;\;\;\;x1 + \left(9 + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x2 \leq 9.8 \cdot 10^{-20}:\\ \;\;\;\;x1 - \left(x2 \cdot \left(6 - x1 \cdot -12\right) - \left(x1 + x1 \cdot -3\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x2 \cdot -6 - x1 \cdot \left(4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right) - 2\right)\\ \end{array} \]

Alternative 18: 51.6% accurate, 6.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x1 \leq -9.5 \cdot 10^{+62}:\\ \;\;\;\;x1 \cdot \left(-1 + x2 \cdot -12\right)\\ \mathbf{elif}\;x1 \leq -2.5 \cdot 10^{-30}:\\ \;\;\;\;x1 + x1 \cdot \left(x2 \cdot \left(x2 \cdot 8\right)\right)\\ \mathbf{elif}\;x1 \leq 1.7 \cdot 10^{-5}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + \left(x1 + x1 \cdot -3\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (if (<= x1 -9.5e+62)
   (* x1 (+ -1.0 (* x2 -12.0)))
   (if (<= x1 -2.5e-30)
     (+ x1 (* x1 (* x2 (* x2 8.0))))
     (if (<= x1 1.7e-5)
       (+ x1 (+ (* x2 -6.0) (+ x1 (* x1 -3.0))))
       (* x1 (+ 2.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0)))))))))
double code(double x1, double x2) {
	double tmp;
	if (x1 <= -9.5e+62) {
		tmp = x1 * (-1.0 + (x2 * -12.0));
	} else if (x1 <= -2.5e-30) {
		tmp = x1 + (x1 * (x2 * (x2 * 8.0)));
	} else if (x1 <= 1.7e-5) {
		tmp = x1 + ((x2 * -6.0) + (x1 + (x1 * -3.0)));
	} else {
		tmp = x1 * (2.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 <= (-9.5d+62)) then
        tmp = x1 * ((-1.0d0) + (x2 * (-12.0d0)))
    else if (x1 <= (-2.5d-30)) then
        tmp = x1 + (x1 * (x2 * (x2 * 8.0d0)))
    else if (x1 <= 1.7d-5) then
        tmp = x1 + ((x2 * (-6.0d0)) + (x1 + (x1 * (-3.0d0))))
    else
        tmp = x1 * (2.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 <= -9.5e+62) {
		tmp = x1 * (-1.0 + (x2 * -12.0));
	} else if (x1 <= -2.5e-30) {
		tmp = x1 + (x1 * (x2 * (x2 * 8.0)));
	} else if (x1 <= 1.7e-5) {
		tmp = x1 + ((x2 * -6.0) + (x1 + (x1 * -3.0)));
	} else {
		tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
	}
	return tmp;
}
def code(x1, x2):
	tmp = 0
	if x1 <= -9.5e+62:
		tmp = x1 * (-1.0 + (x2 * -12.0))
	elif x1 <= -2.5e-30:
		tmp = x1 + (x1 * (x2 * (x2 * 8.0)))
	elif x1 <= 1.7e-5:
		tmp = x1 + ((x2 * -6.0) + (x1 + (x1 * -3.0)))
	else:
		tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))
	return tmp
function code(x1, x2)
	tmp = 0.0
	if (x1 <= -9.5e+62)
		tmp = Float64(x1 * Float64(-1.0 + Float64(x2 * -12.0)));
	elseif (x1 <= -2.5e-30)
		tmp = Float64(x1 + Float64(x1 * Float64(x2 * Float64(x2 * 8.0))));
	elseif (x1 <= 1.7e-5)
		tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 + Float64(x1 * -3.0))));
	else
		tmp = Float64(x1 * Float64(2.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 <= -9.5e+62)
		tmp = x1 * (-1.0 + (x2 * -12.0));
	elseif (x1 <= -2.5e-30)
		tmp = x1 + (x1 * (x2 * (x2 * 8.0)));
	elseif (x1 <= 1.7e-5)
		tmp = x1 + ((x2 * -6.0) + (x1 + (x1 * -3.0)));
	else
		tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := If[LessEqual[x1, -9.5e+62], N[(x1 * N[(-1.0 + N[(x2 * -12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -2.5e-30], N[(x1 + N[(x1 * N[(x2 * N[(x2 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.7e-5], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 + N[(x1 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 * N[(2.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 -9.5 \cdot 10^{+62}:\\
\;\;\;\;x1 \cdot \left(-1 + x2 \cdot -12\right)\\

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

\mathbf{elif}\;x1 \leq 1.7 \cdot 10^{-5}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + \left(x1 + x1 \cdot -3\right)\right)\\

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


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

    1. Initial program 22.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 0.1%

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

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

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

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

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

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

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

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

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

    if -9.5000000000000003e62 < x1 < -2.49999999999999986e-30

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

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x2 \cdot \left(x1 \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 47.9%

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

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

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

        \[\leadsto x1 + x1 \cdot \left(8 \cdot \color{blue}{\left(x2 \cdot x2\right)}\right) \]
      4. associate-*r*47.9%

        \[\leadsto x1 + x1 \cdot \color{blue}{\left(\left(8 \cdot x2\right) \cdot x2\right)} \]
      5. *-commutative47.9%

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

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

    if -2.49999999999999986e-30 < x1 < 1.7e-5

    1. Initial program 99.4%

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

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x2 \cdot \left(x1 \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 98.9%

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

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

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

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

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

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

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

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

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

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

    if 1.7e-5 < x1

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

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x2 \cdot \left(x1 \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 34.7%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -9.5 \cdot 10^{+62}:\\ \;\;\;\;x1 \cdot \left(-1 + x2 \cdot -12\right)\\ \mathbf{elif}\;x1 \leq -2.5 \cdot 10^{-30}:\\ \;\;\;\;x1 + x1 \cdot \left(x2 \cdot \left(x2 \cdot 8\right)\right)\\ \mathbf{elif}\;x1 \leq 1.7 \cdot 10^{-5}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + \left(x1 + x1 \cdot -3\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\ \end{array} \]

Alternative 19: 50.2% accurate, 6.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -1.16 \cdot 10^{+191} \lor \neg \left(x2 \leq 7.5 \cdot 10^{+127}\right):\\
\;\;\;\;x1 + x1 \cdot \left(x2 \cdot \left(x2 \cdot 8\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x2 < -1.15999999999999996e191 or 7.4999999999999996e127 < x2

    1. Initial program 64.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 56.3%

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x2 \cdot \left(x1 \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 62.2%

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

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

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

        \[\leadsto x1 + x1 \cdot \left(8 \cdot \color{blue}{\left(x2 \cdot x2\right)}\right) \]
      4. associate-*r*62.2%

        \[\leadsto x1 + x1 \cdot \color{blue}{\left(\left(8 \cdot x2\right) \cdot x2\right)} \]
      5. *-commutative62.2%

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

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

    if -1.15999999999999996e191 < x2 < 7.4999999999999996e127

    1. Initial program 74.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.6%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x2 \leq -1.16 \cdot 10^{+191} \lor \neg \left(x2 \leq 7.5 \cdot 10^{+127}\right):\\ \;\;\;\;x1 + x1 \cdot \left(x2 \cdot \left(x2 \cdot 8\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 - \left(x2 \cdot \left(6 - x1 \cdot -12\right) - \left(x1 + x1 \cdot -3\right)\right)\\ \end{array} \]

Alternative 20: 42.6% accurate, 7.4× speedup?

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

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

\mathbf{elif}\;x2 \leq -7 \cdot 10^{-68}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x2 \leq 5 \cdot 10^{-92}:\\
\;\;\;\;x1 \cdot \left(-1 + x2 \cdot -12\right)\\

\mathbf{elif}\;x2 \leq 1.85 \cdot 10^{+127}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x2 < -1.6e189 or 1.8499999999999999e127 < x2

    1. Initial program 64.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 56.3%

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x2 \cdot \left(x1 \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 62.2%

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

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

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

        \[\leadsto x1 + x1 \cdot \left(8 \cdot \color{blue}{\left(x2 \cdot x2\right)}\right) \]
      4. associate-*r*62.2%

        \[\leadsto x1 + x1 \cdot \color{blue}{\left(\left(8 \cdot x2\right) \cdot x2\right)} \]
      5. *-commutative62.2%

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

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

    if -1.6e189 < x2 < -7.00000000000000026e-68 or 5.00000000000000011e-92 < x2 < 1.8499999999999999e127

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

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

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

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

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

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

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

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

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

    if -7.00000000000000026e-68 < x2 < 5.00000000000000011e-92

    1. Initial program 71.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 46.6%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x2 \leq -1.6 \cdot 10^{+189}:\\ \;\;\;\;x1 + x1 \cdot \left(x2 \cdot \left(x2 \cdot 8\right)\right)\\ \mathbf{elif}\;x2 \leq -7 \cdot 10^{-68}:\\ \;\;\;\;x2 \cdot \left(x1 \cdot -12 - 6\right)\\ \mathbf{elif}\;x2 \leq 5 \cdot 10^{-92}:\\ \;\;\;\;x1 \cdot \left(-1 + x2 \cdot -12\right)\\ \mathbf{elif}\;x2 \leq 1.85 \cdot 10^{+127}:\\ \;\;\;\;x2 \cdot \left(x1 \cdot -12 - 6\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + x1 \cdot \left(x2 \cdot \left(x2 \cdot 8\right)\right)\\ \end{array} \]

Alternative 21: 51.6% accurate, 7.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -8.8 \cdot 10^{+62}:\\
\;\;\;\;x1 \cdot \left(-1 + x2 \cdot -12\right)\\

\mathbf{elif}\;x1 \leq -3.4 \cdot 10^{-30} \lor \neg \left(x1 \leq 1.7 \cdot 10^{-5}\right):\\
\;\;\;\;x1 + x1 \cdot \left(x2 \cdot \left(x2 \cdot 8\right)\right)\\

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


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

    1. Initial program 22.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 0.1%

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

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

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

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

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

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

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

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

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

    if -8.80000000000000058e62 < x1 < -3.4000000000000003e-30 or 1.7e-5 < x1

    1. Initial program 64.7%

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

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x2 \cdot \left(x1 \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 37.4%

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

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

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

        \[\leadsto x1 + x1 \cdot \left(8 \cdot \color{blue}{\left(x2 \cdot x2\right)}\right) \]
      4. associate-*r*37.4%

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

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

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

    if -3.4000000000000003e-30 < x1 < 1.7e-5

    1. Initial program 99.4%

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

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x2 \cdot \left(x1 \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 98.9%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -8.8 \cdot 10^{+62}:\\ \;\;\;\;x1 \cdot \left(-1 + x2 \cdot -12\right)\\ \mathbf{elif}\;x1 \leq -3.4 \cdot 10^{-30} \lor \neg \left(x1 \leq 1.7 \cdot 10^{-5}\right):\\ \;\;\;\;x1 + x1 \cdot \left(x2 \cdot \left(x2 \cdot 8\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + \left(x1 + x1 \cdot -3\right)\right)\\ \end{array} \]

Alternative 22: 36.2% accurate, 11.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x1 \leq -7.2 \cdot 10^{-84} \lor \neg \left(x1 \leq 1.15 \cdot 10^{-97}\right):\\ \;\;\;\;x1 \cdot \left(-1 + x2 \cdot -12\right)\\ \mathbf{else}:\\ \;\;\;\;x2 \cdot -6\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (if (or (<= x1 -7.2e-84) (not (<= x1 1.15e-97)))
   (* x1 (+ -1.0 (* x2 -12.0)))
   (* x2 -6.0)))
double code(double x1, double x2) {
	double tmp;
	if ((x1 <= -7.2e-84) || !(x1 <= 1.15e-97)) {
		tmp = x1 * (-1.0 + (x2 * -12.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 <= (-7.2d-84)) .or. (.not. (x1 <= 1.15d-97))) then
        tmp = x1 * ((-1.0d0) + (x2 * (-12.0d0)))
    else
        tmp = x2 * (-6.0d0)
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double tmp;
	if ((x1 <= -7.2e-84) || !(x1 <= 1.15e-97)) {
		tmp = x1 * (-1.0 + (x2 * -12.0));
	} else {
		tmp = x2 * -6.0;
	}
	return tmp;
}
def code(x1, x2):
	tmp = 0
	if (x1 <= -7.2e-84) or not (x1 <= 1.15e-97):
		tmp = x1 * (-1.0 + (x2 * -12.0))
	else:
		tmp = x2 * -6.0
	return tmp
function code(x1, x2)
	tmp = 0.0
	if ((x1 <= -7.2e-84) || !(x1 <= 1.15e-97))
		tmp = Float64(x1 * Float64(-1.0 + Float64(x2 * -12.0)));
	else
		tmp = Float64(x2 * -6.0);
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	tmp = 0.0;
	if ((x1 <= -7.2e-84) || ~((x1 <= 1.15e-97)))
		tmp = x1 * (-1.0 + (x2 * -12.0));
	else
		tmp = x2 * -6.0;
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := If[Or[LessEqual[x1, -7.2e-84], N[Not[LessEqual[x1, 1.15e-97]], $MachinePrecision]], N[(x1 * N[(-1.0 + N[(x2 * -12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x2 * -6.0), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -7.2 \cdot 10^{-84} \lor \neg \left(x1 \leq 1.15 \cdot 10^{-97}\right):\\
\;\;\;\;x1 \cdot \left(-1 + x2 \cdot -12\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x1 < -7.20000000000000007e-84 or 1.14999999999999997e-97 < x1

    1. Initial program 57.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 27.5%

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x2 \cdot \left(x1 \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 38.2%

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

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

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

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

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

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

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

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

    if -7.20000000000000007e-84 < x1 < 1.14999999999999997e-97

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

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x2 \cdot \left(x1 \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 70.7%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -7.2 \cdot 10^{-84} \lor \neg \left(x1 \leq 1.15 \cdot 10^{-97}\right):\\ \;\;\;\;x1 \cdot \left(-1 + x2 \cdot -12\right)\\ \mathbf{else}:\\ \;\;\;\;x2 \cdot -6\\ \end{array} \]

Alternative 23: 36.4% accurate, 11.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -1.44 \cdot 10^{-67} \lor \neg \left(x2 \leq 4.2 \cdot 10^{-92}\right):\\
\;\;\;\;x2 \cdot \left(x1 \cdot -12 - 6\right)\\

\mathbf{else}:\\
\;\;\;\;x1 \cdot \left(-1 + x2 \cdot -12\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x2 < -1.44000000000000003e-67 or 4.2e-92 < x2

    1. Initial program 72.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 54.6%

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x2 \cdot \left(x1 \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 64.7%

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

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

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

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

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

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

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

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

    if -1.44000000000000003e-67 < x2 < 4.2e-92

    1. Initial program 71.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 46.6%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x2 \leq -1.44 \cdot 10^{-67} \lor \neg \left(x2 \leq 4.2 \cdot 10^{-92}\right):\\ \;\;\;\;x2 \cdot \left(x1 \cdot -12 - 6\right)\\ \mathbf{else}:\\ \;\;\;\;x1 \cdot \left(-1 + x2 \cdot -12\right)\\ \end{array} \]

Alternative 24: 30.3% accurate, 13.9× speedup?

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

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

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

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


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

    1. Initial program 75.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 55.6%

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x2 \cdot \left(x1 \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 35.1%

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

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

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

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

    if -6e-68 < x2 < 2.5000000000000001e-85

    1. Initial program 71.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 47.8%

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x2 \cdot \left(x1 \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 49.0%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-3 \cdot x1 + 2 \cdot x1} \]
    8. Step-by-step derivation
      1. distribute-rgt-out34.7%

        \[\leadsto \color{blue}{x1 \cdot \left(-3 + 2\right)} \]
      2. metadata-eval34.7%

        \[\leadsto x1 \cdot \color{blue}{-1} \]
      3. *-commutative34.7%

        \[\leadsto \color{blue}{-1 \cdot x1} \]
      4. neg-mul-134.7%

        \[\leadsto \color{blue}{-x1} \]
    9. Simplified34.7%

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

    if 2.5000000000000001e-85 < x2

    1. Initial program 68.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 52.6%

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

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

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

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

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

Alternative 25: 30.1% accurate, 17.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x2 \leq -6 \cdot 10^{-68}:\\ \;\;\;\;x2 \cdot -6\\ \mathbf{elif}\;x2 \leq 4.2 \cdot 10^{-92}:\\ \;\;\;\;-x1\\ \mathbf{else}:\\ \;\;\;\;x2 \cdot -6\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (if (<= x2 -6e-68) (* x2 -6.0) (if (<= x2 4.2e-92) (- x1) (* x2 -6.0))))
double code(double x1, double x2) {
	double tmp;
	if (x2 <= -6e-68) {
		tmp = x2 * -6.0;
	} else if (x2 <= 4.2e-92) {
		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 <= (-6d-68)) then
        tmp = x2 * (-6.0d0)
    else if (x2 <= 4.2d-92) 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 <= -6e-68) {
		tmp = x2 * -6.0;
	} else if (x2 <= 4.2e-92) {
		tmp = -x1;
	} else {
		tmp = x2 * -6.0;
	}
	return tmp;
}
def code(x1, x2):
	tmp = 0
	if x2 <= -6e-68:
		tmp = x2 * -6.0
	elif x2 <= 4.2e-92:
		tmp = -x1
	else:
		tmp = x2 * -6.0
	return tmp
function code(x1, x2)
	tmp = 0.0
	if (x2 <= -6e-68)
		tmp = Float64(x2 * -6.0);
	elseif (x2 <= 4.2e-92)
		tmp = Float64(-x1);
	else
		tmp = Float64(x2 * -6.0);
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	tmp = 0.0;
	if (x2 <= -6e-68)
		tmp = x2 * -6.0;
	elseif (x2 <= 4.2e-92)
		tmp = -x1;
	else
		tmp = x2 * -6.0;
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := If[LessEqual[x2, -6e-68], N[(x2 * -6.0), $MachinePrecision], If[LessEqual[x2, 4.2e-92], (-x1), N[(x2 * -6.0), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;x2 \leq 4.2 \cdot 10^{-92}:\\
\;\;\;\;-x1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x2 < -6e-68 or 4.2e-92 < x2

    1. Initial program 72.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 54.6%

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x2 \cdot \left(x1 \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 33.0%

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

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

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

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

    if -6e-68 < x2 < 4.2e-92

    1. Initial program 71.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 46.6%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-3 \cdot x1 + 2 \cdot x1} \]
    8. Step-by-step derivation
      1. distribute-rgt-out34.3%

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

        \[\leadsto x1 \cdot \color{blue}{-1} \]
      3. *-commutative34.3%

        \[\leadsto \color{blue}{-1 \cdot x1} \]
      4. neg-mul-134.3%

        \[\leadsto \color{blue}{-x1} \]
    9. Simplified34.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x2 \leq -6 \cdot 10^{-68}:\\ \;\;\;\;x2 \cdot -6\\ \mathbf{elif}\;x2 \leq 4.2 \cdot 10^{-92}:\\ \;\;\;\;-x1\\ \mathbf{else}:\\ \;\;\;\;x2 \cdot -6\\ \end{array} \]

Alternative 26: 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 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 51.9%

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{-3 \cdot x1 + 2 \cdot x1} \]
  8. Step-by-step derivation
    1. distribute-rgt-out13.7%

      \[\leadsto \color{blue}{x1 \cdot \left(-3 + 2\right)} \]
    2. metadata-eval13.7%

      \[\leadsto x1 \cdot \color{blue}{-1} \]
    3. *-commutative13.7%

      \[\leadsto \color{blue}{-1 \cdot x1} \]
    4. neg-mul-113.7%

      \[\leadsto \color{blue}{-x1} \]
  9. Simplified13.7%

    \[\leadsto \color{blue}{-x1} \]
  10. Final simplification13.7%

    \[\leadsto -x1 \]

Alternative 27: 3.3% accurate, 127.0× speedup?

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

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

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

    \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x2 \cdot \left(x1 \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 inf 3.3%

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

    \[\leadsto x1 \]

Reproduce

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