Rosa's FloatVsDoubleBenchmark

Percentage Accurate: 70.1% → 99.6%
Time: 26.8s
Alternatives: 20
Speedup: 3.4×

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 20 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.1% 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.6% accurate, 0.1× speedup?

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

\\
\begin{array}{l}
t_0 := -1 - x1 \cdot x1\\
t_1 := 3 - 2 \cdot x2\\
t_2 := 3 \cdot \left(x1 \cdot x1\right)\\
t_3 := \mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right)\\
t_4 := \frac{t\_3 - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\\
t_5 := \frac{x1 - t\_3}{\mathsf{fma}\left(x1, x1, 1\right)}\\
t_6 := x1 \cdot \left(x1 \cdot 3\right)\\
t_7 := \left(t\_6 + 2 \cdot x2\right) - x1\\
t_8 := \frac{t\_7}{t\_0}\\
t_9 := x1 \cdot x1 + 1\\
t_10 := \frac{t\_7}{t\_9}\\
\mathbf{if}\;x1 - \left(3 \cdot \frac{\left(t\_6 - 2 \cdot x2\right) - x1}{t\_0} + \left(\left(\left(t\_6 \cdot t\_8 + t\_9 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_10\right) \cdot \left(3 + t\_8\right) - \left(x1 \cdot x1\right) \cdot \left(t\_10 \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\_2 - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, x1 + \mathsf{fma}\left(\mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, x1 \cdot \mathsf{fma}\left(t\_4, 4, -6\right), \left(x1 \cdot \left(2 \cdot t\_5\right)\right) \cdot \left(t\_5 - -3\right)\right), \mathsf{fma}\left(t\_2, t\_4, {x1}^{3}\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;{x1}^{4} \cdot \left(6 - \frac{3 + \frac{\left(4 \cdot t\_1 - \frac{-1 + -2 \cdot \left(-1 + 3 \cdot t\_1\right)}{x1}\right) - 9}{x1}}{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.3%

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

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

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

    1. Initial program 0.0%

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

      \[\leadsto \color{blue}{{x1}^{4} \cdot \left(6 + -1 \cdot \frac{3 + -1 \cdot \frac{9 + \left(-1 \cdot \frac{1 + -2 \cdot \left(1 + 3 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1} + 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}{-1 - x1 \cdot x1} + \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{x1 - \mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right)}{\mathsf{fma}\left(x1, x1, 1\right)}\right)\right) \cdot \left(\frac{x1 - \mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right)}{\mathsf{fma}\left(x1, x1, 1\right)} - -3\right)\right), \mathsf{fma}\left(3 \cdot \left(x1 \cdot x1\right), \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}, {x1}^{3}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;{x1}^{4} \cdot \left(6 - \frac{3 + \frac{\left(4 \cdot \left(3 - 2 \cdot x2\right) - \frac{-1 + -2 \cdot \left(-1 + 3 \cdot \left(3 - 2 \cdot x2\right)\right)}{x1}\right) - 9}{x1}}{x1}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 99.1% accurate, 0.1× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;{x1}^{4} \cdot \left(6 - \frac{3 + \frac{\left(4 \cdot t\_8 - \frac{-1 + -2 \cdot \left(-1 + 3 \cdot t\_8\right)}{x1}\right) - 9}{x1}}{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.3%

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

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

      \[\leadsto 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), \color{blue}{{x1}^{3}}\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. 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)}, 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
    4. Taylor expanded in x1 around -inf 100.0%

      \[\leadsto \color{blue}{{x1}^{4} \cdot \left(6 + -1 \cdot \frac{3 + -1 \cdot \frac{9 + \left(-1 \cdot \frac{1 + -2 \cdot \left(1 + 3 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1} + 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}{-1 - x1 \cdot x1} + \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{x1 - \mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right)}{\mathsf{fma}\left(x1, x1, 1\right)}\right)\right) \cdot \left(\frac{x1 - \mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right)}{\mathsf{fma}\left(x1, x1, 1\right)} - -3\right)\right), {x1}^{3}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;{x1}^{4} \cdot \left(6 - \frac{3 + \frac{\left(4 \cdot \left(3 - 2 \cdot x2\right) - \frac{-1 + -2 \cdot \left(-1 + 3 \cdot \left(3 - 2 \cdot x2\right)\right)}{x1}\right) - 9}{x1}}{x1}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 99.4% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
t_0 := -1 - x1 \cdot x1\\
t_1 := 3 - 2 \cdot x2\\
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 := x1 \cdot x1 + 1\\
t_6 := \frac{t\_3}{t\_5}\\
t_7 := x1 - \left(3 \cdot \frac{\left(t\_2 - 2 \cdot x2\right) - x1}{t\_0} + \left(\left(\left(t\_2 \cdot t\_4 + t\_5 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_6\right) \cdot \left(3 + t\_4\right) - \left(x1 \cdot x1\right) \cdot \left(t\_6 \cdot 4 - 6\right)\right)\right) - x1 \cdot \left(x1 \cdot x1\right)\right) - x1\right)\right)\\
\mathbf{if}\;t\_7 \leq \infty:\\
\;\;\;\;t\_7\\

\mathbf{else}:\\
\;\;\;\;{x1}^{4} \cdot \left(6 - \frac{3 + \frac{\left(4 \cdot t\_1 - \frac{-1 + -2 \cdot \left(-1 + 3 \cdot t\_1\right)}{x1}\right) - 9}{x1}}{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.3%

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

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

    1. Initial program 0.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 - \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{-1 - x1 \cdot x1} + \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}{-1 - x1 \cdot x1} + \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{3 + \frac{\left(4 \cdot \left(3 - 2 \cdot x2\right) - \frac{-1 + -2 \cdot \left(-1 + 3 \cdot \left(3 - 2 \cdot x2\right)\right)}{x1}\right) - 9}{x1}}{x1}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 99.3% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
t_0 := -1 - x1 \cdot x1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := \left(t\_1 + 2 \cdot x2\right) - x1\\
t_3 := \frac{t\_2}{t\_0}\\
t_4 := x1 \cdot x1 + 1\\
t_5 := \frac{t\_2}{t\_4}\\
t_6 := x1 - \left(3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_0} + \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)\\
\mathbf{if}\;t\_6 \leq \infty:\\
\;\;\;\;t\_6\\

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


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

    1. Initial program 99.3%

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

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

    1. Initial program 0.0%

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

      \[\leadsto 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), \color{blue}{{x1}^{3}}\right)\right) \]
    5. Taylor expanded in x1 around inf 97.1%

      \[\leadsto \color{blue}{6 \cdot {x1}^{4}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification98.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}{-1 - x1 \cdot x1} + \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}{-1 - x1 \cdot x1} + \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}:\\ \;\;\;\;6 \cdot {x1}^{4}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 98.3% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_0 := -1 - x1 \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
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\_1}\\
\mathbf{if}\;x1 \leq -5 \cdot 10^{+102}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot \left(9 + x1 \cdot -19\right)\right)\\

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

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


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

    1. Initial program 0.0%

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

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

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

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

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

    if -5e102 < x1 < 9.99999999999999959e87

    1. Initial program 99.3%

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

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

    1. Initial program 36.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. Simplified36.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)}, 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
    4. Taylor expanded in x1 around inf 36.0%

      \[\leadsto 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), \color{blue}{{x1}^{3}}\right)\right) \]
    5. Taylor expanded in x1 around inf 96.0%

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

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

Alternative 6: 90.3% accurate, 1.1× speedup?

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

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

\mathbf{elif}\;x1 \leq -116000000000:\\
\;\;\;\;t\_6\\

\mathbf{elif}\;x1 \leq -1.25 \cdot 10^{-136}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 - \left(x1 \cdot \left(6 - \left(2 \cdot \left(x2 \cdot -2 + t\_1\right) - \left(t\_2 - \left(x2 \cdot 6 + x2 \cdot 8\right)\right)\right)\right) + t\_3\right)\right)\\

\mathbf{elif}\;x1 \leq 8.2 \cdot 10^{-209}:\\
\;\;\;\;x2 \cdot -6 - x1\\

\mathbf{elif}\;x1 \leq 3.8 \cdot 10^{+20}:\\
\;\;\;\;x2 \cdot -6 - x1 \cdot \left(\left(x1 \cdot \left(6 + \left(2 \cdot \left(\left(2 \cdot x2 - 3\right) - x2 \cdot -2\right) + \left(t\_2 + \left(\left(x1 \cdot \left(3 + \left(16 - x2 \cdot 24\right)\right) - x2 \cdot 8\right) - x2 \cdot 6\right)\right)\right)\right) + t\_3\right) - -1\right)\\

\mathbf{elif}\;x1 \leq 2 \cdot 10^{+153}:\\
\;\;\;\;t\_6\\

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


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

    1. Initial program 0.0%

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

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

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

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

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

    if -5e102 < x1 < -1.16e11 or 3.8e20 < x1 < 2e153

    1. Initial program 95.9%

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

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

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

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

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

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

    if -1.16e11 < x1 < -1.25e-136

    1. Initial program 99.0%

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

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

    if -1.25e-136 < x1 < 8.19999999999999955e-209

    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.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)}, 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
    4. Taylor expanded in x1 around 0 76.5%

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

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

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

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

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

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

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

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

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

    if 8.19999999999999955e-209 < x1 < 3.8e20

    1. Initial program 99.1%

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

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

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

    if 2e153 < 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)}, 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
    4. Taylor expanded in x1 around 0 0.0%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -5 \cdot 10^{+102}:\\ \;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot \left(9 + x1 \cdot -19\right)\right)\\ \mathbf{elif}\;x1 \leq -116000000000:\\ \;\;\;\;x1 + \left(3 \cdot \frac{x1 - \left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right)}{-1 - x1 \cdot x1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) - \left(\left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{-1 - x1 \cdot x1} + \left(-1 - x1 \cdot x1\right) \cdot \left(\left(x1 \cdot x1\right) \cdot \left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} \cdot 4 - 6\right) + -6\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq -1.25 \cdot 10^{-136}:\\ \;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 - \left(x1 \cdot \left(6 - \left(2 \cdot \left(x2 \cdot -2 + \left(3 - 2 \cdot x2\right)\right) - \left(3 \cdot \left(x2 \cdot -2 - 3\right) - \left(x2 \cdot 6 + x2 \cdot 8\right)\right)\right)\right) + 4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 8.2 \cdot 10^{-209}:\\ \;\;\;\;x2 \cdot -6 - x1\\ \mathbf{elif}\;x1 \leq 3.8 \cdot 10^{+20}:\\ \;\;\;\;x2 \cdot -6 - x1 \cdot \left(\left(x1 \cdot \left(6 + \left(2 \cdot \left(\left(2 \cdot x2 - 3\right) - x2 \cdot -2\right) + \left(3 \cdot \left(x2 \cdot -2 - 3\right) + \left(\left(x1 \cdot \left(3 + \left(16 - x2 \cdot 24\right)\right) - x2 \cdot 8\right) - x2 \cdot 6\right)\right)\right)\right) + 4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right) - -1\right)\\ \mathbf{elif}\;x1 \leq 2 \cdot 10^{+153}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{x1 - \left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right)}{-1 - x1 \cdot x1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) - \left(\left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{-1 - x1 \cdot x1} + \left(-1 - x1 \cdot x1\right) \cdot \left(\left(x1 \cdot x1\right) \cdot \left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} \cdot 4 - 6\right) + -6\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot 9\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 96.2% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
t_0 := -1 - x1 \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
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}\\
\mathbf{if}\;x1 \leq -2.5 \cdot 10^{+95}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot \left(9 + x1 \cdot -19\right)\right)\\

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

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


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

    1. Initial program 2.6%

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

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

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

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

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

    if -2.50000000000000012e95 < x1 < 1.99999999999999997e73

    1. Initial program 99.2%

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

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

    if 1.99999999999999997e73 < x1

    1. Initial program 41.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. Simplified41.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)}, 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
    4. Taylor expanded in x1 around inf 41.8%

      \[\leadsto 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), \color{blue}{{x1}^{3}}\right)\right) \]
    5. Taylor expanded in x1 around inf 94.5%

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

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

Alternative 8: 96.2% accurate, 1.1× speedup?

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

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

\mathbf{elif}\;x1 \leq 2 \cdot 10^{+73}:\\
\;\;\;\;x1 - \left(3 \cdot \frac{\left(t\_2 - 2 \cdot x2\right) - x1}{t\_0} + \left(\left(\left(t\_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot \frac{t\_3}{t\_1}\right) \cdot \left(3 + \frac{t\_3}{t\_0}\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}:\\
\;\;\;\;6 \cdot {x1}^{4}\\


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

    1. Initial program 2.6%

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

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

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

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

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

    if -2.50000000000000012e95 < x1 < 1.99999999999999997e73

    1. Initial program 99.2%

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

    1. Initial program 41.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. Simplified41.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)}, 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
    4. Taylor expanded in x1 around inf 41.8%

      \[\leadsto 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), \color{blue}{{x1}^{3}}\right)\right) \]
    5. Taylor expanded in x1 around inf 94.5%

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

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

Alternative 9: 96.2% accurate, 1.3× speedup?

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

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

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


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

    1. Initial program 2.6%

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

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

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

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

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

    if -2.50000000000000012e95 < x1 < 2e153

    1. Initial program 98.3%

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 77.0% accurate, 1.7× speedup?

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

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

\mathbf{elif}\;x1 \leq -1.25 \cdot 10^{-136}:\\
\;\;\;\;x2 \cdot -6 - x1 \cdot \left(\left(x1 \cdot \left(6 + \left(t\_1 + \left(3 \cdot \left(x2 \cdot -2 - 3\right) + \left(\left(x1 \cdot \left(3 + \left(16 - x2 \cdot 24\right)\right) - x2 \cdot 8\right) - x2 \cdot 6\right)\right)\right)\right) + t\_0\right) - -1\right)\\

\mathbf{elif}\;x1 \leq 7.2 \cdot 10^{-48}:\\
\;\;\;\;x2 \cdot -6 - x1\\

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

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


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

    1. Initial program 20.7%

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

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

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

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

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

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

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

    if -5.50000000000000026e54 < x1 < -1.25e-136

    1. Initial program 99.0%

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

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

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

    if -1.25e-136 < x1 < 7.2000000000000003e-48

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

    if 7.2000000000000003e-48 < x1 < 2e153

    1. Initial program 95.7%

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

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

    if 2e153 < 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)}, 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
    4. Taylor expanded in x1 around 0 0.0%

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

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

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

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

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

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

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

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

Alternative 11: 77.1% accurate, 1.7× speedup?

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

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

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

\mathbf{elif}\;x1 \leq 7.2 \cdot 10^{-48}:\\
\;\;\;\;x2 \cdot -6 - x1\\

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

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


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

    1. Initial program 20.7%

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

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

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

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

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

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

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

    if -1.7500000000000001e54 < x1 < -1.25e-136

    1. Initial program 99.0%

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

      \[\leadsto 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), \color{blue}{{x1}^{3}}\right)\right) \]
    5. Taylor expanded in x1 around 0 76.0%

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

    if -1.25e-136 < x1 < 7.2000000000000003e-48

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

    if 7.2000000000000003e-48 < x1 < 2e153

    1. Initial program 95.7%

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

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

    if 2e153 < 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)}, 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
    4. Taylor expanded in x1 around 0 0.0%

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

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

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

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

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

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

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

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

Alternative 12: 79.2% accurate, 2.3× speedup?

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

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

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

\mathbf{elif}\;x1 \leq 1.05 \cdot 10^{-209}:\\
\;\;\;\;x2 \cdot -6 - x1\\

\mathbf{elif}\;x1 \leq 4.4 \cdot 10^{+153}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + t\_1\right)\\

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


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

    1. Initial program 20.7%

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

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

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

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

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

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

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

    if -5.8e52 < x1 < -1.25e-136

    1. Initial program 99.0%

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

      \[\leadsto 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), \color{blue}{{x1}^{3}}\right)\right) \]
    5. Taylor expanded in x1 around 0 76.0%

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

    if -1.25e-136 < x1 < 1.04999999999999998e-209

    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.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)}, 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
    4. Taylor expanded in x1 around 0 76.5%

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

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

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

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

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

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

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

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

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

    if 1.04999999999999998e-209 < x1 < 4.3999999999999999e153

    1. Initial program 97.1%

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

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

    if 4.3999999999999999e153 < x1

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

Alternative 13: 79.1% accurate, 3.4× speedup?

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

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

\mathbf{elif}\;x1 \leq -1.25 \cdot 10^{-136}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;x1 \leq 2 \cdot 10^{-208}:\\
\;\;\;\;x2 \cdot -6 - x1\\

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

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


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

    1. Initial program 20.7%

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

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

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

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

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

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

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

    if -5.50000000000000026e54 < x1 < -1.25e-136 or 2.0000000000000002e-208 < x1 < 4.3999999999999999e153

    1. Initial program 97.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. Simplified98.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)}, 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
    4. Taylor expanded in x1 around 0 69.7%

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

    if -1.25e-136 < x1 < 2.0000000000000002e-208

    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.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)}, 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
    4. Taylor expanded in x1 around 0 76.5%

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

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

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

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

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

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

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

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

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

    if 4.3999999999999999e153 < x1

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

Alternative 14: 67.9% accurate, 5.8× speedup?

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

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

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


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

    1. Initial program 81.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. Simplified81.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
    4. Taylor expanded in x1 around 0 59.2%

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

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

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

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

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

    if 1.60000000000000005e140 < x1

    1. Initial program 14.3%

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

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

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

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

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

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

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

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

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

Alternative 15: 67.1% accurate, 6.3× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x1 < 9.60000000000000032e139

    1. Initial program 81.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. Simplified81.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
    4. Taylor expanded in x1 around 0 59.2%

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

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

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

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

    if 9.60000000000000032e139 < x1

    1. Initial program 14.3%

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

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

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

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

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

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

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

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

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

Alternative 16: 31.6% accurate, 9.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x2 \leq -1.75 \cdot 10^{-178} \lor \neg \left(x2 \leq 3.1 \cdot 10^{-167}\right):\\ \;\;\;\;x2 \cdot -6\\ \mathbf{else}:\\ \;\;\;\;-x1\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (if (or (<= x2 -1.75e-178) (not (<= x2 3.1e-167))) (* x2 -6.0) (- x1)))
double code(double x1, double x2) {
	double tmp;
	if ((x2 <= -1.75e-178) || !(x2 <= 3.1e-167)) {
		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 <= (-1.75d-178)) .or. (.not. (x2 <= 3.1d-167))) 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 <= -1.75e-178) || !(x2 <= 3.1e-167)) {
		tmp = x2 * -6.0;
	} else {
		tmp = -x1;
	}
	return tmp;
}
def code(x1, x2):
	tmp = 0
	if (x2 <= -1.75e-178) or not (x2 <= 3.1e-167):
		tmp = x2 * -6.0
	else:
		tmp = -x1
	return tmp
function code(x1, x2)
	tmp = 0.0
	if ((x2 <= -1.75e-178) || !(x2 <= 3.1e-167))
		tmp = Float64(x2 * -6.0);
	else
		tmp = Float64(-x1);
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	tmp = 0.0;
	if ((x2 <= -1.75e-178) || ~((x2 <= 3.1e-167)))
		tmp = x2 * -6.0;
	else
		tmp = -x1;
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := If[Or[LessEqual[x2, -1.75e-178], N[Not[LessEqual[x2, 3.1e-167]], $MachinePrecision]], N[(x2 * -6.0), $MachinePrecision], (-x1)]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -1.75 \cdot 10^{-178} \lor \neg \left(x2 \leq 3.1 \cdot 10^{-167}\right):\\
\;\;\;\;x2 \cdot -6\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x2 < -1.74999999999999992e-178 or 3.1e-167 < x2

    1. Initial program 71.6%

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

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

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

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

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

    if -1.74999999999999992e-178 < x2 < 3.1e-167

    1. Initial program 74.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. Simplified74.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)}, 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
    4. Taylor expanded in x1 around 0 75.5%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-x1} \]
    13. Simplified49.0%

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

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

Alternative 17: 63.3% accurate, 11.5× speedup?

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

\\
x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot 9\right)
\end{array}
Derivation
  1. Initial program 72.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. Simplified72.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)}, 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
  4. Taylor expanded in x1 around 0 51.1%

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

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

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

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

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

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

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

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

Alternative 18: 43.5% accurate, 15.9× speedup?

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

\\
x2 \cdot \left(\left(-6\right) - \frac{x1}{x2}\right)
\end{array}
Derivation
  1. Initial program 72.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. Simplified72.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)}, 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
  4. Taylor expanded in x1 around 0 51.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\frac{x1}{x2} + 6\right)} \cdot \left(-x2\right) \]
  13. Simplified49.0%

    \[\leadsto \color{blue}{\left(\frac{x1}{x2} + 6\right) \cdot \left(-x2\right)} \]
  14. Final simplification49.0%

    \[\leadsto x2 \cdot \left(\left(-6\right) - \frac{x1}{x2}\right) \]
  15. Add Preprocessing

Alternative 19: 38.1% 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 72.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. Simplified72.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)}, 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
  4. Taylor expanded in x1 around 0 51.1%

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

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

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

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

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

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

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

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

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

Alternative 20: 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 72.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. Simplified72.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)}, 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
  4. Taylor expanded in x1 around 0 51.1%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-x1} \]
  13. Simplified16.4%

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

Reproduce

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