Rosa's FloatVsDoubleBenchmark

Percentage Accurate: 71.0% → 99.6%
Time: 35.2s
Alternatives: 26
Speedup: 4.7×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

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

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

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

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

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

Alternative 2: 99.4% accurate, 0.5× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;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.5%

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

    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}{6 \cdot {x1}^{4}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification99.6%

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

Alternative 3: 96.4% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x1 < -5.50000000000000004e63 or 1.20000000000000007e35 < x1

    1. Initial program 31.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. Simplified31.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 -inf 99.9%

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

    if -5.50000000000000004e63 < x1 < 1.20000000000000007e35

    1. Initial program 99.5%

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

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

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

Alternative 4: 96.4% accurate, 1.1× speedup?

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

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

\mathbf{elif}\;x1 \leq -3.3 \cdot 10^{-6}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(\left(t\_5 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_6\right) \cdot t\_7 + \left(x1 \cdot x1\right) \cdot \left(t\_6 \cdot 4 - 6\right)\right) + t\_3 \cdot t\_6\right) + t\_1\right)\right) + 9\right)\\

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

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


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

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

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

    if -3.4999999999999997e66 < x1 < -3.30000000000000017e-6

    1. Initial program 99.4%

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

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

    if -3.30000000000000017e-6 < x1 < 3.8999999999999998e102

    1. Initial program 99.4%

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

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

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

    1. Initial program 26.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. Simplified26.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 8.3%

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

        \[\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 + 4 \cdot \color{blue}{\left(\left(x1 \cdot x2\right) \cdot \left(2 \cdot x2 - 3\right)\right)}\right) \]
      2. fmm-def8.3%

        \[\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 + 4 \cdot \left(\left(x1 \cdot x2\right) \cdot \color{blue}{\mathsf{fma}\left(2, x2, -3\right)}\right)\right) \]
      3. metadata-eval8.3%

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

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

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

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

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

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

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

Alternative 5: 92.9% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -4.1 \cdot 10^{+15} \lor \neg \left(x1 \leq 4.7 \cdot 10^{+33}\right):\\
\;\;\;\;6 \cdot {x1}^{4}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x1 < -4.1e15 or 4.6999999999999998e33 < x1

    1. Initial program 38.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. Simplified38.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 inf 94.4%

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

    if -4.1e15 < x1 < 4.6999999999999998e33

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

Alternative 6: 95.0% accurate, 1.1× speedup?

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

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

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

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


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

    1. Initial program 11.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. Simplified11.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 98.3%

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

    if -5.59999999999999974e63 < x1 < 3.8999999999999998e102

    1. Initial program 99.4%

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

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

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

    1. Initial program 26.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. Simplified26.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 8.3%

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

        \[\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 + 4 \cdot \color{blue}{\left(\left(x1 \cdot x2\right) \cdot \left(2 \cdot x2 - 3\right)\right)}\right) \]
      2. fmm-def8.3%

        \[\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 + 4 \cdot \left(\left(x1 \cdot x2\right) \cdot \color{blue}{\mathsf{fma}\left(2, x2, -3\right)}\right)\right) \]
      3. metadata-eval8.3%

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

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

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

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

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

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

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

Alternative 7: 95.6% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;x1 \leq -1:\\
\;\;\;\;x1 + \left(\left(x1 + \left(t\_2 + \left(t\_3 \cdot t\_4 + t\_1 \cdot t\_5\right)\right)\right) + t\_0\right)\\

\mathbf{elif}\;x1 \leq 3.3 \cdot 10^{-9}:\\
\;\;\;\;x1 - \left(\left(x1 \cdot \left(2 - t\_6\right) + x2 \cdot \left(x1 \cdot \left(12 - x1 \cdot 6\right) - 8 \cdot \left(x1 \cdot x2\right)\right)\right) - x2 \cdot -6\right)\\

\mathbf{elif}\;x1 \leq 3.9 \cdot 10^{+102}:\\
\;\;\;\;x1 - \left(\left(\left(\left(t\_5 \cdot \left(-1 - x1 \cdot x1\right) - t\_3 \cdot \left(2 \cdot x2\right)\right) - t\_2\right) - x1\right) - t\_0\right)\\

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


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

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

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

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

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

    if -1 < x1 < 3.30000000000000018e-9

    1. Initial program 99.5%

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

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

        \[\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 + 4 \cdot \color{blue}{\left(\left(x1 \cdot x2\right) \cdot \left(2 \cdot x2 - 3\right)\right)}\right) \]
      2. fmm-def99.6%

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

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

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

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

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

    if 3.30000000000000018e-9 < x1 < 3.8999999999999998e102

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

    if 3.8999999999999998e102 < x1

    1. Initial program 26.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. Simplified26.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 8.3%

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

        \[\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 + 4 \cdot \color{blue}{\left(\left(x1 \cdot x2\right) \cdot \left(2 \cdot x2 - 3\right)\right)}\right) \]
      2. fmm-def8.3%

        \[\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 + 4 \cdot \left(\left(x1 \cdot x2\right) \cdot \color{blue}{\mathsf{fma}\left(2, x2, -3\right)}\right)\right) \]
      3. metadata-eval8.3%

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

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

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

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

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

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

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

Alternative 8: 95.2% accurate, 1.2× speedup?

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

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

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

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

\mathbf{elif}\;x1 \leq 3.9 \cdot 10^{+102}:\\
\;\;\;\;t\_2\\

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


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

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

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

      \[\leadsto \color{blue}{-6 \cdot x2 + x1 \cdot \left(\left(-4 \cdot \left(x2 \cdot \left(3 + -2 \cdot x2\right)\right) + x1 \cdot \left(\left(2 \cdot \left(3 + -4 \cdot x2\right) + \left(3 \cdot \left(3 - -2 \cdot x2\right) + \left(6 \cdot x2 + \left(8 \cdot x2 + x1 \cdot \left(\left(-4 \cdot \left(x2 \cdot \left(3 + -2 \cdot x2\right)\right) + 2 \cdot \left(\left(1 + \left(-3 \cdot \left(3 + -2 \cdot x2\right) + 2 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right)\right) - -2 \cdot \left(x2 \cdot \left(3 + -2 \cdot x2\right)\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 -2.12000000000000003e102 < x1 < -1.30000000000000004 or 3.30000000000000018e-9 < x1 < 3.8999999999999998e102

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

    if -1.30000000000000004 < x1 < 3.30000000000000018e-9

    1. Initial program 99.5%

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

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

        \[\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 + 4 \cdot \color{blue}{\left(\left(x1 \cdot x2\right) \cdot \left(2 \cdot x2 - 3\right)\right)}\right) \]
      2. fmm-def99.6%

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

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

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

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

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

    if 3.8999999999999998e102 < x1

    1. Initial program 26.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. Simplified26.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 8.3%

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

        \[\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 + 4 \cdot \color{blue}{\left(\left(x1 \cdot x2\right) \cdot \left(2 \cdot x2 - 3\right)\right)}\right) \]
      2. fmm-def8.3%

        \[\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 + 4 \cdot \left(\left(x1 \cdot x2\right) \cdot \color{blue}{\mathsf{fma}\left(2, x2, -3\right)}\right)\right) \]
      3. metadata-eval8.3%

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

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

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

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

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

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

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

Alternative 9: 94.1% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
t_0 := 3 \cdot \left(x2 \cdot -2\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := x1 \cdot \left(x1 \cdot 3 + 9\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}{-1 - x1 \cdot x1}\\
t_6 := \frac{t\_4}{t\_1}\\
t_7 := x1 \cdot \left(x1 \cdot x1\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 -4.1 \cdot 10^{+15}:\\
\;\;\;\;x1 + \left(t\_0 - \left(\left(\left(t\_3 \cdot t\_5 + t\_1 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_5\right) - x1 \cdot 2\right)\right) - t\_7\right) - x1\right)\right)\\

\mathbf{elif}\;x1 \leq 2.9 \cdot 10^{+33}:\\
\;\;\;\;x1 - \left(\left(x1 \cdot \left(2 - t\_2\right) + x2 \cdot \left(x1 \cdot \left(12 - x1 \cdot 6\right) - 8 \cdot \left(x1 \cdot x2\right)\right)\right) - x2 \cdot -6\right)\\

\mathbf{elif}\;x1 \leq 2 \cdot 10^{+101}:\\
\;\;\;\;x1 + \left(t\_0 + \left(x1 + \left(t\_7 + \left(t\_3 \cdot \left(2 \cdot x2\right) - t\_1 \cdot \left(\left(t\_6 - 3\right) \cdot \left(x1 \cdot \left(x1 \cdot 2\right)\right) - \left(x1 \cdot x1\right) \cdot \left(t\_6 \cdot 4 - 6\right)\right)\right)\right)\right)\right)\\

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


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

    1. Initial program 0.0%

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

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

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

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

    if -4.1e15 < x1 < 2.90000000000000025e33

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

    if 2.90000000000000025e33 < x1 < 2e101

    1. Initial program 99.0%

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

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

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

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

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

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

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

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

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

    if 2e101 < x1

    1. Initial program 26.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. Simplified26.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 8.3%

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

        \[\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 + 4 \cdot \color{blue}{\left(\left(x1 \cdot x2\right) \cdot \left(2 \cdot x2 - 3\right)\right)}\right) \]
      2. fmm-def8.3%

        \[\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 + 4 \cdot \left(\left(x1 \cdot x2\right) \cdot \color{blue}{\mathsf{fma}\left(2, x2, -3\right)}\right)\right) \]
      3. metadata-eval8.3%

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

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

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

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

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

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

    \[\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 -4.1 \cdot 10^{+15}:\\ \;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2\right) - \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(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{-1 - x1 \cdot x1}\right) - x1 \cdot 2\right)\right) - x1 \cdot \left(x1 \cdot x1\right)\right) - x1\right)\right)\\ \mathbf{elif}\;x1 \leq 2.9 \cdot 10^{+33}:\\ \;\;\;\;x1 - \left(\left(x1 \cdot \left(2 - x1 \cdot \left(x1 \cdot 3 + 9\right)\right) + x2 \cdot \left(x1 \cdot \left(12 - x1 \cdot 6\right) - 8 \cdot \left(x1 \cdot x2\right)\right)\right) - x2 \cdot -6\right)\\ \mathbf{elif}\;x1 \leq 2 \cdot 10^{+101}:\\ \;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2\right) + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(\left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \left(2 \cdot x2\right) - \left(x1 \cdot x1 + 1\right) \cdot \left(\left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) \cdot \left(x1 \cdot \left(x1 \cdot 2\right)\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}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x1 \cdot \left(x1 \cdot 3 + 9\right) - 2\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 94.3% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3 + 9\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{-1 - x1 \cdot x1}\\
t_3 := x1 + \left(3 \cdot \left(x2 \cdot -2\right) - \left(\left(\left(t\_1 \cdot t\_2 + \left(x1 \cdot x1 + 1\right) \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_2\right) - x1 \cdot 2\right)\right) - x1 \cdot \left(x1 \cdot x1\right)\right) - x1\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 -8 \cdot 10^{+15}:\\
\;\;\;\;t\_3\\

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

\mathbf{elif}\;x1 \leq 5.5 \cdot 10^{+102}:\\
\;\;\;\;t\_3\\

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


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

    1. Initial program 0.0%

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

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

      \[\leadsto \color{blue}{-6 \cdot x2 + x1 \cdot \left(\left(-4 \cdot \left(x2 \cdot \left(3 + -2 \cdot x2\right)\right) + x1 \cdot \left(\left(2 \cdot \left(3 + -4 \cdot x2\right) + \left(3 \cdot \left(3 - -2 \cdot x2\right) + \left(6 \cdot x2 + \left(8 \cdot x2 + x1 \cdot \left(\left(-4 \cdot \left(x2 \cdot \left(3 + -2 \cdot x2\right)\right) + 2 \cdot \left(\left(1 + \left(-3 \cdot \left(3 + -2 \cdot x2\right) + 2 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right)\right) - -2 \cdot \left(x2 \cdot \left(3 + -2 \cdot x2\right)\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 < -8e15 or 2.90000000000000025e33 < x1 < 5.49999999999999981e102

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

    if -8e15 < x1 < 2.90000000000000025e33

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

    if 5.49999999999999981e102 < x1

    1. Initial program 26.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. Simplified26.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 8.3%

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

        \[\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 + 4 \cdot \color{blue}{\left(\left(x1 \cdot x2\right) \cdot \left(2 \cdot x2 - 3\right)\right)}\right) \]
      2. fmm-def8.3%

        \[\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 + 4 \cdot \left(\left(x1 \cdot x2\right) \cdot \color{blue}{\mathsf{fma}\left(2, x2, -3\right)}\right)\right) \]
      3. metadata-eval8.3%

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

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

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

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

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

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

    \[\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 -8 \cdot 10^{+15}:\\ \;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2\right) - \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(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{-1 - x1 \cdot x1}\right) - x1 \cdot 2\right)\right) - x1 \cdot \left(x1 \cdot x1\right)\right) - x1\right)\right)\\ \mathbf{elif}\;x1 \leq 2.9 \cdot 10^{+33}:\\ \;\;\;\;x1 - \left(\left(x1 \cdot \left(2 - x1 \cdot \left(x1 \cdot 3 + 9\right)\right) + x2 \cdot \left(x1 \cdot \left(12 - x1 \cdot 6\right) - 8 \cdot \left(x1 \cdot x2\right)\right)\right) - x2 \cdot -6\right)\\ \mathbf{elif}\;x1 \leq 5.5 \cdot 10^{+102}:\\ \;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2\right) - \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(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{-1 - x1 \cdot x1}\right) - x1 \cdot 2\right)\right) - x1 \cdot \left(x1 \cdot x1\right)\right) - x1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x1 \cdot \left(x1 \cdot 3 + 9\right) - 2\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 93.5% accurate, 1.6× speedup?

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

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

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

\mathbf{elif}\;x1 \leq 2.9 \cdot 10^{+33}:\\
\;\;\;\;x1 - \left(\left(x1 \cdot \left(2 - t\_6\right) + x2 \cdot \left(x1 \cdot \left(12 - x1 \cdot 6\right) - 8 \cdot \left(x1 \cdot x2\right)\right)\right) - x2 \cdot -6\right)\\

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

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


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

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

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

      \[\leadsto \color{blue}{-6 \cdot x2 + x1 \cdot \left(\left(-4 \cdot \left(x2 \cdot \left(3 + -2 \cdot x2\right)\right) + x1 \cdot \left(\left(2 \cdot \left(3 + -4 \cdot x2\right) + \left(3 \cdot \left(3 - -2 \cdot x2\right) + \left(6 \cdot x2 + \left(8 \cdot x2 + x1 \cdot \left(\left(-4 \cdot \left(x2 \cdot \left(3 + -2 \cdot x2\right)\right) + 2 \cdot \left(\left(1 + \left(-3 \cdot \left(3 + -2 \cdot x2\right) + 2 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right)\right) - -2 \cdot \left(x2 \cdot \left(3 + -2 \cdot x2\right)\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 -2.12000000000000003e102 < x1 < -4.1e15

    1. Initial program 99.4%

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

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

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

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

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

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

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

    if -4.1e15 < x1 < 2.90000000000000025e33

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

    if 2.90000000000000025e33 < x1 < 5e102

    1. Initial program 99.0%

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

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

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

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

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

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

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

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

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

    if 5e102 < x1

    1. Initial program 26.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. Simplified26.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 8.3%

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

        \[\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 + 4 \cdot \color{blue}{\left(\left(x1 \cdot x2\right) \cdot \left(2 \cdot x2 - 3\right)\right)}\right) \]
      2. fmm-def8.3%

        \[\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 + 4 \cdot \left(\left(x1 \cdot x2\right) \cdot \color{blue}{\mathsf{fma}\left(2, x2, -3\right)}\right)\right) \]
      3. metadata-eval8.3%

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

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

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

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

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

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

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

Alternative 12: 93.8% accurate, 1.6× speedup?

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

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

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

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

\mathbf{elif}\;x1 \leq 2 \cdot 10^{+101}:\\
\;\;\;\;x1 + \left(t\_5 + \left(x1 + \left(t\_6 + \left(t\_2 + t\_4 \cdot \left(x1 \cdot 2 + \left(x1 \cdot x1\right) \cdot \left(\frac{t\_3}{t\_4} \cdot 4 - 6\right)\right)\right)\right)\right)\right)\\

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


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

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

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

      \[\leadsto \color{blue}{-6 \cdot x2 + x1 \cdot \left(\left(-4 \cdot \left(x2 \cdot \left(3 + -2 \cdot x2\right)\right) + x1 \cdot \left(\left(2 \cdot \left(3 + -4 \cdot x2\right) + \left(3 \cdot \left(3 - -2 \cdot x2\right) + \left(6 \cdot x2 + \left(8 \cdot x2 + x1 \cdot \left(\left(-4 \cdot \left(x2 \cdot \left(3 + -2 \cdot x2\right)\right) + 2 \cdot \left(\left(1 + \left(-3 \cdot \left(3 + -2 \cdot x2\right) + 2 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right)\right) - -2 \cdot \left(x2 \cdot \left(3 + -2 \cdot x2\right)\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 -2.12000000000000003e102 < x1 < -4.1e15

    1. Initial program 99.4%

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

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

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

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

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

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

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

    if -4.1e15 < x1 < 2.90000000000000025e33

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

    if 2.90000000000000025e33 < x1 < 2e101

    1. Initial program 99.0%

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

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

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

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

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

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

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

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

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

    if 2e101 < x1

    1. Initial program 26.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. Simplified26.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 8.3%

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

        \[\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 + 4 \cdot \color{blue}{\left(\left(x1 \cdot x2\right) \cdot \left(2 \cdot x2 - 3\right)\right)}\right) \]
      2. fmm-def8.3%

        \[\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 + 4 \cdot \left(\left(x1 \cdot x2\right) \cdot \color{blue}{\mathsf{fma}\left(2, x2, -3\right)}\right)\right) \]
      3. metadata-eval8.3%

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

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

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

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

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

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

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

Alternative 13: 93.9% accurate, 1.6× speedup?

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

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

\mathbf{elif}\;x1 \leq -1.6 \cdot 10^{+16}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;x1 \leq 2.9 \cdot 10^{+33}:\\
\;\;\;\;x1 - \left(\left(x1 \cdot \left(2 - t\_3\right) + x2 \cdot \left(x1 \cdot \left(12 - x1 \cdot 6\right) - 8 \cdot \left(x1 \cdot x2\right)\right)\right) - x2 \cdot -6\right)\\

\mathbf{elif}\;x1 \leq 4 \cdot 10^{+102}:\\
\;\;\;\;t\_2\\

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


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

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

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

      \[\leadsto \color{blue}{-6 \cdot x2 + x1 \cdot \left(\left(-4 \cdot \left(x2 \cdot \left(3 + -2 \cdot x2\right)\right) + x1 \cdot \left(\left(2 \cdot \left(3 + -4 \cdot x2\right) + \left(3 \cdot \left(3 - -2 \cdot x2\right) + \left(6 \cdot x2 + \left(8 \cdot x2 + x1 \cdot \left(\left(-4 \cdot \left(x2 \cdot \left(3 + -2 \cdot x2\right)\right) + 2 \cdot \left(\left(1 + \left(-3 \cdot \left(3 + -2 \cdot x2\right) + 2 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right)\right) - -2 \cdot \left(x2 \cdot \left(3 + -2 \cdot x2\right)\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 -2.12000000000000003e102 < x1 < -1.6e16 or 2.90000000000000025e33 < x1 < 3.99999999999999991e102

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

    if -1.6e16 < x1 < 2.90000000000000025e33

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

    if 3.99999999999999991e102 < x1

    1. Initial program 26.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. Simplified26.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 8.3%

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

        \[\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 + 4 \cdot \color{blue}{\left(\left(x1 \cdot x2\right) \cdot \left(2 \cdot x2 - 3\right)\right)}\right) \]
      2. fmm-def8.3%

        \[\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 + 4 \cdot \left(\left(x1 \cdot x2\right) \cdot \color{blue}{\mathsf{fma}\left(2, x2, -3\right)}\right)\right) \]
      3. metadata-eval8.3%

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

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

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

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

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

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

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

Alternative 14: 86.1% accurate, 3.0× speedup?

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

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

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

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


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

    1. Initial program 16.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. Simplified35.1%

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

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

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

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

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

    if -2.9000000000000002e43 < x1 < 2e101

    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.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 76.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 + \color{blue}{4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)}\right) \]
    5. Step-by-step derivation
      1. associate-*r*83.7%

        \[\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 + 4 \cdot \color{blue}{\left(\left(x1 \cdot x2\right) \cdot \left(2 \cdot x2 - 3\right)\right)}\right) \]
      2. fmm-def83.7%

        \[\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 + 4 \cdot \left(\left(x1 \cdot x2\right) \cdot \color{blue}{\mathsf{fma}\left(2, x2, -3\right)}\right)\right) \]
      3. metadata-eval83.7%

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

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

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

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

    if 2e101 < x1

    1. Initial program 26.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. Simplified26.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 8.3%

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

        \[\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 + 4 \cdot \color{blue}{\left(\left(x1 \cdot x2\right) \cdot \left(2 \cdot x2 - 3\right)\right)}\right) \]
      2. fmm-def8.3%

        \[\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 + 4 \cdot \left(\left(x1 \cdot x2\right) \cdot \color{blue}{\mathsf{fma}\left(2, x2, -3\right)}\right)\right) \]
      3. metadata-eval8.3%

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

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

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

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

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

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

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

Alternative 15: 79.5% accurate, 3.3× speedup?

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

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

\mathbf{elif}\;x1 \leq 3.7 \cdot 10^{+102}:\\
\;\;\;\;x1 - \left(x1 \cdot \left(2 + \left(4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right) - 3 \cdot \left(x1 \cdot \left(3 - x2 \cdot -2\right)\right)\right)\right) - x2 \cdot -6\right)\\

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


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

    1. Initial program 20.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. Simplified36.7%

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

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

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

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

    if -9.6000000000000004e39 < x1 < 3.70000000000000023e102

    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.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 76.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 + \color{blue}{4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)}\right) \]
    5. Step-by-step derivation
      1. associate-*r*84.6%

        \[\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 + 4 \cdot \color{blue}{\left(\left(x1 \cdot x2\right) \cdot \left(2 \cdot x2 - 3\right)\right)}\right) \]
      2. fmm-def84.6%

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

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

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

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

    if 3.70000000000000023e102 < x1

    1. Initial program 26.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. Simplified26.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 8.3%

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

        \[\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 + 4 \cdot \color{blue}{\left(\left(x1 \cdot x2\right) \cdot \left(2 \cdot x2 - 3\right)\right)}\right) \]
      2. fmm-def8.3%

        \[\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 + 4 \cdot \left(\left(x1 \cdot x2\right) \cdot \color{blue}{\mathsf{fma}\left(2, x2, -3\right)}\right)\right) \]
      3. metadata-eval8.3%

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

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

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

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

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

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

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

Alternative 16: 78.6% accurate, 3.3× speedup?

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

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

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


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

    1. Initial program 20.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. Simplified36.7%

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

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

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

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

    if -3.35000000000000011e40 < x1

    1. Initial program 84.5%

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

      \[\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 + \color{blue}{4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)}\right) \]
    5. Step-by-step derivation
      1. associate-*r*68.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 + 4 \cdot \color{blue}{\left(\left(x1 \cdot x2\right) \cdot \left(2 \cdot x2 - 3\right)\right)}\right) \]
      2. fmm-def68.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 + 4 \cdot \left(\left(x1 \cdot x2\right) \cdot \color{blue}{\mathsf{fma}\left(2, x2, -3\right)}\right)\right) \]
      3. metadata-eval68.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 + 4 \cdot \left(\left(x1 \cdot x2\right) \cdot \mathsf{fma}\left(2, x2, \color{blue}{-3}\right)\right)\right) \]
    6. Simplified68.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 + \color{blue}{4 \cdot \left(\left(x1 \cdot x2\right) \cdot \mathsf{fma}\left(2, x2, -3\right)\right)}\right) \]
    7. Taylor expanded in x1 around 0 80.3%

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

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

Alternative 17: 54.6% accurate, 4.2× speedup?

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

\\
\begin{array}{l}
t_0 := x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\mathbf{if}\;x2 \leq -1.95 \cdot 10^{+57}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;x2 \leq 1.5 \cdot 10^{-76}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x2 \cdot -12 - 2\right)\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x2 < -1.94999999999999984e57 or 6.0000000000000001e218 < x2

    1. Initial program 72.0%

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

        \[\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 + 4 \cdot \color{blue}{\left(\left(x1 \cdot x2\right) \cdot \left(2 \cdot x2 - 3\right)\right)}\right) \]
      2. fmm-def70.3%

        \[\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 + 4 \cdot \left(\left(x1 \cdot x2\right) \cdot \color{blue}{\mathsf{fma}\left(2, x2, -3\right)}\right)\right) \]
      3. metadata-eval70.3%

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

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

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

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

    if -1.94999999999999984e57 < x2 < 1.50000000000000012e-76

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

      \[\leadsto \color{blue}{x1 + \mathsf{fma}\left(3, \frac{3 \cdot \left(x1 \cdot x1\right) - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, 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 49.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 + \color{blue}{4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)}\right) \]
    5. Step-by-step derivation
      1. associate-*r*49.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 + 4 \cdot \color{blue}{\left(\left(x1 \cdot x2\right) \cdot \left(2 \cdot x2 - 3\right)\right)}\right) \]
      2. fmm-def49.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 + 4 \cdot \left(\left(x1 \cdot x2\right) \cdot \color{blue}{\mathsf{fma}\left(2, x2, -3\right)}\right)\right) \]
      3. metadata-eval49.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 + 4 \cdot \left(\left(x1 \cdot x2\right) \cdot \mathsf{fma}\left(2, x2, \color{blue}{-3}\right)\right)\right) \]
    6. Simplified49.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 + \color{blue}{4 \cdot \left(\left(x1 \cdot x2\right) \cdot \mathsf{fma}\left(2, x2, -3\right)\right)}\right) \]
    7. Taylor expanded in x1 around 0 66.7%

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

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

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

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

    if 1.50000000000000012e-76 < x2 < 6.0000000000000001e218

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

      \[\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 + \color{blue}{4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)}\right) \]
    5. Step-by-step derivation
      1. associate-*r*47.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 + 4 \cdot \color{blue}{\left(\left(x1 \cdot x2\right) \cdot \left(2 \cdot x2 - 3\right)\right)}\right) \]
      2. fmm-def47.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 + 4 \cdot \left(\left(x1 \cdot x2\right) \cdot \color{blue}{\mathsf{fma}\left(2, x2, -3\right)}\right)\right) \]
      3. metadata-eval47.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 + 4 \cdot \left(\left(x1 \cdot x2\right) \cdot \mathsf{fma}\left(2, x2, \color{blue}{-3}\right)\right)\right) \]
    6. Simplified47.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 + \color{blue}{4 \cdot \left(\left(x1 \cdot x2\right) \cdot \mathsf{fma}\left(2, x2, -3\right)\right)}\right) \]
    7. Taylor expanded in x1 around 0 55.2%

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

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

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

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

Alternative 18: 41.3% accurate, 4.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -2.9 \cdot 10^{+43}:\\
\;\;\;\;x1 - x2 \cdot \left(6 + x1 \cdot 12\right)\\

\mathbf{elif}\;x1 \leq -2.4 \cdot 10^{-82} \lor \neg \left(x1 \leq 1.35 \cdot 10^{-176}\right):\\
\;\;\;\;x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\

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


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

    1. Initial program 16.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. Simplified16.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 2.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 + \color{blue}{4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)}\right) \]
    5. Step-by-step derivation
      1. associate-*r*2.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 + 4 \cdot \color{blue}{\left(\left(x1 \cdot x2\right) \cdot \left(2 \cdot x2 - 3\right)\right)}\right) \]
      2. fmm-def2.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 + 4 \cdot \left(\left(x1 \cdot x2\right) \cdot \color{blue}{\mathsf{fma}\left(2, x2, -3\right)}\right)\right) \]
      3. metadata-eval2.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 + 4 \cdot \left(\left(x1 \cdot x2\right) \cdot \mathsf{fma}\left(2, x2, \color{blue}{-3}\right)\right)\right) \]
    6. Simplified2.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 + \color{blue}{4 \cdot \left(\left(x1 \cdot x2\right) \cdot \mathsf{fma}\left(2, x2, -3\right)\right)}\right) \]
    7. Taylor expanded in x1 around 0 33.2%

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

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

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

    if -2.9000000000000002e43 < x1 < -2.40000000000000008e-82 or 1.3499999999999999e-176 < x1

    1. Initial program 76.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. Simplified77.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 51.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 + \color{blue}{4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)}\right) \]
    5. Step-by-step derivation
      1. associate-*r*51.7%

        \[\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 + 4 \cdot \color{blue}{\left(\left(x1 \cdot x2\right) \cdot \left(2 \cdot x2 - 3\right)\right)}\right) \]
      2. fmm-def51.7%

        \[\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 + 4 \cdot \left(\left(x1 \cdot x2\right) \cdot \color{blue}{\mathsf{fma}\left(2, x2, -3\right)}\right)\right) \]
      3. metadata-eval51.7%

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

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

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

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

    if -2.40000000000000008e-82 < x1 < 1.3499999999999999e-176

    1. Initial program 99.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -2.9 \cdot 10^{+43}:\\ \;\;\;\;x1 - x2 \cdot \left(6 + x1 \cdot 12\right)\\ \mathbf{elif}\;x1 \leq -2.4 \cdot 10^{-82} \lor \neg \left(x1 \leq 1.35 \cdot 10^{-176}\right):\\ \;\;\;\;x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x2 \cdot -6\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 79.3% accurate, 4.7× speedup?

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

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

\mathbf{elif}\;x1 \leq 3.9 \cdot 10^{+102}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 - x2 \cdot \left(12 - x2 \cdot 8\right)\right)\\

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


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

    1. Initial program 16.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. Simplified35.1%

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

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

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

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

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

    if -2.9000000000000002e43 < x1 < 3.8999999999999998e102

    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.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 76.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 + \color{blue}{4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)}\right) \]
    5. Step-by-step derivation
      1. associate-*r*83.7%

        \[\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 + 4 \cdot \color{blue}{\left(\left(x1 \cdot x2\right) \cdot \left(2 \cdot x2 - 3\right)\right)}\right) \]
      2. fmm-def83.7%

        \[\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 + 4 \cdot \left(\left(x1 \cdot x2\right) \cdot \color{blue}{\mathsf{fma}\left(2, x2, -3\right)}\right)\right) \]
      3. metadata-eval83.7%

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

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

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

      \[\leadsto x1 + \mathsf{fma}\left(3, \frac{3 \cdot \left(x1 \cdot x1\right) - \mathsf{fma}\left(2, x2, x1\right)}{1}, x1 + \color{blue}{x2 \cdot \left(-12 \cdot x1 + 8 \cdot \left(x1 \cdot x2\right)\right)}\right) \]
    9. Taylor expanded in x1 around 0 75.3%

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

    if 3.8999999999999998e102 < x1

    1. Initial program 26.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. Simplified26.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 8.3%

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

        \[\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 + 4 \cdot \color{blue}{\left(\left(x1 \cdot x2\right) \cdot \left(2 \cdot x2 - 3\right)\right)}\right) \]
      2. fmm-def8.3%

        \[\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 + 4 \cdot \left(\left(x1 \cdot x2\right) \cdot \color{blue}{\mathsf{fma}\left(2, x2, -3\right)}\right)\right) \]
      3. metadata-eval8.3%

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

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

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

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

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

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

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

Alternative 20: 49.4% accurate, 5.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -1.9 \cdot 10^{+56} \lor \neg \left(x2 \leq 1.15 \cdot 10^{+217}\right):\\
\;\;\;\;x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x2 < -1.89999999999999998e56 or 1.1499999999999999e217 < x2

    1. Initial program 72.0%

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

        \[\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 + 4 \cdot \color{blue}{\left(\left(x1 \cdot x2\right) \cdot \left(2 \cdot x2 - 3\right)\right)}\right) \]
      2. fmm-def70.3%

        \[\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 + 4 \cdot \left(\left(x1 \cdot x2\right) \cdot \color{blue}{\mathsf{fma}\left(2, x2, -3\right)}\right)\right) \]
      3. metadata-eval70.3%

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

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

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

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

    if -1.89999999999999998e56 < x2 < 1.1499999999999999e217

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

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

        \[\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 + 4 \cdot \color{blue}{\left(\left(x1 \cdot x2\right) \cdot \left(2 \cdot x2 - 3\right)\right)}\right) \]
      2. fmm-def48.6%

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

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

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

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

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

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

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

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

Alternative 21: 69.8% accurate, 6.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -2.9 \cdot 10^{+43}:\\
\;\;\;\;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 - x2 \cdot \left(12 - x2 \cdot 8\right)\right)\\


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

    1. Initial program 16.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. Simplified35.1%

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

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

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

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

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

    if -2.9000000000000002e43 < x1

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

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

      \[\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 + \color{blue}{4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)}\right) \]
    5. Step-by-step derivation
      1. associate-*r*68.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 + 4 \cdot \color{blue}{\left(\left(x1 \cdot x2\right) \cdot \left(2 \cdot x2 - 3\right)\right)}\right) \]
      2. fmm-def68.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 + 4 \cdot \left(\left(x1 \cdot x2\right) \cdot \color{blue}{\mathsf{fma}\left(2, x2, -3\right)}\right)\right) \]
      3. metadata-eval68.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 + 4 \cdot \left(\left(x1 \cdot x2\right) \cdot \mathsf{fma}\left(2, x2, \color{blue}{-3}\right)\right)\right) \]
    6. Simplified68.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 + \color{blue}{4 \cdot \left(\left(x1 \cdot x2\right) \cdot \mathsf{fma}\left(2, x2, -3\right)\right)}\right) \]
    7. Taylor expanded in x1 around 0 83.5%

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

      \[\leadsto x1 + \mathsf{fma}\left(3, \frac{3 \cdot \left(x1 \cdot x1\right) - \mathsf{fma}\left(2, x2, x1\right)}{1}, x1 + \color{blue}{x2 \cdot \left(-12 \cdot x1 + 8 \cdot \left(x1 \cdot x2\right)\right)}\right) \]
    9. Taylor expanded in x1 around 0 66.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -2.9 \cdot 10^{+43}:\\ \;\;\;\;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 - x2 \cdot \left(12 - x2 \cdot 8\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 22: 63.4% accurate, 6.3× speedup?

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

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

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


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

    1. Initial program 75.0%

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

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

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

      \[\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. *-commutative71.8%

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

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

    if 3.00000000000000029e-20 < x1

    1. Initial program 58.5%

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

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

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

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

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

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

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

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

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

Alternative 23: 31.7% accurate, 6.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -9.5 \cdot 10^{+153} \lor \neg \left(x1 \leq 1.35\right):\\
\;\;\;\;x1 - x1 \cdot \left(-1 - x2 \cdot -12\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x1 < -9.4999999999999995e153 or 1.3500000000000001 < x1

    1. Initial program 35.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. Simplified35.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 11.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 + \color{blue}{4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)}\right) \]
    5. Step-by-step derivation
      1. associate-*r*11.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 + 4 \cdot \color{blue}{\left(\left(x1 \cdot x2\right) \cdot \left(2 \cdot x2 - 3\right)\right)}\right) \]
      2. fmm-def11.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 + 4 \cdot \left(\left(x1 \cdot x2\right) \cdot \color{blue}{\mathsf{fma}\left(2, x2, -3\right)}\right)\right) \]
      3. metadata-eval11.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 + 4 \cdot \left(\left(x1 \cdot x2\right) \cdot \mathsf{fma}\left(2, x2, \color{blue}{-3}\right)\right)\right) \]
    6. Simplified11.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 + \color{blue}{4 \cdot \left(\left(x1 \cdot x2\right) \cdot \mathsf{fma}\left(2, x2, -3\right)\right)}\right) \]
    7. Taylor expanded in x1 around inf 22.8%

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

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

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

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

    if -9.4999999999999995e153 < x1 < 1.3500000000000001

    1. Initial program 92.5%

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

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

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

Alternative 24: 32.3% accurate, 14.1× speedup?

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

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

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

    \[\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 + \color{blue}{4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)}\right) \]
  5. Step-by-step derivation
    1. associate-*r*54.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 + 4 \cdot \color{blue}{\left(\left(x1 \cdot x2\right) \cdot \left(2 \cdot x2 - 3\right)\right)}\right) \]
    2. fmm-def54.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 + 4 \cdot \left(\left(x1 \cdot x2\right) \cdot \color{blue}{\mathsf{fma}\left(2, x2, -3\right)}\right)\right) \]
    3. metadata-eval54.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 + 4 \cdot \left(\left(x1 \cdot x2\right) \cdot \mathsf{fma}\left(2, x2, \color{blue}{-3}\right)\right)\right) \]
  6. Simplified54.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 + \color{blue}{4 \cdot \left(\left(x1 \cdot x2\right) \cdot \mathsf{fma}\left(2, x2, -3\right)\right)}\right) \]
  7. Taylor expanded in x1 around 0 72.9%

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

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

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

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

Alternative 25: 26.6% accurate, 42.3× speedup?

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

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

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

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

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

Alternative 26: 3.2% accurate, 127.0× speedup?

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

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

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

    \[\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 + \color{blue}{4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)}\right) \]
  5. Step-by-step derivation
    1. associate-*r*54.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 + 4 \cdot \color{blue}{\left(\left(x1 \cdot x2\right) \cdot \left(2 \cdot x2 - 3\right)\right)}\right) \]
    2. fmm-def54.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 + 4 \cdot \left(\left(x1 \cdot x2\right) \cdot \color{blue}{\mathsf{fma}\left(2, x2, -3\right)}\right)\right) \]
    3. metadata-eval54.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 + 4 \cdot \left(\left(x1 \cdot x2\right) \cdot \mathsf{fma}\left(2, x2, \color{blue}{-3}\right)\right)\right) \]
  6. Simplified54.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 + \color{blue}{4 \cdot \left(\left(x1 \cdot x2\right) \cdot \mathsf{fma}\left(2, x2, -3\right)\right)}\right) \]
  7. Taylor expanded in x1 around 0 72.9%

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

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

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

Reproduce

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