Rosa's FloatVsDoubleBenchmark

Percentage Accurate: 70.1% → 99.5%
Time: 1.8min
Alternatives: 29
Speedup: 3.4×

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 29 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 70.1% accurate, 1.0× speedup?

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

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

Alternative 1: 99.5% accurate, 0.1× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;x1 + 6 \cdot {x1}^{4}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < +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.6%

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

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

    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. Add Preprocessing
    3. 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) \]
    4. 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(-2 \cdot x2 + -1 \cdot x1\right)}\right) \]
    5. Step-by-step derivation
      1. 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) \]
      2. 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) \]
      3. *-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) \]
    6. 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) \]
    7. 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) \]
    8. Taylor expanded in x1 around inf 100.0%

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

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

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 := \left(t\_1 + 2 \cdot x2\right) - x1\\ t_3 := -1 - x1 \cdot x1\\ t_4 := x1 \cdot x1 + 1\\ t_5 := \frac{t\_2}{t\_4}\\ t_6 := \left(x1 \cdot 2\right) \cdot t\_5\\ t_7 := \left(x1 \cdot x1\right) \cdot \left(t\_5 \cdot 4 - 6\right)\\ \mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t\_4 \cdot \left(t\_6 \cdot \left(t\_5 - 3\right) + t\_7\right) + t\_1 \cdot t\_5\right) + t\_0\right)\right) + 3 \cdot \frac{x1 + \left(2 \cdot x2 - t\_1\right)}{t\_3}\right) \leq \infty:\\ \;\;\;\;x1 + \left(\left(x1 + \left(t\_0 - \left(t\_4 \cdot \left(t\_6 \cdot \left(3 + \frac{t\_2}{t\_3}\right) - t\_7\right) - 3 \cdot t\_1\right)\right)\right) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + 6 \cdot {x1}^{4}\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (* x1 (* x1 x1)))
        (t_1 (* x1 (* x1 3.0)))
        (t_2 (- (+ t_1 (* 2.0 x2)) x1))
        (t_3 (- -1.0 (* x1 x1)))
        (t_4 (+ (* x1 x1) 1.0))
        (t_5 (/ t_2 t_4))
        (t_6 (* (* x1 2.0) t_5))
        (t_7 (* (* x1 x1) (- (* t_5 4.0) 6.0))))
   (if (<=
        (+
         x1
         (+
          (+ x1 (+ (+ (* t_4 (+ (* t_6 (- t_5 3.0)) t_7)) (* t_1 t_5)) t_0))
          (* 3.0 (/ (+ x1 (- (* 2.0 x2) t_1)) t_3))))
        INFINITY)
     (+
      x1
      (+
       (+
        x1
        (- t_0 (- (* t_4 (- (* t_6 (+ 3.0 (/ t_2 t_3))) t_7)) (* 3.0 t_1))))
       (* 3.0 (- (* x2 -2.0) x1))))
     (+ x1 (* 6.0 (pow x1 4.0))))))
double code(double x1, double x2) {
	double t_0 = x1 * (x1 * x1);
	double t_1 = x1 * (x1 * 3.0);
	double t_2 = (t_1 + (2.0 * x2)) - x1;
	double t_3 = -1.0 - (x1 * x1);
	double t_4 = (x1 * x1) + 1.0;
	double t_5 = t_2 / t_4;
	double t_6 = (x1 * 2.0) * t_5;
	double t_7 = (x1 * x1) * ((t_5 * 4.0) - 6.0);
	double tmp;
	if ((x1 + ((x1 + (((t_4 * ((t_6 * (t_5 - 3.0)) + t_7)) + (t_1 * t_5)) + t_0)) + (3.0 * ((x1 + ((2.0 * x2) - t_1)) / t_3)))) <= ((double) INFINITY)) {
		tmp = x1 + ((x1 + (t_0 - ((t_4 * ((t_6 * (3.0 + (t_2 / t_3))) - t_7)) - (3.0 * t_1)))) + (3.0 * ((x2 * -2.0) - x1)));
	} else {
		tmp = x1 + (6.0 * pow(x1, 4.0));
	}
	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 = (t_1 + (2.0 * x2)) - x1;
	double t_3 = -1.0 - (x1 * x1);
	double t_4 = (x1 * x1) + 1.0;
	double t_5 = t_2 / t_4;
	double t_6 = (x1 * 2.0) * t_5;
	double t_7 = (x1 * x1) * ((t_5 * 4.0) - 6.0);
	double tmp;
	if ((x1 + ((x1 + (((t_4 * ((t_6 * (t_5 - 3.0)) + t_7)) + (t_1 * t_5)) + t_0)) + (3.0 * ((x1 + ((2.0 * x2) - t_1)) / t_3)))) <= Double.POSITIVE_INFINITY) {
		tmp = x1 + ((x1 + (t_0 - ((t_4 * ((t_6 * (3.0 + (t_2 / t_3))) - t_7)) - (3.0 * t_1)))) + (3.0 * ((x2 * -2.0) - x1)));
	} else {
		tmp = x1 + (6.0 * Math.pow(x1, 4.0));
	}
	return tmp;
}
def code(x1, x2):
	t_0 = x1 * (x1 * x1)
	t_1 = x1 * (x1 * 3.0)
	t_2 = (t_1 + (2.0 * x2)) - x1
	t_3 = -1.0 - (x1 * x1)
	t_4 = (x1 * x1) + 1.0
	t_5 = t_2 / t_4
	t_6 = (x1 * 2.0) * t_5
	t_7 = (x1 * x1) * ((t_5 * 4.0) - 6.0)
	tmp = 0
	if (x1 + ((x1 + (((t_4 * ((t_6 * (t_5 - 3.0)) + t_7)) + (t_1 * t_5)) + t_0)) + (3.0 * ((x1 + ((2.0 * x2) - t_1)) / t_3)))) <= math.inf:
		tmp = x1 + ((x1 + (t_0 - ((t_4 * ((t_6 * (3.0 + (t_2 / t_3))) - t_7)) - (3.0 * t_1)))) + (3.0 * ((x2 * -2.0) - x1)))
	else:
		tmp = x1 + (6.0 * math.pow(x1, 4.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(Float64(t_1 + Float64(2.0 * x2)) - x1)
	t_3 = Float64(-1.0 - Float64(x1 * x1))
	t_4 = Float64(Float64(x1 * x1) + 1.0)
	t_5 = Float64(t_2 / t_4)
	t_6 = Float64(Float64(x1 * 2.0) * t_5)
	t_7 = Float64(Float64(x1 * x1) * Float64(Float64(t_5 * 4.0) - 6.0))
	tmp = 0.0
	if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_4 * Float64(Float64(t_6 * Float64(t_5 - 3.0)) + t_7)) + Float64(t_1 * t_5)) + t_0)) + Float64(3.0 * Float64(Float64(x1 + Float64(Float64(2.0 * x2) - t_1)) / t_3)))) <= Inf)
		tmp = Float64(x1 + Float64(Float64(x1 + Float64(t_0 - Float64(Float64(t_4 * Float64(Float64(t_6 * Float64(3.0 + Float64(t_2 / t_3))) - t_7)) - Float64(3.0 * t_1)))) + Float64(3.0 * Float64(Float64(x2 * -2.0) - x1))));
	else
		tmp = Float64(x1 + Float64(6.0 * (x1 ^ 4.0)));
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	t_0 = x1 * (x1 * x1);
	t_1 = x1 * (x1 * 3.0);
	t_2 = (t_1 + (2.0 * x2)) - x1;
	t_3 = -1.0 - (x1 * x1);
	t_4 = (x1 * x1) + 1.0;
	t_5 = t_2 / t_4;
	t_6 = (x1 * 2.0) * t_5;
	t_7 = (x1 * x1) * ((t_5 * 4.0) - 6.0);
	tmp = 0.0;
	if ((x1 + ((x1 + (((t_4 * ((t_6 * (t_5 - 3.0)) + t_7)) + (t_1 * t_5)) + t_0)) + (3.0 * ((x1 + ((2.0 * x2) - t_1)) / t_3)))) <= Inf)
		tmp = x1 + ((x1 + (t_0 - ((t_4 * ((t_6 * (3.0 + (t_2 / t_3))) - t_7)) - (3.0 * t_1)))) + (3.0 * ((x2 * -2.0) - x1)));
	else
		tmp = x1 + (6.0 * (x1 ^ 4.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[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$3 = N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$2 / t$95$4), $MachinePrecision]}, Block[{t$95$6 = N[(N[(x1 * 2.0), $MachinePrecision] * t$95$5), $MachinePrecision]}, Block[{t$95$7 = N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$5 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$4 * N[(N[(t$95$6 * N[(t$95$5 - 3.0), $MachinePrecision]), $MachinePrecision] + t$95$7), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * t$95$5), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x1 + N[(N[(2.0 * x2), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(N[(x1 + N[(t$95$0 - N[(N[(t$95$4 * N[(N[(t$95$6 * N[(3.0 + N[(t$95$2 / t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$7), $MachinePrecision]), $MachinePrecision] - N[(3.0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(6.0 * N[Power[x1, 4.0], $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 := \left(t\_1 + 2 \cdot x2\right) - x1\\
t_3 := -1 - x1 \cdot x1\\
t_4 := x1 \cdot x1 + 1\\
t_5 := \frac{t\_2}{t\_4}\\
t_6 := \left(x1 \cdot 2\right) \cdot t\_5\\
t_7 := \left(x1 \cdot x1\right) \cdot \left(t\_5 \cdot 4 - 6\right)\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t\_4 \cdot \left(t\_6 \cdot \left(t\_5 - 3\right) + t\_7\right) + t\_1 \cdot t\_5\right) + t\_0\right)\right) + 3 \cdot \frac{x1 + \left(2 \cdot x2 - t\_1\right)}{t\_3}\right) \leq \infty:\\
\;\;\;\;x1 + \left(\left(x1 + \left(t\_0 - \left(t\_4 \cdot \left(t\_6 \cdot \left(3 + \frac{t\_2}{t\_3}\right) - t\_7\right) - 3 \cdot t\_1\right)\right)\right) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right)\\

\mathbf{else}:\\
\;\;\;\;x1 + 6 \cdot {x1}^{4}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < +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. Add Preprocessing
    3. 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) \]
    4. Taylor expanded in x1 around 0 99.4%

      \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \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) \]
    5. Step-by-step derivation
      1. 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) \]
      2. 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) \]
      3. *-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. 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 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))))

    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. Add Preprocessing
    3. 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) \]
    4. 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(-2 \cdot x2 + -1 \cdot x1\right)}\right) \]
    5. Step-by-step derivation
      1. 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) \]
      2. 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) \]
      3. *-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) \]
    6. 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) \]
    7. 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) \]
    8. Taylor expanded in x1 around inf 100.0%

      \[\leadsto x1 + \color{blue}{6 \cdot {x1}^{4}} \]
  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{x1 + \left(2 \cdot x2 - x1 \cdot \left(x1 \cdot 3\right)\right)}{-1 - x1 \cdot x1}\right) \leq \infty:\\ \;\;\;\;x1 + \left(\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(3 + \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{-1 - x1 \cdot x1}\right) - \left(x1 \cdot x1\right) \cdot \left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} \cdot 4 - 6\right)\right) - 3 \cdot \left(x1 \cdot \left(x1 \cdot 3\right)\right)\right)\right)\right) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + 6 \cdot {x1}^{4}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 95.0% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := 2 \cdot x2 - 3\\
t_2 := \left(t\_0 + 2 \cdot x2\right) - x1\\
t_3 := x2 \cdot \left(3 - 2 \cdot x2\right)\\
t_4 := 3 \cdot \left(x2 \cdot -2 - x1\right)\\
t_5 := x1 \cdot x1 + 1\\
t_6 := 4 \cdot t\_3\\
t_7 := \frac{t\_2}{t\_5}\\
\mathbf{if}\;x1 \leq -5.5 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(t\_4 + \left(x1 - x1 \cdot \left(x1 \cdot \left(\left(2 \cdot \left(t\_1 - x2 \cdot -2\right) + \left(x1 \cdot \left(3 + \left(t\_6 - 2 \cdot \left(\left(1 + \left(2 \cdot \left(x2 \cdot \left(3 + x2 \cdot -2\right)\right) + 3 \cdot t\_1\right)\right) + 2 \cdot t\_3\right)\right)\right) - x2 \cdot 8\right)\right) - 3\right) + t\_6\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 2.5 \cdot 10^{+152}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) - \left(t\_5 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_7\right) \cdot \left(3 + \frac{t\_2}{-1 - x1 \cdot x1}\right) - \left(x1 \cdot x1\right) \cdot \left(t\_7 \cdot 4 - 6\right)\right) - 3 \cdot t\_0\right)\right)\right) + t\_4\right)\\

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


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

    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. Add Preprocessing
    3. 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) \]
    4. 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(-2 \cdot x2 + -1 \cdot x1\right)}\right) \]
    5. Step-by-step derivation
      1. 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) \]
      2. 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) \]
      3. *-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) \]
    6. 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) \]
    7. Taylor expanded in x1 around 0 80.0%

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

    if -5.49999999999999981e102 < x1 < 2.5e152

    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. Add Preprocessing
    3. 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) \]
    4. Taylor expanded in x1 around 0 99.4%

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

    1. Initial program 5.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. Add Preprocessing
    3. Taylor expanded in x1 around inf 5.6%

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

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

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

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

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

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

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

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

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

Alternative 4: 92.5% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
t_0 := 2 \cdot x2 - 3\\
t_1 := 4 \cdot \left(x2 \cdot t\_0\right)\\
t_2 := 3 \cdot \left(x2 \cdot -2 - x1\right)\\
t_3 := x1 \cdot x1 + 1\\
t_4 := 3 - 2 \cdot x2\\
t_5 := x1 \cdot \left(x1 \cdot 3\right)\\
t_6 := \frac{\left(t\_5 + 2 \cdot x2\right) - x1}{t\_3}\\
\mathbf{if}\;x1 \leq -5.5 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(t\_2 + \left(x1 + x1 \cdot \left(t\_1 + x1 \cdot \left(3 + \left(2 \cdot \left(x2 \cdot -2 + t\_4\right) + \left(x2 \cdot 8 + x1 \cdot \left(\left(t\_1 + 2 \cdot \left(\left(1 + \left(2 \cdot \left(x2 \cdot \left(3 + x2 \cdot -2\right)\right) + 3 \cdot t\_0\right)\right) + 2 \cdot \left(x2 \cdot t\_4\right)\right)\right) - 3\right)\right)\right)\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 2.5 \cdot 10^{+152}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_5 - 2 \cdot x2\right) - x1}{t\_3} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot t\_5 + t\_3 \cdot \left(\left(x1 \cdot x1\right) \cdot 6 - \left(\left(x1 \cdot 2\right) \cdot t\_6\right) \cdot \left(3 - t\_6\right)\right)\right)\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;x1 + \left(t\_2 + \left(x1 + x1 \cdot \left(t\_1 + x1 \cdot 9\right)\right)\right)\\


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

    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. Add Preprocessing
    3. 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) \]
    4. 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(-2 \cdot x2 + -1 \cdot x1\right)}\right) \]
    5. Step-by-step derivation
      1. 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) \]
      2. 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) \]
      3. *-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) \]
    6. 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) \]
    7. Taylor expanded in x1 around 0 80.0%

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

    if -5.49999999999999981e102 < x1 < 2.5e152

    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. Add Preprocessing
    3. 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) \]
    4. Taylor expanded in x1 around inf 97.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 \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) \]

    if 2.5e152 < x1

    1. Initial program 5.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. Add Preprocessing
    3. Taylor expanded in x1 around inf 5.6%

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

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

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

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

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

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

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

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

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

Alternative 5: 87.7% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;x1 \leq -0.106:\\
\;\;\;\;x1 + \left(\left(x1 + \left(t\_3 + \left(t\_7 + t\_1 \cdot \left(\left(x1 \cdot x1\right) \cdot 6 - t\_6 \cdot \left(3 - t\_5\right)\right)\right)\right)\right) + 3 \cdot \left(x2 \cdot -2\right)\right)\\

\mathbf{elif}\;x1 \leq 7.5 \cdot 10^{+138}:\\
\;\;\;\;x1 + \left(t\_2 + \left(x1 + \left(t\_3 + \left(t\_7 + t\_1 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(t\_5 \cdot 4 - 6\right) + t\_6 \cdot t\_0\right)\right)\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;x1 + \left(t\_2 + \left(x1 + x1 \cdot \left(4 \cdot \left(x2 \cdot t\_0\right) + x1 \cdot 9\right)\right)\right)\\


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

    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. Add Preprocessing
    3. 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) \]
    4. 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(-2 \cdot x2 + -1 \cdot x1\right)}\right) \]
    5. Step-by-step derivation
      1. 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) \]
      2. 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) \]
      3. *-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) \]
    6. 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) \]
    7. Taylor expanded in x1 around 0 48.8%

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

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

    if -5.49999999999999981e102 < x1 < -0.105999999999999997

    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. Add Preprocessing
    3. Taylor expanded in x1 around inf 99.5%

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

    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. Add Preprocessing
    3. Taylor expanded in x1 around inf 98.2%

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

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

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

    if 7.4999999999999999e138 < x1

    1. Initial program 12.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. Add Preprocessing
    3. Taylor expanded in x1 around inf 12.8%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -5.5 \cdot 10^{+102}:\\ \;\;\;\;x1 - \left(x2 \cdot \left(6 - -3 \cdot \frac{x1}{x2}\right) + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right) - x1 \cdot \left(3 + \left(x2 \cdot 8 - 2 \cdot \left(\left(2 \cdot x2 - 3\right) - x2 \cdot -2\right)\right)\right)\right) - x1\right)\right)\\ \mathbf{elif}\;x1 \leq -0.106:\\ \;\;\;\;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(x1 \cdot x1\right) \cdot 6 - \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(3 - \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right)\right)\right)\right)\right) + 3 \cdot \left(x2 \cdot -2\right)\right)\\ \mathbf{elif}\;x1 \leq 7.5 \cdot 10^{+138}:\\ \;\;\;\;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 \left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} \cdot 4 - 6\right) + \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(2 \cdot x2 - 3\right)\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2 - x1\right) + \left(x1 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) + x1 \cdot 9\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 90.7% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
t_0 := 2 \cdot x2 - 3\\
t_1 := 4 \cdot \left(x2 \cdot t\_0\right)\\
t_2 := 3 \cdot \left(x2 \cdot -2 - x1\right)\\
t_3 := x1 \cdot \left(x1 \cdot 3\right)\\
t_4 := 3 - 2 \cdot x2\\
t_5 := x1 \cdot x1 + 1\\
t_6 := \frac{\left(t\_3 + 2 \cdot x2\right) - x1}{t\_5}\\
\mathbf{if}\;x1 \leq -5 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(t\_2 + \left(x1 + x1 \cdot \left(t\_1 + x1 \cdot \left(3 + \left(2 \cdot \left(x2 \cdot -2 + t\_4\right) + \left(x2 \cdot 8 + x1 \cdot \left(\left(t\_1 + 2 \cdot \left(\left(1 + \left(2 \cdot \left(x2 \cdot \left(3 + x2 \cdot -2\right)\right) + 3 \cdot t\_0\right)\right) + 2 \cdot \left(x2 \cdot t\_4\right)\right)\right) - 3\right)\right)\right)\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 7.5 \cdot 10^{+138}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot t\_3 + t\_5 \cdot \left(\left(x1 \cdot x1\right) \cdot 6 - \left(\left(x1 \cdot 2\right) \cdot t\_6\right) \cdot \left(3 - t\_6\right)\right)\right)\right)\right) + 3 \cdot \left(x2 \cdot -2 + x1 \cdot \left(-1 + x1 \cdot \left(3 - x2 \cdot -2\right)\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;x1 + \left(t\_2 + \left(x1 + x1 \cdot \left(t\_1 + x1 \cdot 9\right)\right)\right)\\


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

    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. Add Preprocessing
    3. 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) \]
    4. 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(-2 \cdot x2 + -1 \cdot x1\right)}\right) \]
    5. Step-by-step derivation
      1. 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) \]
      2. 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) \]
      3. *-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) \]
    6. 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) \]
    7. Taylor expanded in x1 around 0 80.0%

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

    if -5e102 < x1 < 7.4999999999999999e138

    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. Add Preprocessing
    3. 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) \]
    4. Taylor expanded in x1 around inf 97.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 \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) \]
    5. Taylor expanded in x1 around 0 96.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 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 + x1 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right) - 1\right)\right)}\right) \]

    if 7.4999999999999999e138 < x1

    1. Initial program 12.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. Add Preprocessing
    3. Taylor expanded in x1 around inf 12.8%

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

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

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

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

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

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

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

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

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

Alternative 7: 88.9% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;x1 \leq -0.085:\\
\;\;\;\;t\_4\\

\mathbf{elif}\;x1 \leq 3.1 \cdot 10^{-32}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_2 - 2 \cdot x2\right) - x1}{t\_1} + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot -3 + 2 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 2.5 \cdot 10^{+152}:\\
\;\;\;\;t\_4\\

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


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

    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. Add Preprocessing
    3. 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) \]
    4. 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(-2 \cdot x2 + -1 \cdot x1\right)}\right) \]
    5. Step-by-step derivation
      1. 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) \]
      2. 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) \]
      3. *-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) \]
    6. 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) \]
    7. Taylor expanded in x1 around 0 48.8%

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

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

    if -5.49999999999999981e102 < x1 < -0.0850000000000000061 or 3.10000000000000011e-32 < x1 < 2.5e152

    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. Add Preprocessing
    3. Taylor expanded in x1 around inf 99.6%

      \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \color{blue}{3}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    4. Taylor expanded in x1 around inf 97.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 \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) \]
    5. Taylor expanded in x1 around 0 97.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 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) \]
    6. Step-by-step derivation
      1. *-commutative97.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 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) \]
    7. Simplified97.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 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.0850000000000000061 < x1 < 3.10000000000000011e-32

    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. Add Preprocessing
    3. Taylor expanded in x1 around 0 88.4%

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

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

    if 2.5e152 < x1

    1. Initial program 5.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. Add Preprocessing
    3. Taylor expanded in x1 around inf 5.6%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -5.5 \cdot 10^{+102}:\\ \;\;\;\;x1 - \left(x2 \cdot \left(6 - -3 \cdot \frac{x1}{x2}\right) + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right) - x1 \cdot \left(3 + \left(x2 \cdot 8 - 2 \cdot \left(\left(2 \cdot x2 - 3\right) - x2 \cdot -2\right)\right)\right)\right) - x1\right)\right)\\ \mathbf{elif}\;x1 \leq -0.085:\\ \;\;\;\;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(x1 \cdot x1\right) \cdot 6 - \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(3 - \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right)\right)\right)\right)\right) + 3 \cdot \left(x2 \cdot -2\right)\right)\\ \mathbf{elif}\;x1 \leq 3.1 \cdot 10^{-32}:\\ \;\;\;\;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 -3 + 2 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 2.5 \cdot 10^{+152}:\\ \;\;\;\;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(x1 \cdot x1\right) \cdot 6 - \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(3 - \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right)\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 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) + x1 \cdot 9\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 87.4% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;x1 \leq 7.5 \cdot 10^{+138}:\\
\;\;\;\;x1 + \left(t\_1 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot t\_3 + t\_0 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(t\_4 \cdot 4 - 6\right) + \left(t\_4 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2 - x1\right)\right)\right)\right)\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;x1 + \left(t\_1 + \left(x1 + x1 \cdot \left(4 \cdot \left(x2 \cdot t\_2\right) + x1 \cdot 9\right)\right)\right)\\


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

    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. Add Preprocessing
    3. 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) \]
    4. 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(-2 \cdot x2 + -1 \cdot x1\right)}\right) \]
    5. Step-by-step derivation
      1. 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) \]
      2. 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) \]
      3. *-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) \]
    6. 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) \]
    7. Taylor expanded in x1 around 0 48.8%

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

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

    if -5.49999999999999981e102 < x1 < 7.4999999999999999e138

    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. Add Preprocessing
    3. 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) \]
    4. Taylor expanded in x1 around 0 99.4%

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

      \[\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 3\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right) \]
    8. Step-by-step derivation
      1. neg-mul-195.5%

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

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

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

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

    if 7.4999999999999999e138 < x1

    1. Initial program 12.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. Add Preprocessing
    3. Taylor expanded in x1 around inf 12.8%

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

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

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

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

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

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

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

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

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

Alternative 9: 90.2% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
t_0 := 2 \cdot x2 - 3\\
t_1 := x1 \cdot x1 + 1\\
t_2 := 3 \cdot \left(x2 \cdot -2 - x1\right)\\
t_3 := x1 \cdot \left(x1 \cdot 3\right)\\
t_4 := x2 \cdot \left(3 - 2 \cdot x2\right)\\
t_5 := 4 \cdot t\_4\\
t_6 := \frac{\left(t\_3 + 2 \cdot x2\right) - x1}{t\_1}\\
\mathbf{if}\;x1 \leq -5.5 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(t\_2 + \left(x1 - x1 \cdot \left(x1 \cdot \left(\left(2 \cdot \left(t\_0 - x2 \cdot -2\right) + \left(x1 \cdot \left(3 + \left(t\_5 - 2 \cdot \left(\left(1 + \left(2 \cdot \left(x2 \cdot \left(3 + x2 \cdot -2\right)\right) + 3 \cdot t\_0\right)\right) + 2 \cdot t\_4\right)\right)\right) - x2 \cdot 8\right)\right) - 3\right) + t\_5\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 7.5 \cdot 10^{+138}:\\
\;\;\;\;x1 + \left(t\_2 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot t\_3 - t\_1 \cdot \left(\left(t\_6 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(x1 - 2 \cdot x2\right)\right) - \left(x1 \cdot x1\right) \cdot \left(t\_6 \cdot 4 - 6\right)\right)\right)\right)\right)\right)\\

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


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

    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. Add Preprocessing
    3. 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) \]
    4. 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(-2 \cdot x2 + -1 \cdot x1\right)}\right) \]
    5. Step-by-step derivation
      1. 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) \]
      2. 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) \]
      3. *-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) \]
    6. 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) \]
    7. Taylor expanded in x1 around 0 80.0%

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

    if -5.49999999999999981e102 < x1 < 7.4999999999999999e138

    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. Add Preprocessing
    3. 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) \]
    4. Taylor expanded in x1 around 0 99.4%

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

      \[\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 3\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right) \]
    8. Step-by-step derivation
      1. neg-mul-195.5%

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

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

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

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

    if 7.4999999999999999e138 < x1

    1. Initial program 12.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. Add Preprocessing
    3. Taylor expanded in x1 around inf 12.8%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -5.5 \cdot 10^{+102}:\\ \;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2 - x1\right) + \left(x1 - x1 \cdot \left(x1 \cdot \left(\left(2 \cdot \left(\left(2 \cdot x2 - 3\right) - x2 \cdot -2\right) + \left(x1 \cdot \left(3 + \left(4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right) - 2 \cdot \left(\left(1 + \left(2 \cdot \left(x2 \cdot \left(3 + x2 \cdot -2\right)\right) + 3 \cdot \left(2 \cdot x2 - 3\right)\right)\right) + 2 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right)\right)\right) - x2 \cdot 8\right)\right) - 3\right) + 4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 7.5 \cdot 10^{+138}:\\ \;\;\;\;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(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(x1 - 2 \cdot x2\right)\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)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 - \left(3 \cdot \left(x1 - x2 \cdot -2\right) + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right) - x1 \cdot 9\right) - x1\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 86.1% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;x1 \leq -2.4 \cdot 10^{+18}:\\
\;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2 + x1 \cdot \left(-1 + x1 \cdot \left(3 - x2 \cdot -2\right)\right)\right) + t\_3\right)\\

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

\mathbf{elif}\;x1 \leq 2.5 \cdot 10^{+152}:\\
\;\;\;\;x1 + \left(t\_4 + t\_3\right)\\

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


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

    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. Add Preprocessing
    3. 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) \]
    4. 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(-2 \cdot x2 + -1 \cdot x1\right)}\right) \]
    5. Step-by-step derivation
      1. 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) \]
      2. 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) \]
      3. *-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) \]
    6. 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) \]
    7. Taylor expanded in x1 around 0 48.8%

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

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

    if -5.49999999999999981e102 < x1 < -2.4e18

    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. Add Preprocessing
    3. Taylor expanded in x1 around inf 99.5%

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

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

    if -2.4e18 < x1 < 4e7

    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. Add Preprocessing
    3. Taylor expanded in x1 around 0 88.4%

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

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

    if 4e7 < x1 < 2.5e152

    1. Initial program 99.7%

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

    if 2.5e152 < x1

    1. Initial program 5.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. Add Preprocessing
    3. Taylor expanded in x1 around inf 5.6%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -5.5 \cdot 10^{+102}:\\ \;\;\;\;x1 - \left(x2 \cdot \left(6 - -3 \cdot \frac{x1}{x2}\right) + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right) - x1 \cdot \left(3 + \left(x2 \cdot 8 - 2 \cdot \left(\left(2 \cdot x2 - 3\right) - x2 \cdot -2\right)\right)\right)\right) - x1\right)\right)\\ \mathbf{elif}\;x1 \leq -2.4 \cdot 10^{+18}:\\ \;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2 + x1 \cdot \left(-1 + x1 \cdot \left(3 - x2 \cdot -2\right)\right)\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 + \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 0\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 40000000:\\ \;\;\;\;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 -3 + 2 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 2.5 \cdot 10^{+152}:\\ \;\;\;\;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 6 + \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 0\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2 - x1\right) + \left(x1 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) + x1 \cdot 9\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 85.3% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
t_0 := 2 \cdot x2 - 3\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := x1 + \left(3 \cdot \left(x2 \cdot -2 + x1 \cdot \left(-1 + x1 \cdot \left(3 - x2 \cdot -2\right)\right)\right) + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot t\_1 + t\_2 \cdot \left(\left(x1 \cdot x1\right) \cdot 6 + \left(\left(x1 \cdot 2\right) \cdot \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_2}\right) \cdot 0\right)\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -5.5 \cdot 10^{+102}:\\
\;\;\;\;x1 - \left(x2 \cdot \left(6 - -3 \cdot \frac{x1}{x2}\right) + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right) - x1 \cdot \left(3 + \left(x2 \cdot 8 - 2 \cdot \left(t\_0 - x2 \cdot -2\right)\right)\right)\right) - x1\right)\right)\\

\mathbf{elif}\;x1 \leq -2.4 \cdot 10^{+18}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;x1 \leq 36000000:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_2} + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot -3 + 2 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 7.5 \cdot 10^{+138}:\\
\;\;\;\;t\_3\\

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


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

    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. Add Preprocessing
    3. 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) \]
    4. 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(-2 \cdot x2 + -1 \cdot x1\right)}\right) \]
    5. Step-by-step derivation
      1. 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) \]
      2. 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) \]
      3. *-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) \]
    6. 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) \]
    7. Taylor expanded in x1 around 0 48.8%

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

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

    if -5.49999999999999981e102 < x1 < -2.4e18 or 3.6e7 < x1 < 7.4999999999999999e138

    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. Add Preprocessing
    3. Taylor expanded in x1 around inf 99.5%

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

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

    if -2.4e18 < x1 < 3.6e7

    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. Add Preprocessing
    3. Taylor expanded in x1 around 0 88.4%

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

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

    if 7.4999999999999999e138 < x1

    1. Initial program 12.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. Add Preprocessing
    3. Taylor expanded in x1 around inf 12.8%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -5.5 \cdot 10^{+102}:\\ \;\;\;\;x1 - \left(x2 \cdot \left(6 - -3 \cdot \frac{x1}{x2}\right) + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right) - x1 \cdot \left(3 + \left(x2 \cdot 8 - 2 \cdot \left(\left(2 \cdot x2 - 3\right) - x2 \cdot -2\right)\right)\right)\right) - x1\right)\right)\\ \mathbf{elif}\;x1 \leq -2.4 \cdot 10^{+18}:\\ \;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2 + x1 \cdot \left(-1 + x1 \cdot \left(3 - x2 \cdot -2\right)\right)\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 + \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 0\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 36000000:\\ \;\;\;\;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 -3 + 2 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 7.5 \cdot 10^{+138}:\\ \;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2 + x1 \cdot \left(-1 + x1 \cdot \left(3 - x2 \cdot -2\right)\right)\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 + \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 0\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2 - x1\right) + \left(x1 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) + x1 \cdot 9\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 78.5% accurate, 2.4× speedup?

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

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

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

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

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


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

    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. Add Preprocessing
    3. 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) \]
    4. 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(-2 \cdot x2 + -1 \cdot x1\right)}\right) \]
    5. Step-by-step derivation
      1. 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) \]
      2. 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) \]
      3. *-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) \]
    6. 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) \]
    7. Taylor expanded in x1 around 0 70.4%

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

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

    if -2.6999999999999998e161 < x1 < -8.8000000000000005e29

    1. Initial program 54.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. Add Preprocessing
    3. Taylor expanded in x1 around 0 5.6%

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

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

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

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

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

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

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

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

    if -8.8000000000000005e29 < x1 < 6.4999999999999996e108

    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. Add Preprocessing
    3. Taylor expanded in x1 around 0 81.1%

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

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

    if 6.4999999999999996e108 < x1

    1. Initial program 22.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. Add Preprocessing
    3. Taylor expanded in x1 around 0 9.8%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -2.7 \cdot 10^{+161}:\\ \;\;\;\;x1 - \left(3 \cdot \left(x1 - x2 \cdot -2\right) + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right) - x1 \cdot 9\right) - x1\right)\right)\\ \mathbf{elif}\;x1 \leq -8.8 \cdot 10^{+29}:\\ \;\;\;\;x1 + x2 \cdot \left(\left(\frac{x1 + x1 \cdot -3}{x2} - x1 \cdot 12\right) - 6\right)\\ \mathbf{elif}\;x1 \leq 6.5 \cdot 10^{+108}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{x1 + \left(2 \cdot x2 - x1 \cdot \left(x1 \cdot 3\right)\right)}{-1 - x1 \cdot x1} + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot -3 + 2 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 - \left(x1 \cdot \left(2 - \left(x2 \cdot -12 + x1 \cdot \left(x1 \cdot 3 + 3 \cdot \left(3 - x2 \cdot -2\right)\right)\right)\right) - x2 \cdot -6\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 78.9% accurate, 2.5× speedup?

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

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

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

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


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

    1. Initial program 41.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. Add Preprocessing
    3. Taylor expanded in x1 around inf 39.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) \]
    4. Taylor expanded in x1 around 0 41.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) \]
    5. Step-by-step derivation
      1. neg-mul-141.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) \]
      2. unsub-neg41.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) \]
      3. *-commutative41.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) \]
    6. Simplified41.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) \]
    7. Taylor expanded in x1 around 0 40.4%

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

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

    if -2.9999999999999998e-25 < x1 < 6.4999999999999996e108

    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. Add Preprocessing
    3. Taylor expanded in x1 around 0 82.6%

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

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

    if 6.4999999999999996e108 < x1

    1. Initial program 22.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. Add Preprocessing
    3. Taylor expanded in x1 around 0 9.8%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -3 \cdot 10^{-25}:\\ \;\;\;\;x1 - \left(x2 \cdot \left(6 - -3 \cdot \frac{x1}{x2}\right) + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right) - x1 \cdot \left(3 + \left(x2 \cdot 8 - 2 \cdot \left(\left(2 \cdot x2 - 3\right) - x2 \cdot -2\right)\right)\right)\right) - x1\right)\right)\\ \mathbf{elif}\;x1 \leq 6.5 \cdot 10^{+108}:\\ \;\;\;\;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 -3 + 2 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(\left(x2 \cdot -12 + x1 \cdot \left(x1 \cdot 3 + 3 \cdot \left(3 - x2 \cdot -2\right)\right)\right) - 2\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 72.8% accurate, 2.7× speedup?

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

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

\mathbf{elif}\;x1 \leq -3 \cdot 10^{-163}:\\
\;\;\;\;t\_0\\

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

\mathbf{elif}\;x1 \leq 6.5 \cdot 10^{+108}:\\
\;\;\;\;t\_0\\

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


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

    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. Add Preprocessing
    3. Taylor expanded in x1 around 0 3.4%

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

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

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

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

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

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

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

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

    if -2.99999999999999978e30 < x1 < -3.0000000000000002e-163 or 6.39999999999999975e-259 < x1 < 6.4999999999999996e108

    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. Add Preprocessing
    3. Taylor expanded in x1 around 0 81.0%

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

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

    if -3.0000000000000002e-163 < x1 < 6.39999999999999975e-259

    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. Add Preprocessing
    3. Taylor expanded in x1 around 0 79.5%

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

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

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

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

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

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

    if 6.4999999999999996e108 < x1

    1. Initial program 22.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. Add Preprocessing
    3. Taylor expanded in x1 around 0 9.8%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -3 \cdot 10^{+30}:\\ \;\;\;\;x1 + x2 \cdot \left(\left(\frac{x1 + x1 \cdot -3}{x2} - x1 \cdot 12\right) - 6\right)\\ \mathbf{elif}\;x1 \leq -3 \cdot 10^{-163}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 - x1 \cdot \left(2 - 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 6.4 \cdot 10^{-259}:\\ \;\;\;\;x1 - \left(x1 \cdot \left(2 + \left(3 \cdot \left(x1 \cdot \left(x2 \cdot -2 - 3\right)\right) - x2 \cdot -12\right)\right) - x2 \cdot -6\right)\\ \mathbf{elif}\;x1 \leq 6.5 \cdot 10^{+108}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 - x1 \cdot \left(2 - 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 - \left(x1 \cdot \left(2 - \left(x2 \cdot -12 + x1 \cdot \left(x1 \cdot 3 + 3 \cdot \left(3 - x2 \cdot -2\right)\right)\right)\right) - x2 \cdot -6\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 72.9% accurate, 2.7× speedup?

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

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

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

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

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

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


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

    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. Add Preprocessing
    3. Taylor expanded in x1 around 0 3.4%

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

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

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

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

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

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

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

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

    if -2.99999999999999978e30 < x1 < -3.0000000000000002e-163

    1. Initial program 99.1%

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

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

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

    if -3.0000000000000002e-163 < x1 < 3.0999999999999998e-259

    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. Add Preprocessing
    3. Taylor expanded in x1 around 0 79.5%

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

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

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

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

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

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

    if 3.0999999999999998e-259 < x1 < 6.4999999999999996e108

    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. Add Preprocessing
    3. Taylor expanded in x1 around 0 82.8%

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

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

    if 6.4999999999999996e108 < x1

    1. Initial program 22.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. Add Preprocessing
    3. Taylor expanded in x1 around 0 9.8%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -3 \cdot 10^{+30}:\\ \;\;\;\;x1 + x2 \cdot \left(\left(\frac{x1 + x1 \cdot -3}{x2} - x1 \cdot 12\right) - 6\right)\\ \mathbf{elif}\;x1 \leq -3 \cdot 10^{-163}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 - x1 \cdot \left(2 + \left(4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right) + 3 \cdot \left(x1 \cdot \left(x2 \cdot -2 - 3\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 3.1 \cdot 10^{-259}:\\ \;\;\;\;x1 - \left(x1 \cdot \left(2 + \left(3 \cdot \left(x1 \cdot \left(x2 \cdot -2 - 3\right)\right) - x2 \cdot -12\right)\right) - x2 \cdot -6\right)\\ \mathbf{elif}\;x1 \leq 6.5 \cdot 10^{+108}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 - x1 \cdot \left(2 - 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 - \left(x1 \cdot \left(2 - \left(x2 \cdot -12 + x1 \cdot \left(x1 \cdot 3 + 3 \cdot \left(3 - x2 \cdot -2\right)\right)\right)\right) - x2 \cdot -6\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 73.4% accurate, 3.0× speedup?

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

\\
\begin{array}{l}
t_0 := 4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\\
\mathbf{if}\;x1 \leq -2.7 \cdot 10^{+161}:\\
\;\;\;\;x1 - \left(3 \cdot \left(x1 - x2 \cdot -2\right) + \left(x1 \cdot \left(t\_0 - x1 \cdot 9\right) - x1\right)\right)\\

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

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


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

    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. Add Preprocessing
    3. 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) \]
    4. 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(-2 \cdot x2 + -1 \cdot x1\right)}\right) \]
    5. Step-by-step derivation
      1. 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) \]
      2. 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) \]
      3. *-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) \]
    6. 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) \]
    7. Taylor expanded in x1 around 0 70.4%

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

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

    if -2.6999999999999998e161 < x1 < -8.8000000000000005e29

    1. Initial program 54.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. Add Preprocessing
    3. Taylor expanded in x1 around 0 5.6%

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

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

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

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

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

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

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

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

    if -8.8000000000000005e29 < x1

    1. Initial program 81.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. Add Preprocessing
    3. Taylor expanded in x1 around 0 64.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -2.7 \cdot 10^{+161}:\\ \;\;\;\;x1 - \left(3 \cdot \left(x1 - x2 \cdot -2\right) + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right) - x1 \cdot 9\right) - x1\right)\right)\\ \mathbf{elif}\;x1 \leq -8.8 \cdot 10^{+29}:\\ \;\;\;\;x1 + x2 \cdot \left(\left(\frac{x1 + x1 \cdot -3}{x2} - x1 \cdot 12\right) - 6\right)\\ \mathbf{else}:\\ \;\;\;\;x1 - \left(x1 \cdot \left(2 + \left(x1 \cdot \left(3 \cdot \left(x2 \cdot -2 - 3\right) - x1 \cdot 3\right) + 4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right)\right) - x2 \cdot -6\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 58.6% accurate, 3.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\\ t_1 := x1 + \left(x2 \cdot -6 - x1 \cdot \left(2 - t\_0\right)\right)\\ \mathbf{if}\;x1 \leq -3 \cdot 10^{+30}:\\ \;\;\;\;x1 \cdot \left(-1 + x2 \cdot -12\right)\\ \mathbf{elif}\;x1 \leq -1.36 \cdot 10^{-161}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x1 \leq 3.8 \cdot 10^{-260}:\\ \;\;\;\;x2 \cdot -6 - x1\\ \mathbf{elif}\;x1 \leq 9 \cdot 10^{+154}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x1 \leq 3.7 \cdot 10^{+257}:\\ \;\;\;\;x2 \cdot \left(\frac{x1}{x2} - 6\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + x1 \cdot \left(1 + t\_0\right)\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0))))
        (t_1 (+ x1 (- (* x2 -6.0) (* x1 (- 2.0 t_0))))))
   (if (<= x1 -3e+30)
     (* x1 (+ -1.0 (* x2 -12.0)))
     (if (<= x1 -1.36e-161)
       t_1
       (if (<= x1 3.8e-260)
         (- (* x2 -6.0) x1)
         (if (<= x1 9e+154)
           t_1
           (if (<= x1 3.7e+257)
             (* x2 (- (/ x1 x2) 6.0))
             (+ x1 (* x1 (+ 1.0 t_0))))))))))
double code(double x1, double x2) {
	double t_0 = 4.0 * (x2 * ((2.0 * x2) - 3.0));
	double t_1 = x1 + ((x2 * -6.0) - (x1 * (2.0 - t_0)));
	double tmp;
	if (x1 <= -3e+30) {
		tmp = x1 * (-1.0 + (x2 * -12.0));
	} else if (x1 <= -1.36e-161) {
		tmp = t_1;
	} else if (x1 <= 3.8e-260) {
		tmp = (x2 * -6.0) - x1;
	} else if (x1 <= 9e+154) {
		tmp = t_1;
	} else if (x1 <= 3.7e+257) {
		tmp = x2 * ((x1 / x2) - 6.0);
	} else {
		tmp = x1 + (x1 * (1.0 + t_0));
	}
	return tmp;
}
real(8) function code(x1, x2)
    real(8), intent (in) :: x1
    real(8), intent (in) :: x2
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = 4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))
    t_1 = x1 + ((x2 * (-6.0d0)) - (x1 * (2.0d0 - t_0)))
    if (x1 <= (-3d+30)) then
        tmp = x1 * ((-1.0d0) + (x2 * (-12.0d0)))
    else if (x1 <= (-1.36d-161)) then
        tmp = t_1
    else if (x1 <= 3.8d-260) then
        tmp = (x2 * (-6.0d0)) - x1
    else if (x1 <= 9d+154) then
        tmp = t_1
    else if (x1 <= 3.7d+257) then
        tmp = x2 * ((x1 / x2) - 6.0d0)
    else
        tmp = x1 + (x1 * (1.0d0 + t_0))
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double t_0 = 4.0 * (x2 * ((2.0 * x2) - 3.0));
	double t_1 = x1 + ((x2 * -6.0) - (x1 * (2.0 - t_0)));
	double tmp;
	if (x1 <= -3e+30) {
		tmp = x1 * (-1.0 + (x2 * -12.0));
	} else if (x1 <= -1.36e-161) {
		tmp = t_1;
	} else if (x1 <= 3.8e-260) {
		tmp = (x2 * -6.0) - x1;
	} else if (x1 <= 9e+154) {
		tmp = t_1;
	} else if (x1 <= 3.7e+257) {
		tmp = x2 * ((x1 / x2) - 6.0);
	} else {
		tmp = x1 + (x1 * (1.0 + t_0));
	}
	return tmp;
}
def code(x1, x2):
	t_0 = 4.0 * (x2 * ((2.0 * x2) - 3.0))
	t_1 = x1 + ((x2 * -6.0) - (x1 * (2.0 - t_0)))
	tmp = 0
	if x1 <= -3e+30:
		tmp = x1 * (-1.0 + (x2 * -12.0))
	elif x1 <= -1.36e-161:
		tmp = t_1
	elif x1 <= 3.8e-260:
		tmp = (x2 * -6.0) - x1
	elif x1 <= 9e+154:
		tmp = t_1
	elif x1 <= 3.7e+257:
		tmp = x2 * ((x1 / x2) - 6.0)
	else:
		tmp = x1 + (x1 * (1.0 + t_0))
	return tmp
function code(x1, x2)
	t_0 = Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)))
	t_1 = Float64(x1 + Float64(Float64(x2 * -6.0) - Float64(x1 * Float64(2.0 - t_0))))
	tmp = 0.0
	if (x1 <= -3e+30)
		tmp = Float64(x1 * Float64(-1.0 + Float64(x2 * -12.0)));
	elseif (x1 <= -1.36e-161)
		tmp = t_1;
	elseif (x1 <= 3.8e-260)
		tmp = Float64(Float64(x2 * -6.0) - x1);
	elseif (x1 <= 9e+154)
		tmp = t_1;
	elseif (x1 <= 3.7e+257)
		tmp = Float64(x2 * Float64(Float64(x1 / x2) - 6.0));
	else
		tmp = Float64(x1 + Float64(x1 * Float64(1.0 + t_0)));
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	t_0 = 4.0 * (x2 * ((2.0 * x2) - 3.0));
	t_1 = x1 + ((x2 * -6.0) - (x1 * (2.0 - t_0)));
	tmp = 0.0;
	if (x1 <= -3e+30)
		tmp = x1 * (-1.0 + (x2 * -12.0));
	elseif (x1 <= -1.36e-161)
		tmp = t_1;
	elseif (x1 <= 3.8e-260)
		tmp = (x2 * -6.0) - x1;
	elseif (x1 <= 9e+154)
		tmp = t_1;
	elseif (x1 <= 3.7e+257)
		tmp = x2 * ((x1 / x2) - 6.0);
	else
		tmp = x1 + (x1 * (1.0 + t_0));
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := Block[{t$95$0 = N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] - N[(x1 * N[(2.0 - t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -3e+30], N[(x1 * N[(-1.0 + N[(x2 * -12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -1.36e-161], t$95$1, If[LessEqual[x1, 3.8e-260], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision], If[LessEqual[x1, 9e+154], t$95$1, If[LessEqual[x1, 3.7e+257], N[(x2 * N[(N[(x1 / x2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 * N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x1 \leq -1.36 \cdot 10^{-161}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x1 \leq 3.8 \cdot 10^{-260}:\\
\;\;\;\;x2 \cdot -6 - x1\\

\mathbf{elif}\;x1 \leq 9 \cdot 10^{+154}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x1 \leq 3.7 \cdot 10^{+257}:\\
\;\;\;\;x2 \cdot \left(\frac{x1}{x2} - 6\right)\\

\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 + t\_0\right)\\


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

    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. Add Preprocessing
    3. Taylor expanded in x1 around 0 3.4%

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

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

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

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

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

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

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

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

    if -2.99999999999999978e30 < x1 < -1.36e-161 or 3.8000000000000003e-260 < x1 < 9.00000000000000018e154

    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. Add Preprocessing
    3. Taylor expanded in x1 around 0 77.7%

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

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

    if -1.36e-161 < x1 < 3.8000000000000003e-260

    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. Add Preprocessing
    3. Taylor expanded in x1 around inf 99.5%

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

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

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

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

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

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

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

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

    if 9.00000000000000018e154 < x1 < 3.69999999999999991e257

    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. Add Preprocessing
    3. Taylor expanded in x1 around 0 0.0%

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

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

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

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

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

    if 3.69999999999999991e257 < x1

    1. Initial program 0.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -3 \cdot 10^{+30}:\\ \;\;\;\;x1 \cdot \left(-1 + x2 \cdot -12\right)\\ \mathbf{elif}\;x1 \leq -1.36 \cdot 10^{-161}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 - x1 \cdot \left(2 - 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 3.8 \cdot 10^{-260}:\\ \;\;\;\;x2 \cdot -6 - x1\\ \mathbf{elif}\;x1 \leq 9 \cdot 10^{+154}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 - x1 \cdot \left(2 - 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 3.7 \cdot 10^{+257}:\\ \;\;\;\;x2 \cdot \left(\frac{x1}{x2} - 6\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 64.4% accurate, 3.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 + x2 \cdot \left(\left(\frac{x1 + x1 \cdot -3}{x2} - x1 \cdot 12\right) - 6\right)\\ t_1 := 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\\ t_2 := x1 + \left(x2 \cdot -6 - x1 \cdot \left(2 - t\_1\right)\right)\\ \mathbf{if}\;x1 \leq -3 \cdot 10^{+30}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x1 \leq -1.5 \cdot 10^{-203}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x1 \leq 6.4 \cdot 10^{-259}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x1 \leq 1.32 \cdot 10^{+155}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x1 \leq 4.4 \cdot 10^{+256}:\\ \;\;\;\;x2 \cdot \left(\frac{x1}{x2} - 6\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + x1 \cdot \left(1 + t\_1\right)\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (+ x1 (* x2 (- (- (/ (+ x1 (* x1 -3.0)) x2) (* x1 12.0)) 6.0))))
        (t_1 (* 4.0 (* x2 (- (* 2.0 x2) 3.0))))
        (t_2 (+ x1 (- (* x2 -6.0) (* x1 (- 2.0 t_1))))))
   (if (<= x1 -3e+30)
     t_0
     (if (<= x1 -1.5e-203)
       t_2
       (if (<= x1 6.4e-259)
         t_0
         (if (<= x1 1.32e+155)
           t_2
           (if (<= x1 4.4e+256)
             (* x2 (- (/ x1 x2) 6.0))
             (+ x1 (* x1 (+ 1.0 t_1))))))))))
double code(double x1, double x2) {
	double t_0 = x1 + (x2 * ((((x1 + (x1 * -3.0)) / x2) - (x1 * 12.0)) - 6.0));
	double t_1 = 4.0 * (x2 * ((2.0 * x2) - 3.0));
	double t_2 = x1 + ((x2 * -6.0) - (x1 * (2.0 - t_1)));
	double tmp;
	if (x1 <= -3e+30) {
		tmp = t_0;
	} else if (x1 <= -1.5e-203) {
		tmp = t_2;
	} else if (x1 <= 6.4e-259) {
		tmp = t_0;
	} else if (x1 <= 1.32e+155) {
		tmp = t_2;
	} else if (x1 <= 4.4e+256) {
		tmp = x2 * ((x1 / x2) - 6.0);
	} else {
		tmp = x1 + (x1 * (1.0 + t_1));
	}
	return tmp;
}
real(8) function code(x1, x2)
    real(8), intent (in) :: x1
    real(8), intent (in) :: x2
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_0 = x1 + (x2 * ((((x1 + (x1 * (-3.0d0))) / x2) - (x1 * 12.0d0)) - 6.0d0))
    t_1 = 4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))
    t_2 = x1 + ((x2 * (-6.0d0)) - (x1 * (2.0d0 - t_1)))
    if (x1 <= (-3d+30)) then
        tmp = t_0
    else if (x1 <= (-1.5d-203)) then
        tmp = t_2
    else if (x1 <= 6.4d-259) then
        tmp = t_0
    else if (x1 <= 1.32d+155) then
        tmp = t_2
    else if (x1 <= 4.4d+256) then
        tmp = x2 * ((x1 / x2) - 6.0d0)
    else
        tmp = x1 + (x1 * (1.0d0 + t_1))
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double t_0 = x1 + (x2 * ((((x1 + (x1 * -3.0)) / x2) - (x1 * 12.0)) - 6.0));
	double t_1 = 4.0 * (x2 * ((2.0 * x2) - 3.0));
	double t_2 = x1 + ((x2 * -6.0) - (x1 * (2.0 - t_1)));
	double tmp;
	if (x1 <= -3e+30) {
		tmp = t_0;
	} else if (x1 <= -1.5e-203) {
		tmp = t_2;
	} else if (x1 <= 6.4e-259) {
		tmp = t_0;
	} else if (x1 <= 1.32e+155) {
		tmp = t_2;
	} else if (x1 <= 4.4e+256) {
		tmp = x2 * ((x1 / x2) - 6.0);
	} else {
		tmp = x1 + (x1 * (1.0 + t_1));
	}
	return tmp;
}
def code(x1, x2):
	t_0 = x1 + (x2 * ((((x1 + (x1 * -3.0)) / x2) - (x1 * 12.0)) - 6.0))
	t_1 = 4.0 * (x2 * ((2.0 * x2) - 3.0))
	t_2 = x1 + ((x2 * -6.0) - (x1 * (2.0 - t_1)))
	tmp = 0
	if x1 <= -3e+30:
		tmp = t_0
	elif x1 <= -1.5e-203:
		tmp = t_2
	elif x1 <= 6.4e-259:
		tmp = t_0
	elif x1 <= 1.32e+155:
		tmp = t_2
	elif x1 <= 4.4e+256:
		tmp = x2 * ((x1 / x2) - 6.0)
	else:
		tmp = x1 + (x1 * (1.0 + t_1))
	return tmp
function code(x1, x2)
	t_0 = Float64(x1 + Float64(x2 * Float64(Float64(Float64(Float64(x1 + Float64(x1 * -3.0)) / x2) - Float64(x1 * 12.0)) - 6.0)))
	t_1 = Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)))
	t_2 = Float64(x1 + Float64(Float64(x2 * -6.0) - Float64(x1 * Float64(2.0 - t_1))))
	tmp = 0.0
	if (x1 <= -3e+30)
		tmp = t_0;
	elseif (x1 <= -1.5e-203)
		tmp = t_2;
	elseif (x1 <= 6.4e-259)
		tmp = t_0;
	elseif (x1 <= 1.32e+155)
		tmp = t_2;
	elseif (x1 <= 4.4e+256)
		tmp = Float64(x2 * Float64(Float64(x1 / x2) - 6.0));
	else
		tmp = Float64(x1 + Float64(x1 * Float64(1.0 + t_1)));
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	t_0 = x1 + (x2 * ((((x1 + (x1 * -3.0)) / x2) - (x1 * 12.0)) - 6.0));
	t_1 = 4.0 * (x2 * ((2.0 * x2) - 3.0));
	t_2 = x1 + ((x2 * -6.0) - (x1 * (2.0 - t_1)));
	tmp = 0.0;
	if (x1 <= -3e+30)
		tmp = t_0;
	elseif (x1 <= -1.5e-203)
		tmp = t_2;
	elseif (x1 <= 6.4e-259)
		tmp = t_0;
	elseif (x1 <= 1.32e+155)
		tmp = t_2;
	elseif (x1 <= 4.4e+256)
		tmp = x2 * ((x1 / x2) - 6.0);
	else
		tmp = x1 + (x1 * (1.0 + t_1));
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(x2 * N[(N[(N[(N[(x1 + N[(x1 * -3.0), $MachinePrecision]), $MachinePrecision] / x2), $MachinePrecision] - N[(x1 * 12.0), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] - N[(x1 * N[(2.0 - t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -3e+30], t$95$0, If[LessEqual[x1, -1.5e-203], t$95$2, If[LessEqual[x1, 6.4e-259], t$95$0, If[LessEqual[x1, 1.32e+155], t$95$2, If[LessEqual[x1, 4.4e+256], N[(x2 * N[(N[(x1 / x2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 * N[(1.0 + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x1 + x2 \cdot \left(\left(\frac{x1 + x1 \cdot -3}{x2} - x1 \cdot 12\right) - 6\right)\\
t_1 := 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\\
t_2 := x1 + \left(x2 \cdot -6 - x1 \cdot \left(2 - t\_1\right)\right)\\
\mathbf{if}\;x1 \leq -3 \cdot 10^{+30}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;x1 \leq -1.5 \cdot 10^{-203}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;x1 \leq 6.4 \cdot 10^{-259}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;x1 \leq 1.32 \cdot 10^{+155}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;x1 \leq 4.4 \cdot 10^{+256}:\\
\;\;\;\;x2 \cdot \left(\frac{x1}{x2} - 6\right)\\

\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 + t\_1\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x1 < -2.99999999999999978e30 or -1.5000000000000001e-203 < x1 < 6.39999999999999975e-259

    1. Initial program 54.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. Add Preprocessing
    3. Taylor expanded in x1 around 0 27.5%

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

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

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

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

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

      \[\leadsto x1 + \left(\left(4 \cdot \left(x1 \cdot \left(x2 \cdot -3\right)\right) + x1\right) + 3 \cdot \color{blue}{\left(-2 \cdot x2 + -1 \cdot x1\right)}\right) \]
    8. Step-by-step derivation
      1. neg-mul-154.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) \]
      2. unsub-neg54.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) \]
      3. *-commutative54.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) \]
    9. Simplified41.3%

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

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

    if -2.99999999999999978e30 < x1 < -1.5000000000000001e-203 or 6.39999999999999975e-259 < x1 < 1.32e155

    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. Add Preprocessing
    3. Taylor expanded in x1 around 0 78.8%

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

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

    if 1.32e155 < x1 < 4.3999999999999999e256

    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. Add Preprocessing
    3. Taylor expanded in x1 around 0 0.0%

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

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

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

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

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

    if 4.3999999999999999e256 < x1

    1. Initial program 0.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -3 \cdot 10^{+30}:\\ \;\;\;\;x1 + x2 \cdot \left(\left(\frac{x1 + x1 \cdot -3}{x2} - x1 \cdot 12\right) - 6\right)\\ \mathbf{elif}\;x1 \leq -1.5 \cdot 10^{-203}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 - x1 \cdot \left(2 - 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 6.4 \cdot 10^{-259}:\\ \;\;\;\;x1 + x2 \cdot \left(\left(\frac{x1 + x1 \cdot -3}{x2} - x1 \cdot 12\right) - 6\right)\\ \mathbf{elif}\;x1 \leq 1.32 \cdot 10^{+155}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 - x1 \cdot \left(2 - 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 4.4 \cdot 10^{+256}:\\ \;\;\;\;x2 \cdot \left(\frac{x1}{x2} - 6\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 71.9% accurate, 3.4× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x1 < -2.6999999999999998e161 or -2.99999999999999978e30 < x1

    1. Initial program 71.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. Add Preprocessing
    3. Taylor expanded in x1 around inf 70.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) \]
    4. Taylor expanded in x1 around 0 71.5%

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

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

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

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

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

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

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

    if -2.6999999999999998e161 < x1 < -2.99999999999999978e30

    1. Initial program 53.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. Add Preprocessing
    3. Taylor expanded in x1 around 0 5.7%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -2.7 \cdot 10^{+161} \lor \neg \left(x1 \leq -3 \cdot 10^{+30}\right):\\ \;\;\;\;x1 - \left(3 \cdot \left(x1 - x2 \cdot -2\right) + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right) - x1 \cdot 9\right) - x1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + x2 \cdot \left(\left(\frac{x1 + x1 \cdot -3}{x2} - x1 \cdot 12\right) - 6\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 20: 69.7% accurate, 3.8× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 + t\_0\right)\\


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

    1. Initial program 64.2%

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

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

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

    if -1.5 < x2 < 2.4499999999999999e218

    1. Initial program 67.9%

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

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

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

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

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

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

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

    if 2.4499999999999999e218 < x2

    1. Initial program 100.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x2 \leq -1.5:\\ \;\;\;\;x1 + \left(x2 \cdot -6 - x1 \cdot \left(2 - 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\\ \mathbf{elif}\;x2 \leq 2.45 \cdot 10^{+218}:\\ \;\;\;\;x1 - \left(x1 \cdot \left(2 + \left(3 \cdot \left(x1 \cdot \left(x2 \cdot -2 - 3\right)\right) - x2 \cdot -12\right)\right) - x2 \cdot -6\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 21: 51.1% accurate, 4.2× speedup?

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

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

\mathbf{elif}\;x1 \leq 1.3 \cdot 10^{+163} \lor \neg \left(x1 \leq 4.7 \cdot 10^{+254}\right):\\
\;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x1 < 8.99999999999999982e-33

    1. Initial program 76.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. Add Preprocessing
    3. Taylor expanded in x1 around 0 57.4%

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

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

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

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

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

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

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

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

    if 8.99999999999999982e-33 < x1 < 1.3000000000000001e163 or 4.7000000000000001e254 < x1

    1. Initial program 71.2%

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

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

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

    if 1.3000000000000001e163 < x1 < 4.7000000000000001e254

    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. Add Preprocessing
    3. Taylor expanded in x1 around 0 0.0%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq 9 \cdot 10^{-33}:\\ \;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x2 \cdot -12\right)\\ \mathbf{elif}\;x1 \leq 1.3 \cdot 10^{+163} \lor \neg \left(x1 \leq 4.7 \cdot 10^{+254}\right):\\ \;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x2 \cdot \left(\frac{x1}{x2} - 6\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 22: 39.7% accurate, 5.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 \cdot \left(-1 + x2 \cdot -12\right)\\ \mathbf{if}\;x1 \leq -2.8 \cdot 10^{-54}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x1 \leq 2.35 \cdot 10^{-110}:\\ \;\;\;\;x2 \cdot -6\\ \mathbf{elif}\;x1 \leq 2.15 \cdot 10^{+36}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;x2 \cdot \left(\frac{x1}{x2} - 6\right)\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (* x1 (+ -1.0 (* x2 -12.0)))))
   (if (<= x1 -2.8e-54)
     t_0
     (if (<= x1 2.35e-110)
       (* x2 -6.0)
       (if (<= x1 2.15e+36) t_0 (* x2 (- (/ x1 x2) 6.0)))))))
double code(double x1, double x2) {
	double t_0 = x1 * (-1.0 + (x2 * -12.0));
	double tmp;
	if (x1 <= -2.8e-54) {
		tmp = t_0;
	} else if (x1 <= 2.35e-110) {
		tmp = x2 * -6.0;
	} else if (x1 <= 2.15e+36) {
		tmp = t_0;
	} else {
		tmp = x2 * ((x1 / x2) - 6.0);
	}
	return tmp;
}
real(8) function code(x1, x2)
    real(8), intent (in) :: x1
    real(8), intent (in) :: x2
    real(8) :: t_0
    real(8) :: tmp
    t_0 = x1 * ((-1.0d0) + (x2 * (-12.0d0)))
    if (x1 <= (-2.8d-54)) then
        tmp = t_0
    else if (x1 <= 2.35d-110) then
        tmp = x2 * (-6.0d0)
    else if (x1 <= 2.15d+36) then
        tmp = t_0
    else
        tmp = x2 * ((x1 / x2) - 6.0d0)
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double t_0 = x1 * (-1.0 + (x2 * -12.0));
	double tmp;
	if (x1 <= -2.8e-54) {
		tmp = t_0;
	} else if (x1 <= 2.35e-110) {
		tmp = x2 * -6.0;
	} else if (x1 <= 2.15e+36) {
		tmp = t_0;
	} else {
		tmp = x2 * ((x1 / x2) - 6.0);
	}
	return tmp;
}
def code(x1, x2):
	t_0 = x1 * (-1.0 + (x2 * -12.0))
	tmp = 0
	if x1 <= -2.8e-54:
		tmp = t_0
	elif x1 <= 2.35e-110:
		tmp = x2 * -6.0
	elif x1 <= 2.15e+36:
		tmp = t_0
	else:
		tmp = x2 * ((x1 / x2) - 6.0)
	return tmp
function code(x1, x2)
	t_0 = Float64(x1 * Float64(-1.0 + Float64(x2 * -12.0)))
	tmp = 0.0
	if (x1 <= -2.8e-54)
		tmp = t_0;
	elseif (x1 <= 2.35e-110)
		tmp = Float64(x2 * -6.0);
	elseif (x1 <= 2.15e+36)
		tmp = t_0;
	else
		tmp = Float64(x2 * Float64(Float64(x1 / x2) - 6.0));
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	t_0 = x1 * (-1.0 + (x2 * -12.0));
	tmp = 0.0;
	if (x1 <= -2.8e-54)
		tmp = t_0;
	elseif (x1 <= 2.35e-110)
		tmp = x2 * -6.0;
	elseif (x1 <= 2.15e+36)
		tmp = t_0;
	else
		tmp = x2 * ((x1 / x2) - 6.0);
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(-1.0 + N[(x2 * -12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -2.8e-54], t$95$0, If[LessEqual[x1, 2.35e-110], N[(x2 * -6.0), $MachinePrecision], If[LessEqual[x1, 2.15e+36], t$95$0, N[(x2 * N[(N[(x1 / x2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x1 \cdot \left(-1 + x2 \cdot -12\right)\\
\mathbf{if}\;x1 \leq -2.8 \cdot 10^{-54}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;x1 \leq 2.35 \cdot 10^{-110}:\\
\;\;\;\;x2 \cdot -6\\

\mathbf{elif}\;x1 \leq 2.15 \cdot 10^{+36}:\\
\;\;\;\;t\_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x1 < -2.8000000000000002e-54 or 2.34999999999999996e-110 < x1 < 2.15000000000000002e36

    1. Initial program 58.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. Add Preprocessing
    3. Taylor expanded in x1 around 0 33.2%

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

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

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

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

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

      \[\leadsto x1 + \left(\left(4 \cdot \left(x1 \cdot \left(x2 \cdot -3\right)\right) + x1\right) + 3 \cdot \color{blue}{\left(-2 \cdot x2 + -1 \cdot x1\right)}\right) \]
    8. Step-by-step derivation
      1. neg-mul-158.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) \]
      2. unsub-neg58.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) \]
      3. *-commutative58.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) \]
    9. Simplified23.7%

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

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

    if -2.8000000000000002e-54 < x1 < 2.34999999999999996e-110

    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. Add Preprocessing
    3. Taylor expanded in x1 around 0 87.2%

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

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

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

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

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

        \[\leadsto \color{blue}{x2 \cdot -6} \]
    9. Simplified65.9%

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

    if 2.15000000000000002e36 < x1

    1. Initial program 34.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. Add Preprocessing
    3. Taylor expanded in x1 around 0 10.8%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -2.8 \cdot 10^{-54}:\\ \;\;\;\;x1 \cdot \left(-1 + x2 \cdot -12\right)\\ \mathbf{elif}\;x1 \leq 2.35 \cdot 10^{-110}:\\ \;\;\;\;x2 \cdot -6\\ \mathbf{elif}\;x1 \leq 2.15 \cdot 10^{+36}:\\ \;\;\;\;x1 \cdot \left(-1 + x2 \cdot -12\right)\\ \mathbf{else}:\\ \;\;\;\;x2 \cdot \left(\frac{x1}{x2} - 6\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 23: 35.8% accurate, 7.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -2.8 \cdot 10^{-54} \lor \neg \left(x1 \leq 1.5 \cdot 10^{-117}\right):\\
\;\;\;\;x1 \cdot \left(-1 + x2 \cdot -12\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x1 < -2.8000000000000002e-54 or 1.49999999999999996e-117 < x1

    1. Initial program 50.9%

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

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

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

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

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

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

      \[\leadsto x1 + \left(\left(4 \cdot \left(x1 \cdot \left(x2 \cdot -3\right)\right) + x1\right) + 3 \cdot \color{blue}{\left(-2 \cdot x2 + -1 \cdot x1\right)}\right) \]
    8. Step-by-step derivation
      1. neg-mul-151.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) \]
      2. unsub-neg51.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) \]
      3. *-commutative51.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) \]
    9. Simplified21.4%

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

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

    if -2.8000000000000002e-54 < x1 < 1.49999999999999996e-117

    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. Add Preprocessing
    3. Taylor expanded in x1 around 0 87.2%

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

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

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

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

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

        \[\leadsto \color{blue}{x2 \cdot -6} \]
    9. Simplified65.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -2.8 \cdot 10^{-54} \lor \neg \left(x1 \leq 1.5 \cdot 10^{-117}\right):\\ \;\;\;\;x1 \cdot \left(-1 + x2 \cdot -12\right)\\ \mathbf{else}:\\ \;\;\;\;x2 \cdot -6\\ \end{array} \]
  5. Add Preprocessing

Alternative 24: 47.6% accurate, 7.5× speedup?

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

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

\mathbf{elif}\;x1 \leq 3.1 \cdot 10^{-32}:\\
\;\;\;\;x2 \cdot -6 - x1\\

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


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

    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. Add Preprocessing
    3. Taylor expanded in x1 around 0 3.4%

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

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

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

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

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

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

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

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

    if -1.05e30 < x1 < 3.10000000000000011e-32

    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. Add Preprocessing
    3. Taylor expanded in x1 around inf 98.0%

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

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

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

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

    if 3.10000000000000011e-32 < x1

    1. Initial program 46.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. Add Preprocessing
    3. Taylor expanded in x1 around 0 21.8%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -1.05 \cdot 10^{+30}:\\ \;\;\;\;x1 \cdot \left(-1 + x2 \cdot -12\right)\\ \mathbf{elif}\;x1 \leq 3.1 \cdot 10^{-32}:\\ \;\;\;\;x2 \cdot -6 - x1\\ \mathbf{else}:\\ \;\;\;\;x2 \cdot \left(\frac{x1}{x2} - 6\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 25: 48.4% accurate, 7.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x1 < 2.29999999999999996e36

    1. Initial program 77.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. Add Preprocessing
    3. Taylor expanded in x1 around 0 58.1%

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

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

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

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

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

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

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

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

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

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

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

    if 2.29999999999999996e36 < x1

    1. Initial program 34.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. Add Preprocessing
    3. Taylor expanded in x1 around 0 10.8%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq 2.3 \cdot 10^{+36}:\\ \;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x2 \cdot -12\right)\\ \mathbf{else}:\\ \;\;\;\;x2 \cdot \left(\frac{x1}{x2} - 6\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 26: 31.8% accurate, 8.4× speedup?

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

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

\mathbf{elif}\;x2 \leq 9.6 \cdot 10^{-170}:\\
\;\;\;\;-x1\\

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


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

    1. Initial program 66.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. Add Preprocessing
    3. Taylor expanded in x1 around 0 45.6%

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

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

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

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

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

        \[\leadsto \color{blue}{x2 \cdot -6} \]
    9. Simplified31.7%

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

    if -4.8000000000000004e-230 < x2 < 9.5999999999999998e-170

    1. Initial program 65.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. Add Preprocessing
    3. Taylor expanded in x1 around 0 45.3%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-3 \cdot x1 + 2 \cdot x1} \]
    11. Step-by-step derivation
      1. distribute-rgt-out38.6%

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

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

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

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

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

    if 9.5999999999999998e-170 < x2

    1. Initial program 73.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. Add Preprocessing
    3. Taylor expanded in x1 around 0 54.5%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x2 \leq -4.8 \cdot 10^{-230}:\\ \;\;\;\;x2 \cdot -6\\ \mathbf{elif}\;x2 \leq 9.6 \cdot 10^{-170}:\\ \;\;\;\;-x1\\ \mathbf{else}:\\ \;\;\;\;x1 + x2 \cdot -6\\ \end{array} \]
  5. Add Preprocessing

Alternative 27: 31.6% accurate, 9.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -1.55 \cdot 10^{-229} \lor \neg \left(x2 \leq 2.5 \cdot 10^{-164}\right):\\
\;\;\;\;x2 \cdot -6\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x2 < -1.55e-229 or 2.49999999999999981e-164 < x2

    1. Initial program 70.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. Add Preprocessing
    3. Taylor expanded in x1 around 0 49.9%

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

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

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

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

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

        \[\leadsto \color{blue}{x2 \cdot -6} \]
    9. Simplified31.3%

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

    if -1.55e-229 < x2 < 2.49999999999999981e-164

    1. Initial program 63.2%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-3 \cdot x1 + 2 \cdot x1} \]
    11. Step-by-step derivation
      1. distribute-rgt-out37.3%

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

        \[\leadsto x1 \cdot \color{blue}{-1} \]
      3. *-commutative37.3%

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

        \[\leadsto \color{blue}{-x1} \]
    12. Simplified37.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x2 \leq -1.55 \cdot 10^{-229} \lor \neg \left(x2 \leq 2.5 \cdot 10^{-164}\right):\\ \;\;\;\;x2 \cdot -6\\ \mathbf{else}:\\ \;\;\;\;-x1\\ \end{array} \]
  5. Add Preprocessing

Alternative 28: 14.5% 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.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. Add Preprocessing
  3. Taylor expanded in x1 around 0 48.5%

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{-3 \cdot x1 + 2 \cdot x1} \]
  11. Step-by-step derivation
    1. distribute-rgt-out13.3%

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

      \[\leadsto x1 \cdot \color{blue}{-1} \]
    3. *-commutative13.3%

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

      \[\leadsto \color{blue}{-x1} \]
  12. Simplified13.3%

    \[\leadsto \color{blue}{-x1} \]
  13. Final simplification13.3%

    \[\leadsto -x1 \]
  14. Add Preprocessing

Alternative 29: 3.3% accurate, 127.0× speedup?

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

\\
x1
\end{array}
Derivation
  1. Initial program 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. Add Preprocessing
  3. Taylor expanded in x1 around 0 48.5%

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

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

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

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

    \[\leadsto \color{blue}{x1} \]
  8. Final simplification3.2%

    \[\leadsto x1 \]
  9. Add Preprocessing

Reproduce

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