Rosa's FloatVsDoubleBenchmark

Percentage Accurate: 70.4% → 99.5%
Time: 49.6s
Alternatives: 22
Speedup: 5.5×

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

\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(x1, x1 \cdot 3, \mathsf{fma}\left(2, x2, -x1\right)\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_2}\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_3\right) \cdot \left(t_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_3 \cdot 4 - 6\right)\right) + t_1 \cdot t_3\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_2}\right) \leq \infty:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, \frac{t_1 - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, \mathsf{fma}\left(x1, x1 \cdot \frac{t_0}{\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_0}{\mathsf{fma}\left(x1, x1, 1\right)} \cdot \left(x1 \cdot \left(-6 + \frac{t_0}{\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) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right)\\


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

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

      \[\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 0.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 0.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) + 3 \cdot \color{blue}{\left(-1 \cdot x1 + -2 \cdot x2\right)}\right) \]
    4. Step-by-step derivation
      1. +-commutative0.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) + 3 \cdot \color{blue}{\left(-2 \cdot x2 + -1 \cdot x1\right)}\right) \]
      2. neg-mul-10.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) + 3 \cdot \left(-2 \cdot x2 + \color{blue}{\left(-x1\right)}\right)\right) \]
      3. unsub-neg0.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) + 3 \cdot \color{blue}{\left(-2 \cdot x2 - x1\right)}\right) \]
      4. *-commutative0.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) + 3 \cdot \left(\color{blue}{x2 \cdot -2} - x1\right)\right) \]
    5. Simplified0.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) + 3 \cdot \color{blue}{\left(x2 \cdot -2 - x1\right)}\right) \]
    6. Taylor expanded in x1 around inf 100.0%

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

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

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

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

Alternative 2: 99.3% accurate, 0.5× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + t_5\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.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.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) + 3 \cdot \color{blue}{\left(-1 \cdot x1 + -2 \cdot x2\right)}\right) \]
    4. Step-by-step derivation
      1. +-commutative99.4%

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

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

      \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot 3\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \color{blue}{\left(x2 \cdot -2 - x1\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 0.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 0.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) + 3 \cdot \color{blue}{\left(-1 \cdot x1 + -2 \cdot x2\right)}\right) \]
    4. Step-by-step derivation
      1. +-commutative0.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) + 3 \cdot \color{blue}{\left(-2 \cdot x2 + -1 \cdot x1\right)}\right) \]
      2. neg-mul-10.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) + 3 \cdot \left(-2 \cdot x2 + \color{blue}{\left(-x1\right)}\right)\right) \]
      3. unsub-neg0.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) + 3 \cdot \color{blue}{\left(-2 \cdot x2 - x1\right)}\right) \]
      4. *-commutative0.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) + 3 \cdot \left(\color{blue}{x2 \cdot -2} - x1\right)\right) \]
    5. Simplified0.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) + 3 \cdot \color{blue}{\left(x2 \cdot -2 - x1\right)}\right) \]
    6. Taylor expanded in x1 around inf 100.0%

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

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

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

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

Alternative 3: 95.5% accurate, 1.1× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;x1 + \left(t_0 + \left(x1 + \left(t_2 + \left(t_5 + t_3 \cdot \left(x1 \cdot \left(x1 \cdot 6\right)\right)\right)\right)\right)\right)\\


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

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

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

        \[\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(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) + -1 \cdot x1\right)}\right) \]
      2. neg-mul-144.8%

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

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

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

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

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

        \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right) + x1\right) + 3 \cdot \left(\mathsf{fma}\left(\color{blue}{x1 \cdot x1}, 3 - -2 \cdot x2, -2 \cdot x2\right) - x1\right)\right) \]
      8. cancel-sign-sub-inv44.8%

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

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

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

      \[\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(\mathsf{fma}\left(x1 \cdot x1, 3 + 2 \cdot x2, x2 \cdot -2\right) - x1\right)}\right) \]
    6. Taylor expanded in x1 around inf 44.8%

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

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

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

        \[\leadsto x1 + \left(\color{blue}{x1 \cdot -2} + 9 \cdot {x1}^{2}\right) \]
      3. fma-def82.2%

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

        \[\leadsto x1 + \mathsf{fma}\left(x1, -2, \color{blue}{{x1}^{2} \cdot 9}\right) \]
      5. unpow282.2%

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

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

      \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(x1, -2, x1 \cdot \left(x1 \cdot 9\right)\right)} \]

    if -2.2499999999999999e104 < x1 < 4.99999999999999984e78

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

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

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

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

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

    if 4.99999999999999984e78 < x1

    1. Initial program 31.7%

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

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

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

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

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

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

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

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

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

Alternative 4: 93.0% accurate, 1.2× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;x1 + \left(t_0 + \left(x1 + \left(t_2 + \left(t_5 + t_3 \cdot \left(x1 \cdot \left(x1 \cdot 6\right)\right)\right)\right)\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.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 44.8%

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

        \[\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(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) + -1 \cdot x1\right)}\right) \]
      2. neg-mul-144.8%

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

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

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

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

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

        \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right) + x1\right) + 3 \cdot \left(\mathsf{fma}\left(\color{blue}{x1 \cdot x1}, 3 - -2 \cdot x2, -2 \cdot x2\right) - x1\right)\right) \]
      8. cancel-sign-sub-inv44.8%

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

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

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

      \[\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(\mathsf{fma}\left(x1 \cdot x1, 3 + 2 \cdot x2, x2 \cdot -2\right) - x1\right)}\right) \]
    6. Taylor expanded in x1 around inf 44.8%

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

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

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

        \[\leadsto x1 + 3 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(3 + \color{blue}{\left(--2\right)} \cdot x2\right)\right) \]
      3. cancel-sign-sub-inv71.7%

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

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

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

    if -5.60000000000000037e102 < x1 < 9.99999999999999967e78

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

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

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

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

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

    if 9.99999999999999967e78 < x1

    1. Initial program 31.7%

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

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

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

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

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

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

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

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

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

Alternative 5: 90.9% accurate, 1.5× speedup?

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

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

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

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

\mathbf{elif}\;x1 \leq 2 \cdot 10^{+76}:\\
\;\;\;\;t_5\\

\mathbf{else}:\\
\;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2 - x1\right) + \left(x1 + \left(t_0 + \left(t_2 + t_3 \cdot \left(x1 \cdot \left(x1 \cdot 6\right)\right)\right)\right)\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.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 44.8%

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

        \[\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(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) + -1 \cdot x1\right)}\right) \]
      2. neg-mul-144.8%

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

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

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

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

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

        \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right) + x1\right) + 3 \cdot \left(\mathsf{fma}\left(\color{blue}{x1 \cdot x1}, 3 - -2 \cdot x2, -2 \cdot x2\right) - x1\right)\right) \]
      8. cancel-sign-sub-inv44.8%

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

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

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

      \[\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(\mathsf{fma}\left(x1 \cdot x1, 3 + 2 \cdot x2, x2 \cdot -2\right) - x1\right)}\right) \]
    6. Taylor expanded in x1 around inf 44.8%

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

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

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

        \[\leadsto x1 + 3 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(3 + \color{blue}{\left(--2\right)} \cdot x2\right)\right) \]
      3. cancel-sign-sub-inv71.7%

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

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

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

    if -5.60000000000000037e102 < x1 < -0.050000000000000003 or 0.048000000000000001 < x1 < 2.0000000000000001e76

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

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

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

        \[\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. Simplified92.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 3 - 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) + 3 \cdot \color{blue}{\left(x2 \cdot -2\right)}\right) \]

    if -0.050000000000000003 < x1 < 0.048000000000000001

    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 98.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) \]

    if 2.0000000000000001e76 < x1

    1. Initial program 31.7%

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

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

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

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

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

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

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

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

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

Alternative 6: 90.7% accurate, 1.5× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;x1 + \left(t_0 + \left(x1 + \left(t_1 + \left(t_3 + t_4 \cdot \left(x1 \cdot \left(x1 \cdot 6\right)\right)\right)\right)\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.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 44.8%

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

        \[\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(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) + -1 \cdot x1\right)}\right) \]
      2. neg-mul-144.8%

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

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

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

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

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

        \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right) + x1\right) + 3 \cdot \left(\mathsf{fma}\left(\color{blue}{x1 \cdot x1}, 3 - -2 \cdot x2, -2 \cdot x2\right) - x1\right)\right) \]
      8. cancel-sign-sub-inv44.8%

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

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

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

      \[\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(\mathsf{fma}\left(x1 \cdot x1, 3 + 2 \cdot x2, x2 \cdot -2\right) - x1\right)}\right) \]
    6. Taylor expanded in x1 around inf 44.8%

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

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

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

        \[\leadsto x1 + 3 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(3 + \color{blue}{\left(--2\right)} \cdot x2\right)\right) \]
      3. cancel-sign-sub-inv71.7%

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

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

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

    if -5.60000000000000037e102 < x1 < 2.0000000000000001e76

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

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

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

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

    if 2.0000000000000001e76 < x1

    1. Initial program 31.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

\mathbf{else}:\\
\;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2 - x1\right) + \left(x1 + \left(t_0 + \left(t_2 + t_3 \cdot \left(\left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\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.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 44.8%

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

        \[\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(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) + -1 \cdot x1\right)}\right) \]
      2. neg-mul-144.8%

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

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

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

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

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

        \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right) + x1\right) + 3 \cdot \left(\mathsf{fma}\left(\color{blue}{x1 \cdot x1}, 3 - -2 \cdot x2, -2 \cdot x2\right) - x1\right)\right) \]
      8. cancel-sign-sub-inv44.8%

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

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

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

      \[\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(\mathsf{fma}\left(x1 \cdot x1, 3 + 2 \cdot x2, x2 \cdot -2\right) - x1\right)}\right) \]
    6. Taylor expanded in x1 around inf 44.8%

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

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

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

        \[\leadsto x1 + 3 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(3 + \color{blue}{\left(--2\right)} \cdot x2\right)\right) \]
      3. cancel-sign-sub-inv71.7%

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

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

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

    if -5.60000000000000037e102 < x1 < -2.05e17

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

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

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

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

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

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

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

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

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

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

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

    if -2.05e17 < x1 < 12800

    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 96.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) \]

    if 12800 < x1

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

      \[\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 52.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) + 3 \cdot \color{blue}{\left(-1 \cdot x1 + -2 \cdot x2\right)}\right) \]
    4. Step-by-step derivation
      1. +-commutative52.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) + 3 \cdot \color{blue}{\left(-2 \cdot x2 + -1 \cdot x1\right)}\right) \]
      2. neg-mul-152.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) + 3 \cdot \left(-2 \cdot x2 + \color{blue}{\left(-x1\right)}\right)\right) \]
      3. unsub-neg52.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) + 3 \cdot \color{blue}{\left(-2 \cdot x2 - x1\right)}\right) \]
      4. *-commutative52.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) + 3 \cdot \left(\color{blue}{x2 \cdot -2} - x1\right)\right) \]
    5. Simplified52.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) + 3 \cdot \color{blue}{\left(x2 \cdot -2 - x1\right)}\right) \]
    6. Taylor expanded in x1 around inf 87.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 \left(x2 \cdot -2 - x1\right)\right) \]
    7. Step-by-step derivation
      1. *-commutative87.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 \left(x2 \cdot -2 - x1\right)\right) \]
      2. unpow287.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 \left(x2 \cdot -2 - x1\right)\right) \]
    8. Simplified87.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 \left(x2 \cdot -2 - x1\right)\right) \]
  3. Recombined 4 regimes into one program.
  4. Final simplification89.3%

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

Alternative 8: 86.2% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 \cdot x1 + 1\\ t_1 := x1 \cdot \left(x1 \cdot 3\right)\\ \mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\ \;\;\;\;x1 + 3 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(3 - x2 \cdot -2\right)\right)\\ \mathbf{elif}\;x1 \leq -8 \cdot 10^{+34} \lor \neg \left(x1 \leq 11000\right):\\ \;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2 - x1\right) + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot t_1 + t_0 \cdot \left(x1 \cdot \left(x1 \cdot 6\right)\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_0} + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (+ (* x1 x1) 1.0)) (t_1 (* x1 (* x1 3.0))))
   (if (<= x1 -5.6e+102)
     (+ x1 (* 3.0 (* (* x1 x1) (- 3.0 (* x2 -2.0)))))
     (if (or (<= x1 -8e+34) (not (<= x1 11000.0)))
       (+
        x1
        (+
         (* 3.0 (- (* x2 -2.0) x1))
         (+
          x1
          (+ (* x1 (* x1 x1)) (+ (* 3.0 t_1) (* t_0 (* x1 (* x1 6.0))))))))
       (+
        x1
        (+
         (* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_0))
         (+ x1 (* 4.0 (* x2 (* x1 (- (* 2.0 x2) 3.0)))))))))))
double code(double x1, double x2) {
	double t_0 = (x1 * x1) + 1.0;
	double t_1 = x1 * (x1 * 3.0);
	double tmp;
	if (x1 <= -5.6e+102) {
		tmp = x1 + (3.0 * ((x1 * x1) * (3.0 - (x2 * -2.0))));
	} else if ((x1 <= -8e+34) || !(x1 <= 11000.0)) {
		tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_0 * (x1 * (x1 * 6.0)))))));
	} else {
		tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x2 * (x1 * ((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) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = (x1 * x1) + 1.0d0
    t_1 = x1 * (x1 * 3.0d0)
    if (x1 <= (-5.6d+102)) then
        tmp = x1 + (3.0d0 * ((x1 * x1) * (3.0d0 - (x2 * (-2.0d0)))))
    else if ((x1 <= (-8d+34)) .or. (.not. (x1 <= 11000.0d0))) then
        tmp = x1 + ((3.0d0 * ((x2 * (-2.0d0)) - x1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0d0 * t_1) + (t_0 * (x1 * (x1 * 6.0d0)))))))
    else
        tmp = x1 + ((3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_0)) + (x1 + (4.0d0 * (x2 * (x1 * ((2.0d0 * x2) - 3.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);
	double tmp;
	if (x1 <= -5.6e+102) {
		tmp = x1 + (3.0 * ((x1 * x1) * (3.0 - (x2 * -2.0))));
	} else if ((x1 <= -8e+34) || !(x1 <= 11000.0)) {
		tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_0 * (x1 * (x1 * 6.0)))))));
	} else {
		tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))));
	}
	return tmp;
}
def code(x1, x2):
	t_0 = (x1 * x1) + 1.0
	t_1 = x1 * (x1 * 3.0)
	tmp = 0
	if x1 <= -5.6e+102:
		tmp = x1 + (3.0 * ((x1 * x1) * (3.0 - (x2 * -2.0))))
	elif (x1 <= -8e+34) or not (x1 <= 11000.0):
		tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_0 * (x1 * (x1 * 6.0)))))))
	else:
		tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))))
	return tmp
function code(x1, x2)
	t_0 = Float64(Float64(x1 * x1) + 1.0)
	t_1 = Float64(x1 * Float64(x1 * 3.0))
	tmp = 0.0
	if (x1 <= -5.6e+102)
		tmp = Float64(x1 + Float64(3.0 * Float64(Float64(x1 * x1) * Float64(3.0 - Float64(x2 * -2.0)))));
	elseif ((x1 <= -8e+34) || !(x1 <= 11000.0))
		tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(3.0 * t_1) + Float64(t_0 * Float64(x1 * Float64(x1 * 6.0))))))));
	else
		tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_0)) + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * Float64(Float64(2.0 * x2) - 3.0)))))));
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	t_0 = (x1 * x1) + 1.0;
	t_1 = x1 * (x1 * 3.0);
	tmp = 0.0;
	if (x1 <= -5.6e+102)
		tmp = x1 + (3.0 * ((x1 * x1) * (3.0 - (x2 * -2.0))));
	elseif ((x1 <= -8e+34) || ~((x1 <= 11000.0)))
		tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_0 * (x1 * (x1 * 6.0)))))));
	else
		tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.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]}, If[LessEqual[x1, -5.6e+102], N[(x1 + N[(3.0 * N[(N[(x1 * x1), $MachinePrecision] * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x1, -8e+34], N[Not[LessEqual[x1, 11000.0]], $MachinePrecision]], N[(x1 + N[(N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 * t$95$1), $MachinePrecision] + N[(t$95$0 * N[(x1 * N[(x1 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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[(x1 + N[(4.0 * N[(x2 * N[(x1 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x1 \leq -8 \cdot 10^{+34} \lor \neg \left(x1 \leq 11000\right):\\
\;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2 - x1\right) + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot t_1 + t_0 \cdot \left(x1 \cdot \left(x1 \cdot 6\right)\right)\right)\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_0} + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\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.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 44.8%

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

        \[\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(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) + -1 \cdot x1\right)}\right) \]
      2. neg-mul-144.8%

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

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

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

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

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

        \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right) + x1\right) + 3 \cdot \left(\mathsf{fma}\left(\color{blue}{x1 \cdot x1}, 3 - -2 \cdot x2, -2 \cdot x2\right) - x1\right)\right) \]
      8. cancel-sign-sub-inv44.8%

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

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

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

      \[\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(\mathsf{fma}\left(x1 \cdot x1, 3 + 2 \cdot x2, x2 \cdot -2\right) - x1\right)}\right) \]
    6. Taylor expanded in x1 around inf 44.8%

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

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

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

        \[\leadsto x1 + 3 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(3 + \color{blue}{\left(--2\right)} \cdot x2\right)\right) \]
      3. cancel-sign-sub-inv71.7%

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

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

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

    if -5.60000000000000037e102 < x1 < -7.99999999999999956e34 or 11000 < x1

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

      \[\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 60.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) + 3 \cdot \color{blue}{\left(-1 \cdot x1 + -2 \cdot x2\right)}\right) \]
    4. Step-by-step derivation
      1. +-commutative60.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) + 3 \cdot \color{blue}{\left(-2 \cdot x2 + -1 \cdot x1\right)}\right) \]
      2. neg-mul-160.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) + 3 \cdot \left(-2 \cdot x2 + \color{blue}{\left(-x1\right)}\right)\right) \]
      3. unsub-neg60.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) + 3 \cdot \color{blue}{\left(-2 \cdot x2 - x1\right)}\right) \]
      4. *-commutative60.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) + 3 \cdot \left(\color{blue}{x2 \cdot -2} - x1\right)\right) \]
    5. Simplified60.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) + 3 \cdot \color{blue}{\left(x2 \cdot -2 - x1\right)}\right) \]
    6. Taylor expanded in x1 around inf 87.1%

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

        \[\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 \left(x2 \cdot -2 - x1\right)\right) \]
      2. unpow287.1%

        \[\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 \left(x2 \cdot -2 - x1\right)\right) \]
      3. associate-*l*87.2%

        \[\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 3\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right) \]
    8. Simplified87.2%

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

    if -7.99999999999999956e34 < x1 < 11000

    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 95.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. Recombined 3 regimes into one program.
  4. Final simplification88.6%

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

Alternative 9: 86.2% accurate, 2.9× speedup?

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

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

\mathbf{elif}\;x1 \leq -3.5 \cdot 10^{+34}:\\
\;\;\;\;x1 + \left(t_0 + \left(x1 + \left(t_1 + \left(t_3 + t_4 \cdot \left(x1 \cdot \left(x1 \cdot 6\right)\right)\right)\right)\right)\right)\\

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

\mathbf{else}:\\
\;\;\;\;x1 + \left(t_0 + \left(x1 + \left(t_1 + \left(t_3 + t_4 \cdot \left(\left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\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.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 44.8%

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

        \[\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(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) + -1 \cdot x1\right)}\right) \]
      2. neg-mul-144.8%

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

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

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

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

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

        \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right) + x1\right) + 3 \cdot \left(\mathsf{fma}\left(\color{blue}{x1 \cdot x1}, 3 - -2 \cdot x2, -2 \cdot x2\right) - x1\right)\right) \]
      8. cancel-sign-sub-inv44.8%

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

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

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

      \[\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(\mathsf{fma}\left(x1 \cdot x1, 3 + 2 \cdot x2, x2 \cdot -2\right) - x1\right)}\right) \]
    6. Taylor expanded in x1 around inf 44.8%

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

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

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

        \[\leadsto x1 + 3 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(3 + \color{blue}{\left(--2\right)} \cdot x2\right)\right) \]
      3. cancel-sign-sub-inv71.7%

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

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

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

    if -5.60000000000000037e102 < x1 < -3.49999999999999998e34

    1. Initial program 99.3%

      \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    2. Taylor expanded in x1 around inf 99.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 \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.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) + 3 \cdot \color{blue}{\left(-1 \cdot x1 + -2 \cdot x2\right)}\right) \]
    4. Step-by-step derivation
      1. +-commutative99.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) + 3 \cdot \color{blue}{\left(-2 \cdot x2 + -1 \cdot x1\right)}\right) \]
      2. neg-mul-199.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) + 3 \cdot \left(-2 \cdot x2 + \color{blue}{\left(-x1\right)}\right)\right) \]
      3. unsub-neg99.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) + 3 \cdot \color{blue}{\left(-2 \cdot x2 - x1\right)}\right) \]
      4. *-commutative99.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) + 3 \cdot \left(\color{blue}{x2 \cdot -2} - x1\right)\right) \]
    5. Simplified99.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) + 3 \cdot \color{blue}{\left(x2 \cdot -2 - x1\right)}\right) \]
    6. Taylor expanded in x1 around inf 83.2%

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

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

        \[\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 \left(x2 \cdot -2 - x1\right)\right) \]
      3. associate-*l*83.5%

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

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

    if -3.49999999999999998e34 < x1 < 2e3

    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 95.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) \]

    if 2e3 < x1

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

      \[\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 52.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) + 3 \cdot \color{blue}{\left(-1 \cdot x1 + -2 \cdot x2\right)}\right) \]
    4. Step-by-step derivation
      1. +-commutative52.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) + 3 \cdot \color{blue}{\left(-2 \cdot x2 + -1 \cdot x1\right)}\right) \]
      2. neg-mul-152.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) + 3 \cdot \left(-2 \cdot x2 + \color{blue}{\left(-x1\right)}\right)\right) \]
      3. unsub-neg52.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) + 3 \cdot \color{blue}{\left(-2 \cdot x2 - x1\right)}\right) \]
      4. *-commutative52.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) + 3 \cdot \left(\color{blue}{x2 \cdot -2} - x1\right)\right) \]
    5. Simplified52.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) + 3 \cdot \color{blue}{\left(x2 \cdot -2 - x1\right)}\right) \]
    6. Taylor expanded in x1 around inf 87.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 \left(x2 \cdot -2 - x1\right)\right) \]
    7. Step-by-step derivation
      1. *-commutative87.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 \left(x2 \cdot -2 - x1\right)\right) \]
      2. unpow287.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 \left(x2 \cdot -2 - x1\right)\right) \]
    8. Simplified87.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 \left(x2 \cdot -2 - x1\right)\right) \]
  3. Recombined 4 regimes into one program.
  4. Final simplification88.6%

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

Alternative 10: 80.1% accurate, 3.2× speedup?

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

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

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

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


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

    1. Initial program 11.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 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 39.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(-1 \cdot x1 + \left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right)\right)}\right) \]
    4. Step-by-step derivation
      1. +-commutative39.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(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) + -1 \cdot x1\right)}\right) \]
      2. neg-mul-139.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 \left(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) + \color{blue}{\left(-x1\right)}\right)\right) \]
      3. unsub-neg39.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(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) - x1\right)}\right) \]
      4. +-commutative39.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 \left(\color{blue}{\left(\left(3 - -2 \cdot x2\right) \cdot {x1}^{2} + -2 \cdot x2\right)} - x1\right)\right) \]
      5. *-commutative39.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 \left(\left(\color{blue}{{x1}^{2} \cdot \left(3 - -2 \cdot x2\right)} + -2 \cdot x2\right) - x1\right)\right) \]
      6. fma-def39.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 \left(\color{blue}{\mathsf{fma}\left({x1}^{2}, 3 - -2 \cdot x2, -2 \cdot x2\right)} - x1\right)\right) \]
      7. unpow239.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 \left(\mathsf{fma}\left(\color{blue}{x1 \cdot x1}, 3 - -2 \cdot x2, -2 \cdot x2\right) - x1\right)\right) \]
      8. cancel-sign-sub-inv39.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 \left(\mathsf{fma}\left(x1 \cdot x1, \color{blue}{3 + \left(--2\right) \cdot x2}, -2 \cdot x2\right) - x1\right)\right) \]
      9. metadata-eval39.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 \left(\mathsf{fma}\left(x1 \cdot x1, 3 + \color{blue}{2} \cdot x2, -2 \cdot x2\right) - x1\right)\right) \]
      10. *-commutative39.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 \left(\mathsf{fma}\left(x1 \cdot x1, 3 + 2 \cdot x2, \color{blue}{x2 \cdot -2}\right) - x1\right)\right) \]
    5. Simplified39.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(\mathsf{fma}\left(x1 \cdot x1, 3 + 2 \cdot x2, x2 \cdot -2\right) - x1\right)}\right) \]
    6. Taylor expanded in x1 around inf 39.7%

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

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

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

        \[\leadsto x1 + 3 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(3 + \color{blue}{\left(--2\right)} \cdot x2\right)\right) \]
      3. cancel-sign-sub-inv65.2%

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

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

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

    if -4.79999999999999999e64 < x1 < 1.80000000000000004

    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 94.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) \]

    if 1.80000000000000004 < x1

    1. Initial program 53.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 18.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 55.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(-1 \cdot x1 + \left(-2 \cdot x2 + \left(\left(3 - -2 \cdot x2\right) \cdot {x1}^{2} + {x1}^{3}\right)\right)\right)}\right) \]
    4. Step-by-step derivation
      1. +-commutative55.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(\left(-2 \cdot x2 + \left(\left(3 - -2 \cdot x2\right) \cdot {x1}^{2} + {x1}^{3}\right)\right) + -1 \cdot x1\right)}\right) \]
      2. neg-mul-155.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 \left(\left(-2 \cdot x2 + \left(\left(3 - -2 \cdot x2\right) \cdot {x1}^{2} + {x1}^{3}\right)\right) + \color{blue}{\left(-x1\right)}\right)\right) \]
      3. unsub-neg55.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(\left(-2 \cdot x2 + \left(\left(3 - -2 \cdot x2\right) \cdot {x1}^{2} + {x1}^{3}\right)\right) - x1\right)}\right) \]
      4. *-commutative55.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 \left(\left(\color{blue}{x2 \cdot -2} + \left(\left(3 - -2 \cdot x2\right) \cdot {x1}^{2} + {x1}^{3}\right)\right) - x1\right)\right) \]
      5. fma-def55.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 \left(\color{blue}{\mathsf{fma}\left(x2, -2, \left(3 - -2 \cdot x2\right) \cdot {x1}^{2} + {x1}^{3}\right)} - x1\right)\right) \]
      6. +-commutative55.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 \left(\mathsf{fma}\left(x2, -2, \color{blue}{{x1}^{3} + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}}\right) - x1\right)\right) \]
      7. cube-mult55.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 \left(\mathsf{fma}\left(x2, -2, \color{blue}{x1 \cdot \left(x1 \cdot x1\right)} + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) - x1\right)\right) \]
      8. unpow255.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 \left(\mathsf{fma}\left(x2, -2, x1 \cdot \color{blue}{{x1}^{2}} + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) - x1\right)\right) \]
      9. distribute-rgt-out62.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 \left(\mathsf{fma}\left(x2, -2, \color{blue}{{x1}^{2} \cdot \left(x1 + \left(3 - -2 \cdot x2\right)\right)}\right) - x1\right)\right) \]
      10. unpow262.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 \left(\mathsf{fma}\left(x2, -2, \color{blue}{\left(x1 \cdot x1\right)} \cdot \left(x1 + \left(3 - -2 \cdot x2\right)\right)\right) - x1\right)\right) \]
      11. cancel-sign-sub-inv62.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 \left(\mathsf{fma}\left(x2, -2, \left(x1 \cdot x1\right) \cdot \left(x1 + \color{blue}{\left(3 + \left(--2\right) \cdot x2\right)}\right)\right) - x1\right)\right) \]
      12. metadata-eval62.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 \left(\mathsf{fma}\left(x2, -2, \left(x1 \cdot x1\right) \cdot \left(x1 + \left(3 + \color{blue}{2} \cdot x2\right)\right)\right) - x1\right)\right) \]
    5. Simplified62.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(\mathsf{fma}\left(x2, -2, \left(x1 \cdot x1\right) \cdot \left(x1 + \left(3 + 2 \cdot x2\right)\right)\right) - x1\right)}\right) \]
    6. Taylor expanded in x2 around 0 74.1%

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

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

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

Alternative 11: 79.9% accurate, 4.1× speedup?

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

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

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

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


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

    1. Initial program 11.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 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 39.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(-1 \cdot x1 + \left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right)\right)}\right) \]
    4. Step-by-step derivation
      1. +-commutative39.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(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) + -1 \cdot x1\right)}\right) \]
      2. neg-mul-139.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 \left(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) + \color{blue}{\left(-x1\right)}\right)\right) \]
      3. unsub-neg39.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(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) - x1\right)}\right) \]
      4. +-commutative39.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 \left(\color{blue}{\left(\left(3 - -2 \cdot x2\right) \cdot {x1}^{2} + -2 \cdot x2\right)} - x1\right)\right) \]
      5. *-commutative39.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 \left(\left(\color{blue}{{x1}^{2} \cdot \left(3 - -2 \cdot x2\right)} + -2 \cdot x2\right) - x1\right)\right) \]
      6. fma-def39.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 \left(\color{blue}{\mathsf{fma}\left({x1}^{2}, 3 - -2 \cdot x2, -2 \cdot x2\right)} - x1\right)\right) \]
      7. unpow239.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 \left(\mathsf{fma}\left(\color{blue}{x1 \cdot x1}, 3 - -2 \cdot x2, -2 \cdot x2\right) - x1\right)\right) \]
      8. cancel-sign-sub-inv39.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 \left(\mathsf{fma}\left(x1 \cdot x1, \color{blue}{3 + \left(--2\right) \cdot x2}, -2 \cdot x2\right) - x1\right)\right) \]
      9. metadata-eval39.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 \left(\mathsf{fma}\left(x1 \cdot x1, 3 + \color{blue}{2} \cdot x2, -2 \cdot x2\right) - x1\right)\right) \]
      10. *-commutative39.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 \left(\mathsf{fma}\left(x1 \cdot x1, 3 + 2 \cdot x2, \color{blue}{x2 \cdot -2}\right) - x1\right)\right) \]
    5. Simplified39.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(\mathsf{fma}\left(x1 \cdot x1, 3 + 2 \cdot x2, x2 \cdot -2\right) - x1\right)}\right) \]
    6. Taylor expanded in x1 around inf 39.7%

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

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

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

        \[\leadsto x1 + 3 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(3 + \color{blue}{\left(--2\right)} \cdot x2\right)\right) \]
      3. cancel-sign-sub-inv65.2%

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

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

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

    if -8.09999999999999998e62 < x1 < 1.3600000000000001e-34

    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 94.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 94.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(-1 \cdot x1 + -2 \cdot x2\right)}\right) \]
    4. Step-by-step derivation
      1. +-commutative99.4%

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

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

    if 1.3600000000000001e-34 < x1

    1. Initial program 59.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 29.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 60.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(-1 \cdot x1 + \left(-2 \cdot x2 + \left(\left(3 - -2 \cdot x2\right) \cdot {x1}^{2} + {x1}^{3}\right)\right)\right)}\right) \]
    4. Step-by-step derivation
      1. +-commutative60.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(\left(-2 \cdot x2 + \left(\left(3 - -2 \cdot x2\right) \cdot {x1}^{2} + {x1}^{3}\right)\right) + -1 \cdot x1\right)}\right) \]
      2. neg-mul-160.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 \left(\left(-2 \cdot x2 + \left(\left(3 - -2 \cdot x2\right) \cdot {x1}^{2} + {x1}^{3}\right)\right) + \color{blue}{\left(-x1\right)}\right)\right) \]
      3. unsub-neg60.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(\left(-2 \cdot x2 + \left(\left(3 - -2 \cdot x2\right) \cdot {x1}^{2} + {x1}^{3}\right)\right) - x1\right)}\right) \]
      4. *-commutative60.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 \left(\left(\color{blue}{x2 \cdot -2} + \left(\left(3 - -2 \cdot x2\right) \cdot {x1}^{2} + {x1}^{3}\right)\right) - x1\right)\right) \]
      5. fma-def60.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 \left(\color{blue}{\mathsf{fma}\left(x2, -2, \left(3 - -2 \cdot x2\right) \cdot {x1}^{2} + {x1}^{3}\right)} - x1\right)\right) \]
      6. +-commutative60.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 \left(\mathsf{fma}\left(x2, -2, \color{blue}{{x1}^{3} + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}}\right) - x1\right)\right) \]
      7. cube-mult60.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 \left(\mathsf{fma}\left(x2, -2, \color{blue}{x1 \cdot \left(x1 \cdot x1\right)} + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) - x1\right)\right) \]
      8. unpow260.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 \left(\mathsf{fma}\left(x2, -2, x1 \cdot \color{blue}{{x1}^{2}} + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) - x1\right)\right) \]
      9. distribute-rgt-out66.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 \left(\mathsf{fma}\left(x2, -2, \color{blue}{{x1}^{2} \cdot \left(x1 + \left(3 - -2 \cdot x2\right)\right)}\right) - x1\right)\right) \]
      10. unpow266.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 \left(\mathsf{fma}\left(x2, -2, \color{blue}{\left(x1 \cdot x1\right)} \cdot \left(x1 + \left(3 - -2 \cdot x2\right)\right)\right) - x1\right)\right) \]
      11. cancel-sign-sub-inv66.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 \left(\mathsf{fma}\left(x2, -2, \left(x1 \cdot x1\right) \cdot \left(x1 + \color{blue}{\left(3 + \left(--2\right) \cdot x2\right)}\right)\right) - x1\right)\right) \]
      12. metadata-eval66.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 \left(\mathsf{fma}\left(x2, -2, \left(x1 \cdot x1\right) \cdot \left(x1 + \left(3 + \color{blue}{2} \cdot x2\right)\right)\right) - x1\right)\right) \]
    5. Simplified66.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(\mathsf{fma}\left(x2, -2, \left(x1 \cdot x1\right) \cdot \left(x1 + \left(3 + 2 \cdot x2\right)\right)\right) - x1\right)}\right) \]
    6. Taylor expanded in x2 around 0 76.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}{3 \cdot \left({x1}^{2} \cdot \left(3 + x1\right) - x1\right)}\right) \]
    7. Step-by-step derivation
      1. +-commutative76.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 \left({x1}^{2} \cdot \color{blue}{\left(x1 + 3\right)} - x1\right)\right) \]
      2. unpow276.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 \left(\color{blue}{\left(x1 \cdot x1\right)} \cdot \left(x1 + 3\right) - x1\right)\right) \]
    8. Simplified76.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}{3 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 + 3\right) - x1\right)}\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification82.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -8.1 \cdot 10^{+62}:\\ \;\;\;\;x1 + 3 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(3 - x2 \cdot -2\right)\right)\\ \mathbf{elif}\;x1 \leq 1.36 \cdot 10^{-34}:\\ \;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2 - x1\right) + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right) + 3 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 + 3\right) - x1\right)\right)\\ \end{array} \]

Alternative 12: 75.4% accurate, 4.7× speedup?

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

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

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

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

\mathbf{elif}\;x1 \leq 3.8 \cdot 10^{+102}:\\
\;\;\;\;t_0\\

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


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

    1. Initial program 11.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 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 39.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(-1 \cdot x1 + \left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right)\right)}\right) \]
    4. Step-by-step derivation
      1. +-commutative39.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(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) + -1 \cdot x1\right)}\right) \]
      2. neg-mul-139.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 \left(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) + \color{blue}{\left(-x1\right)}\right)\right) \]
      3. unsub-neg39.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(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) - x1\right)}\right) \]
      4. +-commutative39.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 \left(\color{blue}{\left(\left(3 - -2 \cdot x2\right) \cdot {x1}^{2} + -2 \cdot x2\right)} - x1\right)\right) \]
      5. *-commutative39.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 \left(\left(\color{blue}{{x1}^{2} \cdot \left(3 - -2 \cdot x2\right)} + -2 \cdot x2\right) - x1\right)\right) \]
      6. fma-def39.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 \left(\color{blue}{\mathsf{fma}\left({x1}^{2}, 3 - -2 \cdot x2, -2 \cdot x2\right)} - x1\right)\right) \]
      7. unpow239.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 \left(\mathsf{fma}\left(\color{blue}{x1 \cdot x1}, 3 - -2 \cdot x2, -2 \cdot x2\right) - x1\right)\right) \]
      8. cancel-sign-sub-inv39.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 \left(\mathsf{fma}\left(x1 \cdot x1, \color{blue}{3 + \left(--2\right) \cdot x2}, -2 \cdot x2\right) - x1\right)\right) \]
      9. metadata-eval39.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 \left(\mathsf{fma}\left(x1 \cdot x1, 3 + \color{blue}{2} \cdot x2, -2 \cdot x2\right) - x1\right)\right) \]
      10. *-commutative39.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 \left(\mathsf{fma}\left(x1 \cdot x1, 3 + 2 \cdot x2, \color{blue}{x2 \cdot -2}\right) - x1\right)\right) \]
    5. Simplified39.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(\mathsf{fma}\left(x1 \cdot x1, 3 + 2 \cdot x2, x2 \cdot -2\right) - x1\right)}\right) \]
    6. Taylor expanded in x1 around inf 39.7%

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

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

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

        \[\leadsto x1 + 3 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(3 + \color{blue}{\left(--2\right)} \cdot x2\right)\right) \]
      3. cancel-sign-sub-inv65.2%

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

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

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

    if -2.15e63 < x1 < -1.90000000000000007e-178 or 3.5000000000000003e-229 < x1 < 3.79999999999999979e102

    1. Initial program 99.3%

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

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

        \[\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(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) + -1 \cdot x1\right)}\right) \]
      2. neg-mul-176.9%

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

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

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

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

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

        \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right) + x1\right) + 3 \cdot \left(\mathsf{fma}\left(\color{blue}{x1 \cdot x1}, 3 - -2 \cdot x2, -2 \cdot x2\right) - x1\right)\right) \]
      8. cancel-sign-sub-inv76.9%

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

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

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

      \[\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(\mathsf{fma}\left(x1 \cdot x1, 3 + 2 \cdot x2, x2 \cdot -2\right) - x1\right)}\right) \]
    6. Taylor expanded in x1 around 0 78.1%

      \[\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.90000000000000007e-178 < x1 < 3.5000000000000003e-229

    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 92.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. *-commutative92.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. Simplified92.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 92.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. associate-*r*92.4%

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

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

        \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \color{blue}{\left(x2 \cdot \left(2 \cdot x1\right)\right)}\right) + x1\right) + 3 \cdot \left(x2 \cdot -2\right)\right) \]
      4. rem-log-exp69.0%

        \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(x2 \cdot \color{blue}{\log \left(e^{2 \cdot x1}\right)}\right)\right) + x1\right) + 3 \cdot \left(x2 \cdot -2\right)\right) \]
      5. *-commutative69.0%

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

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

        \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(x2 \cdot \color{blue}{\left(\log \left(e^{x1}\right) + \log \left(e^{x1}\right)\right)}\right)\right) + x1\right) + 3 \cdot \left(x2 \cdot -2\right)\right) \]
      8. rem-log-exp76.4%

        \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(x2 \cdot \left(\color{blue}{x1} + \log \left(e^{x1}\right)\right)\right)\right) + x1\right) + 3 \cdot \left(x2 \cdot -2\right)\right) \]
      9. rem-log-exp92.4%

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

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

    if 3.79999999999999979e102 < x1

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

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

        \[\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(\left(-2 \cdot x2 + \left(\left(3 - -2 \cdot x2\right) \cdot {x1}^{2} + {x1}^{3}\right)\right) + -1 \cdot x1\right)}\right) \]
      2. neg-mul-180.0%

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

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

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

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

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

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

        \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right) + x1\right) + 3 \cdot \left(\mathsf{fma}\left(x2, -2, x1 \cdot \color{blue}{{x1}^{2}} + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) - x1\right)\right) \]
      9. distribute-rgt-out91.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 \left(\mathsf{fma}\left(x2, -2, \color{blue}{{x1}^{2} \cdot \left(x1 + \left(3 - -2 \cdot x2\right)\right)}\right) - x1\right)\right) \]
      10. unpow291.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 \left(\mathsf{fma}\left(x2, -2, \color{blue}{\left(x1 \cdot x1\right)} \cdot \left(x1 + \left(3 - -2 \cdot x2\right)\right)\right) - x1\right)\right) \]
      11. cancel-sign-sub-inv91.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 \left(\mathsf{fma}\left(x2, -2, \left(x1 \cdot x1\right) \cdot \left(x1 + \color{blue}{\left(3 + \left(--2\right) \cdot x2\right)}\right)\right) - x1\right)\right) \]
      12. metadata-eval91.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 \left(\mathsf{fma}\left(x2, -2, \left(x1 \cdot x1\right) \cdot \left(x1 + \left(3 + \color{blue}{2} \cdot x2\right)\right)\right) - x1\right)\right) \]
    5. Simplified91.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(\mathsf{fma}\left(x2, -2, \left(x1 \cdot x1\right) \cdot \left(x1 + \left(3 + 2 \cdot x2\right)\right)\right) - x1\right)}\right) \]
    6. Taylor expanded in x2 around 0 100.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -2.15 \cdot 10^{+63}:\\ \;\;\;\;x1 + 3 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(3 - x2 \cdot -2\right)\right)\\ \mathbf{elif}\;x1 \leq -1.9 \cdot 10^{-178}:\\ \;\;\;\;x1 + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right) + x2 \cdot -6\right)\\ \mathbf{elif}\;x1 \leq 3.5 \cdot 10^{-229}:\\ \;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2\right) + \left(x1 + 4 \cdot \left(x2 \cdot \left(x2 \cdot \left(x1 + x1\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 3.8 \cdot 10^{+102}:\\ \;\;\;\;x1 + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right) + x2 \cdot -6\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x1 + 3 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 + 3\right) - x1\right)\right)\\ \end{array} \]

Alternative 13: 79.7% accurate, 4.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x1 \leq -1.55 \cdot 10^{+66}:\\ \;\;\;\;x1 + 3 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(3 - x2 \cdot -2\right)\right)\\ \mathbf{elif}\;x1 \leq 3.8 \cdot 10^{+102}:\\ \;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2 - x1\right) + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x1 + 3 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 + 3\right) - x1\right)\right)\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (if (<= x1 -1.55e+66)
   (+ x1 (* 3.0 (* (* x1 x1) (- 3.0 (* x2 -2.0)))))
   (if (<= x1 3.8e+102)
     (+
      x1
      (+
       (* 3.0 (- (* x2 -2.0) x1))
       (+ x1 (* 4.0 (* x2 (* x1 (- (* 2.0 x2) 3.0)))))))
     (+ x1 (+ x1 (* 3.0 (- (* (* x1 x1) (+ x1 3.0)) x1)))))))
double code(double x1, double x2) {
	double tmp;
	if (x1 <= -1.55e+66) {
		tmp = x1 + (3.0 * ((x1 * x1) * (3.0 - (x2 * -2.0))));
	} else if (x1 <= 3.8e+102) {
		tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))));
	} else {
		tmp = x1 + (x1 + (3.0 * (((x1 * x1) * (x1 + 3.0)) - x1)));
	}
	return tmp;
}
real(8) function code(x1, x2)
    real(8), intent (in) :: x1
    real(8), intent (in) :: x2
    real(8) :: tmp
    if (x1 <= (-1.55d+66)) then
        tmp = x1 + (3.0d0 * ((x1 * x1) * (3.0d0 - (x2 * (-2.0d0)))))
    else if (x1 <= 3.8d+102) then
        tmp = x1 + ((3.0d0 * ((x2 * (-2.0d0)) - x1)) + (x1 + (4.0d0 * (x2 * (x1 * ((2.0d0 * x2) - 3.0d0))))))
    else
        tmp = x1 + (x1 + (3.0d0 * (((x1 * x1) * (x1 + 3.0d0)) - x1)))
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double tmp;
	if (x1 <= -1.55e+66) {
		tmp = x1 + (3.0 * ((x1 * x1) * (3.0 - (x2 * -2.0))));
	} else if (x1 <= 3.8e+102) {
		tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))));
	} else {
		tmp = x1 + (x1 + (3.0 * (((x1 * x1) * (x1 + 3.0)) - x1)));
	}
	return tmp;
}
def code(x1, x2):
	tmp = 0
	if x1 <= -1.55e+66:
		tmp = x1 + (3.0 * ((x1 * x1) * (3.0 - (x2 * -2.0))))
	elif x1 <= 3.8e+102:
		tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))))
	else:
		tmp = x1 + (x1 + (3.0 * (((x1 * x1) * (x1 + 3.0)) - x1)))
	return tmp
function code(x1, x2)
	tmp = 0.0
	if (x1 <= -1.55e+66)
		tmp = Float64(x1 + Float64(3.0 * Float64(Float64(x1 * x1) * Float64(3.0 - Float64(x2 * -2.0)))));
	elseif (x1 <= 3.8e+102)
		tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)) + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * Float64(Float64(2.0 * x2) - 3.0)))))));
	else
		tmp = Float64(x1 + Float64(x1 + Float64(3.0 * Float64(Float64(Float64(x1 * x1) * Float64(x1 + 3.0)) - x1))));
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	tmp = 0.0;
	if (x1 <= -1.55e+66)
		tmp = x1 + (3.0 * ((x1 * x1) * (3.0 - (x2 * -2.0))));
	elseif (x1 <= 3.8e+102)
		tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))));
	else
		tmp = x1 + (x1 + (3.0 * (((x1 * x1) * (x1 + 3.0)) - x1)));
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := If[LessEqual[x1, -1.55e+66], N[(x1 + N[(3.0 * N[(N[(x1 * x1), $MachinePrecision] * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 3.8e+102], N[(x1 + N[(N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision] + 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[(x1 + N[(3.0 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(x1 + 3.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

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

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


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

    1. Initial program 11.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 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 39.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(-1 \cdot x1 + \left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right)\right)}\right) \]
    4. Step-by-step derivation
      1. +-commutative39.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(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) + -1 \cdot x1\right)}\right) \]
      2. neg-mul-139.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 \left(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) + \color{blue}{\left(-x1\right)}\right)\right) \]
      3. unsub-neg39.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(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) - x1\right)}\right) \]
      4. +-commutative39.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 \left(\color{blue}{\left(\left(3 - -2 \cdot x2\right) \cdot {x1}^{2} + -2 \cdot x2\right)} - x1\right)\right) \]
      5. *-commutative39.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 \left(\left(\color{blue}{{x1}^{2} \cdot \left(3 - -2 \cdot x2\right)} + -2 \cdot x2\right) - x1\right)\right) \]
      6. fma-def39.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 \left(\color{blue}{\mathsf{fma}\left({x1}^{2}, 3 - -2 \cdot x2, -2 \cdot x2\right)} - x1\right)\right) \]
      7. unpow239.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 \left(\mathsf{fma}\left(\color{blue}{x1 \cdot x1}, 3 - -2 \cdot x2, -2 \cdot x2\right) - x1\right)\right) \]
      8. cancel-sign-sub-inv39.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 \left(\mathsf{fma}\left(x1 \cdot x1, \color{blue}{3 + \left(--2\right) \cdot x2}, -2 \cdot x2\right) - x1\right)\right) \]
      9. metadata-eval39.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 \left(\mathsf{fma}\left(x1 \cdot x1, 3 + \color{blue}{2} \cdot x2, -2 \cdot x2\right) - x1\right)\right) \]
      10. *-commutative39.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 \left(\mathsf{fma}\left(x1 \cdot x1, 3 + 2 \cdot x2, \color{blue}{x2 \cdot -2}\right) - x1\right)\right) \]
    5. Simplified39.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(\mathsf{fma}\left(x1 \cdot x1, 3 + 2 \cdot x2, x2 \cdot -2\right) - x1\right)}\right) \]
    6. Taylor expanded in x1 around inf 39.7%

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

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

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

        \[\leadsto x1 + 3 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(3 + \color{blue}{\left(--2\right)} \cdot x2\right)\right) \]
      3. cancel-sign-sub-inv65.2%

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

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

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

    if -1.55000000000000009e66 < x1 < 3.79999999999999979e102

    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 85.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 84.9%

      \[\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(-1 \cdot x1 + -2 \cdot x2\right)}\right) \]
    4. Step-by-step derivation
      1. +-commutative99.4%

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

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

      \[\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 - x1\right)}\right) \]

    if 3.79999999999999979e102 < x1

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

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

        \[\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(\left(-2 \cdot x2 + \left(\left(3 - -2 \cdot x2\right) \cdot {x1}^{2} + {x1}^{3}\right)\right) + -1 \cdot x1\right)}\right) \]
      2. neg-mul-180.0%

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

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

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

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

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

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

        \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right) + x1\right) + 3 \cdot \left(\mathsf{fma}\left(x2, -2, x1 \cdot \color{blue}{{x1}^{2}} + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) - x1\right)\right) \]
      9. distribute-rgt-out91.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 \left(\mathsf{fma}\left(x2, -2, \color{blue}{{x1}^{2} \cdot \left(x1 + \left(3 - -2 \cdot x2\right)\right)}\right) - x1\right)\right) \]
      10. unpow291.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 \left(\mathsf{fma}\left(x2, -2, \color{blue}{\left(x1 \cdot x1\right)} \cdot \left(x1 + \left(3 - -2 \cdot x2\right)\right)\right) - x1\right)\right) \]
      11. cancel-sign-sub-inv91.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 \left(\mathsf{fma}\left(x2, -2, \left(x1 \cdot x1\right) \cdot \left(x1 + \color{blue}{\left(3 + \left(--2\right) \cdot x2\right)}\right)\right) - x1\right)\right) \]
      12. metadata-eval91.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 \left(\mathsf{fma}\left(x2, -2, \left(x1 \cdot x1\right) \cdot \left(x1 + \left(3 + \color{blue}{2} \cdot x2\right)\right)\right) - x1\right)\right) \]
    5. Simplified91.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(\mathsf{fma}\left(x2, -2, \left(x1 \cdot x1\right) \cdot \left(x1 + \left(3 + 2 \cdot x2\right)\right)\right) - x1\right)}\right) \]
    6. Taylor expanded in x2 around 0 100.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -1.55 \cdot 10^{+66}:\\ \;\;\;\;x1 + 3 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(3 - x2 \cdot -2\right)\right)\\ \mathbf{elif}\;x1 \leq 3.8 \cdot 10^{+102}:\\ \;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2 - x1\right) + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x1 + 3 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 + 3\right) - x1\right)\right)\\ \end{array} \]

Alternative 14: 67.5% accurate, 5.5× speedup?

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

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

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

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

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

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


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

    1. Initial program 11.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 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 39.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(-1 \cdot x1 + \left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right)\right)}\right) \]
    4. Step-by-step derivation
      1. +-commutative39.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(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) + -1 \cdot x1\right)}\right) \]
      2. neg-mul-139.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 \left(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) + \color{blue}{\left(-x1\right)}\right)\right) \]
      3. unsub-neg39.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(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) - x1\right)}\right) \]
      4. +-commutative39.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 \left(\color{blue}{\left(\left(3 - -2 \cdot x2\right) \cdot {x1}^{2} + -2 \cdot x2\right)} - x1\right)\right) \]
      5. *-commutative39.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 \left(\left(\color{blue}{{x1}^{2} \cdot \left(3 - -2 \cdot x2\right)} + -2 \cdot x2\right) - x1\right)\right) \]
      6. fma-def39.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 \left(\color{blue}{\mathsf{fma}\left({x1}^{2}, 3 - -2 \cdot x2, -2 \cdot x2\right)} - x1\right)\right) \]
      7. unpow239.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 \left(\mathsf{fma}\left(\color{blue}{x1 \cdot x1}, 3 - -2 \cdot x2, -2 \cdot x2\right) - x1\right)\right) \]
      8. cancel-sign-sub-inv39.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 \left(\mathsf{fma}\left(x1 \cdot x1, \color{blue}{3 + \left(--2\right) \cdot x2}, -2 \cdot x2\right) - x1\right)\right) \]
      9. metadata-eval39.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 \left(\mathsf{fma}\left(x1 \cdot x1, 3 + \color{blue}{2} \cdot x2, -2 \cdot x2\right) - x1\right)\right) \]
      10. *-commutative39.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 \left(\mathsf{fma}\left(x1 \cdot x1, 3 + 2 \cdot x2, \color{blue}{x2 \cdot -2}\right) - x1\right)\right) \]
    5. Simplified39.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(\mathsf{fma}\left(x1 \cdot x1, 3 + 2 \cdot x2, x2 \cdot -2\right) - x1\right)}\right) \]
    6. Taylor expanded in x1 around inf 39.7%

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

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

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

        \[\leadsto x1 + 3 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(3 + \color{blue}{\left(--2\right)} \cdot x2\right)\right) \]
      3. cancel-sign-sub-inv65.2%

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

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

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

    if -9e61 < x1 < -5.2000000000000002e-120

    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 83.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 81.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(-1 \cdot x1 + \left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right)\right)}\right) \]
    4. Step-by-step derivation
      1. +-commutative81.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(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) + -1 \cdot x1\right)}\right) \]
      2. neg-mul-181.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 \left(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) + \color{blue}{\left(-x1\right)}\right)\right) \]
      3. unsub-neg81.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(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) - x1\right)}\right) \]
      4. +-commutative81.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 \left(\color{blue}{\left(\left(3 - -2 \cdot x2\right) \cdot {x1}^{2} + -2 \cdot x2\right)} - x1\right)\right) \]
      5. *-commutative81.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 \left(\left(\color{blue}{{x1}^{2} \cdot \left(3 - -2 \cdot x2\right)} + -2 \cdot x2\right) - x1\right)\right) \]
      6. fma-def81.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 \left(\color{blue}{\mathsf{fma}\left({x1}^{2}, 3 - -2 \cdot x2, -2 \cdot x2\right)} - x1\right)\right) \]
      7. unpow281.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 \left(\mathsf{fma}\left(\color{blue}{x1 \cdot x1}, 3 - -2 \cdot x2, -2 \cdot x2\right) - x1\right)\right) \]
      8. cancel-sign-sub-inv81.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 \left(\mathsf{fma}\left(x1 \cdot x1, \color{blue}{3 + \left(--2\right) \cdot x2}, -2 \cdot x2\right) - x1\right)\right) \]
      9. metadata-eval81.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 \left(\mathsf{fma}\left(x1 \cdot x1, 3 + \color{blue}{2} \cdot x2, -2 \cdot x2\right) - x1\right)\right) \]
      10. *-commutative81.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 \left(\mathsf{fma}\left(x1 \cdot x1, 3 + 2 \cdot x2, \color{blue}{x2 \cdot -2}\right) - x1\right)\right) \]
    5. Simplified81.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(\mathsf{fma}\left(x1 \cdot x1, 3 + 2 \cdot x2, x2 \cdot -2\right) - x1\right)}\right) \]
    6. Taylor expanded in x1 around 0 83.4%

      \[\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)} \]
    7. Taylor expanded in x2 around inf 63.2%

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

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

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

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

    if -5.2000000000000002e-120 < x1 < 3.0500000000000001e-12

    1. Initial program 99.4%

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

      \[\leadsto x1 + \left(\left(\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.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(-1 \cdot x1 + \left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right)\right)}\right) \]
    4. Step-by-step derivation
      1. +-commutative99.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(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) + -1 \cdot x1\right)}\right) \]
      2. neg-mul-199.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 \left(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) + \color{blue}{\left(-x1\right)}\right)\right) \]
      3. unsub-neg99.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(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) - x1\right)}\right) \]
      4. +-commutative99.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 \left(\color{blue}{\left(\left(3 - -2 \cdot x2\right) \cdot {x1}^{2} + -2 \cdot x2\right)} - x1\right)\right) \]
      5. *-commutative99.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 \left(\left(\color{blue}{{x1}^{2} \cdot \left(3 - -2 \cdot x2\right)} + -2 \cdot x2\right) - x1\right)\right) \]
      6. fma-def99.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 \left(\color{blue}{\mathsf{fma}\left({x1}^{2}, 3 - -2 \cdot x2, -2 \cdot x2\right)} - x1\right)\right) \]
      7. unpow299.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 \left(\mathsf{fma}\left(\color{blue}{x1 \cdot x1}, 3 - -2 \cdot x2, -2 \cdot x2\right) - x1\right)\right) \]
      8. cancel-sign-sub-inv99.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 \left(\mathsf{fma}\left(x1 \cdot x1, \color{blue}{3 + \left(--2\right) \cdot x2}, -2 \cdot x2\right) - x1\right)\right) \]
      9. metadata-eval99.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 \left(\mathsf{fma}\left(x1 \cdot x1, 3 + \color{blue}{2} \cdot x2, -2 \cdot x2\right) - x1\right)\right) \]
      10. *-commutative99.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 \left(\mathsf{fma}\left(x1 \cdot x1, 3 + 2 \cdot x2, \color{blue}{x2 \cdot -2}\right) - x1\right)\right) \]
    5. Simplified99.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(\mathsf{fma}\left(x1 \cdot x1, 3 + 2 \cdot x2, x2 \cdot -2\right) - x1\right)}\right) \]
    6. Taylor expanded in x1 around 0 86.2%

      \[\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)} \]
    7. Taylor expanded in x2 around 0 76.5%

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

    if 3.0500000000000001e-12 < x1 < 3.29999999999999999e102

    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 37.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 36.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. *-commutative36.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. Simplified36.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 36.7%

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

    if 3.29999999999999999e102 < x1

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

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

        \[\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(\left(-2 \cdot x2 + \left(\left(3 - -2 \cdot x2\right) \cdot {x1}^{2} + {x1}^{3}\right)\right) + -1 \cdot x1\right)}\right) \]
      2. neg-mul-180.0%

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

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

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

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

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

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

        \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right) + x1\right) + 3 \cdot \left(\mathsf{fma}\left(x2, -2, x1 \cdot \color{blue}{{x1}^{2}} + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) - x1\right)\right) \]
      9. distribute-rgt-out91.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 \left(\mathsf{fma}\left(x2, -2, \color{blue}{{x1}^{2} \cdot \left(x1 + \left(3 - -2 \cdot x2\right)\right)}\right) - x1\right)\right) \]
      10. unpow291.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 \left(\mathsf{fma}\left(x2, -2, \color{blue}{\left(x1 \cdot x1\right)} \cdot \left(x1 + \left(3 - -2 \cdot x2\right)\right)\right) - x1\right)\right) \]
      11. cancel-sign-sub-inv91.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 \left(\mathsf{fma}\left(x2, -2, \left(x1 \cdot x1\right) \cdot \left(x1 + \color{blue}{\left(3 + \left(--2\right) \cdot x2\right)}\right)\right) - x1\right)\right) \]
      12. metadata-eval91.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 \left(\mathsf{fma}\left(x2, -2, \left(x1 \cdot x1\right) \cdot \left(x1 + \left(3 + \color{blue}{2} \cdot x2\right)\right)\right) - x1\right)\right) \]
    5. Simplified91.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(\mathsf{fma}\left(x2, -2, \left(x1 \cdot x1\right) \cdot \left(x1 + \left(3 + 2 \cdot x2\right)\right)\right) - x1\right)}\right) \]
    6. Taylor expanded in x2 around 0 100.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -9 \cdot 10^{+61}:\\ \;\;\;\;x1 + 3 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(3 - x2 \cdot -2\right)\right)\\ \mathbf{elif}\;x1 \leq -5.2 \cdot 10^{-120}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(8 \cdot \left(x2 \cdot x2\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 3.05 \cdot 10^{-12}:\\ \;\;\;\;x2 \cdot \left(x1 \cdot -12 - 6\right) + \left(x1 + x1 \cdot -2\right)\\ \mathbf{elif}\;x1 \leq 3.3 \cdot 10^{+102}:\\ \;\;\;\;x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x1 + 3 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 + 3\right) - x1\right)\right)\\ \end{array} \]

Alternative 15: 74.1% accurate, 5.5× speedup?

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

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

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

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


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

    1. Initial program 11.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 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 39.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(-1 \cdot x1 + \left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right)\right)}\right) \]
    4. Step-by-step derivation
      1. +-commutative39.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(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) + -1 \cdot x1\right)}\right) \]
      2. neg-mul-139.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 \left(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) + \color{blue}{\left(-x1\right)}\right)\right) \]
      3. unsub-neg39.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(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) - x1\right)}\right) \]
      4. +-commutative39.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 \left(\color{blue}{\left(\left(3 - -2 \cdot x2\right) \cdot {x1}^{2} + -2 \cdot x2\right)} - x1\right)\right) \]
      5. *-commutative39.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 \left(\left(\color{blue}{{x1}^{2} \cdot \left(3 - -2 \cdot x2\right)} + -2 \cdot x2\right) - x1\right)\right) \]
      6. fma-def39.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 \left(\color{blue}{\mathsf{fma}\left({x1}^{2}, 3 - -2 \cdot x2, -2 \cdot x2\right)} - x1\right)\right) \]
      7. unpow239.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 \left(\mathsf{fma}\left(\color{blue}{x1 \cdot x1}, 3 - -2 \cdot x2, -2 \cdot x2\right) - x1\right)\right) \]
      8. cancel-sign-sub-inv39.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 \left(\mathsf{fma}\left(x1 \cdot x1, \color{blue}{3 + \left(--2\right) \cdot x2}, -2 \cdot x2\right) - x1\right)\right) \]
      9. metadata-eval39.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 \left(\mathsf{fma}\left(x1 \cdot x1, 3 + \color{blue}{2} \cdot x2, -2 \cdot x2\right) - x1\right)\right) \]
      10. *-commutative39.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 \left(\mathsf{fma}\left(x1 \cdot x1, 3 + 2 \cdot x2, \color{blue}{x2 \cdot -2}\right) - x1\right)\right) \]
    5. Simplified39.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(\mathsf{fma}\left(x1 \cdot x1, 3 + 2 \cdot x2, x2 \cdot -2\right) - x1\right)}\right) \]
    6. Taylor expanded in x1 around inf 39.7%

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

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

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

        \[\leadsto x1 + 3 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(3 + \color{blue}{\left(--2\right)} \cdot x2\right)\right) \]
      3. cancel-sign-sub-inv65.2%

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

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

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

    if -1.80000000000000007e64 < x1 < 3.70000000000000023e102

    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 85.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 82.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(-1 \cdot x1 + \left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right)\right)}\right) \]
    4. Step-by-step derivation
      1. +-commutative82.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(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) + -1 \cdot x1\right)}\right) \]
      2. neg-mul-182.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 \left(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) + \color{blue}{\left(-x1\right)}\right)\right) \]
      3. unsub-neg82.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(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) - x1\right)}\right) \]
      4. +-commutative82.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 \left(\color{blue}{\left(\left(3 - -2 \cdot x2\right) \cdot {x1}^{2} + -2 \cdot x2\right)} - x1\right)\right) \]
      5. *-commutative82.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 \left(\left(\color{blue}{{x1}^{2} \cdot \left(3 - -2 \cdot x2\right)} + -2 \cdot x2\right) - x1\right)\right) \]
      6. fma-def82.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 \left(\color{blue}{\mathsf{fma}\left({x1}^{2}, 3 - -2 \cdot x2, -2 \cdot x2\right)} - x1\right)\right) \]
      7. unpow282.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 \left(\mathsf{fma}\left(\color{blue}{x1 \cdot x1}, 3 - -2 \cdot x2, -2 \cdot x2\right) - x1\right)\right) \]
      8. cancel-sign-sub-inv82.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 \left(\mathsf{fma}\left(x1 \cdot x1, \color{blue}{3 + \left(--2\right) \cdot x2}, -2 \cdot x2\right) - x1\right)\right) \]
      9. metadata-eval82.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 \left(\mathsf{fma}\left(x1 \cdot x1, 3 + \color{blue}{2} \cdot x2, -2 \cdot x2\right) - x1\right)\right) \]
      10. *-commutative82.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 \left(\mathsf{fma}\left(x1 \cdot x1, 3 + 2 \cdot x2, \color{blue}{x2 \cdot -2}\right) - x1\right)\right) \]
    5. Simplified82.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(\mathsf{fma}\left(x1 \cdot x1, 3 + 2 \cdot x2, x2 \cdot -2\right) - x1\right)}\right) \]
    6. Taylor expanded in x1 around 0 77.1%

      \[\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.70000000000000023e102 < x1

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

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

        \[\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(\left(-2 \cdot x2 + \left(\left(3 - -2 \cdot x2\right) \cdot {x1}^{2} + {x1}^{3}\right)\right) + -1 \cdot x1\right)}\right) \]
      2. neg-mul-180.0%

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

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

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

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

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

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

        \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right) + x1\right) + 3 \cdot \left(\mathsf{fma}\left(x2, -2, x1 \cdot \color{blue}{{x1}^{2}} + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) - x1\right)\right) \]
      9. distribute-rgt-out91.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 \left(\mathsf{fma}\left(x2, -2, \color{blue}{{x1}^{2} \cdot \left(x1 + \left(3 - -2 \cdot x2\right)\right)}\right) - x1\right)\right) \]
      10. unpow291.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 \left(\mathsf{fma}\left(x2, -2, \color{blue}{\left(x1 \cdot x1\right)} \cdot \left(x1 + \left(3 - -2 \cdot x2\right)\right)\right) - x1\right)\right) \]
      11. cancel-sign-sub-inv91.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 \left(\mathsf{fma}\left(x2, -2, \left(x1 \cdot x1\right) \cdot \left(x1 + \color{blue}{\left(3 + \left(--2\right) \cdot x2\right)}\right)\right) - x1\right)\right) \]
      12. metadata-eval91.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 \left(\mathsf{fma}\left(x2, -2, \left(x1 \cdot x1\right) \cdot \left(x1 + \left(3 + \color{blue}{2} \cdot x2\right)\right)\right) - x1\right)\right) \]
    5. Simplified91.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(\mathsf{fma}\left(x2, -2, \left(x1 \cdot x1\right) \cdot \left(x1 + \left(3 + 2 \cdot x2\right)\right)\right) - x1\right)}\right) \]
    6. Taylor expanded in x2 around 0 100.0%

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

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

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

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

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

Alternative 16: 61.7% accurate, 6.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 + 3 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(3 - x2 \cdot -2\right)\right)\\ \mathbf{if}\;x1 \leq -1.65 \cdot 10^{+65}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x1 \leq -5.2 \cdot 10^{-120}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(8 \cdot \left(x2 \cdot x2\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 7.2 \cdot 10^{-13}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\ \mathbf{elif}\;x1 \leq 3.3 \cdot 10^{+184}:\\ \;\;\;\;x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (+ x1 (* 3.0 (* (* x1 x1) (- 3.0 (* x2 -2.0)))))))
   (if (<= x1 -1.65e+65)
     t_0
     (if (<= x1 -5.2e-120)
       (+ x1 (+ (* x2 -6.0) (* x1 (* 8.0 (* x2 x2)))))
       (if (<= x1 7.2e-13)
         (+ x1 (+ (* x2 -6.0) (* x1 -2.0)))
         (if (<= x1 3.3e+184)
           (* x1 (+ 2.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0)))))
           t_0))))))
double code(double x1, double x2) {
	double t_0 = x1 + (3.0 * ((x1 * x1) * (3.0 - (x2 * -2.0))));
	double tmp;
	if (x1 <= -1.65e+65) {
		tmp = t_0;
	} else if (x1 <= -5.2e-120) {
		tmp = x1 + ((x2 * -6.0) + (x1 * (8.0 * (x2 * x2))));
	} else if (x1 <= 7.2e-13) {
		tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
	} else if (x1 <= 3.3e+184) {
		tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(x1, x2)
    real(8), intent (in) :: x1
    real(8), intent (in) :: x2
    real(8) :: t_0
    real(8) :: tmp
    t_0 = x1 + (3.0d0 * ((x1 * x1) * (3.0d0 - (x2 * (-2.0d0)))))
    if (x1 <= (-1.65d+65)) then
        tmp = t_0
    else if (x1 <= (-5.2d-120)) then
        tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (8.0d0 * (x2 * x2))))
    else if (x1 <= 7.2d-13) then
        tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (-2.0d0)))
    else if (x1 <= 3.3d+184) then
        tmp = x1 * (2.0d0 + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))))
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double t_0 = x1 + (3.0 * ((x1 * x1) * (3.0 - (x2 * -2.0))));
	double tmp;
	if (x1 <= -1.65e+65) {
		tmp = t_0;
	} else if (x1 <= -5.2e-120) {
		tmp = x1 + ((x2 * -6.0) + (x1 * (8.0 * (x2 * x2))));
	} else if (x1 <= 7.2e-13) {
		tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
	} else if (x1 <= 3.3e+184) {
		tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x1, x2):
	t_0 = x1 + (3.0 * ((x1 * x1) * (3.0 - (x2 * -2.0))))
	tmp = 0
	if x1 <= -1.65e+65:
		tmp = t_0
	elif x1 <= -5.2e-120:
		tmp = x1 + ((x2 * -6.0) + (x1 * (8.0 * (x2 * x2))))
	elif x1 <= 7.2e-13:
		tmp = x1 + ((x2 * -6.0) + (x1 * -2.0))
	elif x1 <= 3.3e+184:
		tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))
	else:
		tmp = t_0
	return tmp
function code(x1, x2)
	t_0 = Float64(x1 + Float64(3.0 * Float64(Float64(x1 * x1) * Float64(3.0 - Float64(x2 * -2.0)))))
	tmp = 0.0
	if (x1 <= -1.65e+65)
		tmp = t_0;
	elseif (x1 <= -5.2e-120)
		tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(8.0 * Float64(x2 * x2)))));
	elseif (x1 <= 7.2e-13)
		tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * -2.0)));
	elseif (x1 <= 3.3e+184)
		tmp = Float64(x1 * Float64(2.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)))));
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	t_0 = x1 + (3.0 * ((x1 * x1) * (3.0 - (x2 * -2.0))));
	tmp = 0.0;
	if (x1 <= -1.65e+65)
		tmp = t_0;
	elseif (x1 <= -5.2e-120)
		tmp = x1 + ((x2 * -6.0) + (x1 * (8.0 * (x2 * x2))));
	elseif (x1 <= 7.2e-13)
		tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
	elseif (x1 <= 3.3e+184)
		tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(3.0 * N[(N[(x1 * x1), $MachinePrecision] * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.65e+65], t$95$0, If[LessEqual[x1, -5.2e-120], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(8.0 * N[(x2 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 7.2e-13], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 3.3e+184], N[(x1 * N[(2.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x1 < -1.65000000000000012e65 or 3.2999999999999998e184 < x1

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

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

        \[\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(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) + -1 \cdot x1\right)}\right) \]
      2. neg-mul-154.2%

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

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

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

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

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

        \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right) + x1\right) + 3 \cdot \left(\mathsf{fma}\left(\color{blue}{x1 \cdot x1}, 3 - -2 \cdot x2, -2 \cdot x2\right) - x1\right)\right) \]
      8. cancel-sign-sub-inv54.2%

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

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

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

      \[\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(\mathsf{fma}\left(x1 \cdot x1, 3 + 2 \cdot x2, x2 \cdot -2\right) - x1\right)}\right) \]
    6. Taylor expanded in x1 around inf 54.2%

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

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

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

        \[\leadsto x1 + 3 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(3 + \color{blue}{\left(--2\right)} \cdot x2\right)\right) \]
      3. cancel-sign-sub-inv72.5%

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

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

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

    if -1.65000000000000012e65 < x1 < -5.2000000000000002e-120

    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 83.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 81.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(-1 \cdot x1 + \left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right)\right)}\right) \]
    4. Step-by-step derivation
      1. +-commutative81.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(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) + -1 \cdot x1\right)}\right) \]
      2. neg-mul-181.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 \left(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) + \color{blue}{\left(-x1\right)}\right)\right) \]
      3. unsub-neg81.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(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) - x1\right)}\right) \]
      4. +-commutative81.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 \left(\color{blue}{\left(\left(3 - -2 \cdot x2\right) \cdot {x1}^{2} + -2 \cdot x2\right)} - x1\right)\right) \]
      5. *-commutative81.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 \left(\left(\color{blue}{{x1}^{2} \cdot \left(3 - -2 \cdot x2\right)} + -2 \cdot x2\right) - x1\right)\right) \]
      6. fma-def81.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 \left(\color{blue}{\mathsf{fma}\left({x1}^{2}, 3 - -2 \cdot x2, -2 \cdot x2\right)} - x1\right)\right) \]
      7. unpow281.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 \left(\mathsf{fma}\left(\color{blue}{x1 \cdot x1}, 3 - -2 \cdot x2, -2 \cdot x2\right) - x1\right)\right) \]
      8. cancel-sign-sub-inv81.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 \left(\mathsf{fma}\left(x1 \cdot x1, \color{blue}{3 + \left(--2\right) \cdot x2}, -2 \cdot x2\right) - x1\right)\right) \]
      9. metadata-eval81.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 \left(\mathsf{fma}\left(x1 \cdot x1, 3 + \color{blue}{2} \cdot x2, -2 \cdot x2\right) - x1\right)\right) \]
      10. *-commutative81.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 \left(\mathsf{fma}\left(x1 \cdot x1, 3 + 2 \cdot x2, \color{blue}{x2 \cdot -2}\right) - x1\right)\right) \]
    5. Simplified81.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(\mathsf{fma}\left(x1 \cdot x1, 3 + 2 \cdot x2, x2 \cdot -2\right) - x1\right)}\right) \]
    6. Taylor expanded in x1 around 0 83.4%

      \[\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)} \]
    7. Taylor expanded in x2 around inf 63.2%

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

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

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

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

    if -5.2000000000000002e-120 < x1 < 7.1999999999999996e-13

    1. Initial program 99.4%

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

      \[\leadsto x1 + \left(\left(\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.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(-1 \cdot x1 + \left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right)\right)}\right) \]
    4. Step-by-step derivation
      1. +-commutative99.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(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) + -1 \cdot x1\right)}\right) \]
      2. neg-mul-199.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 \left(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) + \color{blue}{\left(-x1\right)}\right)\right) \]
      3. unsub-neg99.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(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) - x1\right)}\right) \]
      4. +-commutative99.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 \left(\color{blue}{\left(\left(3 - -2 \cdot x2\right) \cdot {x1}^{2} + -2 \cdot x2\right)} - x1\right)\right) \]
      5. *-commutative99.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 \left(\left(\color{blue}{{x1}^{2} \cdot \left(3 - -2 \cdot x2\right)} + -2 \cdot x2\right) - x1\right)\right) \]
      6. fma-def99.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 \left(\color{blue}{\mathsf{fma}\left({x1}^{2}, 3 - -2 \cdot x2, -2 \cdot x2\right)} - x1\right)\right) \]
      7. unpow299.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 \left(\mathsf{fma}\left(\color{blue}{x1 \cdot x1}, 3 - -2 \cdot x2, -2 \cdot x2\right) - x1\right)\right) \]
      8. cancel-sign-sub-inv99.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 \left(\mathsf{fma}\left(x1 \cdot x1, \color{blue}{3 + \left(--2\right) \cdot x2}, -2 \cdot x2\right) - x1\right)\right) \]
      9. metadata-eval99.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 \left(\mathsf{fma}\left(x1 \cdot x1, 3 + \color{blue}{2} \cdot x2, -2 \cdot x2\right) - x1\right)\right) \]
      10. *-commutative99.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 \left(\mathsf{fma}\left(x1 \cdot x1, 3 + 2 \cdot x2, \color{blue}{x2 \cdot -2}\right) - x1\right)\right) \]
    5. Simplified99.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(\mathsf{fma}\left(x1 \cdot x1, 3 + 2 \cdot x2, x2 \cdot -2\right) - x1\right)}\right) \]
    6. Taylor expanded in x1 around 0 86.2%

      \[\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)} \]
    7. Taylor expanded in x2 around 0 76.5%

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

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

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

    if 7.1999999999999996e-13 < x1 < 3.2999999999999998e184

    1. Initial program 86.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 31.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 41.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(-2 \cdot x2\right)}\right) \]
    4. Step-by-step derivation
      1. *-commutative41.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) \]
    5. Simplified41.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) \]
    6. Taylor expanded in x1 around inf 41.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -1.65 \cdot 10^{+65}:\\ \;\;\;\;x1 + 3 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(3 - x2 \cdot -2\right)\right)\\ \mathbf{elif}\;x1 \leq -5.2 \cdot 10^{-120}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(8 \cdot \left(x2 \cdot x2\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 7.2 \cdot 10^{-13}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\ \mathbf{elif}\;x1 \leq 3.3 \cdot 10^{+184}:\\ \;\;\;\;x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + 3 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(3 - x2 \cdot -2\right)\right)\\ \end{array} \]

Alternative 17: 61.7% accurate, 6.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 + 3 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(3 - x2 \cdot -2\right)\right)\\ \mathbf{if}\;x1 \leq -6.2 \cdot 10^{+65}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x1 \leq -6.5 \cdot 10^{-120}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(8 \cdot \left(x2 \cdot x2\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 6.4 \cdot 10^{-10}:\\ \;\;\;\;x2 \cdot \left(x1 \cdot -12 - 6\right) + \left(x1 + x1 \cdot -2\right)\\ \mathbf{elif}\;x1 \leq 3.3 \cdot 10^{+184}:\\ \;\;\;\;x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (+ x1 (* 3.0 (* (* x1 x1) (- 3.0 (* x2 -2.0)))))))
   (if (<= x1 -6.2e+65)
     t_0
     (if (<= x1 -6.5e-120)
       (+ x1 (+ (* x2 -6.0) (* x1 (* 8.0 (* x2 x2)))))
       (if (<= x1 6.4e-10)
         (+ (* x2 (- (* x1 -12.0) 6.0)) (+ x1 (* x1 -2.0)))
         (if (<= x1 3.3e+184)
           (* x1 (+ 2.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0)))))
           t_0))))))
double code(double x1, double x2) {
	double t_0 = x1 + (3.0 * ((x1 * x1) * (3.0 - (x2 * -2.0))));
	double tmp;
	if (x1 <= -6.2e+65) {
		tmp = t_0;
	} else if (x1 <= -6.5e-120) {
		tmp = x1 + ((x2 * -6.0) + (x1 * (8.0 * (x2 * x2))));
	} else if (x1 <= 6.4e-10) {
		tmp = (x2 * ((x1 * -12.0) - 6.0)) + (x1 + (x1 * -2.0));
	} else if (x1 <= 3.3e+184) {
		tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(x1, x2)
    real(8), intent (in) :: x1
    real(8), intent (in) :: x2
    real(8) :: t_0
    real(8) :: tmp
    t_0 = x1 + (3.0d0 * ((x1 * x1) * (3.0d0 - (x2 * (-2.0d0)))))
    if (x1 <= (-6.2d+65)) then
        tmp = t_0
    else if (x1 <= (-6.5d-120)) then
        tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (8.0d0 * (x2 * x2))))
    else if (x1 <= 6.4d-10) then
        tmp = (x2 * ((x1 * (-12.0d0)) - 6.0d0)) + (x1 + (x1 * (-2.0d0)))
    else if (x1 <= 3.3d+184) then
        tmp = x1 * (2.0d0 + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))))
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double t_0 = x1 + (3.0 * ((x1 * x1) * (3.0 - (x2 * -2.0))));
	double tmp;
	if (x1 <= -6.2e+65) {
		tmp = t_0;
	} else if (x1 <= -6.5e-120) {
		tmp = x1 + ((x2 * -6.0) + (x1 * (8.0 * (x2 * x2))));
	} else if (x1 <= 6.4e-10) {
		tmp = (x2 * ((x1 * -12.0) - 6.0)) + (x1 + (x1 * -2.0));
	} else if (x1 <= 3.3e+184) {
		tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x1, x2):
	t_0 = x1 + (3.0 * ((x1 * x1) * (3.0 - (x2 * -2.0))))
	tmp = 0
	if x1 <= -6.2e+65:
		tmp = t_0
	elif x1 <= -6.5e-120:
		tmp = x1 + ((x2 * -6.0) + (x1 * (8.0 * (x2 * x2))))
	elif x1 <= 6.4e-10:
		tmp = (x2 * ((x1 * -12.0) - 6.0)) + (x1 + (x1 * -2.0))
	elif x1 <= 3.3e+184:
		tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))
	else:
		tmp = t_0
	return tmp
function code(x1, x2)
	t_0 = Float64(x1 + Float64(3.0 * Float64(Float64(x1 * x1) * Float64(3.0 - Float64(x2 * -2.0)))))
	tmp = 0.0
	if (x1 <= -6.2e+65)
		tmp = t_0;
	elseif (x1 <= -6.5e-120)
		tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(8.0 * Float64(x2 * x2)))));
	elseif (x1 <= 6.4e-10)
		tmp = Float64(Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0)) + Float64(x1 + Float64(x1 * -2.0)));
	elseif (x1 <= 3.3e+184)
		tmp = Float64(x1 * Float64(2.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)))));
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	t_0 = x1 + (3.0 * ((x1 * x1) * (3.0 - (x2 * -2.0))));
	tmp = 0.0;
	if (x1 <= -6.2e+65)
		tmp = t_0;
	elseif (x1 <= -6.5e-120)
		tmp = x1 + ((x2 * -6.0) + (x1 * (8.0 * (x2 * x2))));
	elseif (x1 <= 6.4e-10)
		tmp = (x2 * ((x1 * -12.0) - 6.0)) + (x1 + (x1 * -2.0));
	elseif (x1 <= 3.3e+184)
		tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(3.0 * N[(N[(x1 * x1), $MachinePrecision] * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -6.2e+65], t$95$0, If[LessEqual[x1, -6.5e-120], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(8.0 * N[(x2 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 6.4e-10], N[(N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 3.3e+184], N[(x1 * N[(2.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x1 < -6.19999999999999981e65 or 3.2999999999999998e184 < x1

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

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

        \[\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(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) + -1 \cdot x1\right)}\right) \]
      2. neg-mul-154.2%

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

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

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

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

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

        \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right) + x1\right) + 3 \cdot \left(\mathsf{fma}\left(\color{blue}{x1 \cdot x1}, 3 - -2 \cdot x2, -2 \cdot x2\right) - x1\right)\right) \]
      8. cancel-sign-sub-inv54.2%

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

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

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

      \[\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(\mathsf{fma}\left(x1 \cdot x1, 3 + 2 \cdot x2, x2 \cdot -2\right) - x1\right)}\right) \]
    6. Taylor expanded in x1 around inf 54.2%

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

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

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

        \[\leadsto x1 + 3 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(3 + \color{blue}{\left(--2\right)} \cdot x2\right)\right) \]
      3. cancel-sign-sub-inv72.5%

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

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

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

    if -6.19999999999999981e65 < x1 < -6.50000000000000029e-120

    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 83.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 81.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(-1 \cdot x1 + \left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right)\right)}\right) \]
    4. Step-by-step derivation
      1. +-commutative81.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(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) + -1 \cdot x1\right)}\right) \]
      2. neg-mul-181.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 \left(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) + \color{blue}{\left(-x1\right)}\right)\right) \]
      3. unsub-neg81.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(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) - x1\right)}\right) \]
      4. +-commutative81.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 \left(\color{blue}{\left(\left(3 - -2 \cdot x2\right) \cdot {x1}^{2} + -2 \cdot x2\right)} - x1\right)\right) \]
      5. *-commutative81.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 \left(\left(\color{blue}{{x1}^{2} \cdot \left(3 - -2 \cdot x2\right)} + -2 \cdot x2\right) - x1\right)\right) \]
      6. fma-def81.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 \left(\color{blue}{\mathsf{fma}\left({x1}^{2}, 3 - -2 \cdot x2, -2 \cdot x2\right)} - x1\right)\right) \]
      7. unpow281.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 \left(\mathsf{fma}\left(\color{blue}{x1 \cdot x1}, 3 - -2 \cdot x2, -2 \cdot x2\right) - x1\right)\right) \]
      8. cancel-sign-sub-inv81.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 \left(\mathsf{fma}\left(x1 \cdot x1, \color{blue}{3 + \left(--2\right) \cdot x2}, -2 \cdot x2\right) - x1\right)\right) \]
      9. metadata-eval81.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 \left(\mathsf{fma}\left(x1 \cdot x1, 3 + \color{blue}{2} \cdot x2, -2 \cdot x2\right) - x1\right)\right) \]
      10. *-commutative81.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 \left(\mathsf{fma}\left(x1 \cdot x1, 3 + 2 \cdot x2, \color{blue}{x2 \cdot -2}\right) - x1\right)\right) \]
    5. Simplified81.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(\mathsf{fma}\left(x1 \cdot x1, 3 + 2 \cdot x2, x2 \cdot -2\right) - x1\right)}\right) \]
    6. Taylor expanded in x1 around 0 83.4%

      \[\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)} \]
    7. Taylor expanded in x2 around inf 63.2%

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

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

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

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

    if -6.50000000000000029e-120 < x1 < 6.39999999999999961e-10

    1. Initial program 99.4%

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

      \[\leadsto x1 + \left(\left(\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.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(-1 \cdot x1 + \left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right)\right)}\right) \]
    4. Step-by-step derivation
      1. +-commutative99.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(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) + -1 \cdot x1\right)}\right) \]
      2. neg-mul-199.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 \left(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) + \color{blue}{\left(-x1\right)}\right)\right) \]
      3. unsub-neg99.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(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) - x1\right)}\right) \]
      4. +-commutative99.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 \left(\color{blue}{\left(\left(3 - -2 \cdot x2\right) \cdot {x1}^{2} + -2 \cdot x2\right)} - x1\right)\right) \]
      5. *-commutative99.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 \left(\left(\color{blue}{{x1}^{2} \cdot \left(3 - -2 \cdot x2\right)} + -2 \cdot x2\right) - x1\right)\right) \]
      6. fma-def99.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 \left(\color{blue}{\mathsf{fma}\left({x1}^{2}, 3 - -2 \cdot x2, -2 \cdot x2\right)} - x1\right)\right) \]
      7. unpow299.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 \left(\mathsf{fma}\left(\color{blue}{x1 \cdot x1}, 3 - -2 \cdot x2, -2 \cdot x2\right) - x1\right)\right) \]
      8. cancel-sign-sub-inv99.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 \left(\mathsf{fma}\left(x1 \cdot x1, \color{blue}{3 + \left(--2\right) \cdot x2}, -2 \cdot x2\right) - x1\right)\right) \]
      9. metadata-eval99.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 \left(\mathsf{fma}\left(x1 \cdot x1, 3 + \color{blue}{2} \cdot x2, -2 \cdot x2\right) - x1\right)\right) \]
      10. *-commutative99.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 \left(\mathsf{fma}\left(x1 \cdot x1, 3 + 2 \cdot x2, \color{blue}{x2 \cdot -2}\right) - x1\right)\right) \]
    5. Simplified99.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(\mathsf{fma}\left(x1 \cdot x1, 3 + 2 \cdot x2, x2 \cdot -2\right) - x1\right)}\right) \]
    6. Taylor expanded in x1 around 0 86.2%

      \[\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)} \]
    7. Taylor expanded in x2 around 0 76.5%

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

    if 6.39999999999999961e-10 < x1 < 3.2999999999999998e184

    1. Initial program 86.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 31.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 41.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(-2 \cdot x2\right)}\right) \]
    4. Step-by-step derivation
      1. *-commutative41.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) \]
    5. Simplified41.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) \]
    6. Taylor expanded in x1 around inf 41.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -6.2 \cdot 10^{+65}:\\ \;\;\;\;x1 + 3 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(3 - x2 \cdot -2\right)\right)\\ \mathbf{elif}\;x1 \leq -6.5 \cdot 10^{-120}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(8 \cdot \left(x2 \cdot x2\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 6.4 \cdot 10^{-10}:\\ \;\;\;\;x2 \cdot \left(x1 \cdot -12 - 6\right) + \left(x1 + x1 \cdot -2\right)\\ \mathbf{elif}\;x1 \leq 3.3 \cdot 10^{+184}:\\ \;\;\;\;x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + 3 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(3 - x2 \cdot -2\right)\right)\\ \end{array} \]

Alternative 18: 61.1% accurate, 6.6× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x1 < -4e4 or 3.2999999999999998e184 < x1

    1. Initial program 19.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 5.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 52.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(-1 \cdot x1 + \left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right)\right)}\right) \]
    4. Step-by-step derivation
      1. +-commutative52.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(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) + -1 \cdot x1\right)}\right) \]
      2. neg-mul-152.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 \left(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) + \color{blue}{\left(-x1\right)}\right)\right) \]
      3. unsub-neg52.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(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) - x1\right)}\right) \]
      4. +-commutative52.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 \left(\color{blue}{\left(\left(3 - -2 \cdot x2\right) \cdot {x1}^{2} + -2 \cdot x2\right)} - x1\right)\right) \]
      5. *-commutative52.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 \left(\left(\color{blue}{{x1}^{2} \cdot \left(3 - -2 \cdot x2\right)} + -2 \cdot x2\right) - x1\right)\right) \]
      6. fma-def52.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 \left(\color{blue}{\mathsf{fma}\left({x1}^{2}, 3 - -2 \cdot x2, -2 \cdot x2\right)} - x1\right)\right) \]
      7. unpow252.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 \left(\mathsf{fma}\left(\color{blue}{x1 \cdot x1}, 3 - -2 \cdot x2, -2 \cdot x2\right) - x1\right)\right) \]
      8. cancel-sign-sub-inv52.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 \left(\mathsf{fma}\left(x1 \cdot x1, \color{blue}{3 + \left(--2\right) \cdot x2}, -2 \cdot x2\right) - x1\right)\right) \]
      9. metadata-eval52.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 \left(\mathsf{fma}\left(x1 \cdot x1, 3 + \color{blue}{2} \cdot x2, -2 \cdot x2\right) - x1\right)\right) \]
      10. *-commutative52.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 \left(\mathsf{fma}\left(x1 \cdot x1, 3 + 2 \cdot x2, \color{blue}{x2 \cdot -2}\right) - x1\right)\right) \]
    5. Simplified52.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(\mathsf{fma}\left(x1 \cdot x1, 3 + 2 \cdot x2, x2 \cdot -2\right) - x1\right)}\right) \]
    6. Taylor expanded in x1 around inf 52.6%

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

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

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

        \[\leadsto x1 + 3 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(3 + \color{blue}{\left(--2\right)} \cdot x2\right)\right) \]
      3. cancel-sign-sub-inv66.6%

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

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

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

    if -4e4 < x1 < 1.02e-12

    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.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 x1 around 0 99.3%

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

        \[\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(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) + -1 \cdot x1\right)}\right) \]
      2. neg-mul-199.3%

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

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

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

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

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

        \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right) + x1\right) + 3 \cdot \left(\mathsf{fma}\left(\color{blue}{x1 \cdot x1}, 3 - -2 \cdot x2, -2 \cdot x2\right) - x1\right)\right) \]
      8. cancel-sign-sub-inv99.3%

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

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

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

      \[\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(\mathsf{fma}\left(x1 \cdot x1, 3 + 2 \cdot x2, x2 \cdot -2\right) - x1\right)}\right) \]
    6. Taylor expanded in x1 around 0 88.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)} \]
    7. Taylor expanded in x2 around 0 73.4%

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

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

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

    if 1.02e-12 < x1 < 3.2999999999999998e184

    1. Initial program 86.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 31.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 41.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(-2 \cdot x2\right)}\right) \]
    4. Step-by-step derivation
      1. *-commutative41.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) \]
    5. Simplified41.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) \]
    6. Taylor expanded in x1 around inf 41.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -40000:\\ \;\;\;\;x1 + 3 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(3 - x2 \cdot -2\right)\right)\\ \mathbf{elif}\;x1 \leq 1.02 \cdot 10^{-12}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\ \mathbf{elif}\;x1 \leq 3.3 \cdot 10^{+184}:\\ \;\;\;\;x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + 3 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(3 - x2 \cdot -2\right)\right)\\ \end{array} \]

Alternative 19: 42.5% accurate, 7.4× speedup?

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

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

\mathbf{elif}\;x2 \leq -2.9 \cdot 10^{-151}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x2 \leq 1.6 \cdot 10^{-98}:\\
\;\;\;\;-x1\\

\mathbf{elif}\;x2 \leq 5.5 \cdot 10^{+113}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x2 < -2.3500000000000002e116 or 5.5000000000000001e113 < x2

    1. Initial program 70.1%

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

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

        \[\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(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) + -1 \cdot x1\right)}\right) \]
      2. neg-mul-161.8%

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

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

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

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

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

        \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right) + x1\right) + 3 \cdot \left(\mathsf{fma}\left(\color{blue}{x1 \cdot x1}, 3 - -2 \cdot x2, -2 \cdot x2\right) - x1\right)\right) \]
      8. cancel-sign-sub-inv61.8%

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

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

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

      \[\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(\mathsf{fma}\left(x1 \cdot x1, 3 + 2 \cdot x2, x2 \cdot -2\right) - x1\right)}\right) \]
    6. Taylor expanded in x2 around inf 53.8%

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

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

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

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

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

    if -2.3500000000000002e116 < x2 < -2.90000000000000013e-151 or 1.6e-98 < x2 < 5.5000000000000001e113

    1. Initial program 68.7%

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

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

        \[\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(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) + -1 \cdot x1\right)}\right) \]
      2. neg-mul-168.8%

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

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

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

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

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

        \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right) + x1\right) + 3 \cdot \left(\mathsf{fma}\left(\color{blue}{x1 \cdot x1}, 3 - -2 \cdot x2, -2 \cdot x2\right) - x1\right)\right) \]
      8. cancel-sign-sub-inv68.8%

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

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

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

      \[\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(\mathsf{fma}\left(x1 \cdot x1, 3 + 2 \cdot x2, x2 \cdot -2\right) - x1\right)}\right) \]
    6. Taylor expanded in x1 around 0 43.4%

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

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

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

    if -2.90000000000000013e-151 < x2 < 1.6e-98

    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 0 47.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 80.9%

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

        \[\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(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) + -1 \cdot x1\right)}\right) \]
      2. neg-mul-180.9%

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

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

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

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

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

        \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right) + x1\right) + 3 \cdot \left(\mathsf{fma}\left(\color{blue}{x1 \cdot x1}, 3 - -2 \cdot x2, -2 \cdot x2\right) - x1\right)\right) \]
      8. cancel-sign-sub-inv80.9%

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

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

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

      \[\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(\mathsf{fma}\left(x1 \cdot x1, 3 + 2 \cdot x2, x2 \cdot -2\right) - x1\right)}\right) \]
    6. Taylor expanded in x1 around 0 48.6%

      \[\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)} \]
    7. Taylor expanded in x2 around 0 38.0%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x2 \leq -2.35 \cdot 10^{+116}:\\ \;\;\;\;x1 + \left(x2 \cdot x2\right) \cdot \left(x1 \cdot 8\right)\\ \mathbf{elif}\;x2 \leq -2.9 \cdot 10^{-151}:\\ \;\;\;\;x1 + x2 \cdot -6\\ \mathbf{elif}\;x2 \leq 1.6 \cdot 10^{-98}:\\ \;\;\;\;-x1\\ \mathbf{elif}\;x2 \leq 5.5 \cdot 10^{+113}:\\ \;\;\;\;x1 + x2 \cdot -6\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x2 \cdot x2\right) \cdot \left(x1 \cdot 8\right)\\ \end{array} \]

Alternative 20: 49.1% accurate, 9.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -4.7 \cdot 10^{+112} \lor \neg \left(x2 \leq 8.2 \cdot 10^{+100}\right):\\
\;\;\;\;x1 + \left(x2 \cdot x2\right) \cdot \left(x1 \cdot 8\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x2 < -4.69999999999999997e112 or 8.2000000000000006e100 < x2

    1. Initial program 69.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 65.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 62.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(-1 \cdot x1 + \left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right)\right)}\right) \]
    4. Step-by-step derivation
      1. +-commutative62.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(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) + -1 \cdot x1\right)}\right) \]
      2. neg-mul-162.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 \left(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) + \color{blue}{\left(-x1\right)}\right)\right) \]
      3. unsub-neg62.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(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) - x1\right)}\right) \]
      4. +-commutative62.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 \left(\color{blue}{\left(\left(3 - -2 \cdot x2\right) \cdot {x1}^{2} + -2 \cdot x2\right)} - x1\right)\right) \]
      5. *-commutative62.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 \left(\left(\color{blue}{{x1}^{2} \cdot \left(3 - -2 \cdot x2\right)} + -2 \cdot x2\right) - x1\right)\right) \]
      6. fma-def62.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 \left(\color{blue}{\mathsf{fma}\left({x1}^{2}, 3 - -2 \cdot x2, -2 \cdot x2\right)} - x1\right)\right) \]
      7. unpow262.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 \left(\mathsf{fma}\left(\color{blue}{x1 \cdot x1}, 3 - -2 \cdot x2, -2 \cdot x2\right) - x1\right)\right) \]
      8. cancel-sign-sub-inv62.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 \left(\mathsf{fma}\left(x1 \cdot x1, \color{blue}{3 + \left(--2\right) \cdot x2}, -2 \cdot x2\right) - x1\right)\right) \]
      9. metadata-eval62.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 \left(\mathsf{fma}\left(x1 \cdot x1, 3 + \color{blue}{2} \cdot x2, -2 \cdot x2\right) - x1\right)\right) \]
      10. *-commutative62.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 \left(\mathsf{fma}\left(x1 \cdot x1, 3 + 2 \cdot x2, \color{blue}{x2 \cdot -2}\right) - x1\right)\right) \]
    5. Simplified62.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(\mathsf{fma}\left(x1 \cdot x1, 3 + 2 \cdot x2, x2 \cdot -2\right) - x1\right)}\right) \]
    6. Taylor expanded in x2 around inf 53.7%

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

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

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

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

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

    if -4.69999999999999997e112 < x2 < 8.2000000000000006e100

    1. Initial program 67.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 49.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 74.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(-1 \cdot x1 + \left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right)\right)}\right) \]
    4. Step-by-step derivation
      1. +-commutative74.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(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) + -1 \cdot x1\right)}\right) \]
      2. neg-mul-174.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 \left(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) + \color{blue}{\left(-x1\right)}\right)\right) \]
      3. unsub-neg74.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(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) - x1\right)}\right) \]
      4. +-commutative74.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 \left(\color{blue}{\left(\left(3 - -2 \cdot x2\right) \cdot {x1}^{2} + -2 \cdot x2\right)} - x1\right)\right) \]
      5. *-commutative74.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 \left(\left(\color{blue}{{x1}^{2} \cdot \left(3 - -2 \cdot x2\right)} + -2 \cdot x2\right) - x1\right)\right) \]
      6. fma-def74.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 \left(\color{blue}{\mathsf{fma}\left({x1}^{2}, 3 - -2 \cdot x2, -2 \cdot x2\right)} - x1\right)\right) \]
      7. unpow274.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 \left(\mathsf{fma}\left(\color{blue}{x1 \cdot x1}, 3 - -2 \cdot x2, -2 \cdot x2\right) - x1\right)\right) \]
      8. cancel-sign-sub-inv74.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 \left(\mathsf{fma}\left(x1 \cdot x1, \color{blue}{3 + \left(--2\right) \cdot x2}, -2 \cdot x2\right) - x1\right)\right) \]
      9. metadata-eval74.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 \left(\mathsf{fma}\left(x1 \cdot x1, 3 + \color{blue}{2} \cdot x2, -2 \cdot x2\right) - x1\right)\right) \]
      10. *-commutative74.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 \left(\mathsf{fma}\left(x1 \cdot x1, 3 + 2 \cdot x2, \color{blue}{x2 \cdot -2}\right) - x1\right)\right) \]
    5. Simplified74.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(\mathsf{fma}\left(x1 \cdot x1, 3 + 2 \cdot x2, x2 \cdot -2\right) - x1\right)}\right) \]
    6. Taylor expanded in x1 around 0 51.0%

      \[\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)} \]
    7. Taylor expanded in x2 around 0 49.0%

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

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

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

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

Alternative 21: 31.4% accurate, 13.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -2.3 \cdot 10^{-149} \lor \neg \left(x2 \leq 8 \cdot 10^{-99}\right):\\
\;\;\;\;x1 + x2 \cdot -6\\

\mathbf{else}:\\
\;\;\;\;-x1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x2 < -2.3e-149 or 8.0000000000000002e-99 < x2

    1. Initial program 69.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 58.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 65.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(-1 \cdot x1 + \left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right)\right)}\right) \]
    4. Step-by-step derivation
      1. +-commutative65.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(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) + -1 \cdot x1\right)}\right) \]
      2. neg-mul-165.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 \left(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) + \color{blue}{\left(-x1\right)}\right)\right) \]
      3. unsub-neg65.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(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) - x1\right)}\right) \]
      4. +-commutative65.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 \left(\color{blue}{\left(\left(3 - -2 \cdot x2\right) \cdot {x1}^{2} + -2 \cdot x2\right)} - x1\right)\right) \]
      5. *-commutative65.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 \left(\left(\color{blue}{{x1}^{2} \cdot \left(3 - -2 \cdot x2\right)} + -2 \cdot x2\right) - x1\right)\right) \]
      6. fma-def65.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 \left(\color{blue}{\mathsf{fma}\left({x1}^{2}, 3 - -2 \cdot x2, -2 \cdot x2\right)} - x1\right)\right) \]
      7. unpow265.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 \left(\mathsf{fma}\left(\color{blue}{x1 \cdot x1}, 3 - -2 \cdot x2, -2 \cdot x2\right) - x1\right)\right) \]
      8. cancel-sign-sub-inv65.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 \left(\mathsf{fma}\left(x1 \cdot x1, \color{blue}{3 + \left(--2\right) \cdot x2}, -2 \cdot x2\right) - x1\right)\right) \]
      9. metadata-eval65.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 \left(\mathsf{fma}\left(x1 \cdot x1, 3 + \color{blue}{2} \cdot x2, -2 \cdot x2\right) - x1\right)\right) \]
      10. *-commutative65.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 \left(\mathsf{fma}\left(x1 \cdot x1, 3 + 2 \cdot x2, \color{blue}{x2 \cdot -2}\right) - x1\right)\right) \]
    5. Simplified65.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(\mathsf{fma}\left(x1 \cdot x1, 3 + 2 \cdot x2, x2 \cdot -2\right) - x1\right)}\right) \]
    6. Taylor expanded in x1 around 0 28.8%

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

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

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

    if -2.3e-149 < x2 < 8.0000000000000002e-99

    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 0 47.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 80.9%

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

        \[\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(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) + -1 \cdot x1\right)}\right) \]
      2. neg-mul-180.9%

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

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

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

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

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

        \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right) + x1\right) + 3 \cdot \left(\mathsf{fma}\left(\color{blue}{x1 \cdot x1}, 3 - -2 \cdot x2, -2 \cdot x2\right) - x1\right)\right) \]
      8. cancel-sign-sub-inv80.9%

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

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

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

      \[\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(\mathsf{fma}\left(x1 \cdot x1, 3 + 2 \cdot x2, x2 \cdot -2\right) - x1\right)}\right) \]
    6. Taylor expanded in x1 around 0 48.6%

      \[\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)} \]
    7. Taylor expanded in x2 around 0 38.0%

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

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

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

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

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

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

Alternative 22: 14.1% 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 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 55.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 70.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(-1 \cdot x1 + \left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right)\right)}\right) \]
  4. Step-by-step derivation
    1. +-commutative70.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(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) + -1 \cdot x1\right)}\right) \]
    2. neg-mul-170.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 \left(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) + \color{blue}{\left(-x1\right)}\right)\right) \]
    3. unsub-neg70.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(\left(-2 \cdot x2 + \left(3 - -2 \cdot x2\right) \cdot {x1}^{2}\right) - x1\right)}\right) \]
    4. +-commutative70.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 \left(\color{blue}{\left(\left(3 - -2 \cdot x2\right) \cdot {x1}^{2} + -2 \cdot x2\right)} - x1\right)\right) \]
    5. *-commutative70.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 \left(\left(\color{blue}{{x1}^{2} \cdot \left(3 - -2 \cdot x2\right)} + -2 \cdot x2\right) - x1\right)\right) \]
    6. fma-def70.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 \left(\color{blue}{\mathsf{fma}\left({x1}^{2}, 3 - -2 \cdot x2, -2 \cdot x2\right)} - x1\right)\right) \]
    7. unpow270.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 \left(\mathsf{fma}\left(\color{blue}{x1 \cdot x1}, 3 - -2 \cdot x2, -2 \cdot x2\right) - x1\right)\right) \]
    8. cancel-sign-sub-inv70.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 \left(\mathsf{fma}\left(x1 \cdot x1, \color{blue}{3 + \left(--2\right) \cdot x2}, -2 \cdot x2\right) - x1\right)\right) \]
    9. metadata-eval70.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 \left(\mathsf{fma}\left(x1 \cdot x1, 3 + \color{blue}{2} \cdot x2, -2 \cdot x2\right) - x1\right)\right) \]
    10. *-commutative70.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 \left(\mathsf{fma}\left(x1 \cdot x1, 3 + 2 \cdot x2, \color{blue}{x2 \cdot -2}\right) - x1\right)\right) \]
  5. Simplified70.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(\mathsf{fma}\left(x1 \cdot x1, 3 + 2 \cdot x2, x2 \cdot -2\right) - x1\right)}\right) \]
  6. Taylor expanded in x1 around 0 54.2%

    \[\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)} \]
  7. Taylor expanded in x2 around 0 15.6%

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

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

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

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

    \[\leadsto \color{blue}{-x1} \]
  10. Final simplification15.6%

    \[\leadsto -x1 \]

Reproduce

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