Rosa's FloatVsDoubleBenchmark

Percentage Accurate: 68.2% → 99.4%
Time: 1.4min
Alternatives: 30
Speedup: 3.3×

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 30 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: 68.2% accurate, 1.0× speedup?

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

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

Alternative 1: 99.4% accurate, 0.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \left(\frac{\mathsf{fma}\left(3, {x1}^{2}, x2 \cdot -2\right)}{\mathsf{fma}\left(x1, x1, 1\right)} - \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x1}{\mathsf{fma}\left(x1, x1, 1\right)}\right)} - 1\right)}\right)\right) \]
    9. Step-by-step derivation
      1. expm1-define99.4%

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

      \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \left(\frac{\mathsf{fma}\left(3, {x1}^{2}, x2 \cdot -2\right)}{\mathsf{fma}\left(x1, x1, 1\right)} - \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x1}{\mathsf{fma}\left(x1, x1, 1\right)}\right)\right)}\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 \color{blue}{\frac{-1}{x1}} + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\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}^{4} \cdot \left(6 - 3 \cdot \frac{1}{x1}\right)} \]
    5. Step-by-step derivation
      1. associate-*r/100.0%

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

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

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

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

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

Alternative 2: 99.4% accurate, 0.2× speedup?

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \left(\frac{\mathsf{fma}\left(3, {x1}^{2}, \color{blue}{x2 \cdot -2}\right)}{\mathsf{fma}\left(x1, x1, 1\right)} - \frac{x1}{\mathsf{fma}\left(x1, x1, 1\right)}\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 \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \color{blue}{\left(\frac{\mathsf{fma}\left(3, {x1}^{2}, x2 \cdot -2\right)}{\mathsf{fma}\left(x1, x1, 1\right)} - \frac{x1}{\mathsf{fma}\left(x1, x1, 1\right)}\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 \color{blue}{\frac{-1}{x1}} + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\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}^{4} \cdot \left(6 - 3 \cdot \frac{1}{x1}\right)} \]
    5. Step-by-step derivation
      1. associate-*r/100.0%

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

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

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

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

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

Alternative 3: 99.4% accurate, 0.5× speedup?

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

\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

    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 \color{blue}{\frac{-1}{x1}} + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\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}^{4} \cdot \left(6 - 3 \cdot \frac{1}{x1}\right)} \]
    5. Step-by-step derivation
      1. associate-*r/100.0%

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

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

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

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

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

Alternative 4: 96.7% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;x1 \leq 3.6 \cdot 10^{+48}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{x1 - \left(t\_0 - 2 \cdot x2\right)}{-1 - x1 \cdot x1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_0 \cdot t\_2 + t\_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\

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


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

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

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

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

    if -8.99999999999999996e55 < x1 < 3.59999999999999983e48

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

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

    if 3.59999999999999983e48 < x1

    1. Initial program 33.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 33.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 \color{blue}{\frac{-1}{x1}} + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\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}^{4} \cdot \left(6 - 3 \cdot \frac{1}{x1}\right)} \]
    5. Step-by-step derivation
      1. associate-*r/100.0%

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

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

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

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

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

Alternative 5: 94.3% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
\mathbf{if}\;x1 \leq -1.2 \cdot 10^{+50} \lor \neg \left(x1 \leq 3.6 \cdot 10^{+48}\right):\\
\;\;\;\;x1 - {x1}^{3} \cdot \left(3 - x1 \cdot 6\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x1 < -1.2000000000000001e50 or 3.59999999999999983e48 < x1

    1. Initial program 29.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 29.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 \color{blue}{\frac{-1}{x1}} + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\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.8%

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

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

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

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

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

    if -1.2000000000000001e50 < x1 < 3.59999999999999983e48

    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 96.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 \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 \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\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.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(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 \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) \]
    5. Taylor expanded in x1 around 0 96.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(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 \color{blue}{\left(-2 \cdot x2 + -1 \cdot x1\right)}\right) \]
    6. Step-by-step derivation
      1. mul-1-neg96.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(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(-2 \cdot x2 + \color{blue}{\left(-x1\right)}\right)\right) \]
      2. unsub-neg96.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(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 \color{blue}{\left(-2 \cdot x2 - x1\right)}\right) \]
      3. *-commutative96.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(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(\color{blue}{x2 \cdot -2} - x1\right)\right) \]
    7. Simplified96.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(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 \color{blue}{\left(x2 \cdot -2 - x1\right)}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification96.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -1.2 \cdot 10^{+50} \lor \neg \left(x1 \leq 3.6 \cdot 10^{+48}\right):\\ \;\;\;\;x1 - {x1}^{3} \cdot \left(3 - x1 \cdot 6\right)\\ \mathbf{else}:\\ \;\;\;\;x1 - \left(3 \cdot \left(x1 - x2 \cdot -2\right) - \left(x1 - \left(\left(\left(x1 \cdot x1 + 1\right) \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 - \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} \cdot 4\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(3 - 2 \cdot x2\right)\right) - 3 \cdot \left(x1 \cdot \left(x1 \cdot 3\right)\right)\right) - x1 \cdot \left(x1 \cdot x1\right)\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 95.9% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
\mathbf{if}\;x1 \leq -1.36 \cdot 10^{+57} \lor \neg \left(x1 \leq 3.6 \cdot 10^{+48}\right):\\
\;\;\;\;x1 - {x1}^{3} \cdot \left(3 - x1 \cdot 6\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x1 < -1.36e57 or 3.59999999999999983e48 < x1

    1. Initial program 28.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 28.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 \color{blue}{\frac{-1}{x1}} + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\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.8%

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

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

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

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

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

    if -1.36e57 < x1 < 3.59999999999999983e48

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -1.36 \cdot 10^{+57} \lor \neg \left(x1 \leq 3.6 \cdot 10^{+48}\right):\\ \;\;\;\;x1 - {x1}^{3} \cdot \left(3 - x1 \cdot 6\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{x1 - \left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right)}{-1 - x1 \cdot x1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(\left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 \cdot x1 + 1\right) \cdot \left(\left(\left(x1 \cdot 2\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 94.3% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
\mathbf{if}\;x1 \leq -7.8 \cdot 10^{+49} \lor \neg \left(x1 \leq 3.3 \cdot 10^{+48}\right):\\
\;\;\;\;x1 + 6 \cdot {x1}^{4}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x1 < -7.8000000000000002e49 or 3.30000000000000023e48 < x1

    1. Initial program 29.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 29.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 \color{blue}{\frac{-1}{x1}} + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\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.8%

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

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

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

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

      \[\leadsto x1 + {x1}^{4} \cdot \color{blue}{6} \]

    if -7.8000000000000002e49 < x1 < 3.30000000000000023e48

    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 96.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 \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 \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\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.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(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 \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) \]
    5. Taylor expanded in x1 around 0 96.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(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 \color{blue}{\left(-2 \cdot x2 + -1 \cdot x1\right)}\right) \]
    6. Step-by-step derivation
      1. mul-1-neg96.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(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(-2 \cdot x2 + \color{blue}{\left(-x1\right)}\right)\right) \]
      2. unsub-neg96.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(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 \color{blue}{\left(-2 \cdot x2 - x1\right)}\right) \]
      3. *-commutative96.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(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(\color{blue}{x2 \cdot -2} - x1\right)\right) \]
    7. Simplified96.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(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 \color{blue}{\left(x2 \cdot -2 - x1\right)}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification96.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -7.8 \cdot 10^{+49} \lor \neg \left(x1 \leq 3.3 \cdot 10^{+48}\right):\\ \;\;\;\;x1 + 6 \cdot {x1}^{4}\\ \mathbf{else}:\\ \;\;\;\;x1 - \left(3 \cdot \left(x1 - x2 \cdot -2\right) - \left(x1 - \left(\left(\left(x1 \cdot x1 + 1\right) \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 - \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} \cdot 4\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(3 - 2 \cdot x2\right)\right) - 3 \cdot \left(x1 \cdot \left(x1 \cdot 3\right)\right)\right) - x1 \cdot \left(x1 \cdot x1\right)\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 89.6% accurate, 1.3× speedup?

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

\mathbf{elif}\;x1 \leq -2.8 \cdot 10^{+112}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{x1 - \left(t\_0 - 2 \cdot x2\right)}{-1 - x1 \cdot x1} + \left(x1 - \left(x1 \cdot \left(x1 \cdot \left(6 + \left(\left(\left(-2 \cdot t\_1 - \left(x2 \cdot 6 + x2 \cdot 8\right)\right) - x2 \cdot -4\right) - x1 \cdot -6\right)\right) - 2\right) - x2 \cdot -4\right)\right)\right)\\

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

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


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

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

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

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

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

    if -1.35000000000000003e154 < x1 < -2.8000000000000001e112

    1. Initial program 10.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 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 \color{blue}{\frac{-1}{x1}} + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\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 100.0%

      \[\leadsto x1 + \left(\left(\color{blue}{\left(-4 \cdot x2 + x1 \cdot \left(2 + x1 \cdot \left(\left(-6 \cdot x1 + \left(-4 \cdot x2 + \left(-2 \cdot \left(3 - 2 \cdot x2\right) + \left(6 \cdot x2 + 8 \cdot x2\right)\right)\right)\right) - 6\right)\right)\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.8000000000000001e112 < x1 < 3.2e87

    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 95.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 \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 \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\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 95.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(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 \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) \]
    5. Taylor expanded in x1 around 0 95.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(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 \color{blue}{\left(-2 \cdot x2 + -1 \cdot x1\right)}\right) \]
    6. Step-by-step derivation
      1. mul-1-neg95.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(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(-2 \cdot x2 + \color{blue}{\left(-x1\right)}\right)\right) \]
      2. unsub-neg95.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(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 \color{blue}{\left(-2 \cdot x2 - x1\right)}\right) \]
      3. *-commutative95.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(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(\color{blue}{x2 \cdot -2} - x1\right)\right) \]
    7. Simplified95.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(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 \color{blue}{\left(x2 \cdot -2 - x1\right)}\right) \]

    if 3.2e87 < x1

    1. Initial program 27.7%

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

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

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

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

Alternative 9: 89.3% accurate, 1.4× speedup?

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

\mathbf{elif}\;x1 \leq -2.8 \cdot 10^{+112}:\\
\;\;\;\;x1 + \left(t\_3 + \left(x1 - \left(x1 \cdot \left(x1 \cdot \left(6 + \left(\left(\left(-2 \cdot t\_1 - \left(x2 \cdot 6 + x2 \cdot 8\right)\right) - x2 \cdot -4\right) - x1 \cdot -6\right)\right) - 2\right) - x2 \cdot -4\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 3.2 \cdot 10^{+87}:\\
\;\;\;\;x1 + \left(t\_3 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot t\_0 - t\_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_2}\right) \cdot \left(3 - 2 \cdot x2\right) - \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\

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


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

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

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

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

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

    if -1.35000000000000003e154 < x1 < -2.8000000000000001e112

    1. Initial program 10.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 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 \color{blue}{\frac{-1}{x1}} + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\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 100.0%

      \[\leadsto x1 + \left(\left(\color{blue}{\left(-4 \cdot x2 + x1 \cdot \left(2 + x1 \cdot \left(\left(-6 \cdot x1 + \left(-4 \cdot x2 + \left(-2 \cdot \left(3 - 2 \cdot x2\right) + \left(6 \cdot x2 + 8 \cdot x2\right)\right)\right)\right) - 6\right)\right)\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.8000000000000001e112 < x1 < 3.2e87

    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 95.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 \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 \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\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 95.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(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 \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) \]
    5. Taylor expanded in x1 around inf 95.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(2 \cdot x2 - 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 3.2e87 < x1

    1. Initial program 27.7%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(\left(x2 \cdot -12 + x1 \cdot \left(9 + x2 \cdot 6\right)\right) - 2\right)\right)\\ \mathbf{elif}\;x1 \leq -2.8 \cdot 10^{+112}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{x1 - \left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right)}{-1 - x1 \cdot x1} + \left(x1 - \left(x1 \cdot \left(x1 \cdot \left(6 + \left(\left(\left(-2 \cdot \left(2 \cdot x2 - 3\right) - \left(x2 \cdot 6 + x2 \cdot 8\right)\right) - x2 \cdot -4\right) - x1 \cdot -6\right)\right) - 2\right) - x2 \cdot -4\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 3.2 \cdot 10^{+87}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{x1 - \left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right)}{-1 - x1 \cdot x1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot \left(x1 \cdot \left(x1 \cdot 3\right)\right) - \left(x1 \cdot x1 + 1\right) \cdot \left(\left(\left(x1 \cdot 2\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(3 - 2 \cdot x2\right) - \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(\left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) + x2 \cdot \left(x1 \cdot 6 + \frac{x1 \cdot \left(x1 \cdot 3 + 9\right)}{x2}\right)\right) - 2\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 87.4% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;x1 \leq -2.7 \cdot 10^{+28}:\\
\;\;\;\;t\_5\\

\mathbf{elif}\;x1 \leq 0.43:\\
\;\;\;\;x1 + \left(x2 \cdot -6 - \left(x1 \cdot \left(2 - t\_3\right) + x2 \cdot \left(x1 \cdot \left(12 - x1 \cdot 6\right) - 8 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 3.2 \cdot 10^{+87}:\\
\;\;\;\;t\_5\\

\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(\left(4 \cdot \left(x2 \cdot t\_1\right) + x2 \cdot \left(x1 \cdot 6 + \frac{t\_3}{x2}\right)\right) - 2\right)\right)\\


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

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

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

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

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

    if -1.35000000000000003e154 < x1 < -3.09999999999999987e102

    1. Initial program 18.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 inf 18.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}{\frac{-1}{x1}} + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\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 100.0%

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

    if -3.09999999999999987e102 < x1 < -2.7000000000000002e28 or 0.429999999999999993 < x1 < 3.2e87

    1. Initial program 98.9%

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

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

      \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot 3\right) \cdot \left(2 \cdot x2 - 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.7000000000000002e28 < x1 < 0.429999999999999993

    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 88.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 89.2%

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

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

    if 3.2e87 < x1

    1. Initial program 27.7%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(\left(x2 \cdot -12 + x1 \cdot \left(9 + x2 \cdot 6\right)\right) - 2\right)\right)\\ \mathbf{elif}\;x1 \leq -3.1 \cdot 10^{+102}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{x1 - \left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right)}{-1 - x1 \cdot x1} + \left(x1 - \left(x1 \cdot \left(x1 \cdot \left(6 + \left(\left(\left(-2 \cdot \left(2 \cdot x2 - 3\right) - \left(x2 \cdot 6 + x2 \cdot 8\right)\right) - x2 \cdot -4\right) - x1 \cdot -6\right)\right) - 2\right) - x2 \cdot -4\right)\right)\right)\\ \mathbf{elif}\;x1 \leq -2.7 \cdot 10^{+28}:\\ \;\;\;\;x1 - \left(3 \cdot \frac{x1 - \left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right)}{x1 \cdot x1 + 1} - \left(x1 - \left(\left(\left(\left(x1 \cdot x1\right) \cdot 6 + \left(2 \cdot x2 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot 3\right)\right) \cdot \left(-1 - x1 \cdot x1\right) - 3 \cdot \left(x1 \cdot \left(x1 \cdot 3\right)\right)\right) - x1 \cdot \left(x1 \cdot x1\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 0.43:\\ \;\;\;\;x1 + \left(x2 \cdot -6 - \left(x1 \cdot \left(2 - x1 \cdot \left(x1 \cdot 3 + 9\right)\right) + x2 \cdot \left(x1 \cdot \left(12 - x1 \cdot 6\right) - 8 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 3.2 \cdot 10^{+87}:\\ \;\;\;\;x1 - \left(3 \cdot \frac{x1 - \left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right)}{x1 \cdot x1 + 1} - \left(x1 - \left(\left(\left(\left(x1 \cdot x1\right) \cdot 6 + \left(2 \cdot x2 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot 3\right)\right) \cdot \left(-1 - x1 \cdot x1\right) - 3 \cdot \left(x1 \cdot \left(x1 \cdot 3\right)\right)\right) - x1 \cdot \left(x1 \cdot x1\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(\left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) + x2 \cdot \left(x1 \cdot 6 + \frac{x1 \cdot \left(x1 \cdot 3 + 9\right)}{x2}\right)\right) - 2\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 87.4% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 2 \cdot x2 - 3\\ t_1 := x1 \cdot x1 + 1\\ t_2 := -1 - x1 \cdot x1\\ t_3 := \left(x1 \cdot 2\right) \cdot 3\\ t_4 := x1 \cdot \left(x1 \cdot 3 + 9\right)\\ t_5 := x1 \cdot \left(x1 \cdot x1\right)\\ t_6 := x1 \cdot \left(x1 \cdot 3\right)\\ t_7 := x1 - \left(t\_6 - 2 \cdot x2\right)\\ t_8 := 3 \cdot t\_6\\ \mathbf{if}\;x1 \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(\left(x2 \cdot -12 + x1 \cdot \left(9 + x2 \cdot 6\right)\right) - 2\right)\right)\\ \mathbf{elif}\;x1 \leq -3.2 \cdot 10^{+102}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{t\_7}{t\_2} + \left(x1 - \left(x1 \cdot \left(x1 \cdot \left(6 + \left(\left(\left(-2 \cdot t\_0 - \left(x2 \cdot 6 + x2 \cdot 8\right)\right) - x2 \cdot -4\right) - x1 \cdot -6\right)\right) - 2\right) - x2 \cdot -4\right)\right)\right)\\ \mathbf{elif}\;x1 \leq -2.7 \cdot 10^{+28}:\\ \;\;\;\;x1 + \left(\left(x1 + \left(t\_5 - \left(t\_1 \cdot \left(t\_3 \cdot \left(3 - 2 \cdot x2\right) - \left(x1 \cdot x1\right) \cdot \left(\frac{\left(t\_6 + 2 \cdot x2\right) - x1}{t\_1} \cdot 4 - 6\right)\right) - t\_8\right)\right)\right) + 3 \cdot \left(x2 \cdot -2\right)\right)\\ \mathbf{elif}\;x1 \leq 0.43:\\ \;\;\;\;x1 + \left(x2 \cdot -6 - \left(x1 \cdot \left(2 - t\_4\right) + x2 \cdot \left(x1 \cdot \left(12 - x1 \cdot 6\right) - 8 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 3.2 \cdot 10^{+87}:\\ \;\;\;\;x1 - \left(3 \cdot \frac{t\_7}{t\_1} - \left(x1 - \left(\left(\left(\left(x1 \cdot x1\right) \cdot 6 + t\_0 \cdot t\_3\right) \cdot t\_2 - t\_8\right) - t\_5\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(\left(4 \cdot \left(x2 \cdot t\_0\right) + x2 \cdot \left(x1 \cdot 6 + \frac{t\_4}{x2}\right)\right) - 2\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 (- -1.0 (* x1 x1)))
        (t_3 (* (* x1 2.0) 3.0))
        (t_4 (* x1 (+ (* x1 3.0) 9.0)))
        (t_5 (* x1 (* x1 x1)))
        (t_6 (* x1 (* x1 3.0)))
        (t_7 (- x1 (- t_6 (* 2.0 x2))))
        (t_8 (* 3.0 t_6)))
   (if (<= x1 -1.35e+154)
     (+
      x1
      (+
       (* x2 -6.0)
       (* x1 (- (+ (* x2 -12.0) (* x1 (+ 9.0 (* x2 6.0)))) 2.0))))
     (if (<= x1 -3.2e+102)
       (+
        x1
        (+
         (* 3.0 (/ t_7 t_2))
         (-
          x1
          (-
           (*
            x1
            (-
             (*
              x1
              (+
               6.0
               (-
                (- (- (* -2.0 t_0) (+ (* x2 6.0) (* x2 8.0))) (* x2 -4.0))
                (* x1 -6.0))))
             2.0))
           (* x2 -4.0)))))
       (if (<= x1 -2.7e+28)
         (+
          x1
          (+
           (+
            x1
            (-
             t_5
             (-
              (*
               t_1
               (-
                (* t_3 (- 3.0 (* 2.0 x2)))
                (*
                 (* x1 x1)
                 (- (* (/ (- (+ t_6 (* 2.0 x2)) x1) t_1) 4.0) 6.0))))
              t_8)))
           (* 3.0 (* x2 -2.0))))
         (if (<= x1 0.43)
           (+
            x1
            (-
             (* x2 -6.0)
             (+
              (* x1 (- 2.0 t_4))
              (* x2 (- (* x1 (- 12.0 (* x1 6.0))) (* 8.0 (* x1 x2)))))))
           (if (<= x1 3.2e+87)
             (-
              x1
              (-
               (* 3.0 (/ t_7 t_1))
               (-
                x1
                (- (- (* (+ (* (* x1 x1) 6.0) (* t_0 t_3)) t_2) t_8) t_5))))
             (+
              x1
              (+
               (* x2 -6.0)
               (*
                x1
                (-
                 (+ (* 4.0 (* x2 t_0)) (* x2 (+ (* x1 6.0) (/ t_4 x2))))
                 2.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 = -1.0 - (x1 * x1);
	double t_3 = (x1 * 2.0) * 3.0;
	double t_4 = x1 * ((x1 * 3.0) + 9.0);
	double t_5 = x1 * (x1 * x1);
	double t_6 = x1 * (x1 * 3.0);
	double t_7 = x1 - (t_6 - (2.0 * x2));
	double t_8 = 3.0 * t_6;
	double tmp;
	if (x1 <= -1.35e+154) {
		tmp = x1 + ((x2 * -6.0) + (x1 * (((x2 * -12.0) + (x1 * (9.0 + (x2 * 6.0)))) - 2.0)));
	} else if (x1 <= -3.2e+102) {
		tmp = x1 + ((3.0 * (t_7 / t_2)) + (x1 - ((x1 * ((x1 * (6.0 + ((((-2.0 * t_0) - ((x2 * 6.0) + (x2 * 8.0))) - (x2 * -4.0)) - (x1 * -6.0)))) - 2.0)) - (x2 * -4.0))));
	} else if (x1 <= -2.7e+28) {
		tmp = x1 + ((x1 + (t_5 - ((t_1 * ((t_3 * (3.0 - (2.0 * x2))) - ((x1 * x1) * (((((t_6 + (2.0 * x2)) - x1) / t_1) * 4.0) - 6.0)))) - t_8))) + (3.0 * (x2 * -2.0)));
	} else if (x1 <= 0.43) {
		tmp = x1 + ((x2 * -6.0) - ((x1 * (2.0 - t_4)) + (x2 * ((x1 * (12.0 - (x1 * 6.0))) - (8.0 * (x1 * x2))))));
	} else if (x1 <= 3.2e+87) {
		tmp = x1 - ((3.0 * (t_7 / t_1)) - (x1 - ((((((x1 * x1) * 6.0) + (t_0 * t_3)) * t_2) - t_8) - t_5)));
	} else {
		tmp = x1 + ((x2 * -6.0) + (x1 * (((4.0 * (x2 * t_0)) + (x2 * ((x1 * 6.0) + (t_4 / x2)))) - 2.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) :: t_8
    real(8) :: tmp
    t_0 = (2.0d0 * x2) - 3.0d0
    t_1 = (x1 * x1) + 1.0d0
    t_2 = (-1.0d0) - (x1 * x1)
    t_3 = (x1 * 2.0d0) * 3.0d0
    t_4 = x1 * ((x1 * 3.0d0) + 9.0d0)
    t_5 = x1 * (x1 * x1)
    t_6 = x1 * (x1 * 3.0d0)
    t_7 = x1 - (t_6 - (2.0d0 * x2))
    t_8 = 3.0d0 * t_6
    if (x1 <= (-1.35d+154)) then
        tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (((x2 * (-12.0d0)) + (x1 * (9.0d0 + (x2 * 6.0d0)))) - 2.0d0)))
    else if (x1 <= (-3.2d+102)) then
        tmp = x1 + ((3.0d0 * (t_7 / t_2)) + (x1 - ((x1 * ((x1 * (6.0d0 + (((((-2.0d0) * t_0) - ((x2 * 6.0d0) + (x2 * 8.0d0))) - (x2 * (-4.0d0))) - (x1 * (-6.0d0))))) - 2.0d0)) - (x2 * (-4.0d0)))))
    else if (x1 <= (-2.7d+28)) then
        tmp = x1 + ((x1 + (t_5 - ((t_1 * ((t_3 * (3.0d0 - (2.0d0 * x2))) - ((x1 * x1) * (((((t_6 + (2.0d0 * x2)) - x1) / t_1) * 4.0d0) - 6.0d0)))) - t_8))) + (3.0d0 * (x2 * (-2.0d0))))
    else if (x1 <= 0.43d0) then
        tmp = x1 + ((x2 * (-6.0d0)) - ((x1 * (2.0d0 - t_4)) + (x2 * ((x1 * (12.0d0 - (x1 * 6.0d0))) - (8.0d0 * (x1 * x2))))))
    else if (x1 <= 3.2d+87) then
        tmp = x1 - ((3.0d0 * (t_7 / t_1)) - (x1 - ((((((x1 * x1) * 6.0d0) + (t_0 * t_3)) * t_2) - t_8) - t_5)))
    else
        tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (((4.0d0 * (x2 * t_0)) + (x2 * ((x1 * 6.0d0) + (t_4 / x2)))) - 2.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 = -1.0 - (x1 * x1);
	double t_3 = (x1 * 2.0) * 3.0;
	double t_4 = x1 * ((x1 * 3.0) + 9.0);
	double t_5 = x1 * (x1 * x1);
	double t_6 = x1 * (x1 * 3.0);
	double t_7 = x1 - (t_6 - (2.0 * x2));
	double t_8 = 3.0 * t_6;
	double tmp;
	if (x1 <= -1.35e+154) {
		tmp = x1 + ((x2 * -6.0) + (x1 * (((x2 * -12.0) + (x1 * (9.0 + (x2 * 6.0)))) - 2.0)));
	} else if (x1 <= -3.2e+102) {
		tmp = x1 + ((3.0 * (t_7 / t_2)) + (x1 - ((x1 * ((x1 * (6.0 + ((((-2.0 * t_0) - ((x2 * 6.0) + (x2 * 8.0))) - (x2 * -4.0)) - (x1 * -6.0)))) - 2.0)) - (x2 * -4.0))));
	} else if (x1 <= -2.7e+28) {
		tmp = x1 + ((x1 + (t_5 - ((t_1 * ((t_3 * (3.0 - (2.0 * x2))) - ((x1 * x1) * (((((t_6 + (2.0 * x2)) - x1) / t_1) * 4.0) - 6.0)))) - t_8))) + (3.0 * (x2 * -2.0)));
	} else if (x1 <= 0.43) {
		tmp = x1 + ((x2 * -6.0) - ((x1 * (2.0 - t_4)) + (x2 * ((x1 * (12.0 - (x1 * 6.0))) - (8.0 * (x1 * x2))))));
	} else if (x1 <= 3.2e+87) {
		tmp = x1 - ((3.0 * (t_7 / t_1)) - (x1 - ((((((x1 * x1) * 6.0) + (t_0 * t_3)) * t_2) - t_8) - t_5)));
	} else {
		tmp = x1 + ((x2 * -6.0) + (x1 * (((4.0 * (x2 * t_0)) + (x2 * ((x1 * 6.0) + (t_4 / x2)))) - 2.0)));
	}
	return tmp;
}
def code(x1, x2):
	t_0 = (2.0 * x2) - 3.0
	t_1 = (x1 * x1) + 1.0
	t_2 = -1.0 - (x1 * x1)
	t_3 = (x1 * 2.0) * 3.0
	t_4 = x1 * ((x1 * 3.0) + 9.0)
	t_5 = x1 * (x1 * x1)
	t_6 = x1 * (x1 * 3.0)
	t_7 = x1 - (t_6 - (2.0 * x2))
	t_8 = 3.0 * t_6
	tmp = 0
	if x1 <= -1.35e+154:
		tmp = x1 + ((x2 * -6.0) + (x1 * (((x2 * -12.0) + (x1 * (9.0 + (x2 * 6.0)))) - 2.0)))
	elif x1 <= -3.2e+102:
		tmp = x1 + ((3.0 * (t_7 / t_2)) + (x1 - ((x1 * ((x1 * (6.0 + ((((-2.0 * t_0) - ((x2 * 6.0) + (x2 * 8.0))) - (x2 * -4.0)) - (x1 * -6.0)))) - 2.0)) - (x2 * -4.0))))
	elif x1 <= -2.7e+28:
		tmp = x1 + ((x1 + (t_5 - ((t_1 * ((t_3 * (3.0 - (2.0 * x2))) - ((x1 * x1) * (((((t_6 + (2.0 * x2)) - x1) / t_1) * 4.0) - 6.0)))) - t_8))) + (3.0 * (x2 * -2.0)))
	elif x1 <= 0.43:
		tmp = x1 + ((x2 * -6.0) - ((x1 * (2.0 - t_4)) + (x2 * ((x1 * (12.0 - (x1 * 6.0))) - (8.0 * (x1 * x2))))))
	elif x1 <= 3.2e+87:
		tmp = x1 - ((3.0 * (t_7 / t_1)) - (x1 - ((((((x1 * x1) * 6.0) + (t_0 * t_3)) * t_2) - t_8) - t_5)))
	else:
		tmp = x1 + ((x2 * -6.0) + (x1 * (((4.0 * (x2 * t_0)) + (x2 * ((x1 * 6.0) + (t_4 / x2)))) - 2.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(-1.0 - Float64(x1 * x1))
	t_3 = Float64(Float64(x1 * 2.0) * 3.0)
	t_4 = Float64(x1 * Float64(Float64(x1 * 3.0) + 9.0))
	t_5 = Float64(x1 * Float64(x1 * x1))
	t_6 = Float64(x1 * Float64(x1 * 3.0))
	t_7 = Float64(x1 - Float64(t_6 - Float64(2.0 * x2)))
	t_8 = Float64(3.0 * t_6)
	tmp = 0.0
	if (x1 <= -1.35e+154)
		tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(Float64(x2 * -12.0) + Float64(x1 * Float64(9.0 + Float64(x2 * 6.0)))) - 2.0))));
	elseif (x1 <= -3.2e+102)
		tmp = Float64(x1 + Float64(Float64(3.0 * Float64(t_7 / t_2)) + Float64(x1 - Float64(Float64(x1 * Float64(Float64(x1 * Float64(6.0 + Float64(Float64(Float64(Float64(-2.0 * t_0) - Float64(Float64(x2 * 6.0) + Float64(x2 * 8.0))) - Float64(x2 * -4.0)) - Float64(x1 * -6.0)))) - 2.0)) - Float64(x2 * -4.0)))));
	elseif (x1 <= -2.7e+28)
		tmp = Float64(x1 + Float64(Float64(x1 + Float64(t_5 - Float64(Float64(t_1 * Float64(Float64(t_3 * Float64(3.0 - Float64(2.0 * x2))) - Float64(Float64(x1 * x1) * Float64(Float64(Float64(Float64(Float64(t_6 + Float64(2.0 * x2)) - x1) / t_1) * 4.0) - 6.0)))) - t_8))) + Float64(3.0 * Float64(x2 * -2.0))));
	elseif (x1 <= 0.43)
		tmp = Float64(x1 + Float64(Float64(x2 * -6.0) - Float64(Float64(x1 * Float64(2.0 - t_4)) + Float64(x2 * Float64(Float64(x1 * Float64(12.0 - Float64(x1 * 6.0))) - Float64(8.0 * Float64(x1 * x2)))))));
	elseif (x1 <= 3.2e+87)
		tmp = Float64(x1 - Float64(Float64(3.0 * Float64(t_7 / t_1)) - Float64(x1 - Float64(Float64(Float64(Float64(Float64(Float64(x1 * x1) * 6.0) + Float64(t_0 * t_3)) * t_2) - t_8) - t_5))));
	else
		tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(Float64(4.0 * Float64(x2 * t_0)) + Float64(x2 * Float64(Float64(x1 * 6.0) + Float64(t_4 / x2)))) - 2.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 = -1.0 - (x1 * x1);
	t_3 = (x1 * 2.0) * 3.0;
	t_4 = x1 * ((x1 * 3.0) + 9.0);
	t_5 = x1 * (x1 * x1);
	t_6 = x1 * (x1 * 3.0);
	t_7 = x1 - (t_6 - (2.0 * x2));
	t_8 = 3.0 * t_6;
	tmp = 0.0;
	if (x1 <= -1.35e+154)
		tmp = x1 + ((x2 * -6.0) + (x1 * (((x2 * -12.0) + (x1 * (9.0 + (x2 * 6.0)))) - 2.0)));
	elseif (x1 <= -3.2e+102)
		tmp = x1 + ((3.0 * (t_7 / t_2)) + (x1 - ((x1 * ((x1 * (6.0 + ((((-2.0 * t_0) - ((x2 * 6.0) + (x2 * 8.0))) - (x2 * -4.0)) - (x1 * -6.0)))) - 2.0)) - (x2 * -4.0))));
	elseif (x1 <= -2.7e+28)
		tmp = x1 + ((x1 + (t_5 - ((t_1 * ((t_3 * (3.0 - (2.0 * x2))) - ((x1 * x1) * (((((t_6 + (2.0 * x2)) - x1) / t_1) * 4.0) - 6.0)))) - t_8))) + (3.0 * (x2 * -2.0)));
	elseif (x1 <= 0.43)
		tmp = x1 + ((x2 * -6.0) - ((x1 * (2.0 - t_4)) + (x2 * ((x1 * (12.0 - (x1 * 6.0))) - (8.0 * (x1 * x2))))));
	elseif (x1 <= 3.2e+87)
		tmp = x1 - ((3.0 * (t_7 / t_1)) - (x1 - ((((((x1 * x1) * 6.0) + (t_0 * t_3)) * t_2) - t_8) - t_5)));
	else
		tmp = x1 + ((x2 * -6.0) + (x1 * (((4.0 * (x2 * t_0)) + (x2 * ((x1 * 6.0) + (t_4 / x2)))) - 2.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[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 * 2.0), $MachinePrecision] * 3.0), $MachinePrecision]}, Block[{t$95$4 = N[(x1 * N[(N[(x1 * 3.0), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(x1 - N[(t$95$6 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$8 = N[(3.0 * t$95$6), $MachinePrecision]}, If[LessEqual[x1, -1.35e+154], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(N[(x2 * -12.0), $MachinePrecision] + N[(x1 * N[(9.0 + N[(x2 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -3.2e+102], N[(x1 + N[(N[(3.0 * N[(t$95$7 / t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 - N[(N[(x1 * N[(N[(x1 * N[(6.0 + N[(N[(N[(N[(-2.0 * t$95$0), $MachinePrecision] - N[(N[(x2 * 6.0), $MachinePrecision] + N[(x2 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x2 * -4.0), $MachinePrecision]), $MachinePrecision] - N[(x1 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] - N[(x2 * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -2.7e+28], N[(x1 + N[(N[(x1 + N[(t$95$5 - N[(N[(t$95$1 * N[(N[(t$95$3 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x1 * x1), $MachinePrecision] * N[(N[(N[(N[(N[(t$95$6 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision] * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$8), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 0.43], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] - N[(N[(x1 * N[(2.0 - t$95$4), $MachinePrecision]), $MachinePrecision] + N[(x2 * N[(N[(x1 * N[(12.0 - N[(x1 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 3.2e+87], N[(x1 - N[(N[(3.0 * N[(t$95$7 / t$95$1), $MachinePrecision]), $MachinePrecision] - N[(x1 - N[(N[(N[(N[(N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision] + N[(t$95$0 * t$95$3), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision] - t$95$8), $MachinePrecision] - t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(N[(4.0 * N[(x2 * t$95$0), $MachinePrecision]), $MachinePrecision] + N[(x2 * N[(N[(x1 * 6.0), $MachinePrecision] + N[(t$95$4 / x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x1 \leq -3.2 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{t\_7}{t\_2} + \left(x1 - \left(x1 \cdot \left(x1 \cdot \left(6 + \left(\left(\left(-2 \cdot t\_0 - \left(x2 \cdot 6 + x2 \cdot 8\right)\right) - x2 \cdot -4\right) - x1 \cdot -6\right)\right) - 2\right) - x2 \cdot -4\right)\right)\right)\\

\mathbf{elif}\;x1 \leq -2.7 \cdot 10^{+28}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(t\_5 - \left(t\_1 \cdot \left(t\_3 \cdot \left(3 - 2 \cdot x2\right) - \left(x1 \cdot x1\right) \cdot \left(\frac{\left(t\_6 + 2 \cdot x2\right) - x1}{t\_1} \cdot 4 - 6\right)\right) - t\_8\right)\right)\right) + 3 \cdot \left(x2 \cdot -2\right)\right)\\

\mathbf{elif}\;x1 \leq 0.43:\\
\;\;\;\;x1 + \left(x2 \cdot -6 - \left(x1 \cdot \left(2 - t\_4\right) + x2 \cdot \left(x1 \cdot \left(12 - x1 \cdot 6\right) - 8 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 3.2 \cdot 10^{+87}:\\
\;\;\;\;x1 - \left(3 \cdot \frac{t\_7}{t\_1} - \left(x1 - \left(\left(\left(\left(x1 \cdot x1\right) \cdot 6 + t\_0 \cdot t\_3\right) \cdot t\_2 - t\_8\right) - t\_5\right)\right)\right)\\

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


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

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

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

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

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

    if -1.35000000000000003e154 < x1 < -3.1999999999999999e102

    1. Initial program 18.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 inf 18.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}{\frac{-1}{x1}} + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\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 100.0%

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

    if -3.1999999999999999e102 < x1 < -2.7000000000000002e28

    1. Initial program 99.2%

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

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

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

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

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

    if -2.7000000000000002e28 < x1 < 0.429999999999999993

    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 88.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 89.2%

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

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

    if 0.429999999999999993 < x1 < 3.2e87

    1. Initial program 98.6%

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

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

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

    1. Initial program 27.7%

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

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

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

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

Alternative 12: 82.0% accurate, 1.8× speedup?

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

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

\mathbf{elif}\;x1 \leq -4.5 \cdot 10^{+45}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{x1 - \left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right)}{-1 - x1 \cdot x1} + \left(x1 - \left(x1 \cdot \left(x1 \cdot \left(6 + \left(\left(\left(-2 \cdot t\_1 - \left(x2 \cdot 6 + x2 \cdot 8\right)\right) - x2 \cdot -4\right) - x1 \cdot -6\right)\right) - 2\right) - x2 \cdot -4\right)\right)\right)\\

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

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


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

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

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

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

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

    if -9.4999999999999995e153 < x1 < -4.4999999999999998e45

    1. Initial program 52.4%

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

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

      \[\leadsto x1 + \left(\left(\color{blue}{\left(-4 \cdot x2 + x1 \cdot \left(2 + x1 \cdot \left(\left(-6 \cdot x1 + \left(-4 \cdot x2 + \left(-2 \cdot \left(3 - 2 \cdot x2\right) + \left(6 \cdot x2 + 8 \cdot x2\right)\right)\right)\right) - 6\right)\right)\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 -4.4999999999999998e45 < x1 < 7.4999999999999999e51

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

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

    if 7.4999999999999999e51 < x1

    1. Initial program 32.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 11.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 84.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -9.5 \cdot 10^{+153}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(\left(x2 \cdot -12 + x1 \cdot \left(9 + x2 \cdot 6\right)\right) - 2\right)\right)\\ \mathbf{elif}\;x1 \leq -4.5 \cdot 10^{+45}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{x1 - \left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right)}{-1 - x1 \cdot x1} + \left(x1 - \left(x1 \cdot \left(x1 \cdot \left(6 + \left(\left(\left(-2 \cdot \left(2 \cdot x2 - 3\right) - \left(x2 \cdot 6 + x2 \cdot 8\right)\right) - x2 \cdot -4\right) - x1 \cdot -6\right)\right) - 2\right) - x2 \cdot -4\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 7.5 \cdot 10^{+51}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 - \left(x1 \cdot \left(2 - x1 \cdot \left(x1 \cdot 3 + 9\right)\right) + x2 \cdot \left(x1 \cdot \left(12 - x1 \cdot 6\right) - 8 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(\left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) + x2 \cdot \left(x1 \cdot 6 + \frac{x1 \cdot \left(x1 \cdot 3 + 9\right)}{x2}\right)\right) - 2\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 74.7% accurate, 2.6× speedup?

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

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

\mathbf{elif}\;x1 \leq -4.8 \cdot 10^{-261}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;x1 \leq 3.85 \cdot 10^{+102}:\\
\;\;\;\;t\_1\\

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


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

    1. Initial program 24.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 5.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 4.9%

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

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

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

    if -4.2999999999999999e49 < x1 < -4.80000000000000028e-261 or 6.5000000000000004e-171 < x1 < 3.85000000000000007e102

    1. Initial program 99.2%

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

      \[\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 -4.80000000000000028e-261 < x1 < 6.5000000000000004e-171

    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 80.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 81.1%

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

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

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

    if 3.85000000000000007e102 < 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 5.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 x1 around 0 88.6%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -4.3 \cdot 10^{+49}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(\left(x2 \cdot -12 + x1 \cdot \left(9 + x2 \cdot 6\right)\right) - 2\right)\right)\\ \mathbf{elif}\;x1 \leq -4.8 \cdot 10^{-261}:\\ \;\;\;\;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(3 - x2 \cdot -2\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 6.5 \cdot 10^{-171}:\\ \;\;\;\;x1 + x2 \cdot \left(\left(x1 \cdot \left(x1 \cdot 6 - 12\right) + \frac{x1 \cdot \left(x1 \cdot \left(x1 \cdot 3 + 9\right) - 2\right)}{x2}\right) - 6\right)\\ \mathbf{elif}\;x1 \leq 3.85 \cdot 10^{+102}:\\ \;\;\;\;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(3 - x2 \cdot -2\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 - x1 \cdot \left(2 - x1 \cdot \left(x1 \cdot 3 + 9\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 74.6% accurate, 2.6× speedup?

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

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

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

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

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

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


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

    1. Initial program 24.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 5.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 4.9%

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

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

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

    if -7.5000000000000006e48 < x1 < -3.09999999999999995e-266

    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 84.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 85.2%

      \[\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.09999999999999995e-266 < x1 < 6.5000000000000004e-171

    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 80.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 81.1%

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

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

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

    if 6.5000000000000004e-171 < x1 < 5e102

    1. Initial program 99.2%

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

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

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

        \[\leadsto x1 + \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 + \color{blue}{x2 \cdot 6}\right)\right) - 2\right)\right) \]
    7. Simplified77.7%

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

    if 5e102 < 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 5.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 x1 around 0 88.6%

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

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

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

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

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

Alternative 15: 74.2% accurate, 2.8× speedup?

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

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

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

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

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

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


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

    1. Initial program 24.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 5.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 4.9%

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

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

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

    if -2.9999999999999998e50 < x1 < -1.47999999999999998e-263

    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 84.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 84.7%

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

    if -1.47999999999999998e-263 < x1 < 4.2000000000000001e-170

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

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

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

    if 4.2000000000000001e-170 < x1 < 3.8999999999999998e102

    1. Initial program 99.2%

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

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

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

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

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

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

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

    if 3.8999999999999998e102 < 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 5.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 x1 around 0 88.6%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -3 \cdot 10^{+50}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(\left(x2 \cdot -12 + x1 \cdot \left(9 + x2 \cdot 6\right)\right) - 2\right)\right)\\ \mathbf{elif}\;x1 \leq -1.48 \cdot 10^{-263}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right)\right)\\ \mathbf{elif}\;x1 \leq 4.2 \cdot 10^{-170}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\ \mathbf{elif}\;x1 \leq 3.9 \cdot 10^{+102}:\\ \;\;\;\;x1 - \left(x1 \cdot \left(2 + \left(4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right) - x2 \cdot \left(x1 \cdot 6\right)\right)\right) - x2 \cdot -6\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 - x1 \cdot \left(2 - x1 \cdot \left(x1 \cdot 3 + 9\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 74.2% accurate, 2.8× speedup?

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

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

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

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

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

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


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

    1. Initial program 24.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 5.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 4.9%

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

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

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

    if -1.6999999999999999e47 < x1 < -2.4999999999999999e-261

    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 84.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 84.7%

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

    if -2.4999999999999999e-261 < x1 < 6.2000000000000001e-171

    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 80.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 81.1%

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

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

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

    if 6.2000000000000001e-171 < x1 < 4.1999999999999997e100

    1. Initial program 99.2%

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

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

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

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

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

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

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

    if 4.1999999999999997e100 < 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 5.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 x1 around 0 88.6%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -1.7 \cdot 10^{+47}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(\left(x2 \cdot -12 + x1 \cdot \left(9 + x2 \cdot 6\right)\right) - 2\right)\right)\\ \mathbf{elif}\;x1 \leq -2.5 \cdot 10^{-261}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right)\right)\\ \mathbf{elif}\;x1 \leq 6.2 \cdot 10^{-171}:\\ \;\;\;\;x1 + x2 \cdot \left(\left(x1 \cdot \left(x1 \cdot 6 - 12\right) + \frac{x1 \cdot \left(x1 \cdot \left(x1 \cdot 3 + 9\right) - 2\right)}{x2}\right) - 6\right)\\ \mathbf{elif}\;x1 \leq 4.2 \cdot 10^{+100}:\\ \;\;\;\;x1 - \left(x1 \cdot \left(2 + \left(4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right) - x2 \cdot \left(x1 \cdot 6\right)\right)\right) - x2 \cdot -6\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 - x1 \cdot \left(2 - x1 \cdot \left(x1 \cdot 3 + 9\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 79.4% accurate, 2.8× speedup?

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

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

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

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


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

    1. Initial program 24.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 5.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 4.9%

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

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

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

    if -4.60000000000000004e49 < x1 < 3.10000000000000014e62

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

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

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

    if 3.10000000000000014e62 < x1

    1. Initial program 30.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 11.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 86.0%

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

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

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

Alternative 18: 79.5% accurate, 3.0× speedup?

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

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

\mathbf{elif}\;x1 \leq 5 \cdot 10^{+100}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 - \left(t\_0 + x2 \cdot \left(x1 \cdot \left(12 - x1 \cdot 6\right) - 8 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\\

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


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

    1. Initial program 24.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 5.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 4.9%

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

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

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

    if -1.7e49 < x1 < 4.9999999999999999e100

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

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

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

    if 4.9999999999999999e100 < 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 5.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 x1 around 0 88.6%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -1.7 \cdot 10^{+49}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(\left(x2 \cdot -12 + x1 \cdot \left(9 + x2 \cdot 6\right)\right) - 2\right)\right)\\ \mathbf{elif}\;x1 \leq 5 \cdot 10^{+100}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 - \left(x1 \cdot \left(2 - x1 \cdot \left(x1 \cdot 3 + 9\right)\right) + x2 \cdot \left(x1 \cdot \left(12 - x1 \cdot 6\right) - 8 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 - x1 \cdot \left(2 - x1 \cdot \left(x1 \cdot 3 + 9\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 70.8% accurate, 3.3× speedup?

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

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

\mathbf{elif}\;x1 \leq -7.1 \cdot 10^{-266}:\\
\;\;\;\;t\_0\\

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

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

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


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

    1. Initial program 13.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 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 x1 around 0 5.6%

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

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

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

    if -8.2e79 < x1 < -7.09999999999999955e-266 or 6.2000000000000001e-171 < x1 < 3.79999999999999979e102

    1. Initial program 99.2%

      \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in x1 around 0 78.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 78.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 -7.09999999999999955e-266 < x1 < 6.2000000000000001e-171

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

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

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

    if 3.79999999999999979e102 < 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 5.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 x1 around 0 88.6%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -8.2 \cdot 10^{+79}:\\ \;\;\;\;x1 + x2 \cdot \left(x1 \cdot \left(x1 \cdot 6 - 12\right) - 6\right)\\ \mathbf{elif}\;x1 \leq -7.1 \cdot 10^{-266}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right)\right)\\ \mathbf{elif}\;x1 \leq 6.2 \cdot 10^{-171}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\ \mathbf{elif}\;x1 \leq 3.8 \cdot 10^{+102}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 - x1 \cdot \left(2 - x1 \cdot \left(x1 \cdot 3 + 9\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 20: 74.5% accurate, 3.3× speedup?

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

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

\mathbf{elif}\;x1 \leq -5.9 \cdot 10^{-266}:\\
\;\;\;\;t\_0\\

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

\mathbf{elif}\;x1 \leq 3.9 \cdot 10^{+102}:\\
\;\;\;\;t\_0\\

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


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

    1. Initial program 24.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 5.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 4.9%

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

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

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

    if -3.10000000000000003e50 < x1 < -5.90000000000000025e-266 or 9.59999999999999947e-171 < x1 < 3.8999999999999998e102

    1. Initial program 99.2%

      \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in x1 around 0 81.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 x1 around 0 81.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 -5.90000000000000025e-266 < x1 < 9.59999999999999947e-171

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

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

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

    if 3.8999999999999998e102 < 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 5.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 x1 around 0 88.6%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -3.1 \cdot 10^{+50}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(\left(x2 \cdot -12 + x1 \cdot \left(9 + x2 \cdot 6\right)\right) - 2\right)\right)\\ \mathbf{elif}\;x1 \leq -5.9 \cdot 10^{-266}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right)\right)\\ \mathbf{elif}\;x1 \leq 9.6 \cdot 10^{-171}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\ \mathbf{elif}\;x1 \leq 3.9 \cdot 10^{+102}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 - x1 \cdot \left(2 - x1 \cdot \left(x1 \cdot 3 + 9\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 21: 52.9% accurate, 4.2× speedup?

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

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

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

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

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x2 < -6.20000000000000016e121 or 3.3000000000000001e177 < x2

    1. Initial program 72.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 56.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 x1 around inf 71.8%

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

    if -6.20000000000000016e121 < x2 < 1.05000000000000006e-41

    1. Initial program 77.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 57.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 74.4%

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

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

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

    if 1.05000000000000006e-41 < x2 < 3.3000000000000001e177

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

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

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

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

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

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

Alternative 22: 62.3% accurate, 4.2× speedup?

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

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

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

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

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x2 < -7.49999999999999965e121 or 5.4000000000000002e175 < x2

    1. Initial program 72.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 56.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 x1 around inf 71.8%

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

    if -7.49999999999999965e121 < x2 < 1.55000000000000005e-32

    1. Initial program 77.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 57.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 74.6%

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

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

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

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

    if 1.55000000000000005e-32 < x2 < 5.4000000000000002e175

    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 51.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 x1 around 0 64.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)} \]
    5. Taylor expanded in x2 around 0 55.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x2 \leq -7.5 \cdot 10^{+121}:\\ \;\;\;\;x1 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) + 1\right)\\ \mathbf{elif}\;x2 \leq 1.55 \cdot 10^{-32}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 - x1 \cdot \left(2 - x1 \cdot \left(x1 \cdot 3 + 9\right)\right)\right)\\ \mathbf{elif}\;x2 \leq 5.4 \cdot 10^{+175}:\\ \;\;\;\;x1 + x2 \cdot \left(x1 \cdot \left(x1 \cdot 6 - 12\right) - 6\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) + 1\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 23: 51.1% accurate, 5.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -3.7 \cdot 10^{+17} \lor \neg \left(x1 \leq 1.4\right):\\
\;\;\;\;x1 + x2 \cdot \left(x1 \cdot \left(x1 \cdot 6 - 12\right) - 6\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x1 < -3.7e17 or 1.3999999999999999 < x1

    1. Initial program 39.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 10.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 44.9%

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

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

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

    if -3.7e17 < x1 < 1.3999999999999999

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -3.7 \cdot 10^{+17} \lor \neg \left(x1 \leq 1.4\right):\\ \;\;\;\;x1 + x2 \cdot \left(x1 \cdot \left(x1 \cdot 6 - 12\right) - 6\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 24: 48.4% accurate, 7.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x2 \leq 10^{-41}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x2 \cdot -12 - 2\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + x2 \cdot \left(x1 \cdot \left(x1 \cdot 6 - 12\right) - 6\right)\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (if (<= x2 1e-41)
   (+ x1 (+ (* x2 -6.0) (* x1 (- (* x2 -12.0) 2.0))))
   (+ x1 (* x2 (- (* x1 (- (* x1 6.0) 12.0)) 6.0)))))
double code(double x1, double x2) {
	double tmp;
	if (x2 <= 1e-41) {
		tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0)));
	} else {
		tmp = x1 + (x2 * ((x1 * ((x1 * 6.0) - 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 (x2 <= 1d-41) then
        tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((x2 * (-12.0d0)) - 2.0d0)))
    else
        tmp = x1 + (x2 * ((x1 * ((x1 * 6.0d0) - 12.0d0)) - 6.0d0))
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double tmp;
	if (x2 <= 1e-41) {
		tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0)));
	} else {
		tmp = x1 + (x2 * ((x1 * ((x1 * 6.0) - 12.0)) - 6.0));
	}
	return tmp;
}
def code(x1, x2):
	tmp = 0
	if x2 <= 1e-41:
		tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0)))
	else:
		tmp = x1 + (x2 * ((x1 * ((x1 * 6.0) - 12.0)) - 6.0))
	return tmp
function code(x1, x2)
	tmp = 0.0
	if (x2 <= 1e-41)
		tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x2 * -12.0) - 2.0))));
	else
		tmp = Float64(x1 + Float64(x2 * Float64(Float64(x1 * Float64(Float64(x1 * 6.0) - 12.0)) - 6.0)));
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	tmp = 0.0;
	if (x2 <= 1e-41)
		tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0)));
	else
		tmp = x1 + (x2 * ((x1 * ((x1 * 6.0) - 12.0)) - 6.0));
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := If[LessEqual[x2, 1e-41], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x2 * -12.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x2 * N[(N[(x1 * N[(N[(x1 * 6.0), $MachinePrecision] - 12.0), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x2 < 1.00000000000000001e-41

    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 56.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 70.9%

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

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

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

    if 1.00000000000000001e-41 < x2

    1. Initial program 69.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 54.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 69.9%

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

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

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

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

Alternative 25: 27.0% accurate, 9.1× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x2 < 3.9999999999999997e253

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

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

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

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

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

    if 3.9999999999999997e253 < x2

    1. Initial program 70.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 61.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 6.6%

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

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

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

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

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

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

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

Alternative 26: 41.2% accurate, 9.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x1 \leq 1.4:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\ \mathbf{else}:\\ \;\;\;\;x2 \cdot \left(\frac{x1}{x2} - 6\right)\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (if (<= x1 1.4) (+ x1 (+ (* x2 -6.0) (* x1 -2.0))) (* x2 (- (/ x1 x2) 6.0))))
double code(double x1, double x2) {
	double tmp;
	if (x1 <= 1.4) {
		tmp = x1 + ((x2 * -6.0) + (x1 * -2.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 <= 1.4d0) then
        tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (-2.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 <= 1.4) {
		tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
	} else {
		tmp = x2 * ((x1 / x2) - 6.0);
	}
	return tmp;
}
def code(x1, x2):
	tmp = 0
	if x1 <= 1.4:
		tmp = x1 + ((x2 * -6.0) + (x1 * -2.0))
	else:
		tmp = x2 * ((x1 / x2) - 6.0)
	return tmp
function code(x1, x2)
	tmp = 0.0
	if (x1 <= 1.4)
		tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * -2.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 <= 1.4)
		tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
	else
		tmp = x2 * ((x1 / x2) - 6.0);
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := If[LessEqual[x1, 1.4], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x2 * N[(N[(x1 / x2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq 1.4:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\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 < 1.3999999999999999

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

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

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

    if 1.3999999999999999 < x1

    1. Initial program 42.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 11.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 7.2%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq 1.4:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\ \mathbf{else}:\\ \;\;\;\;x2 \cdot \left(\frac{x1}{x2} - 6\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 27: 26.6% accurate, 18.1× speedup?

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

\\
x2 \cdot \left(\frac{x1}{x2} - 6\right)
\end{array}
Derivation
  1. Initial program 74.1%

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

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

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

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

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

    \[\leadsto x2 \cdot \left(\frac{x1}{x2} - 6\right) \]
  9. Add Preprocessing

Alternative 28: 20.9% accurate, 25.4× speedup?

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

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

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

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

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

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

    \[\leadsto x1 + x2 \cdot -6 \]
  8. Add Preprocessing

Alternative 29: 20.7% accurate, 42.3× speedup?

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

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

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

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

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

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

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

    \[\leadsto x2 \cdot -6 \]
  9. Add Preprocessing

Alternative 30: 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 74.1%

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

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

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

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

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

    \[\leadsto x1 \]
  9. Add Preprocessing

Reproduce

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