Rosa's FloatVsDoubleBenchmark

Percentage Accurate: 70.8% → 99.4%
Time: 1.1min
Alternatives: 25
Speedup: 5.1×

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

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

Initial Program: 70.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.4% accurate, 0.1× speedup?

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

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

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


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

    1. Initial program 99.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)}, x1 + \mathsf{fma}\left(\mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, x1 \cdot \mathsf{fma}\left(\frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}, 4, -6\right), \left(x1 \cdot \left(2 \cdot \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\right)\right) \cdot \left(\frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)} + -3\right)\right), \mathsf{fma}\left(3 \cdot \left(x1 \cdot x1\right), \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}, {x1}^{3}\right)\right)\right)} \]
    3. Add Preprocessing

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

    1. Initial program 0.0%

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

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

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

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

Alternative 2: 99.2% accurate, 0.5× speedup?

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

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

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


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

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

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

    1. Initial program 0.0%

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

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

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

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

Alternative 3: 96.0% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;x1 \leq -0.004:\\
\;\;\;\;x1 + \left(\left(x1 + \left(\left(t\_0 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_5\right) \cdot \left(3 + t\_5\right) + \left(x1 \cdot x1\right) \cdot \left(t\_4 \cdot 4 - 6\right)\right) + t\_2 \cdot t\_4\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 9\right)\\

\mathbf{elif}\;x1 \leq 2.85 \cdot 10^{+23}:\\
\;\;\;\;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}:\\
\;\;\;\;t\_1\\


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

    1. Initial program 19.8%

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

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

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

    if -5e102 < x1 < -0.0040000000000000001

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

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

    if -0.0040000000000000001 < x1 < 2.85e23

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

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

      \[\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) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification98.1%

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

Alternative 4: 96.0% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;x1 \leq -0.86:\\
\;\;\;\;x1 + \left(9 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(\left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_4\right) + \left(\left(x1 \cdot 2\right) \cdot t\_2\right) \cdot \left(3 + t\_4\right)\right) \cdot t\_0 + t\_3 \cdot t\_2\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 2.85 \cdot 10^{+23}:\\
\;\;\;\;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}:\\
\;\;\;\;t\_1\\


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

    1. Initial program 19.8%

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

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

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

    if -5e102 < x1 < -0.859999999999999987

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

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

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

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

    if -0.859999999999999987 < x1 < 2.85e23

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

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

      \[\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) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification98.0%

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

Alternative 5: 95.9% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;x1 \leq -0.62:\\
\;\;\;\;x1 + \left(9 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_1 \cdot t\_4 + \left(\frac{x2 \cdot 4}{x1} \cdot \left(3 + \frac{t\_3}{t\_2}\right) - \left(x1 \cdot x1\right) \cdot \left(t\_4 \cdot 4 - 6\right)\right) \cdot t\_2\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 2.85 \cdot 10^{+23}:\\
\;\;\;\;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}:\\
\;\;\;\;t\_0\\


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

    1. Initial program 19.8%

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

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

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

    if -5e102 < x1 < -0.619999999999999996

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

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

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

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

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

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

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

    if -0.619999999999999996 < x1 < 2.85e23

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

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

      \[\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) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification97.9%

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

Alternative 6: 97.2% accurate, 1.1× speedup?

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

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

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

\mathbf{elif}\;x1 \leq 102000000:\\
\;\;\;\;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 8.5 \cdot 10^{+151}:\\
\;\;\;\;t\_4\\

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


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

    1. Initial program 0.0%

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

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

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

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

    if -5e102 < x1 < -0.599999999999999978 or 1.02e8 < x1 < 8.50000000000000051e151

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

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

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

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

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

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

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

    if -0.599999999999999978 < x1 < 1.02e8

    1. Initial program 98.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 85.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 85.1%

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

      \[\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 8.50000000000000051e151 < x1

    1. Initial program 3.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 0.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 87.9%

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

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

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

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

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

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

Alternative 7: 94.0% accurate, 1.1× speedup?

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

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

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

\mathbf{elif}\;x1 \leq 2.85 \cdot 10^{+23}:\\
\;\;\;\;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 8.5 \cdot 10^{+151}:\\
\;\;\;\;t\_4\\

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


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

    1. Initial program 0.0%

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

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

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

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

    if -5e102 < x1 < -2.39999999999999991 or 2.85e23 < x1 < 8.50000000000000051e151

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

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

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

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

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

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

    if -2.39999999999999991 < x1 < 2.85e23

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

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

      \[\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 8.50000000000000051e151 < x1

    1. Initial program 3.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 0.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 87.9%

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

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

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

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

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

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

Alternative 8: 94.0% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;x1 \leq -2.4:\\
\;\;\;\;x1 + \left(9 - \left(\left(\left(t\_1 \cdot t\_4 + \left(\left(x1 \cdot x1\right) \cdot \left(t\_3 \cdot 4 - 6\right) + \left(t\_3 - 3\right) \cdot \left(x1 \cdot 6\right)\right) \cdot t\_0\right) - t\_5\right) - x1\right)\right)\\

\mathbf{elif}\;x1 \leq 2.85 \cdot 10^{+23}:\\
\;\;\;\;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 8.5 \cdot 10^{+151}:\\
\;\;\;\;x1 + \left(9 + \left(x1 + \left(t\_5 + \left(t\_1 \cdot t\_3 + \left(\frac{-1}{x1} \cdot \left(\left(x1 \cdot 2\right) \cdot t\_4\right) - \left(x1 \cdot x1\right) \cdot \left(4 \cdot \left(3 + \frac{-1 - \frac{3 - 2 \cdot x2}{x1}}{x1}\right) - 6\right)\right) \cdot t\_0\right)\right)\right)\right)\\

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


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

    1. Initial program 0.0%

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

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

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

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

    if -5e102 < x1 < -2.39999999999999991

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

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

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

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

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

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

    if -2.39999999999999991 < x1 < 2.85e23

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

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

      \[\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.85e23 < x1 < 8.50000000000000051e151

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

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

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

    if 8.50000000000000051e151 < x1

    1. Initial program 3.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 0.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 87.9%

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

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

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

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

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

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

Alternative 9: 94.0% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;x1 \leq -2.4:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;x1 \leq 3.6 \cdot 10^{+23}:\\
\;\;\;\;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 8.5 \cdot 10^{+151}:\\
\;\;\;\;t\_2\\

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


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

    1. Initial program 0.0%

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

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

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

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

    if -5e102 < x1 < -2.39999999999999991 or 3.5999999999999998e23 < x1 < 8.50000000000000051e151

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

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

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

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

    if -2.39999999999999991 < x1 < 3.5999999999999998e23

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

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

      \[\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 8.50000000000000051e151 < x1

    1. Initial program 3.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 0.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 87.9%

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

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

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

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

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

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

Alternative 10: 84.3% accurate, 2.8× speedup?

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

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

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


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

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

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

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

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

    if -3.00000000000000023e46 < x1 < 6.80000000000000036e90

    1. Initial program 98.6%

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

    1. Initial program 31.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 12.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 89.8%

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

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

Alternative 11: 78.7% accurate, 2.9× speedup?

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

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

\mathbf{elif}\;x1 \leq -1.15 \cdot 10^{-226}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;x1 \leq 4.8 \cdot 10^{-266}:\\
\;\;\;\;x2 \cdot -6 - x1\\

\mathbf{elif}\;x1 \leq 1.2 \cdot 10^{+97}:\\
\;\;\;\;t\_0\\

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


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

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

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

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

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

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

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

    if -8.9999999999999998e92 < x1 < -1.15e-226 or 4.7999999999999999e-266 < x1 < 1.2e97

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

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

    if -1.15e-226 < x1 < 4.7999999999999999e-266

    1. Initial program 99.6%

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

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

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

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

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

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

        \[\leadsto \color{blue}{x2 \cdot -6} + -1 \cdot x1 \]
      2. mul-1-neg99.8%

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

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

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

    if 1.2e97 < x1

    1. Initial program 26.2%

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

      \[\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) \]
    4. Taylor expanded in x1 around 0 88.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -9 \cdot 10^{+92}:\\ \;\;\;\;x1 - x2 \cdot \left(6 + \frac{x1 \cdot \left(2 - x1 \cdot 9\right)}{x2}\right)\\ \mathbf{elif}\;x1 \leq -1.15 \cdot 10^{-226}:\\ \;\;\;\;x1 - \left(x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right) - x2 \cdot -6\right)\\ \mathbf{elif}\;x1 \leq 4.8 \cdot 10^{-266}:\\ \;\;\;\;x2 \cdot -6 - x1\\ \mathbf{elif}\;x1 \leq 1.2 \cdot 10^{+97}:\\ \;\;\;\;x1 - \left(x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right) - x2 \cdot -6\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x1 \cdot \left(x1 \cdot 3 - 3 \cdot \left(x2 \cdot -2 - 3\right)\right) - 2\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 83.3% accurate, 3.0× speedup?

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

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

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


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

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

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

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

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

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

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

    if -5.1999999999999998e92 < x1 < 9.2000000000000007e87

    1. Initial program 98.6%

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

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

      \[\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.2000000000000007e87 < x1

    1. Initial program 31.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 12.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 89.8%

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

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

Alternative 13: 77.8% accurate, 3.3× speedup?

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

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

\mathbf{elif}\;x1 \leq -5.6 \cdot 10^{-226}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;x1 \leq 1.25 \cdot 10^{-266}:\\
\;\;\;\;x2 \cdot -6 - x1\\

\mathbf{elif}\;x1 \leq 1.15 \cdot 10^{+98}:\\
\;\;\;\;t\_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x1 < -5.1999999999999998e92 or 1.15000000000000007e98 < x1

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

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

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

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

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

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

    if -5.1999999999999998e92 < x1 < -5.60000000000000016e-226 or 1.24999999999999998e-266 < x1 < 1.15000000000000007e98

    1. Initial program 98.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 74.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 74.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)} \]

    if -5.60000000000000016e-226 < x1 < 1.24999999999999998e-266

    1. Initial program 99.6%

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

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

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

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

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

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

        \[\leadsto \color{blue}{x2 \cdot -6} + -1 \cdot x1 \]
      2. mul-1-neg99.8%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -5.2 \cdot 10^{+92}:\\ \;\;\;\;x1 - x2 \cdot \left(6 + \frac{x1 \cdot \left(2 - x1 \cdot 9\right)}{x2}\right)\\ \mathbf{elif}\;x1 \leq -5.6 \cdot 10^{-226}:\\ \;\;\;\;x1 - \left(x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right) - x2 \cdot -6\right)\\ \mathbf{elif}\;x1 \leq 1.25 \cdot 10^{-266}:\\ \;\;\;\;x2 \cdot -6 - x1\\ \mathbf{elif}\;x1 \leq 1.15 \cdot 10^{+98}:\\ \;\;\;\;x1 - \left(x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right) - x2 \cdot -6\right)\\ \mathbf{else}:\\ \;\;\;\;x1 - x2 \cdot \left(6 + \frac{x1 \cdot \left(2 - x1 \cdot 9\right)}{x2}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 83.2% accurate, 3.3× speedup?

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

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

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


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

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

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

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

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

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

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

    if -5.1999999999999998e92 < x1 < 2.24999999999999988e97

    1. Initial program 98.6%

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

    1. Initial program 26.2%

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

      \[\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) \]
    4. Taylor expanded in x1 around 0 88.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -5.2 \cdot 10^{+92}:\\ \;\;\;\;x1 - x2 \cdot \left(6 + \frac{x1 \cdot \left(2 - x1 \cdot 9\right)}{x2}\right)\\ \mathbf{elif}\;x1 \leq 2.25 \cdot 10^{+97}:\\ \;\;\;\;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(x1 \cdot \left(x1 \cdot 3 - 3 \cdot \left(x2 \cdot -2 - 3\right)\right) - 2\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 73.2% accurate, 3.3× speedup?

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

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

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

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


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

    1. Initial program 75.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 87.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 inf 100.0%

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

    if -1.79999999999999989e263 < x2 < 4.99999999999999999e-79

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

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

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

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

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

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

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

    if 4.99999999999999999e-79 < x2

    1. Initial program 76.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 50.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 70.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)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification78.6%

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

Alternative 16: 72.1% accurate, 5.1× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x2 < -1.79999999999999989e263 or 3.8500000000000001e214 < x2

    1. Initial program 82.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 65.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 inf 73.0%

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

    if -1.79999999999999989e263 < x2 < 3.8500000000000001e214

    1. Initial program 65.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 47.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 70.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 72.1%

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

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

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

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

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

Alternative 17: 67.9% accurate, 5.1× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x2 < -1.79999999999999989e263 or 7.2000000000000002e214 < x2

    1. Initial program 82.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 65.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 inf 73.0%

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

    if -1.79999999999999989e263 < x2 < 7.2000000000000002e214

    1. Initial program 65.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 47.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 70.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 72.1%

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

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

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

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

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

Alternative 18: 62.8% accurate, 6.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -4.6 \cdot 10^{-46} \lor \neg \left(x1 \leq 102000000\right):\\
\;\;\;\;x1 - x1 \cdot \left(2 - x1 \cdot 9\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x1 < -4.5999999999999998e-46 or 1.02e8 < x1

    1. Initial program 37.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 15.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 54.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 55.8%

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

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

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

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

    if -4.5999999999999998e-46 < x1 < 1.02e8

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

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

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

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

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

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

        \[\leadsto \color{blue}{x2 \cdot -6} + -1 \cdot x1 \]
      2. mul-1-neg77.5%

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

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

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

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

Alternative 19: 44.7% accurate, 10.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq 1.15 \cdot 10^{-12}:\\
\;\;\;\;x2 \cdot -6 - x1\\

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


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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x2 \cdot -6} + -1 \cdot x1 \]
      2. mul-1-neg52.8%

        \[\leadsto x2 \cdot -6 + \color{blue}{\left(-x1\right)} \]
      3. unsub-neg52.8%

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

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

    if 1.14999999999999995e-12 < x1

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

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

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

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

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

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

      \[\leadsto \color{blue}{x2 \cdot \left(\frac{x1}{x2} - 10\right)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 20: 63.4% accurate, 11.5× speedup?

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

\\
x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 + -1\right)
\end{array}
Derivation
  1. Initial program 67.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 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 69.1%

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

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

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

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

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

    \[\leadsto x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 + -1\right) \]
  10. Add Preprocessing

Alternative 21: 38.7% accurate, 25.4× speedup?

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

\\
x2 \cdot -6 - x1
\end{array}
Derivation
  1. Initial program 67.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 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 69.1%

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

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

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

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

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

      \[\leadsto \color{blue}{x2 \cdot -6} + -1 \cdot x1 \]
    2. mul-1-neg41.5%

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

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

    \[\leadsto \color{blue}{x2 \cdot -6 - x1} \]
  11. Add Preprocessing

Alternative 22: 25.9% accurate, 25.4× speedup?

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

\\
x1 + x2 \cdot -6
\end{array}
Derivation
  1. Initial program 67.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 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 26.2%

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

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

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

Alternative 23: 7.2% accurate, 25.4× speedup?

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

\\
x1 + x2 \cdot -10
\end{array}
Derivation
  1. Initial program 67.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 25.7%

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

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

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

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

    \[\leadsto x1 + \color{blue}{x2 \cdot -10} \]
  7. Add Preprocessing

Alternative 24: 7.1% accurate, 42.3× speedup?

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

\\
x2 \cdot -10
\end{array}
Derivation
  1. Initial program 67.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 25.7%

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

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

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

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

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

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

      \[\leadsto \color{blue}{x2 \cdot -10} \]
  9. Simplified7.3%

    \[\leadsto \color{blue}{x2 \cdot -10} \]
  10. Add Preprocessing

Alternative 25: 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 67.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 25.7%

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

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

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

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

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

    \[\leadsto \color{blue}{x1} \]
  8. Add Preprocessing

Reproduce

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