Rosa's FloatVsDoubleBenchmark

Percentage Accurate: 70.2% → 99.4%
Time: 34.5s
Alternatives: 27
Speedup: 4.7×

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 27 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.2% accurate, 1.0× speedup?

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

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

Alternative 1: 99.4% accurate, 0.4× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #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
    3. Taylor expanded in x1 around 0 99.3%

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

    if +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 6.8%

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

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

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

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

Alternative 2: 99.3% accurate, 0.5× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #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
    3. Step-by-step derivation
      1. expm1-log1p-u83.0%

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

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

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

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

Alternative 3: 98.1% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;x1 \leq -0.0085:\\
\;\;\;\;x1 + \left(9 + \left(x1 + \left(t\_6 - \left(t\_2 \cdot t\_5 - \left(-1 - x1 \cdot x1\right) \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 - 4 \cdot \left(3 + \frac{-1 + \frac{2 \cdot x2 - 3}{x1}}{x1}\right)\right) + \left(\left(x1 \cdot 2\right) \cdot t\_4\right) \cdot t\_7\right)\right)\right)\right)\right)\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x1 < -7.1000000000000003e106 or 1.2e75 < x1

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

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

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

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

    if -7.1000000000000003e106 < x1 < -0.0085000000000000006

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

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

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

    if -0.0085000000000000006 < x1 < 0.0155

    1. Initial program 99.3%

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

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

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

    if 0.0155 < x1 < 1.2e75

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

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

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

Alternative 4: 96.3% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x1 < -7.1000000000000003e106 or 1.6499999999999999e49 < x1

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

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

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

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

    if -7.1000000000000003e106 < x1 < 1.6499999999999999e49

    1. Initial program 99.2%

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

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

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

Alternative 5: 98.1% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;x1 \leq -0.034:\\
\;\;\;\;x1 + \left(9 + \left(x1 + \left(t\_6 - \left(t\_2 \cdot t\_5 - \left(-1 - x1 \cdot x1\right) \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 - 4 \cdot \left(3 + \frac{-1 + \frac{2 \cdot x2 - 3}{x1}}{x1}\right)\right) + \left(\left(x1 \cdot 2\right) \cdot t\_4\right) \cdot t\_7\right)\right)\right)\right)\right)\\

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

\mathbf{elif}\;x1 \leq 1.2 \cdot 10^{+75}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(\left(t\_0 \cdot \left(t\_7 \cdot \left(\left(x1 \cdot 2\right) \cdot t\_5\right) - \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_5\right)\right) + t\_2 \cdot t\_4\right) + t\_6\right)\right) + 9\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x1 < -7.1000000000000003e106 or 1.2e75 < x1

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

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

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

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

    if -7.1000000000000003e106 < x1 < -0.034000000000000002

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

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

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

    if -0.034000000000000002 < x1 < 0.050000000000000003

    1. Initial program 99.3%

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

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

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

    if 0.050000000000000003 < x1 < 1.2e75

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

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

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

Alternative 6: 98.1% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;x1 \leq -0.017:\\
\;\;\;\;t\_5\\

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

\mathbf{elif}\;x1 \leq 1.2 \cdot 10^{+75}:\\
\;\;\;\;t\_5\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x1 < -7.1000000000000003e106 or 1.2e75 < x1

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

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

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

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

    if -7.1000000000000003e106 < x1 < -0.017000000000000001 or 0.00899999999999999932 < x1 < 1.2e75

    1. Initial program 99.1%

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

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

    if -0.017000000000000001 < x1 < 0.00899999999999999932

    1. Initial program 99.3%

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

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

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

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

Alternative 7: 96.5% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;x1 \leq -0.032:\\
\;\;\;\;x1 + \left(3 \cdot \frac{t\_4}{-1 - x1 \cdot x1} - \left(\left(\left(t\_2 \cdot t\_6 + t\_1 \cdot \left(\left(4 \cdot \left(3 - 2 \cdot x2\right) + x1 \cdot \left(4 - x1 \cdot 6\right)\right) - t\_7 \cdot \left(\left(x1 \cdot 2\right) \cdot t\_6\right)\right)\right) - t\_0\right) - x1\right)\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x1 < -7.1000000000000003e106 or 7.7e49 < x1

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

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

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

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

    if -7.1000000000000003e106 < x1 < -0.032000000000000001

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

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

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

    if -0.032000000000000001 < x1 < 7.7e49

    1. Initial program 99.3%

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

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

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

Alternative 8: 96.5% accurate, 1.0× speedup?

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

\mathbf{elif}\;x1 \leq -0.021:\\
\;\;\;\;x1 + \left(9 + \left(x1 + \left(t\_6 - \left(t\_2 \cdot t\_5 - \left(-1 - x1 \cdot x1\right) \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 - 4 \cdot \left(3 + \frac{-1 + \frac{2 \cdot x2 - 3}{x1}}{x1}\right)\right) + \left(\left(x1 \cdot 2\right) \cdot t\_4\right) \cdot t\_7\right)\right)\right)\right)\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x1 < -7.1000000000000003e106 or 6.40000000000000028e49 < x1

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

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

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

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

    if -7.1000000000000003e106 < x1 < -0.0210000000000000013

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

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

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

    if -0.0210000000000000013 < x1 < 6.40000000000000028e49

    1. Initial program 99.3%

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

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

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

Alternative 9: 94.8% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;x1 \leq -0.016:\\
\;\;\;\;t\_5\\

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

\mathbf{elif}\;x1 \leq 5 \cdot 10^{+152}:\\
\;\;\;\;t\_5\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x1 < -2.1999999999999998e140 or 5e152 < x1

    1. Initial program 0.0%

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

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

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

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

    if -2.1999999999999998e140 < x1 < -0.016 or 1e-3 < x1 < 5e152

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

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

    if -0.016 < x1 < 1e-3

    1. Initial program 99.3%

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

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

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

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

Alternative 10: 94.7% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;x1 \leq -0.75:\\
\;\;\;\;t\_5\\

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

\mathbf{elif}\;x1 \leq 5 \cdot 10^{+153}:\\
\;\;\;\;t\_5\\

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


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

    1. Initial program 0.0%

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

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

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

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

    if -3.20000000000000011e140 < x1 < -0.75 or 0.330000000000000016 < x1 < 5.00000000000000018e153

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

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

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

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

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

        \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \frac{\color{blue}{\frac{2 \cdot x2}{x1}} - \left(1 + 3 \cdot \frac{1}{x1}\right)}{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 \left(x2 \cdot -2\right)\right) \]
      2. associate-*r/91.5%

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

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

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

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

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

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

    if -0.75 < x1 < 0.330000000000000016

    1. Initial program 99.3%

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

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

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

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

Alternative 11: 94.6% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := 3 \cdot \left(x2 \cdot -2\right)\\
t_2 := 3 + \frac{-1 + \frac{2 \cdot x2 - 3}{x1}}{x1}\\
t_3 := x1 + \left(x1 + 3 \cdot \left(x1 \cdot \left(x1 \cdot 3 + -1\right)\right)\right)\\
t_4 := x1 \cdot \left(x1 \cdot 3\right)\\
t_5 := t\_4 + 2 \cdot x2\\
t_6 := \frac{t\_5 - x1}{t\_0}\\
t_7 := \frac{2 \cdot x2}{x1}\\
t_8 := t\_4 \cdot \frac{x1 - t\_5}{t\_0}\\
t_9 := x1 \cdot \left(x1 \cdot x1\right)\\
\mathbf{if}\;x1 \leq -2.2 \cdot 10^{+140}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;x1 \leq -0.7:\\
\;\;\;\;x1 + \left(t\_1 - \left(\left(\left(t\_8 + t\_0 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_6\right) \cdot \frac{\left(1 + \frac{3}{x1}\right) - t\_7}{x1} + \left(x1 \cdot x1\right) \cdot \left(6 - 4 \cdot t\_2\right)\right)\right) - t\_9\right) - x1\right)\right)\\

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

\mathbf{elif}\;x1 \leq 5 \cdot 10^{+152}:\\
\;\;\;\;x1 + \left(t\_1 + \left(x1 + \left(t\_9 - \left(t\_8 - t\_0 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(t\_6 \cdot 4 - 6\right) + \frac{t\_7 + \left(-1 - \frac{3}{x1}\right)}{x1} \cdot \left(\left(x1 \cdot 2\right) \cdot t\_2\right)\right)\right)\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x1 < -2.1999999999999998e140 or 5e152 < x1

    1. Initial program 0.0%

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

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

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

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

    if -2.1999999999999998e140 < x1 < -0.69999999999999996

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

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

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

      \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \color{blue}{\left(x2 \cdot -2\right)}\right) \]
    6. Taylor expanded in x1 around inf 85.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{2 \cdot \frac{x2}{x1} - \left(1 + 3 \cdot \frac{1}{x1}\right)}{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 \left(x2 \cdot -2\right)\right) \]
    7. Step-by-step derivation
      1. associate-*r/85.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{\color{blue}{\frac{2 \cdot x2}{x1}} - \left(1 + 3 \cdot \frac{1}{x1}\right)}{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 \left(x2 \cdot -2\right)\right) \]
      2. associate-*r/85.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{\frac{2 \cdot x2}{x1} - \left(1 + \color{blue}{\frac{3 \cdot 1}{x1}}\right)}{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 \left(x2 \cdot -2\right)\right) \]
      3. metadata-eval85.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{\frac{2 \cdot x2}{x1} - \left(1 + \frac{\color{blue}{3}}{x1}\right)}{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 \left(x2 \cdot -2\right)\right) \]
    8. Simplified85.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{\frac{2 \cdot x2}{x1} - \left(1 + \frac{3}{x1}\right)}{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 \left(x2 \cdot -2\right)\right) \]
    9. Taylor expanded in x1 around -inf 85.1%

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

    if -0.69999999999999996 < x1 < 1.26000000000000001

    1. Initial program 99.3%

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

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

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

    if 1.26000000000000001 < x1 < 5e152

    1. Initial program 99.5%

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

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

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

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

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

        \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \frac{\color{blue}{\frac{2 \cdot x2}{x1}} - \left(1 + 3 \cdot \frac{1}{x1}\right)}{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 \left(x2 \cdot -2\right)\right) \]
      2. associate-*r/98.2%

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

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

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

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

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

Alternative 12: 94.6% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;x1 \leq -0.72:\\
\;\;\;\;x1 + \left(x2 \cdot -6 - \left(\left(\left(t\_7 + t\_0 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_5\right) \cdot \frac{\left(1 + \frac{3}{x1}\right) - t\_8}{x1} + \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_6\right)\right)\right) - t\_1\right) - x1\right)\right)\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x1 < -2.1999999999999998e140 or 5e152 < x1

    1. Initial program 0.0%

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

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

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

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

    if -2.1999999999999998e140 < x1 < -0.71999999999999997

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

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

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

      \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \color{blue}{\left(x2 \cdot -2\right)}\right) \]
    6. Taylor expanded in x1 around inf 85.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{2 \cdot \frac{x2}{x1} - \left(1 + 3 \cdot \frac{1}{x1}\right)}{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 \left(x2 \cdot -2\right)\right) \]
    7. Step-by-step derivation
      1. associate-*r/85.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{\color{blue}{\frac{2 \cdot x2}{x1}} - \left(1 + 3 \cdot \frac{1}{x1}\right)}{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 \left(x2 \cdot -2\right)\right) \]
      2. associate-*r/85.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{\frac{2 \cdot x2}{x1} - \left(1 + \color{blue}{\frac{3 \cdot 1}{x1}}\right)}{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 \left(x2 \cdot -2\right)\right) \]
      3. metadata-eval85.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{\frac{2 \cdot x2}{x1} - \left(1 + \frac{\color{blue}{3}}{x1}\right)}{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 \left(x2 \cdot -2\right)\right) \]
    8. Simplified85.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{\frac{2 \cdot x2}{x1} - \left(1 + \frac{3}{x1}\right)}{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 \left(x2 \cdot -2\right)\right) \]
    9. Taylor expanded in x2 around 0 85.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{\frac{2 \cdot x2}{x1} - \left(1 + \frac{3}{x1}\right)}{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) + \color{blue}{-6 \cdot x2}\right) \]
    10. Step-by-step derivation
      1. *-commutative85.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{\frac{2 \cdot x2}{x1} - \left(1 + \frac{3}{x1}\right)}{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) + \color{blue}{x2 \cdot -6}\right) \]
    11. Simplified85.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{\frac{2 \cdot x2}{x1} - \left(1 + \frac{3}{x1}\right)}{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) + \color{blue}{x2 \cdot -6}\right) \]

    if -0.71999999999999997 < x1 < 1.26000000000000001

    1. Initial program 99.3%

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

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

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

    if 1.26000000000000001 < x1 < 5e152

    1. Initial program 99.5%

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

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

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

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

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

        \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \frac{\color{blue}{\frac{2 \cdot x2}{x1}} - \left(1 + 3 \cdot \frac{1}{x1}\right)}{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 \left(x2 \cdot -2\right)\right) \]
      2. associate-*r/98.2%

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

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

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

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

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

Alternative 13: 92.2% accurate, 1.1× speedup?

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

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

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

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

\mathbf{elif}\;x1 \leq 8 \cdot 10^{+144}:\\
\;\;\;\;t\_4\\

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


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

    1. Initial program 0.0%

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

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

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

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

    if -2.1999999999999998e140 < x1 < -0.0210000000000000013 or 0.0184999999999999991 < x1 < 8.00000000000000019e144

    1. Initial program 92.3%

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

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

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

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

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

    if -0.0210000000000000013 < x1 < 0.0184999999999999991

    1. Initial program 99.3%

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

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

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

    if 8.00000000000000019e144 < x1

    1. Initial program 3.3%

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

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

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

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

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

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

Alternative 14: 90.1% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
t_1 := 3 \cdot \left(x2 \cdot -2\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := x1 + \left(x1 + 3 \cdot \left(x1 \cdot \left(x1 \cdot 3 + -1\right)\right)\right)\\
t_4 := -1 - x1 \cdot x1\\
t_5 := x1 \cdot \left(x1 \cdot 3\right)\\
t_6 := t\_5 + 2 \cdot x2\\
t_7 := \frac{x1 - t\_6}{t\_2}\\
t_8 := \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_7\right)\\
\mathbf{if}\;x1 \leq -2.2 \cdot 10^{+140}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;x1 \leq -3.2 \cdot 10^{+21}:\\
\;\;\;\;x1 + \left(t\_1 + \left(x1 + \left(t\_0 + \left(t\_5 \cdot \frac{t\_6 - x1}{t\_2} + t\_4 \cdot \left(t\_8 - -6\right)\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 3 \cdot 10^{+33}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{x1 - \left(t\_5 - 2 \cdot x2\right)}{t\_4} + \left(x1 + x2 \cdot \left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 5 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(t\_1 + \left(x1 + \left(t\_0 - \left(t\_5 \cdot t\_7 - t\_2 \cdot \left(\left(x1 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(3 + t\_7\right) - t\_8\right)\right)\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x1 < -2.1999999999999998e140 or 5.00000000000000018e153 < x1

    1. Initial program 0.0%

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

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

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

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

    if -2.1999999999999998e140 < x1 < -3.2e21

    1. Initial program 82.5%

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

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

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

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

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

        \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \frac{\color{blue}{\frac{2 \cdot x2}{x1}} - \left(1 + 3 \cdot \frac{1}{x1}\right)}{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 \left(x2 \cdot -2\right)\right) \]
      2. associate-*r/82.5%

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

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

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

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

    if -3.2e21 < x1 < 2.99999999999999984e33

    1. Initial program 99.3%

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

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

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

    if 2.99999999999999984e33 < x1 < 5.00000000000000018e153

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

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

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

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

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

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

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

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

Alternative 15: 90.3% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
t_1 := 3 \cdot \left(x2 \cdot -2\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := x1 + \left(x1 + 3 \cdot \left(x1 \cdot \left(x1 \cdot 3 + -1\right)\right)\right)\\
t_4 := -1 - x1 \cdot x1\\
t_5 := x1 \cdot \left(x1 \cdot 3\right)\\
t_6 := t\_5 + 2 \cdot x2\\
t_7 := \frac{t\_6 - x1}{t\_2}\\
t_8 := t\_5 \cdot t\_7\\
t_9 := \frac{x1 - t\_6}{t\_2}\\
\mathbf{if}\;x1 \leq -2.2 \cdot 10^{+140}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;x1 \leq -3.2 \cdot 10^{+21}:\\
\;\;\;\;x1 + \left(t\_1 + \left(x1 + \left(t\_0 + \left(t\_8 + t\_4 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_9\right) - -6\right)\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 3 \cdot 10^{+33}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{x1 - \left(t\_5 - 2 \cdot x2\right)}{t\_4} + \left(x1 + x2 \cdot \left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 5 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(t\_1 + \left(x1 + \left(t\_0 + \left(t\_8 + t\_2 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(t\_7 \cdot 4 - 6\right) + \frac{1}{x1} \cdot \left(\left(x1 \cdot 2\right) \cdot t\_9\right)\right)\right)\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x1 < -2.1999999999999998e140 or 5.00000000000000018e153 < x1

    1. Initial program 0.0%

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

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

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

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

    if -2.1999999999999998e140 < x1 < -3.2e21

    1. Initial program 82.5%

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

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

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

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

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

        \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \frac{\color{blue}{\frac{2 \cdot x2}{x1}} - \left(1 + 3 \cdot \frac{1}{x1}\right)}{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 \left(x2 \cdot -2\right)\right) \]
      2. associate-*r/82.5%

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

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

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

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

    if -3.2e21 < x1 < 2.99999999999999984e33

    1. Initial program 99.3%

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

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

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

    if 2.99999999999999984e33 < x1 < 5.00000000000000018e153

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

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

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

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

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

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

Alternative 16: 90.3% accurate, 1.4× speedup?

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

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

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

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

\mathbf{elif}\;x1 \leq 5 \cdot 10^{+152}:\\
\;\;\;\;t\_5\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x1 < -2.1999999999999998e140 or 5e152 < x1

    1. Initial program 0.0%

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

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

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

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

    if -2.1999999999999998e140 < x1 < -3.2e21 or 2.99999999999999984e33 < x1 < 5e152

    1. Initial program 90.8%

      \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in x1 around 0 90.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}{\left(-2 \cdot x2\right)}\right) \]
    4. Step-by-step derivation
      1. *-commutative90.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}{\left(x2 \cdot -2\right)}\right) \]
    5. Simplified90.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}{\left(x2 \cdot -2\right)}\right) \]
    6. Taylor expanded in x1 around inf 90.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 \color{blue}{\frac{2 \cdot \frac{x2}{x1} - \left(1 + 3 \cdot \frac{1}{x1}\right)}{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 \left(x2 \cdot -2\right)\right) \]
    7. Step-by-step derivation
      1. associate-*r/90.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 \frac{\color{blue}{\frac{2 \cdot x2}{x1}} - \left(1 + 3 \cdot \frac{1}{x1}\right)}{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 \left(x2 \cdot -2\right)\right) \]
      2. associate-*r/90.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 \frac{\frac{2 \cdot x2}{x1} - \left(1 + \color{blue}{\frac{3 \cdot 1}{x1}}\right)}{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 \left(x2 \cdot -2\right)\right) \]
      3. metadata-eval90.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 \frac{\frac{2 \cdot x2}{x1} - \left(1 + \frac{\color{blue}{3}}{x1}\right)}{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 \left(x2 \cdot -2\right)\right) \]
    8. Simplified90.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 \color{blue}{\frac{\frac{2 \cdot x2}{x1} - \left(1 + \frac{3}{x1}\right)}{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 \left(x2 \cdot -2\right)\right) \]
    9. Taylor expanded in x1 around inf 85.7%

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

    if -3.2e21 < x1 < 2.99999999999999984e33

    1. Initial program 99.3%

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

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

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

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

Alternative 17: 82.1% accurate, 2.7× speedup?

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

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

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

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


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

    1. Initial program 0.0%

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

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

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

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

    if -4.3999999999999999e153 < x1 < 3.9999999999999998e-112

    1. Initial program 95.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 68.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 66.8%

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

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

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

    if 3.9999999999999998e-112 < x1

    1. Initial program 64.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 37.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 80.0%

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

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

Alternative 18: 81.2% accurate, 3.0× speedup?

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

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

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

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


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

    1. Initial program 0.0%

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

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

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

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

    if -4.4999999999999999e142 < x1 < 1.1e-111

    1. Initial program 95.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 68.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 66.8%

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

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

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

    if 1.1e-111 < x1

    1. Initial program 64.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 37.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 80.0%

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

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

Alternative 19: 64.2% accurate, 3.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 - x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right)\\ t_1 := x1 + \left(x1 + 3 \cdot \left(x1 \cdot \left(x1 \cdot 3 + -1\right)\right)\right)\\ \mathbf{if}\;x1 \leq -5.2 \cdot 10^{+140}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x1 \leq -1.3 \cdot 10^{-74}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x1 \leq 3.8 \cdot 10^{-140}:\\ \;\;\;\;x1 + x2 \cdot -6\\ \mathbf{elif}\;x1 \leq 4.4 \cdot 10^{+153}:\\ \;\;\;\;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))))))))
        (t_1 (+ x1 (+ x1 (* 3.0 (* x1 (+ (* x1 3.0) -1.0)))))))
   (if (<= x1 -5.2e+140)
     t_1
     (if (<= x1 -1.3e-74)
       t_0
       (if (<= x1 3.8e-140)
         (+ x1 (* x2 -6.0))
         (if (<= x1 4.4e+153) 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))))));
	double t_1 = x1 + (x1 + (3.0 * (x1 * ((x1 * 3.0) + -1.0))));
	double tmp;
	if (x1 <= -5.2e+140) {
		tmp = t_1;
	} else if (x1 <= -1.3e-74) {
		tmp = t_0;
	} else if (x1 <= 3.8e-140) {
		tmp = x1 + (x2 * -6.0);
	} else if (x1 <= 4.4e+153) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x1, x2)
    real(8), intent (in) :: x1
    real(8), intent (in) :: x2
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = x1 - (x1 * (2.0d0 + (4.0d0 * (x2 * (3.0d0 - (2.0d0 * x2))))))
    t_1 = x1 + (x1 + (3.0d0 * (x1 * ((x1 * 3.0d0) + (-1.0d0)))))
    if (x1 <= (-5.2d+140)) then
        tmp = t_1
    else if (x1 <= (-1.3d-74)) then
        tmp = t_0
    else if (x1 <= 3.8d-140) then
        tmp = x1 + (x2 * (-6.0d0))
    else if (x1 <= 4.4d+153) then
        tmp = t_0
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double t_0 = x1 - (x1 * (2.0 + (4.0 * (x2 * (3.0 - (2.0 * x2))))));
	double t_1 = x1 + (x1 + (3.0 * (x1 * ((x1 * 3.0) + -1.0))));
	double tmp;
	if (x1 <= -5.2e+140) {
		tmp = t_1;
	} else if (x1 <= -1.3e-74) {
		tmp = t_0;
	} else if (x1 <= 3.8e-140) {
		tmp = x1 + (x2 * -6.0);
	} else if (x1 <= 4.4e+153) {
		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))))))
	t_1 = x1 + (x1 + (3.0 * (x1 * ((x1 * 3.0) + -1.0))))
	tmp = 0
	if x1 <= -5.2e+140:
		tmp = t_1
	elif x1 <= -1.3e-74:
		tmp = t_0
	elif x1 <= 3.8e-140:
		tmp = x1 + (x2 * -6.0)
	elif x1 <= 4.4e+153:
		tmp = t_0
	else:
		tmp = t_1
	return tmp
function code(x1, x2)
	t_0 = Float64(x1 - Float64(x1 * Float64(2.0 + Float64(4.0 * Float64(x2 * Float64(3.0 - Float64(2.0 * x2)))))))
	t_1 = Float64(x1 + Float64(x1 + Float64(3.0 * Float64(x1 * Float64(Float64(x1 * 3.0) + -1.0)))))
	tmp = 0.0
	if (x1 <= -5.2e+140)
		tmp = t_1;
	elseif (x1 <= -1.3e-74)
		tmp = t_0;
	elseif (x1 <= 3.8e-140)
		tmp = Float64(x1 + Float64(x2 * -6.0));
	elseif (x1 <= 4.4e+153)
		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))))));
	t_1 = x1 + (x1 + (3.0 * (x1 * ((x1 * 3.0) + -1.0))));
	tmp = 0.0;
	if (x1 <= -5.2e+140)
		tmp = t_1;
	elseif (x1 <= -1.3e-74)
		tmp = t_0;
	elseif (x1 <= 3.8e-140)
		tmp = x1 + (x2 * -6.0);
	elseif (x1 <= 4.4e+153)
		tmp = t_0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 - N[(x1 * N[(2.0 + N[(4.0 * N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(x1 + N[(3.0 * N[(x1 * N[(N[(x1 * 3.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.2e+140], t$95$1, If[LessEqual[x1, -1.3e-74], t$95$0, If[LessEqual[x1, 3.8e-140], N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.4e+153], t$95$0, t$95$1]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x1 \leq -1.3 \cdot 10^{-74}:\\
\;\;\;\;t\_0\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x1 < -5.2000000000000002e140 or 4.3999999999999999e153 < x1

    1. Initial program 0.0%

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

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

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

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

    if -5.2000000000000002e140 < x1 < -1.3e-74 or 3.79999999999999998e-140 < x1 < 4.3999999999999999e153

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

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

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

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

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

    if -1.3e-74 < x1 < 3.79999999999999998e-140

    1. Initial program 99.4%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -5.2 \cdot 10^{+140}:\\ \;\;\;\;x1 + \left(x1 + 3 \cdot \left(x1 \cdot \left(x1 \cdot 3 + -1\right)\right)\right)\\ \mathbf{elif}\;x1 \leq -1.3 \cdot 10^{-74}:\\ \;\;\;\;x1 - x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 3.8 \cdot 10^{-140}:\\ \;\;\;\;x1 + x2 \cdot -6\\ \mathbf{elif}\;x1 \leq 4.4 \cdot 10^{+153}:\\ \;\;\;\;x1 - x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x1 + 3 \cdot \left(x1 \cdot \left(x1 \cdot 3 + -1\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 20: 57.8% accurate, 3.8× speedup?

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

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

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

\mathbf{elif}\;x1 \leq 3.9 \cdot 10^{-63}:\\
\;\;\;\;x1 + x2 \cdot -6\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x1 < -2.1999999999999998e140 or 4.3999999999999999e153 < x1

    1. Initial program 0.0%

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

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

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

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

    if -2.1999999999999998e140 < x1 < -2.99999999999999993e-19 or 3.90000000000000022e-63 < x1 < 4.3999999999999999e153

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

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

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

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

    if -2.99999999999999993e-19 < x1 < 3.90000000000000022e-63

    1. Initial program 99.4%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -2.2 \cdot 10^{+140}:\\ \;\;\;\;x1 + \left(x1 + 3 \cdot \left(x1 \cdot \left(x1 \cdot 3 + -1\right)\right)\right)\\ \mathbf{elif}\;x1 \leq -3 \cdot 10^{-19}:\\ \;\;\;\;x1 - x1 \cdot \left(-1 - x2 \cdot \left(x2 \cdot 8 - 12\right)\right)\\ \mathbf{elif}\;x1 \leq 3.9 \cdot 10^{-63}:\\ \;\;\;\;x1 + x2 \cdot -6\\ \mathbf{elif}\;x1 \leq 4.4 \cdot 10^{+153}:\\ \;\;\;\;x1 - x1 \cdot \left(-1 - x2 \cdot \left(x2 \cdot 8 - 12\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x1 + 3 \cdot \left(x1 \cdot \left(x1 \cdot 3 + -1\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 21: 79.8% accurate, 3.8× speedup?

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

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

\mathbf{elif}\;x1 \leq 1.1 \cdot 10^{-48}:\\
\;\;\;\;x1 + \left(\left(x1 + x2 \cdot \left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right)\right) + \left(x2 \cdot -6 + x1 \cdot -3\right)\right)\\

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


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

    1. Initial program 0.0%

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

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

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

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

    if -3.10000000000000004e141 < x1 < 1.10000000000000006e-48

    1. Initial program 95.9%

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

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

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

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

    if 1.10000000000000006e-48 < x1

    1. Initial program 59.3%

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

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

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

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

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

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

Alternative 22: 73.9% accurate, 4.4× speedup?

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

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

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

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


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

    1. Initial program 0.0%

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

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

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

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

    if -9.50000000000000031e144 < x1 < 1.10000000000000006e-48

    1. Initial program 95.9%

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

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

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

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

    if 1.10000000000000006e-48 < x1

    1. Initial program 59.3%

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

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

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

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

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

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

Alternative 23: 73.6% accurate, 4.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -3.8 \cdot 10^{+140} \lor \neg \left(x1 \leq 4.4 \cdot 10^{+153}\right):\\
\;\;\;\;x1 + \left(x1 + 3 \cdot \left(x1 \cdot \left(x1 \cdot 3 + -1\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x1 < -3.8000000000000001e140 or 4.3999999999999999e153 < x1

    1. Initial program 0.0%

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

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

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

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

    if -3.8000000000000001e140 < x1 < 4.3999999999999999e153

    1. Initial program 96.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 65.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 62.4%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -3.8 \cdot 10^{+140} \lor \neg \left(x1 \leq 4.4 \cdot 10^{+153}\right):\\ \;\;\;\;x1 + \left(x1 + 3 \cdot \left(x1 \cdot \left(x1 \cdot 3 + -1\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 - \left(x1 \cdot \left(2 - x2 \cdot \left(x2 \cdot 8 - 12\right)\right) - x2 \cdot -6\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 24: 37.3% accurate, 5.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -5.5 \cdot 10^{+88} \lor \neg \left(x2 \leq 4.2 \cdot 10^{+136}\right):\\
\;\;\;\;x1 - x1 \cdot \left(-1 - x2 \cdot \left(x2 \cdot 8 - 12\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x2 < -5.5e88 or 4.1999999999999998e136 < x2

    1. Initial program 76.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 51.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 inf 64.6%

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

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

    if -5.5e88 < x2 < 4.1999999999999998e136

    1. Initial program 69.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 46.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 + \left(\left(4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right) + x1\right) + 3 \cdot \color{blue}{\left(-2 \cdot x2 + x1 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right) - 1\right)\right)}\right) \]
    5. Taylor expanded in x1 around 0 30.6%

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

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

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

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

Alternative 25: 32.1% accurate, 6.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x1 < -9.20000000000000042e33 or 5.9999999999999999e57 < x1

    1. Initial program 37.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 10.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 22.9%

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

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

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

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

    if -9.20000000000000042e33 < x1 < 5.9999999999999999e57

    1. Initial program 99.2%

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

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

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

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

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

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

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

Alternative 26: 26.3% 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 71.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 48.0%

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

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

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

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

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

Alternative 27: 3.3% accurate, 42.3× speedup?

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

\\
x1 + x1
\end{array}
Derivation
  1. Initial program 71.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 48.0%

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

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

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

Reproduce

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