Rosa's FloatVsDoubleBenchmark

Percentage Accurate: 69.9% → 99.4%
Time: 58.5s
Alternatives: 17
Speedup: 3.3×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

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

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

\mathbf{else}:\\
\;\;\;\;\left(\left(x1 + x2 \cdot -6\right) + x1 \cdot \left(x1 \cdot 9 - 3\right)\right) + t\_2 \cdot \left(x1 + x1 \cdot \left(x1 \cdot 6 - 4\right)\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 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) < +inf.0

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.4% accurate, 0.5× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\left(\left(x1 + x2 \cdot -6\right) + x1 \cdot \left(x1 \cdot 9 - 3\right)\right) + t\_1 \cdot \left(x1 + x1 \cdot \left(x1 \cdot 6 - 4\right)\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 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) < +inf.0

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

Alternative 3: 97.9% accurate, 1.1× speedup?

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

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

\mathbf{elif}\;x1 \leq -7.9 \cdot 10^{-25}:\\
\;\;\;\;\left(x2 \cdot -6 + \left(3 \cdot \left(2 \cdot x2\right) + -9\right)\right) + t\_3\\

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

\mathbf{elif}\;x1 \leq 5 \cdot 10^{+81}:\\
\;\;\;\;t\_3 + \left(\left(x1 + \left(9 - \frac{3}{x1}\right)\right) + x1 \cdot \left(\left(x1 \cdot 9 + 3 \cdot \frac{2 \cdot x2 - 3}{x1}\right) - 3\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x1 < -1.00000000000000004e154 or 4.9999999999999998e81 < x1

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

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

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

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

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

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

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

    if -1.00000000000000004e154 < x1 < -7.8999999999999997e-25

    1. Initial program 58.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. Simplified96.6%

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

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

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

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

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

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

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

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

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

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

    if -7.8999999999999997e-25 < x1 < 5.99999999999999946e-8

    1. Initial program 99.4%

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

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

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

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

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

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

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

    if 5.99999999999999946e-8 < x1 < 4.9999999999999998e81

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

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

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

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

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

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

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

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

Alternative 4: 97.8% accurate, 1.1× speedup?

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

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

\mathbf{elif}\;x1 \leq -7.9 \cdot 10^{-25}:\\
\;\;\;\;\left(x2 \cdot -6 + \left(3 \cdot \left(2 \cdot x2\right) + -9\right)\right) + t\_4\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x1 < -1.00000000000000004e154 or 5e79 < x1

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

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

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

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

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

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

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

    if -1.00000000000000004e154 < x1 < -7.8999999999999997e-25

    1. Initial program 58.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. Simplified96.6%

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

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

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

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

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

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

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

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

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

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

    if -7.8999999999999997e-25 < x1 < 5.99999999999999946e-8

    1. Initial program 99.4%

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

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

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

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

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

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

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

    if 5.99999999999999946e-8 < x1 < 5e79

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

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

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

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

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

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

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

Alternative 5: 97.8% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;x1 \leq -7.9 \cdot 10^{-25}:\\
\;\;\;\;t\_3\\

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

\mathbf{elif}\;x1 \leq 3 \cdot 10^{+83}:\\
\;\;\;\;t\_3\\

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


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

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

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

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

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

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

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

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

    if -1.00000000000000004e154 < x1 < -7.8999999999999997e-25 or 5.99999999999999946e-8 < x1 < 3e83

    1. Initial program 72.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. Simplified95.6%

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

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

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

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

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

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

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

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

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

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

    if -7.8999999999999997e-25 < x1 < 5.99999999999999946e-8

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

Alternative 6: 93.8% accurate, 2.8× speedup?

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

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

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

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


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

    1. Initial program 27.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. Simplified47.5%

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

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

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

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

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

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

    if -4e4 < x1 < 4e5

    1. Initial program 99.4%

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

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

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

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

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

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

    if 4e5 < x1

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

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

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

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

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

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

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

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

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

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

Alternative 7: 93.6% accurate, 3.0× speedup?

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

\\
\begin{array}{l}
t_0 := \left(x1 \cdot x1 + 1\right) \cdot \left(x1 + x1 \cdot \left(x1 \cdot 6 - 4\right)\right)\\
t_1 := x2 \cdot -6 + x1 \cdot -3\\
t_2 := x1 \cdot \left(x1 \cdot 9 - 3\right)\\
\mathbf{if}\;x1 \leq -3600:\\
\;\;\;\;\left(\left(x1 + x2 \cdot -6\right) + t\_2\right) + t\_0\\

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

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


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

    1. Initial program 27.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. Simplified47.5%

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

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

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

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

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

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

    if -3600 < x1 < 4.9e5

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

    if 4.9e5 < x1

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

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

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

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

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

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

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

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

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

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

Alternative 8: 93.6% accurate, 3.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -32000000 \lor \neg \left(x1 \leq 400000\right):\\
\;\;\;\;\left(\left(x1 + x2 \cdot -6\right) + x1 \cdot \left(x1 \cdot 9 - 3\right)\right) + \left(x1 \cdot x1 + 1\right) \cdot \left(x1 + x1 \cdot \left(x1 \cdot 6 - 4\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x1 < -3.2e7 or 4e5 < x1

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

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

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

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

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

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

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

    if -3.2e7 < x1 < 4e5

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 43.0% accurate, 4.5× speedup?

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

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

\mathbf{elif}\;x1 \leq -7.4 \cdot 10^{-119} \lor \neg \left(x1 \leq 1.6 \cdot 10^{-68}\right):\\
\;\;\;\;x1 \cdot \left(2 + \left(2 \cdot x2 + -3\right) \cdot \left(x2 \cdot 4\right)\right)\\

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


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

    1. Initial program 4.1%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x1 + \left(\left(\color{blue}{\left(x2 \cdot x1\right)} \cdot -12 + x1\right) + 9\right) \]
      3. associate-*l*15.7%

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

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

    if -5.2000000000000001e91 < x1 < -7.4000000000000003e-119 or 1.5999999999999999e-68 < x1

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.4000000000000003e-119 < x1 < 1.5999999999999999e-68

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -5.2 \cdot 10^{+91}:\\ \;\;\;\;x1 + \left(9 + \left(x1 + x2 \cdot \left(x1 \cdot -12\right)\right)\right)\\ \mathbf{elif}\;x1 \leq -7.4 \cdot 10^{-119} \lor \neg \left(x1 \leq 1.6 \cdot 10^{-68}\right):\\ \;\;\;\;x1 \cdot \left(2 + \left(2 \cdot x2 + -3\right) \cdot \left(x2 \cdot 4\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x2 \cdot -6\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 43.3% accurate, 4.5× speedup?

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

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

\mathbf{elif}\;x1 \leq -6.8 \cdot 10^{-119}:\\
\;\;\;\;x1 + \left(9 + x1 \cdot \left(1 + x2 \cdot \left(-12 - x2 \cdot -8\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 8.4 \cdot 10^{-69}:\\
\;\;\;\;x2 \cdot -6\\

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


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

    1. Initial program 4.1%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x1 + \left(\left(\color{blue}{\left(x2 \cdot x1\right)} \cdot -12 + x1\right) + 9\right) \]
      3. associate-*l*15.7%

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

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

    if -4.4e89 < x1 < -6.80000000000000047e-119

    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 66.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. Step-by-step derivation
      1. associate-*r*66.5%

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

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

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

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

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

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

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

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

    if -6.80000000000000047e-119 < x1 < 8.3999999999999999e-69

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

    if 8.3999999999999999e-69 < x1

    1. Initial program 58.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 36.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. Step-by-step derivation
      1. associate-*r*36.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 63.2% accurate, 4.5× speedup?

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

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

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


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

    1. Initial program 4.1%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x1 + \left(\left(\color{blue}{\left(x2 \cdot x1\right)} \cdot -12 + x1\right) + 9\right) \]
      3. associate-*l*15.7%

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

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

    if -2.5000000000000002e90 < x1

    1. Initial program 84.5%

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 57.7% accurate, 4.9× speedup?

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

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

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


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

    1. Initial program 70.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 49.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. Step-by-step derivation
      1. associate-*r*64.7%

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

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

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

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

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

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

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

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

    if -2.5000000000000001e-23 < x2

    1. Initial program 68.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 57.2% accurate, 5.8× speedup?

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

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

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


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

    1. Initial program 4.1%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x1 + \left(\left(\color{blue}{\left(x2 \cdot x1\right)} \cdot -12 + x1\right) + 9\right) \]
      3. associate-*l*15.7%

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

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

    if -3.7000000000000001e95 < x1

    1. Initial program 84.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. Simplified84.5%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 33.1% accurate, 6.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -4.2 \cdot 10^{+83} \lor \neg \left(x1 \leq 6 \cdot 10^{-8}\right):\\
\;\;\;\;x1 + \left(9 + \left(x1 + x2 \cdot \left(x1 \cdot -12\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x1 < -4.20000000000000005e83 or 5.99999999999999946e-8 < x1

    1. Initial program 30.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 14.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. Step-by-step derivation
      1. associate-*r*14.0%

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

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

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

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

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

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

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

        \[\leadsto x1 + \left(\left(\color{blue}{\left(x1 \cdot x2\right) \cdot -12} + x1\right) + 9\right) \]
      2. *-commutative16.0%

        \[\leadsto x1 + \left(\left(\color{blue}{\left(x2 \cdot x1\right)} \cdot -12 + x1\right) + 9\right) \]
      3. associate-*l*16.0%

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

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

    if -4.20000000000000005e83 < x1 < 5.99999999999999946e-8

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

Alternative 15: 26.8% 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 69.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. Simplified69.1%

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

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

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

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

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

Alternative 16: 26.6% accurate, 42.3× speedup?

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{x2 \cdot -6} \]
  10. Final simplification30.0%

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

Alternative 17: 3.5% accurate, 127.0× speedup?

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

\\
9
\end{array}
Derivation
  1. Initial program 69.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 51.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. Step-by-step derivation
    1. associate-*r*57.4%

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

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

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

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

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

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

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

    \[\leadsto 9 \]
  9. Add Preprocessing

Reproduce

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