Rosa's FloatVsDoubleBenchmark

Percentage Accurate: 68.0% → 99.2%
Time: 1.8min
Alternatives: 28
Speedup: 3.2×

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 28 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.0% 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.2% accurate, 0.1× speedup?

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

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

\mathbf{elif}\;x1 \leq -1.7 \cdot 10^{-80}:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, t\_1, t\_0 \cdot t\_4 + \mathsf{fma}\left(x1, x1, 1\right) \cdot \left(x1 + x1 \cdot \left(2 \cdot \left(t\_4 \cdot \left(t\_4 + -3\right)\right) + x1 \cdot \mathsf{fma}\left(t\_4, 4, -6\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 2 \cdot 10^{+152}:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, t\_1, x1 + \mathsf{fma}\left(\mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, x1 \cdot \mathsf{fma}\left(t\_3, 4, -6\right), \left(x1 \cdot \left(2 \cdot t\_3\right)\right) \cdot \left(-3 + t\_3\right)\right), \mathsf{fma}\left(t\_0, t\_3, {x1}^{3}\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x1 < -4.00000000000000015e154 or 2.0000000000000001e152 < x1

    1. Initial program 0.0%

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

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

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

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

    if -4.00000000000000015e154 < x1 < -1.7e-80

    1. Initial program 76.3%

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

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

    if -1.7e-80 < x1 < 2.0000000000000001e152

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -4 \cdot 10^{+154}:\\ \;\;\;\;x1 + \left(x1 + 3 \cdot \left(x1 \cdot \left(x1 \cdot 3 + -1\right)\right)\right)\\ \mathbf{elif}\;x1 \leq -1.7 \cdot 10^{-80}:\\ \;\;\;\;x1 + \mathsf{fma}\left(3, \frac{3 \cdot \left(x1 \cdot x1\right) - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, \left(3 \cdot \left(x1 \cdot x1\right)\right) \cdot \frac{3 \cdot \left(x1 \cdot x1\right) - \mathsf{fma}\left(x2, -2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)} + \mathsf{fma}\left(x1, x1, 1\right) \cdot \left(x1 + x1 \cdot \left(2 \cdot \left(\frac{3 \cdot \left(x1 \cdot x1\right) - \mathsf{fma}\left(x2, -2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)} \cdot \left(\frac{3 \cdot \left(x1 \cdot x1\right) - \mathsf{fma}\left(x2, -2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)} + -3\right)\right) + x1 \cdot \mathsf{fma}\left(\frac{3 \cdot \left(x1 \cdot x1\right) - \mathsf{fma}\left(x2, -2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, 4, -6\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 2 \cdot 10^{+152}:\\ \;\;\;\;x1 + \mathsf{fma}\left(3, \frac{3 \cdot \left(x1 \cdot x1\right) - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, x1 + \mathsf{fma}\left(\mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, x1 \cdot \mathsf{fma}\left(\frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}, 4, -6\right), \left(x1 \cdot \left(2 \cdot \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\right)\right) \cdot \left(-3 + \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\right)\right), \mathsf{fma}\left(3 \cdot \left(x1 \cdot x1\right), \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}, {x1}^{3}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x1 + 3 \cdot \left(x1 \cdot \left(x1 \cdot 3 + -1\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 98.9% accurate, 0.1× speedup?

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

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

\mathbf{elif}\;x1 \leq -1.05 \cdot 10^{-99}:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, \frac{t\_1 - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, t\_1 \cdot t\_4 + \mathsf{fma}\left(x1, x1, 1\right) \cdot \left(x1 + x1 \cdot \left(2 \cdot \left(t\_4 \cdot \left(t\_4 + -3\right)\right) + x1 \cdot \mathsf{fma}\left(t\_4, 4, -6\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 2 \cdot 10^{+152}:\\
\;\;\;\;x1 + \left(\left(\mathsf{fma}\left(\mathsf{fma}\left(t\_3 \cdot \left(x1 \cdot 2\right), -3 + t\_3, \left(x1 \cdot x1\right) \cdot \mathsf{fma}\left(4, t\_3, -6\right)\right), \mathsf{fma}\left(x1, x1, 1\right), t\_3 \cdot t\_0\right) + x1 \cdot \left(x1 \cdot x1\right)\right) + \left(x1 + 3 \cdot \frac{t\_0 - \left(x1 + 2 \cdot x2\right)}{\mathsf{fma}\left(x1, x1, 1\right)}\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x1 < -4.00000000000000015e154 or 2.0000000000000001e152 < x1

    1. Initial program 0.0%

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

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

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

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

    if -4.00000000000000015e154 < x1 < -1.04999999999999992e-99

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

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

    if -1.04999999999999992e-99 < x1 < 2.0000000000000001e152

    1. Initial program 99.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -4 \cdot 10^{+154}:\\ \;\;\;\;x1 + \left(x1 + 3 \cdot \left(x1 \cdot \left(x1 \cdot 3 + -1\right)\right)\right)\\ \mathbf{elif}\;x1 \leq -1.05 \cdot 10^{-99}:\\ \;\;\;\;x1 + \mathsf{fma}\left(3, \frac{3 \cdot \left(x1 \cdot x1\right) - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, \left(3 \cdot \left(x1 \cdot x1\right)\right) \cdot \frac{3 \cdot \left(x1 \cdot x1\right) - \mathsf{fma}\left(x2, -2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)} + \mathsf{fma}\left(x1, x1, 1\right) \cdot \left(x1 + x1 \cdot \left(2 \cdot \left(\frac{3 \cdot \left(x1 \cdot x1\right) - \mathsf{fma}\left(x2, -2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)} \cdot \left(\frac{3 \cdot \left(x1 \cdot x1\right) - \mathsf{fma}\left(x2, -2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)} + -3\right)\right) + x1 \cdot \mathsf{fma}\left(\frac{3 \cdot \left(x1 \cdot x1\right) - \mathsf{fma}\left(x2, -2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, 4, -6\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 2 \cdot 10^{+152}:\\ \;\;\;\;x1 + \left(\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{\mathsf{fma}\left(x1 \cdot 3, x1, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)} \cdot \left(x1 \cdot 2\right), -3 + \frac{\mathsf{fma}\left(x1 \cdot 3, x1, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}, \left(x1 \cdot x1\right) \cdot \mathsf{fma}\left(4, \frac{\mathsf{fma}\left(x1 \cdot 3, x1, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}, -6\right)\right), \mathsf{fma}\left(x1, x1, 1\right), \frac{\mathsf{fma}\left(x1 \cdot 3, x1, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)} \cdot \left(x1 \cdot \left(x1 \cdot 3\right)\right)\right) + x1 \cdot \left(x1 \cdot x1\right)\right) + \left(x1 + 3 \cdot \frac{x1 \cdot \left(x1 \cdot 3\right) - \left(x1 + 2 \cdot x2\right)}{\mathsf{fma}\left(x1, x1, 1\right)}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x1 + 3 \cdot \left(x1 \cdot \left(x1 \cdot 3 + -1\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 98.9% accurate, 0.1× speedup?

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

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

\mathbf{elif}\;x1 \leq -4.9 \cdot 10^{-100}:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, \frac{t\_1 - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, t\_1 \cdot t\_5 + \mathsf{fma}\left(x1, x1, 1\right) \cdot \left(x1 + x1 \cdot \left(2 \cdot \left(t\_5 \cdot \left(t\_5 + -3\right)\right) + x1 \cdot \mathsf{fma}\left(t\_5, 4, -6\right)\right)\right)\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x1 < -4.00000000000000015e154 or 2.0000000000000001e152 < x1

    1. Initial program 0.0%

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

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

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

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

    if -4.00000000000000015e154 < x1 < -4.9000000000000003e-100

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

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

    if -4.9000000000000003e-100 < x1 < 2.0000000000000001e152

    1. Initial program 99.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -4 \cdot 10^{+154}:\\ \;\;\;\;x1 + \left(x1 + 3 \cdot \left(x1 \cdot \left(x1 \cdot 3 + -1\right)\right)\right)\\ \mathbf{elif}\;x1 \leq -4.9 \cdot 10^{-100}:\\ \;\;\;\;x1 + \mathsf{fma}\left(3, \frac{3 \cdot \left(x1 \cdot x1\right) - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, \left(3 \cdot \left(x1 \cdot x1\right)\right) \cdot \frac{3 \cdot \left(x1 \cdot x1\right) - \mathsf{fma}\left(x2, -2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)} + \mathsf{fma}\left(x1, x1, 1\right) \cdot \left(x1 + x1 \cdot \left(2 \cdot \left(\frac{3 \cdot \left(x1 \cdot x1\right) - \mathsf{fma}\left(x2, -2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)} \cdot \left(\frac{3 \cdot \left(x1 \cdot x1\right) - \mathsf{fma}\left(x2, -2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)} + -3\right)\right) + x1 \cdot \mathsf{fma}\left(\frac{3 \cdot \left(x1 \cdot x1\right) - \mathsf{fma}\left(x2, -2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, 4, -6\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 2 \cdot 10^{+152}:\\ \;\;\;\;x1 + \left(\left(x1 + \left(\left(\left(1 + x1 \cdot x1\right) \cdot \left(\left(\left(x1 \cdot 2\right) \cdot \frac{\left(2 \cdot x2 + x1 \cdot \left(x1 \cdot 3\right)\right) - x1}{1 + x1 \cdot x1}\right) \cdot \left(\frac{\left(2 \cdot x2 + x1 \cdot \left(x1 \cdot 3\right)\right) - x1}{1 + x1 \cdot x1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(2 \cdot x2 + x1 \cdot \left(x1 \cdot 3\right)\right) - x1}{1 + x1 \cdot x1} - 6\right)\right) + \left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{\left(2 \cdot x2 + x1 \cdot \left(x1 \cdot 3\right)\right) - x1}{1 + x1 \cdot x1}\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{1 + x1 \cdot x1}\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x1 + 3 \cdot \left(x1 \cdot \left(x1 \cdot 3 + -1\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 98.6% accurate, 0.9× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x1 < -4.5000000000000001e153 or 2.0000000000000001e152 < x1

    1. Initial program 0.0%

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

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

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

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

    if -4.5000000000000001e153 < x1 < -5e102

    1. Initial program 0.0%

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

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

      \[\leadsto x1 + \left(\left(\color{blue}{x1 \cdot \left(6 \cdot \left(2 \cdot x2 - 3\right) + x1 \cdot \left(\left(6 \cdot x2 + \left(8 \cdot x2 + x1 \cdot \left(\left(6 \cdot \left(3 + -2 \cdot x2\right) + 6 \cdot \left(2 \cdot x2 - 3\right)\right) - 6\right)\right)\right) - 12\right)\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 -5e102 < x1 < 2.0000000000000001e152

    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. Recombined 3 regimes into one program.
  4. Final simplification99.2%

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

Alternative 5: 99.0% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;x1 \leq -5 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(t\_4 + \left(x1 + 6 \cdot {x1}^{4}\right)\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x1 < -4.00000000000000015e154 or 2.0000000000000001e152 < x1

    1. Initial program 0.0%

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

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

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

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

    if -4.00000000000000015e154 < x1 < -5e102

    1. Initial program 0.0%

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

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

    if -5e102 < x1 < 2.0000000000000001e152

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

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

Alternative 6: 95.9% accurate, 1.0× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x1 < -5.00000000000000018e153 or 2.0000000000000001e152 < x1

    1. Initial program 0.0%

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

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

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

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

    if -5.00000000000000018e153 < x1 < -1.02000000000000007e98

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

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

    if -1.02000000000000007e98 < x1 < 2.0000000000000001e152

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

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

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

Alternative 7: 93.3% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;x1 \leq -9.2 \cdot 10^{+97}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_2} + \left(x1 + x1 \cdot \left(t\_3 + x1 \cdot \left(\left(x2 \cdot 6 + \left(x2 \cdot 8 + x1 \cdot \left(\left(t\_3 + 6 \cdot \left(3 + x2 \cdot -2\right)\right) - 6\right)\right)\right) - 12\right)\right)\right)\right)\\

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

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

\mathbf{elif}\;x1 \leq 4 \cdot 10^{+102}:\\
\;\;\;\;t\_5\\

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


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

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

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

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

    if -4.00000000000000015e154 < x1 < -9.20000000000000022e97

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

      \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \color{blue}{3}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\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 + \left(\left(\color{blue}{x1 \cdot \left(6 \cdot \left(2 \cdot x2 - 3\right) + x1 \cdot \left(\left(6 \cdot x2 + \left(8 \cdot x2 + x1 \cdot \left(\left(6 \cdot \left(3 + -2 \cdot x2\right) + 6 \cdot \left(2 \cdot x2 - 3\right)\right) - 6\right)\right)\right) - 12\right)\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 -9.20000000000000022e97 < x1 < -1.12e19 or 2.80000000000000019e-7 < x1 < 3.99999999999999991e102

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

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

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

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

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

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

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

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

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

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

    if -1.12e19 < x1 < 2.80000000000000019e-7

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

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

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

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

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

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

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

Alternative 8: 95.9% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;x1 \leq -1.02 \cdot 10^{+98}:\\
\;\;\;\;x1 + \left(t\_3 + \left(x1 + x1 \cdot \left(t\_4 + x1 \cdot \left(\left(x2 \cdot 6 + \left(x2 \cdot 8 + x1 \cdot \left(\left(t\_4 + 6 \cdot \left(3 + x2 \cdot -2\right)\right) - 6\right)\right)\right) - 12\right)\right)\right)\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x1 < -5.00000000000000018e153 or 2.0000000000000001e152 < x1

    1. Initial program 0.0%

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

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

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

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

    if -5.00000000000000018e153 < x1 < -1.02000000000000007e98

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

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

    if -1.02000000000000007e98 < x1 < 2.0000000000000001e152

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

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

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

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

Alternative 9: 88.3% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;x1 \leq -4.5 \cdot 10^{+77}:\\
\;\;\;\;x1 + \left(t\_2 + \left(x1 + x1 \cdot \left(t\_4 + x1 \cdot \left(\left(x2 \cdot 6 + \left(x2 \cdot 8 + x1 \cdot \left(\left(t\_4 + 6 \cdot \left(3 + x2 \cdot -2\right)\right) - 6\right)\right)\right) - 12\right)\right)\right)\right)\\

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

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

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


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

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

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

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

    if -4.5000000000000001e153 < x1 < -4.50000000000000024e77

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

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

      \[\leadsto x1 + \left(\left(\color{blue}{x1 \cdot \left(6 \cdot \left(2 \cdot x2 - 3\right) + x1 \cdot \left(\left(6 \cdot x2 + \left(8 \cdot x2 + x1 \cdot \left(\left(6 \cdot \left(3 + -2 \cdot x2\right) + 6 \cdot \left(2 \cdot x2 - 3\right)\right) - 6\right)\right)\right) - 12\right)\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.50000000000000024e77 < x1 < 2.1e8

    1. Initial program 99.4%

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

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

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

    if 2.1e8 < x1 < 3.99999999999999991e102

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 88.1% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;x1 \leq -6.6 \cdot 10^{+77}:\\
\;\;\;\;x1 + \left(t\_2 + \left(x1 + x1 \cdot \left(t\_4 + x1 \cdot \left(\left(x2 \cdot 6 + \left(x2 \cdot 8 + x1 \cdot \left(\left(t\_4 + 6 \cdot \left(3 + x2 \cdot -2\right)\right) - 6\right)\right)\right) - 12\right)\right)\right)\right)\\

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

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

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


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

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

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

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

    if -4.5000000000000001e153 < x1 < -6.5999999999999996e77

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

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

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

    if -6.5999999999999996e77 < x1 < 1.7e5

    1. Initial program 99.4%

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

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

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

    if 1.7e5 < x1 < 3.99999999999999991e102

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 94.1% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;x1 \leq -1.02 \cdot 10^{+98}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_2} + \left(x1 + x1 \cdot \left(t\_3 + x1 \cdot \left(\left(x2 \cdot 6 + \left(x2 \cdot 8 + x1 \cdot \left(\left(t\_3 + 6 \cdot \left(3 + x2 \cdot -2\right)\right) - 6\right)\right)\right) - 12\right)\right)\right)\right)\\

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

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


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

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

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

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

    if -4.5000000000000001e153 < x1 < -1.02000000000000007e98

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

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

    if -1.02000000000000007e98 < x1 < 3.99999999999999991e102

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

    if 3.99999999999999991e102 < x1

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

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

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

Alternative 12: 84.0% accurate, 1.7× speedup?

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

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

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

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

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


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

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

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

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

    if -4.5000000000000001e153 < x1 < -9.4999999999999998e77

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

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

      \[\leadsto x1 + \left(\left(\color{blue}{x1 \cdot \left(6 \cdot \left(2 \cdot x2 - 3\right) + x1 \cdot \left(\left(6 \cdot x2 + \left(8 \cdot x2 + x1 \cdot \left(\left(6 \cdot \left(3 + -2 \cdot x2\right) + 6 \cdot \left(2 \cdot x2 - 3\right)\right) - 6\right)\right)\right) - 12\right)\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 -9.4999999999999998e77 < x1 < 9.9999999999999998e-17

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

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

    if 9.9999999999999998e-17 < x1

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

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

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

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

Alternative 13: 81.2% accurate, 2.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 + \left(x2 \cdot -6 + x1 \cdot \left(\left(3 \cdot \left(x2 \cdot \left(x1 \cdot 2 + 3 \cdot \frac{x1}{x2}\right)\right) + 4 \cdot \left(x2 \cdot -3\right)\right) - 2\right)\right)\\ \mathbf{if}\;x1 \leq -5.5 \cdot 10^{+157}:\\ \;\;\;\;x1 + \left(x1 + 3 \cdot \left(x1 \cdot \left(x1 \cdot 3 + -1\right)\right)\right)\\ \mathbf{elif}\;x1 \leq -8.5 \cdot 10^{+76}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x1 \leq 850000000:\\ \;\;\;\;x1 + \left(x2 \cdot \left(\left(8 \cdot \left(x1 \cdot x2\right) + x1 \cdot -12\right) - 6\right) + x1 \cdot -2\right)\\ \mathbf{elif}\;x1 \leq 1.85 \cdot 10^{+152}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 - 2\right)\right)\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0
         (+
          x1
          (+
           (* x2 -6.0)
           (*
            x1
            (-
             (+
              (* 3.0 (* x2 (+ (* x1 2.0) (* 3.0 (/ x1 x2)))))
              (* 4.0 (* x2 -3.0)))
             2.0))))))
   (if (<= x1 -5.5e+157)
     (+ x1 (+ x1 (* 3.0 (* x1 (+ (* x1 3.0) -1.0)))))
     (if (<= x1 -8.5e+76)
       t_0
       (if (<= x1 850000000.0)
         (+
          x1
          (+ (* x2 (- (+ (* 8.0 (* x1 x2)) (* x1 -12.0)) 6.0)) (* x1 -2.0)))
         (if (<= x1 1.85e+152)
           t_0
           (+ x1 (+ (* x2 -6.0) (* x1 (- (* x1 9.0) 2.0))))))))))
double code(double x1, double x2) {
	double t_0 = x1 + ((x2 * -6.0) + (x1 * (((3.0 * (x2 * ((x1 * 2.0) + (3.0 * (x1 / x2))))) + (4.0 * (x2 * -3.0))) - 2.0)));
	double tmp;
	if (x1 <= -5.5e+157) {
		tmp = x1 + (x1 + (3.0 * (x1 * ((x1 * 3.0) + -1.0))));
	} else if (x1 <= -8.5e+76) {
		tmp = t_0;
	} else if (x1 <= 850000000.0) {
		tmp = x1 + ((x2 * (((8.0 * (x1 * x2)) + (x1 * -12.0)) - 6.0)) + (x1 * -2.0));
	} else if (x1 <= 1.85e+152) {
		tmp = t_0;
	} else {
		tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 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 + ((x2 * (-6.0d0)) + (x1 * (((3.0d0 * (x2 * ((x1 * 2.0d0) + (3.0d0 * (x1 / x2))))) + (4.0d0 * (x2 * (-3.0d0)))) - 2.0d0)))
    if (x1 <= (-5.5d+157)) then
        tmp = x1 + (x1 + (3.0d0 * (x1 * ((x1 * 3.0d0) + (-1.0d0)))))
    else if (x1 <= (-8.5d+76)) then
        tmp = t_0
    else if (x1 <= 850000000.0d0) then
        tmp = x1 + ((x2 * (((8.0d0 * (x1 * x2)) + (x1 * (-12.0d0))) - 6.0d0)) + (x1 * (-2.0d0)))
    else if (x1 <= 1.85d+152) then
        tmp = t_0
    else
        tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((x1 * 9.0d0) - 2.0d0)))
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double t_0 = x1 + ((x2 * -6.0) + (x1 * (((3.0 * (x2 * ((x1 * 2.0) + (3.0 * (x1 / x2))))) + (4.0 * (x2 * -3.0))) - 2.0)));
	double tmp;
	if (x1 <= -5.5e+157) {
		tmp = x1 + (x1 + (3.0 * (x1 * ((x1 * 3.0) + -1.0))));
	} else if (x1 <= -8.5e+76) {
		tmp = t_0;
	} else if (x1 <= 850000000.0) {
		tmp = x1 + ((x2 * (((8.0 * (x1 * x2)) + (x1 * -12.0)) - 6.0)) + (x1 * -2.0));
	} else if (x1 <= 1.85e+152) {
		tmp = t_0;
	} else {
		tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)));
	}
	return tmp;
}
def code(x1, x2):
	t_0 = x1 + ((x2 * -6.0) + (x1 * (((3.0 * (x2 * ((x1 * 2.0) + (3.0 * (x1 / x2))))) + (4.0 * (x2 * -3.0))) - 2.0)))
	tmp = 0
	if x1 <= -5.5e+157:
		tmp = x1 + (x1 + (3.0 * (x1 * ((x1 * 3.0) + -1.0))))
	elif x1 <= -8.5e+76:
		tmp = t_0
	elif x1 <= 850000000.0:
		tmp = x1 + ((x2 * (((8.0 * (x1 * x2)) + (x1 * -12.0)) - 6.0)) + (x1 * -2.0))
	elif x1 <= 1.85e+152:
		tmp = t_0
	else:
		tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)))
	return tmp
function code(x1, x2)
	t_0 = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(Float64(3.0 * Float64(x2 * Float64(Float64(x1 * 2.0) + Float64(3.0 * Float64(x1 / x2))))) + Float64(4.0 * Float64(x2 * -3.0))) - 2.0))))
	tmp = 0.0
	if (x1 <= -5.5e+157)
		tmp = Float64(x1 + Float64(x1 + Float64(3.0 * Float64(x1 * Float64(Float64(x1 * 3.0) + -1.0)))));
	elseif (x1 <= -8.5e+76)
		tmp = t_0;
	elseif (x1 <= 850000000.0)
		tmp = Float64(x1 + Float64(Float64(x2 * Float64(Float64(Float64(8.0 * Float64(x1 * x2)) + Float64(x1 * -12.0)) - 6.0)) + Float64(x1 * -2.0)));
	elseif (x1 <= 1.85e+152)
		tmp = t_0;
	else
		tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * 9.0) - 2.0))));
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	t_0 = x1 + ((x2 * -6.0) + (x1 * (((3.0 * (x2 * ((x1 * 2.0) + (3.0 * (x1 / x2))))) + (4.0 * (x2 * -3.0))) - 2.0)));
	tmp = 0.0;
	if (x1 <= -5.5e+157)
		tmp = x1 + (x1 + (3.0 * (x1 * ((x1 * 3.0) + -1.0))));
	elseif (x1 <= -8.5e+76)
		tmp = t_0;
	elseif (x1 <= 850000000.0)
		tmp = x1 + ((x2 * (((8.0 * (x1 * x2)) + (x1 * -12.0)) - 6.0)) + (x1 * -2.0));
	elseif (x1 <= 1.85e+152)
		tmp = t_0;
	else
		tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.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[(N[(3.0 * N[(x2 * N[(N[(x1 * 2.0), $MachinePrecision] + N[(3.0 * N[(x1 / x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(4.0 * N[(x2 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.5e+157], N[(x1 + N[(x1 + N[(3.0 * N[(x1 * N[(N[(x1 * 3.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -8.5e+76], t$95$0, If[LessEqual[x1, 850000000.0], N[(x1 + N[(N[(x2 * N[(N[(N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision] + N[(x1 * -12.0), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.85e+152], t$95$0, N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x1 \leq -8.5 \cdot 10^{+76}:\\
\;\;\;\;t\_0\\

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

\mathbf{elif}\;x1 \leq 1.85 \cdot 10^{+152}:\\
\;\;\;\;t\_0\\

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


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

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

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

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

    if -5.5000000000000003e157 < x1 < -8.49999999999999992e76 or 8.5e8 < x1 < 1.84999999999999998e152

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

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

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

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

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

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

    if -8.49999999999999992e76 < x1 < 8.5e8

    1. Initial program 99.4%

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

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

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

    if 1.84999999999999998e152 < x1

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -5.5 \cdot 10^{+157}:\\ \;\;\;\;x1 + \left(x1 + 3 \cdot \left(x1 \cdot \left(x1 \cdot 3 + -1\right)\right)\right)\\ \mathbf{elif}\;x1 \leq -8.5 \cdot 10^{+76}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(\left(3 \cdot \left(x2 \cdot \left(x1 \cdot 2 + 3 \cdot \frac{x1}{x2}\right)\right) + 4 \cdot \left(x2 \cdot -3\right)\right) - 2\right)\right)\\ \mathbf{elif}\;x1 \leq 850000000:\\ \;\;\;\;x1 + \left(x2 \cdot \left(\left(8 \cdot \left(x1 \cdot x2\right) + x1 \cdot -12\right) - 6\right) + x1 \cdot -2\right)\\ \mathbf{elif}\;x1 \leq 1.85 \cdot 10^{+152}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(\left(3 \cdot \left(x2 \cdot \left(x1 \cdot 2 + 3 \cdot \frac{x1}{x2}\right)\right) + 4 \cdot \left(x2 \cdot -3\right)\right) - 2\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 - 2\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 80.1% accurate, 2.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -5.5 \cdot 10^{+157}:\\
\;\;\;\;x1 + \left(x1 + 3 \cdot \left(x1 \cdot \left(x1 \cdot 3 + -1\right)\right)\right)\\

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

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


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

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

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

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

    if -5.5000000000000003e157 < x1 < 9.9999999999999998e-17

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

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

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

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

    if 9.9999999999999998e-17 < x1

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

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

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

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

Alternative 15: 80.2% accurate, 2.9× speedup?

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

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

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

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


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

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

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

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

    if -5.5000000000000003e157 < x1 < 1.35e70

    1. Initial program 91.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 70.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 72.5%

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

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

    if 1.35e70 < x1 < 1.84999999999999998e152

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

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

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

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

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

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

    if 1.84999999999999998e152 < x1

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

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

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

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

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

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

Alternative 16: 68.3% accurate, 2.9× speedup?

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

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

\mathbf{elif}\;x1 \leq -1.1 \cdot 10^{-131}:\\
\;\;\;\;t\_0\\

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

\mathbf{elif}\;x1 \leq 6.8 \cdot 10^{+72}:\\
\;\;\;\;t\_0\\

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

\mathbf{elif}\;x1 \leq 4.5 \cdot 10^{+153}:\\
\;\;\;\;t\_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x1 < -2.99999999999999991e95 or 4.5000000000000001e153 < x1

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

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

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

    if -2.99999999999999991e95 < x1 < -1.1e-131 or 1.0200000000000001e-175 < x1 < 6.7999999999999997e72 or 1.4000000000000001e112 < x1 < 4.5000000000000001e153

    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 74.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 73.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)} \]
    5. Taylor expanded in x1 around inf 65.6%

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

    if -1.1e-131 < x1 < 1.0200000000000001e-175

    1. Initial program 99.8%

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

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

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

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

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

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

    if 6.7999999999999997e72 < x1 < 1.4000000000000001e112

    1. Initial program 100.0%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -3 \cdot 10^{+95}:\\ \;\;\;\;x1 + \left(x1 + 3 \cdot \left(x1 \cdot \left(x1 \cdot 3 + -1\right)\right)\right)\\ \mathbf{elif}\;x1 \leq -1.1 \cdot 10^{-131}:\\ \;\;\;\;x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) + -1\right)\\ \mathbf{elif}\;x1 \leq 1.02 \cdot 10^{-175}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\ \mathbf{elif}\;x1 \leq 6.8 \cdot 10^{+72}:\\ \;\;\;\;x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) + -1\right)\\ \mathbf{elif}\;x1 \leq 1.4 \cdot 10^{+112}:\\ \;\;\;\;x2 \cdot \left(\frac{x1}{x2} - 6\right)\\ \mathbf{elif}\;x1 \leq 4.5 \cdot 10^{+153}:\\ \;\;\;\;x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) + -1\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x1 + 3 \cdot \left(x1 \cdot \left(x1 \cdot 3 + -1\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 80.5% accurate, 3.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -5.5 \cdot 10^{+157}:\\
\;\;\;\;x1 + \left(x1 + 3 \cdot \left(x1 \cdot \left(x1 \cdot 3 + -1\right)\right)\right)\\

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


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

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

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

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

    if -5.5000000000000003e157 < x1 < 9.9999999999999998e-17

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

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

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

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

    if 9.9999999999999998e-17 < x1

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

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

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

Alternative 18: 75.1% accurate, 3.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x2 \cdot -6 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) + -1\right)\\ t_1 := x1 + \left(x1 + 3 \cdot \left(x1 \cdot \left(x1 \cdot 3 + -1\right)\right)\right)\\ \mathbf{if}\;x1 \leq -5.5 \cdot 10^{+157}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x1 \leq -1.15 \cdot 10^{+78}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x1 \cdot \left(x2 \cdot 6 + 9\right) - 2\right)\right)\\ \mathbf{elif}\;x1 \leq -1.2 \cdot 10^{-256}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x1 \leq 2.5 \cdot 10^{-265}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\ \mathbf{elif}\;x1 \leq 4.5 \cdot 10^{+153}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (+ (* x2 -6.0) (* x1 (+ (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) -1.0))))
        (t_1 (+ x1 (+ x1 (* 3.0 (* x1 (+ (* x1 3.0) -1.0)))))))
   (if (<= x1 -5.5e+157)
     t_1
     (if (<= x1 -1.15e+78)
       (+ x1 (+ (* x2 -6.0) (* x1 (- (* x1 (+ (* x2 6.0) 9.0)) 2.0))))
       (if (<= x1 -1.2e-256)
         t_0
         (if (<= x1 2.5e-265)
           (+ x1 (+ (* x2 -6.0) (* x1 -2.0)))
           (if (<= x1 4.5e+153) t_0 t_1)))))))
double code(double x1, double x2) {
	double t_0 = (x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0));
	double t_1 = x1 + (x1 + (3.0 * (x1 * ((x1 * 3.0) + -1.0))));
	double tmp;
	if (x1 <= -5.5e+157) {
		tmp = t_1;
	} else if (x1 <= -1.15e+78) {
		tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * ((x2 * 6.0) + 9.0)) - 2.0)));
	} else if (x1 <= -1.2e-256) {
		tmp = t_0;
	} else if (x1 <= 2.5e-265) {
		tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
	} else if (x1 <= 4.5e+153) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x1, x2)
    real(8), intent (in) :: x1
    real(8), intent (in) :: x2
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = (x2 * (-6.0d0)) + (x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) + (-1.0d0)))
    t_1 = x1 + (x1 + (3.0d0 * (x1 * ((x1 * 3.0d0) + (-1.0d0)))))
    if (x1 <= (-5.5d+157)) then
        tmp = t_1
    else if (x1 <= (-1.15d+78)) then
        tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((x1 * ((x2 * 6.0d0) + 9.0d0)) - 2.0d0)))
    else if (x1 <= (-1.2d-256)) then
        tmp = t_0
    else if (x1 <= 2.5d-265) then
        tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (-2.0d0)))
    else if (x1 <= 4.5d+153) then
        tmp = t_0
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double t_0 = (x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0));
	double t_1 = x1 + (x1 + (3.0 * (x1 * ((x1 * 3.0) + -1.0))));
	double tmp;
	if (x1 <= -5.5e+157) {
		tmp = t_1;
	} else if (x1 <= -1.15e+78) {
		tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * ((x2 * 6.0) + 9.0)) - 2.0)));
	} else if (x1 <= -1.2e-256) {
		tmp = t_0;
	} else if (x1 <= 2.5e-265) {
		tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
	} else if (x1 <= 4.5e+153) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x1, x2):
	t_0 = (x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0))
	t_1 = x1 + (x1 + (3.0 * (x1 * ((x1 * 3.0) + -1.0))))
	tmp = 0
	if x1 <= -5.5e+157:
		tmp = t_1
	elif x1 <= -1.15e+78:
		tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * ((x2 * 6.0) + 9.0)) - 2.0)))
	elif x1 <= -1.2e-256:
		tmp = t_0
	elif x1 <= 2.5e-265:
		tmp = x1 + ((x2 * -6.0) + (x1 * -2.0))
	elif x1 <= 4.5e+153:
		tmp = t_0
	else:
		tmp = t_1
	return tmp
function code(x1, x2)
	t_0 = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) + -1.0)))
	t_1 = Float64(x1 + Float64(x1 + Float64(3.0 * Float64(x1 * Float64(Float64(x1 * 3.0) + -1.0)))))
	tmp = 0.0
	if (x1 <= -5.5e+157)
		tmp = t_1;
	elseif (x1 <= -1.15e+78)
		tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * Float64(Float64(x2 * 6.0) + 9.0)) - 2.0))));
	elseif (x1 <= -1.2e-256)
		tmp = t_0;
	elseif (x1 <= 2.5e-265)
		tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * -2.0)));
	elseif (x1 <= 4.5e+153)
		tmp = t_0;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	t_0 = (x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0));
	t_1 = x1 + (x1 + (3.0 * (x1 * ((x1 * 3.0) + -1.0))));
	tmp = 0.0;
	if (x1 <= -5.5e+157)
		tmp = t_1;
	elseif (x1 <= -1.15e+78)
		tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * ((x2 * 6.0) + 9.0)) - 2.0)));
	elseif (x1 <= -1.2e-256)
		tmp = t_0;
	elseif (x1 <= 2.5e-265)
		tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
	elseif (x1 <= 4.5e+153)
		tmp = t_0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := Block[{t$95$0 = 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] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(x1 + N[(3.0 * N[(x1 * N[(N[(x1 * 3.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.5e+157], t$95$1, If[LessEqual[x1, -1.15e+78], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * N[(N[(x2 * 6.0), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -1.2e-256], t$95$0, If[LessEqual[x1, 2.5e-265], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.5e+153], t$95$0, t$95$1]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;x1 \leq -1.2 \cdot 10^{-256}:\\
\;\;\;\;t\_0\\

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

\mathbf{elif}\;x1 \leq 4.5 \cdot 10^{+153}:\\
\;\;\;\;t\_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x1 < -5.5000000000000003e157 or 4.5000000000000001e153 < x1

    1. Initial program 0.0%

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

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

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

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

    if -5.5000000000000003e157 < x1 < -1.1500000000000001e78

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x1 + \left(-6 \cdot x2 + x1 \cdot \left(x1 \cdot \left(9 + 3 \cdot \color{blue}{\left(--2 \cdot x2\right)}\right) - 2\right)\right) \]
      10. distribute-rgt-neg-in47.1%

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

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

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

        \[\leadsto x1 + \left(-6 \cdot x2 + x1 \cdot \left(x1 \cdot \left(9 + \left(-\color{blue}{x2 \cdot -6}\right)\right) - 2\right)\right) \]
      14. distribute-rgt-neg-in47.1%

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

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

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

    if -1.1500000000000001e78 < x1 < -1.2e-256 or 2.5e-265 < x1 < 4.5000000000000001e153

    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 72.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 72.0%

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

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

    if -1.2e-256 < x1 < 2.5e-265

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -5.5 \cdot 10^{+157}:\\ \;\;\;\;x1 + \left(x1 + 3 \cdot \left(x1 \cdot \left(x1 \cdot 3 + -1\right)\right)\right)\\ \mathbf{elif}\;x1 \leq -1.15 \cdot 10^{+78}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x1 \cdot \left(x2 \cdot 6 + 9\right) - 2\right)\right)\\ \mathbf{elif}\;x1 \leq -1.2 \cdot 10^{-256}:\\ \;\;\;\;x2 \cdot -6 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) + -1\right)\\ \mathbf{elif}\;x1 \leq 2.5 \cdot 10^{-265}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\ \mathbf{elif}\;x1 \leq 4.5 \cdot 10^{+153}:\\ \;\;\;\;x2 \cdot -6 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) + -1\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x1 + 3 \cdot \left(x1 \cdot \left(x1 \cdot 3 + -1\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 79.4% accurate, 3.2× speedup?

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

\\
\begin{array}{l}
t_0 := x1 + \left(x1 + 3 \cdot \left(x1 \cdot \left(x1 \cdot 3 + -1\right)\right)\right)\\
\mathbf{if}\;x1 \leq -5.5 \cdot 10^{+157}:\\
\;\;\;\;t\_0\\

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if x1 < -5.5000000000000003e157 or 4.5000000000000001e153 < x1

    1. Initial program 0.0%

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

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

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

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

    if -5.5000000000000003e157 < x1 < -1.00000000000000001e78

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x1 + \left(-6 \cdot x2 + x1 \cdot \left(x1 \cdot \left(9 + 3 \cdot \color{blue}{\left(--2 \cdot x2\right)}\right) - 2\right)\right) \]
      10. distribute-rgt-neg-in47.1%

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

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

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

        \[\leadsto x1 + \left(-6 \cdot x2 + x1 \cdot \left(x1 \cdot \left(9 + \left(-\color{blue}{x2 \cdot -6}\right)\right) - 2\right)\right) \]
      14. distribute-rgt-neg-in47.1%

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

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

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

    if -1.00000000000000001e78 < x1 < 1.7999999999999999e73

    1. Initial program 99.4%

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

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

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

    if 1.7999999999999999e73 < x1 < 6e111

    1. Initial program 100.0%

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

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

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

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

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

    if 6e111 < x1 < 4.5000000000000001e153

    1. Initial program 100.0%

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

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

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

Alternative 20: 66.6% accurate, 4.0× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x2 < -2e65 or 2.3499999999999999e188 < x2

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

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

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

    if -2e65 < x2 < 3.9999999999999999e-147

    1. Initial program 66.4%

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

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

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

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

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

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

    if 3.9999999999999999e-147 < x2 < 2.3499999999999999e188

    1. Initial program 62.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 47.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 81.6%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x1 + \left(-6 \cdot x2 + x1 \cdot \left(x1 \cdot \left(9 + 3 \cdot \color{blue}{\left(--2 \cdot x2\right)}\right) - 2\right)\right) \]
      10. distribute-rgt-neg-in78.6%

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

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

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

        \[\leadsto x1 + \left(-6 \cdot x2 + x1 \cdot \left(x1 \cdot \left(9 + \left(-\color{blue}{x2 \cdot -6}\right)\right) - 2\right)\right) \]
      14. distribute-rgt-neg-in78.6%

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

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

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

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

Alternative 21: 47.2% accurate, 5.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -4 \cdot 10^{+56} \lor \neg \left(x2 \leq 5.4 \cdot 10^{+41}\right):\\
\;\;\;\;x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) + -1\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x2 < -4.00000000000000037e56 or 5.39999999999999999e41 < x2

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

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

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

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

    if -4.00000000000000037e56 < x2 < 5.39999999999999999e41

    1. Initial program 65.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 46.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 47.1%

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

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

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

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

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

Alternative 22: 64.9% accurate, 5.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -3.1 \cdot 10^{+65} \lor \neg \left(x2 \leq 10^{+121}\right):\\
\;\;\;\;x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) + -1\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x2 < -3.09999999999999991e65 or 1.00000000000000004e121 < x2

    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 54.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 66.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)} \]
    5. Taylor expanded in x1 around inf 64.1%

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

    if -3.09999999999999991e65 < x2 < 1.00000000000000004e121

    1. Initial program 63.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 46.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 76.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)} \]
    5. Taylor expanded in x2 around 0 73.8%

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

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

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

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

Alternative 23: 31.9% accurate, 5.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -3.15 \cdot 10^{-133}:\\
\;\;\;\;-x1\\

\mathbf{elif}\;x1 \leq 1.4 \cdot 10^{-152}:\\
\;\;\;\;x2 \cdot -6\\

\mathbf{elif}\;x1 \leq 4.5 \cdot 10^{-46}:\\
\;\;\;\;-x1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x1 < -3.1500000000000001e-133 or 1.39999999999999992e-152 < x1 < 4.50000000000000001e-46

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

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

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

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

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

        \[\leadsto \color{blue}{-x1} \]
    7. Simplified26.1%

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

    if -3.1500000000000001e-133 < x1 < 1.39999999999999992e-152

    1. Initial program 99.8%

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

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

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

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

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

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

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

    if 4.50000000000000001e-46 < x1

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -3.15 \cdot 10^{-133}:\\ \;\;\;\;-x1\\ \mathbf{elif}\;x1 \leq 1.4 \cdot 10^{-152}:\\ \;\;\;\;x2 \cdot -6\\ \mathbf{elif}\;x1 \leq 4.5 \cdot 10^{-46}:\\ \;\;\;\;-x1\\ \mathbf{else}:\\ \;\;\;\;x2 \cdot \left(\frac{x1}{x2} - 6\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 24: 27.8% accurate, 8.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -2.35 \cdot 10^{-129} \lor \neg \left(x2 \leq 4.7 \cdot 10^{-142}\right):\\
\;\;\;\;x1 + x2 \cdot -6\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x2 < -2.3500000000000001e-129 or 4.6999999999999999e-142 < x2

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

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

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

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

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

    if -2.3500000000000001e-129 < x2 < 4.6999999999999999e-142

    1. Initial program 66.8%

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

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

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

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

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

        \[\leadsto \color{blue}{-x1} \]
    7. Simplified40.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x2 \leq -2.35 \cdot 10^{-129} \lor \neg \left(x2 \leq 4.7 \cdot 10^{-142}\right):\\ \;\;\;\;x1 + x2 \cdot -6\\ \mathbf{else}:\\ \;\;\;\;-x1\\ \end{array} \]
  5. Add Preprocessing

Alternative 25: 41.2% accurate, 9.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x1 \leq 1.35:\\ \;\;\;\;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.35) (+ x1 (+ (* x2 -6.0) (* x1 -2.0))) (* x2 (- (/ x1 x2) 6.0))))
double code(double x1, double x2) {
	double tmp;
	if (x1 <= 1.35) {
		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.35d0) 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.35) {
		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.35:
		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.35)
		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.35)
		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.35], 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.35:\\
\;\;\;\;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.3500000000000001

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

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

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

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

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

    if 1.3500000000000001 < x1

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq 1.35:\\ \;\;\;\;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 26: 27.6% accurate, 9.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -5.2 \cdot 10^{-128} \lor \neg \left(x2 \leq 5 \cdot 10^{-142}\right):\\
\;\;\;\;x2 \cdot -6\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x2 < -5.19999999999999961e-128 or 5.0000000000000002e-142 < x2

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

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

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

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

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

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

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

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

    if -5.19999999999999961e-128 < x2 < 5.0000000000000002e-142

    1. Initial program 66.8%

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

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

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

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

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

        \[\leadsto \color{blue}{-x1} \]
    7. Simplified40.2%

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

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

Alternative 27: 16.2% accurate, 18.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x1 \leq 2.8 \cdot 10^{-7}:\\ \;\;\;\;-x1\\ \mathbf{else}:\\ \;\;\;\;x1\\ \end{array} \end{array} \]
(FPCore (x1 x2) :precision binary64 (if (<= x1 2.8e-7) (- x1) x1))
double code(double x1, double x2) {
	double tmp;
	if (x1 <= 2.8e-7) {
		tmp = -x1;
	} else {
		tmp = x1;
	}
	return tmp;
}
real(8) function code(x1, x2)
    real(8), intent (in) :: x1
    real(8), intent (in) :: x2
    real(8) :: tmp
    if (x1 <= 2.8d-7) then
        tmp = -x1
    else
        tmp = x1
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double tmp;
	if (x1 <= 2.8e-7) {
		tmp = -x1;
	} else {
		tmp = x1;
	}
	return tmp;
}
def code(x1, x2):
	tmp = 0
	if x1 <= 2.8e-7:
		tmp = -x1
	else:
		tmp = x1
	return tmp
function code(x1, x2)
	tmp = 0.0
	if (x1 <= 2.8e-7)
		tmp = Float64(-x1);
	else
		tmp = x1;
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	tmp = 0.0;
	if (x1 <= 2.8e-7)
		tmp = -x1;
	else
		tmp = x1;
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := If[LessEqual[x1, 2.8e-7], (-x1), x1]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq 2.8 \cdot 10^{-7}:\\
\;\;\;\;-x1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x1 < 2.80000000000000019e-7

    1. Initial program 76.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 62.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 63.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)} \]
    5. Taylor expanded in x2 around 0 20.1%

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

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

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

        \[\leadsto \color{blue}{-x1} \]
    7. Simplified20.1%

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

    if 2.80000000000000019e-7 < x1

    1. Initial program 49.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq 2.8 \cdot 10^{-7}:\\ \;\;\;\;-x1\\ \mathbf{else}:\\ \;\;\;\;x1\\ \end{array} \]
  5. Add Preprocessing

Alternative 28: 3.2% accurate, 127.0× speedup?

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

\\
x1
\end{array}
Derivation
  1. Initial program 68.8%

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

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

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

    \[\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 2024075 
(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))))))