Rosa's FloatVsDoubleBenchmark

Percentage Accurate: 70.5% → 99.7%
Time: 34.1s
Alternatives: 23
Speedup: 5.5×

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

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

Initial Program: 70.5% 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.7% accurate, 0.1× speedup?

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

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

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


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

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

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

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

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

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

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

    1. Initial program 0.0%

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

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

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

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

Alternative 2: 99.7% accurate, 0.1× speedup?

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

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

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


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

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

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

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

    1. Initial program 0.0%

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

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

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

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

Alternative 3: 99.5% accurate, 0.4× speedup?

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

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

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


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

    1. Initial program 99.4%

      \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. fma-define99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 0.0%

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

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

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

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

Alternative 4: 99.5% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 99.4%

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

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

    1. Initial program 0.0%

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

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

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

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

Alternative 5: 97.5% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 99.4%

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

Alternative 6: 97.4% accurate, 1.2× speedup?

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

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

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

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


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

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

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

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

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

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

    if -5.49999999999999981e102 < x1 < 5.00000000000000018e153

    1. Initial program 99.4%

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

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

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

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

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

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

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

    if 5.00000000000000018e153 < x1

    1. Initial program 0.0%

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

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

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

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

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

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

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

Alternative 7: 95.0% accurate, 1.3× speedup?

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

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

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

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


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

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

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

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

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

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

    if -5.49999999999999981e102 < x1 < 5.00000000000000018e153

    1. Initial program 99.4%

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

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

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

    if 5.00000000000000018e153 < x1

    1. Initial program 0.0%

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

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

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

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

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

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

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

Alternative 8: 93.7% accurate, 1.3× speedup?

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

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

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

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


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

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

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

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

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

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

    if -4.20000000000000003e102 < x1 < 4.5000000000000001e153

    1. Initial program 99.4%

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

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

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

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

    if 4.5000000000000001e153 < x1

    1. Initial program 0.0%

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

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

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

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

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

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

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

Alternative 9: 93.4% accurate, 1.3× speedup?

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

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

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

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


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

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

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

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

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

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

    if -5.49999999999999981e102 < x1 < 2.7499999999999999e138

    1. Initial program 99.4%

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

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

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

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

    if 2.7499999999999999e138 < x1

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

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

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

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

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

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

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

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

Alternative 10: 95.2% accurate, 1.3× speedup?

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

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

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

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

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

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


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

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

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

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

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

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

    if -5.49999999999999981e102 < x1 < -0.0050000000000000001 or 4.89999999999999972e-12 < x1 < 5.00000000000000018e153

    1. Initial program 99.4%

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

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

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

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

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

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

    if -0.0050000000000000001 < x1 < 4.89999999999999972e-12

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

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

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

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

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

    if 5.00000000000000018e153 < x1

    1. Initial program 0.0%

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

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

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

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

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

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

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

Alternative 11: 91.9% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;x1 \leq -48000000000000:\\
\;\;\;\;t\_3\\

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

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

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


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

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

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

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

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

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

    if -5.49999999999999981e102 < x1 < -4.8e13 or 2.05e11 < x1 < 5.00000000000000018e153

    1. Initial program 99.5%

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

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

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

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

    if -4.8e13 < x1 < 2.05e11

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

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

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

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

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

    if 5.00000000000000018e153 < x1

    1. Initial program 0.0%

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

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

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

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

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

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

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

Alternative 12: 78.4% accurate, 3.7× speedup?

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

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

\mathbf{elif}\;x1 \leq -1.35 \cdot 10^{-162} \lor \neg \left(x1 \leq 5.8 \cdot 10^{-206}\right):\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + \left(x1 \cdot 9 + x2 \cdot \left(x2 \cdot 8 - 12\right)\right)\right)\\

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


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

    1. Initial program 11.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. Simplified29.5%

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

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

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

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

    if -7.79999999999999949e70 < x1 < -1.34999999999999992e-162 or 5.8000000000000004e-206 < x1

    1. Initial program 75.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. Simplified69.8%

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

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

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

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

    if -1.34999999999999992e-162 < x1 < 5.8000000000000004e-206

    1. Initial program 99.8%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -7.8 \cdot 10^{+70}:\\ \;\;\;\;x2 \cdot \left(\frac{x1 \cdot \left(-1 + x1 \cdot 9\right)}{x2} - 6\right)\\ \mathbf{elif}\;x1 \leq -1.35 \cdot 10^{-162} \lor \neg \left(x1 \leq 5.8 \cdot 10^{-206}\right):\\ \;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + \left(x1 \cdot 9 + x2 \cdot \left(x2 \cdot 8 - 12\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x2 \cdot \left(8 \cdot \left(x1 \cdot x2\right) - \left(6 + x1 \cdot 12\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 79.4% accurate, 3.7× speedup?

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

\\
\begin{array}{l}
t_0 := x2 \cdot \left(8 \cdot \left(x1 \cdot x2\right) - \left(6 + x1 \cdot 12\right)\right)\\
\mathbf{if}\;x2 \leq -5.2 \cdot 10^{+84}:\\
\;\;\;\;t\_0\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x2 < -5.2000000000000002e84 or 2.44999999999999985e166 < x2

    1. Initial program 75.8%

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

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

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

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

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

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

    if -5.2000000000000002e84 < x2 < 2.0000000000000001e-58

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

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

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

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

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

    if 2.0000000000000001e-58 < x2 < 2.44999999999999985e166

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x2 \leq -5.2 \cdot 10^{+84}:\\ \;\;\;\;x2 \cdot \left(8 \cdot \left(x1 \cdot x2\right) - \left(6 + x1 \cdot 12\right)\right)\\ \mathbf{elif}\;x2 \leq 2 \cdot 10^{-58}:\\ \;\;\;\;x2 \cdot \left(\frac{x1 \cdot \left(-1 + x1 \cdot 9\right)}{x2} - 6\right)\\ \mathbf{elif}\;x2 \leq 2.45 \cdot 10^{+166}:\\ \;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + \left(x1 \cdot 9 + x2 \cdot \left(x1 \cdot 12 - 12\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x2 \cdot \left(8 \cdot \left(x1 \cdot x2\right) - \left(6 + x1 \cdot 12\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 79.4% accurate, 4.2× speedup?

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

\\
\begin{array}{l}
t_0 := x2 \cdot \left(8 \cdot \left(x1 \cdot x2\right) - \left(6 + x1 \cdot 12\right)\right)\\
\mathbf{if}\;x2 \leq -1.85 \cdot 10^{+81}:\\
\;\;\;\;t\_0\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x2 < -1.85e81 or 2.55e166 < x2

    1. Initial program 75.8%

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

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

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

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

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

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

    if -1.85e81 < x2 < 9.99999999999999936e-50

    1. Initial program 62.4%

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

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

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

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

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

    if 9.99999999999999936e-50 < x2 < 2.55e166

    1. Initial program 54.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. Simplified60.5%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x2 \leq -1.85 \cdot 10^{+81}:\\ \;\;\;\;x2 \cdot \left(8 \cdot \left(x1 \cdot x2\right) - \left(6 + x1 \cdot 12\right)\right)\\ \mathbf{elif}\;x2 \leq 10^{-49}:\\ \;\;\;\;x2 \cdot \left(\frac{x1 \cdot \left(-1 + x1 \cdot 9\right)}{x2} - 6\right)\\ \mathbf{elif}\;x2 \leq 2.55 \cdot 10^{+166}:\\ \;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot \left(9 + x2 \cdot 12\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x2 \cdot \left(8 \cdot \left(x1 \cdot x2\right) - \left(6 + x1 \cdot 12\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 82.5% accurate, 4.9× speedup?

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

\\
\begin{array}{l}
t_0 := x1 \cdot \left(-1 + x1 \cdot 9\right)\\
\mathbf{if}\;x1 \leq -1.55 \cdot 10^{+71}:\\
\;\;\;\;x2 \cdot \left(\frac{t\_0}{x2} - 6\right)\\

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


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

    1. Initial program 11.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. Simplified29.5%

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

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

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

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

    if -1.55000000000000009e71 < x1

    1. Initial program 81.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. Simplified70.4%

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

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

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

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

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

Alternative 16: 78.7% accurate, 5.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -6.5 \cdot 10^{+81} \lor \neg \left(x2 \leq 1.9 \cdot 10^{+164}\right):\\
\;\;\;\;x2 \cdot \left(8 \cdot \left(x1 \cdot x2\right) - \left(6 + x1 \cdot 12\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x2 < -6.4999999999999996e81 or 1.90000000000000011e164 < x2

    1. Initial program 75.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. Simplified46.6%

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

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

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

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

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

    if -6.4999999999999996e81 < x2 < 1.90000000000000011e164

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

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

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

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

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

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

Alternative 17: 64.3% accurate, 7.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -6.5 \cdot 10^{+152} \lor \neg \left(x1 \leq 1.9 \cdot 10^{-26}\right):\\
\;\;\;\;x1 \cdot \left(-1 + x1 \cdot 9\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x1 < -6.4999999999999997e152 or 1.90000000000000007e-26 < x1

    1. Initial program 30.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. Simplified29.3%

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

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

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

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

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

    if -6.4999999999999997e152 < x1 < 1.90000000000000007e-26

    1. Initial program 91.8%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(x2 \cdot \left(6 + \frac{x1}{x2}\right)\right)} \]
    10. Step-by-step derivation
      1. mul-1-neg62.1%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -6.5 \cdot 10^{+152} \lor \neg \left(x1 \leq 1.9 \cdot 10^{-26}\right):\\ \;\;\;\;x1 \cdot \left(-1 + x1 \cdot 9\right)\\ \mathbf{else}:\\ \;\;\;\;x2 \cdot \left(\frac{-x1}{x2} - 6\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 63.4% accurate, 7.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -1.66 \cdot 10^{-18} \lor \neg \left(x1 \leq 1.9 \cdot 10^{-26}\right):\\
\;\;\;\;x1 \cdot \left(-1 + x1 \cdot 9\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x1 < -1.66e-18 or 1.90000000000000007e-26 < x1

    1. Initial program 40.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. Simplified45.8%

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

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

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

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

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

    if -1.66e-18 < x1 < 1.90000000000000007e-26

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x2 \cdot -6} - x1 \]
    10. Applied egg-rr77.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -1.66 \cdot 10^{-18} \lor \neg \left(x1 \leq 1.9 \cdot 10^{-26}\right):\\ \;\;\;\;x1 \cdot \left(-1 + x1 \cdot 9\right)\\ \mathbf{else}:\\ \;\;\;\;x2 \cdot -6 - x1\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 32.2% accurate, 9.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -7.8 \cdot 10^{-151} \lor \neg \left(x2 \leq 2.2 \cdot 10^{-160}\right):\\
\;\;\;\;x2 \cdot -6\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x2 < -7.80000000000000013e-151 or 2.2e-160 < x2

    1. Initial program 67.8%

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

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

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

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

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

    if -7.80000000000000013e-151 < x2 < 2.2e-160

    1. Initial program 56.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. Simplified62.8%

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot x1} \]
    10. Step-by-step derivation
      1. neg-mul-133.6%

        \[\leadsto \color{blue}{-x1} \]
    11. Simplified33.6%

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

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

Alternative 20: 68.4% accurate, 9.8× speedup?

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

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

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

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

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

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

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

Alternative 21: 63.6% accurate, 11.5× speedup?

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

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

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

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

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

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

Alternative 22: 38.5% accurate, 25.4× speedup?

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-6 \cdot x2 - x1} \]
    2. *-commutative34.5%

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

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

Alternative 23: 13.6% accurate, 63.5× speedup?

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{-1 \cdot x1} \]
  10. Step-by-step derivation
    1. neg-mul-111.8%

      \[\leadsto \color{blue}{-x1} \]
  11. Simplified11.8%

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

Reproduce

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