Rosa's FloatVsDoubleBenchmark

Percentage Accurate: 70.6% → 99.7%
Time: 33.4s
Alternatives: 23
Speedup: 5.3×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 23 alternatives:

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

Initial Program: 70.6% accurate, 1.0× speedup?

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

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

Alternative 1: 99.7% accurate, 0.1× speedup?

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

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

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


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

    1. Initial program 99.4%

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

Alternative 2: 99.5% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 99.4%

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

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

    1. Initial program 0.0%

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

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

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

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

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

Alternative 3: 97.7% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_0 := 3 - 2 \cdot x2\\
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 := \left(t\_3 + 2 \cdot x2\right) - x1\\
t_5 := \frac{t\_4}{t\_1}\\
t_6 := \left(x1 \cdot x1\right) \cdot \left(t\_5 \cdot 4 - 6\right)\\
t_7 := t\_5 - 3\\
\mathbf{if}\;x1 \leq -9.2 \cdot 10^{+49}:\\
\;\;\;\;x1 \cdot \left(\left(-1 - -2 \cdot \left(1 - 3 \cdot t\_0\right)\right) - x1 \cdot \left(\left(4 \cdot t\_0 + x1 \cdot \left(3 - x1 \cdot 6\right)\right) - 9\right)\right)\\

\mathbf{elif}\;x1 \leq 1.5 \cdot 10^{-8}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_3 - 2 \cdot x2\right) - x1}{t\_1} + \left(x1 + \left(t\_2 - \left(t\_3 \cdot \frac{t\_4}{-1 - x1 \cdot x1} + t\_1 \cdot \left(t\_7 \cdot \left(\left(x1 \cdot 2\right) \cdot \left(x1 - 2 \cdot x2\right)\right) - t\_6\right)\right)\right)\right)\right)\\

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

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


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

    1. Initial program 28.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. Simplified28.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 + \left(-1 \cdot \frac{1 + -2 \cdot \left(1 + 3 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1} + 4 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1}}{x1}\right)} \]
    5. Taylor expanded in x1 around 0 99.9%

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

    if -9.20000000000000008e49 < x1 < 1.49999999999999987e-8

    1. Initial program 99.4%

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

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

        \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \left(2 \cdot x2 + \color{blue}{\left(-x1\right)}\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. unsub-neg98.4%

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

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

    if 1.49999999999999987e-8 < x1 < 5.00000000000000018e153

    1. Initial program 99.2%

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

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

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

    if 5.00000000000000018e153 < x1

    1. Initial program 0.0%

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

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

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

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

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

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

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

Alternative 4: 97.5% accurate, 1.0× speedup?

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

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

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

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

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


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

    1. Initial program 37.9%

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

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

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

    if -1150 < x1 < 0.299999999999999989

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

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

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

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

    if 0.299999999999999989 < x1 < 5.00000000000000018e153

    1. Initial program 99.6%

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

      \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \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) \]
    4. Step-by-step derivation
      1. metadata-eval99.2%

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

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

    if 5.00000000000000018e153 < x1

    1. Initial program 0.0%

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

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

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

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

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

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

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

Alternative 5: 97.6% accurate, 1.0× speedup?

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

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

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

\mathbf{elif}\;x1 \leq 5 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(9 + \left(x1 + \left(t\_1 + \left(t\_3 \cdot \left(t\_6 \cdot \left(t\_4 - 3\right) + t\_5\right) + t\_0 \cdot \left(3 - \frac{1 + \frac{t\_2}{x1}}{x1}\right)\right)\right)\right)\right)\\

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


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

    1. Initial program 28.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. Simplified28.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 + \left(-1 \cdot \frac{1 + -2 \cdot \left(1 + 3 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1} + 4 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1}}{x1}\right)} \]
    5. Taylor expanded in x1 around 0 99.9%

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

    if -3.99999999999999979e49 < x1 < 1.49999999999999987e-8

    1. Initial program 99.4%

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

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

    if 1.49999999999999987e-8 < x1 < 5.00000000000000018e153

    1. Initial program 99.2%

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

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

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

    if 5.00000000000000018e153 < x1

    1. Initial program 0.0%

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

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

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

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

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

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

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

Alternative 6: 97.7% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
t_0 := 3 - 2 \cdot x2\\
t_1 := x1 \cdot x1 + 1\\
t_2 := x1 \cdot \left(-1 + x1 \cdot 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}{t\_1}\\
\mathbf{if}\;x1 \leq -68:\\
\;\;\;\;x1 \cdot \left(\left(-1 - -2 \cdot \left(1 - 3 \cdot t\_0\right)\right) - x1 \cdot \left(\left(4 \cdot t\_0 + x1 \cdot \left(3 - x1 \cdot 6\right)\right) - 9\right)\right)\\

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

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

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


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

    1. Initial program 37.9%

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

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

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

    if -68 < x1 < 1.49999999999999987e-8

    1. Initial program 99.4%

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

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

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

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

    if 1.49999999999999987e-8 < x1 < 5.00000000000000018e153

    1. Initial program 99.2%

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

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

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

    if 5.00000000000000018e153 < x1

    1. Initial program 0.0%

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

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

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

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

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

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

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

Alternative 7: 97.4% accurate, 1.1× speedup?

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

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

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

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

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


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

    1. Initial program 37.9%

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

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

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

    if -1650 < x1 < 1.94999999999999996

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

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

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

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

    if 1.94999999999999996 < x1 < 5.00000000000000018e153

    1. Initial program 99.6%

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

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

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

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

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

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

    if 5.00000000000000018e153 < x1

    1. Initial program 0.0%

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

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

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

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

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

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

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

Alternative 8: 95.9% accurate, 2.8× speedup?

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

\\
\begin{array}{l}
t_0 := 3 - 2 \cdot x2\\
\mathbf{if}\;x1 \leq -185 \lor \neg \left(x1 \leq 0.29\right):\\
\;\;\;\;x1 \cdot \left(\left(-1 - -2 \cdot \left(1 - 3 \cdot t\_0\right)\right) - x1 \cdot \left(\left(4 \cdot t\_0 + x1 \cdot \left(3 - x1 \cdot 6\right)\right) - 9\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x1 < -185 or 0.28999999999999998 < x1

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

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

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

    if -185 < x1 < 0.28999999999999998

    1. Initial program 99.4%

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

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

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

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

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

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

Alternative 9: 81.8% accurate, 3.3× speedup?

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

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

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

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


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

    1. Initial program 0.0%

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

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

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

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

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

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

    if -7.7999999999999996e155 < x1 < -1.06000000000000004e51

    1. Initial program 58.3%

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

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

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

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

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

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

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

    if -1.06000000000000004e51 < x1

    1. Initial program 83.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.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 75.5%

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

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

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

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

Alternative 10: 83.2% accurate, 3.5× speedup?

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

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

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


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

    1. Initial program 28.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. Simplified28.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 + \left(-1 \cdot \frac{1 + -2 \cdot \left(1 + 3 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1} + 4 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1}}{x1}\right)} \]
    5. Taylor expanded in x1 around 0 79.6%

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

    if -8.5999999999999998e49 < x1

    1. Initial program 83.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.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 75.5%

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

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

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

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

Alternative 11: 80.8% accurate, 4.5× speedup?

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

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

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


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

    1. Initial program 0.0%

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

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

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

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

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

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

    if -9.50000000000000041e117 < x1

    1. Initial program 83.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. Simplified83.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)}, x1 + \mathsf{fma}\left(\mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, x1 \cdot \mathsf{fma}\left(\frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}, 4, -6\right), \left(x1 \cdot \left(2 \cdot \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\right)\right) \cdot \left(\frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)} + -3\right)\right), \mathsf{fma}\left(3 \cdot \left(x1 \cdot x1\right), \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}, {x1}^{3}\right)\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in x1 around 0 69.7%

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

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

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

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

Alternative 12: 74.2% accurate, 4.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x1 \leq -1.95 \cdot 10^{+116} \lor \neg \left(x1 \leq 3.5 \cdot 10^{+152}\right):\\ \;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot 9\right)\\ \mathbf{else}:\\ \;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (if (or (<= x1 -1.95e+116) (not (<= x1 3.5e+152)))
   (+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 9.0))))
   (+ (* x2 -6.0) (* x1 (+ -1.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0))))))))
double code(double x1, double x2) {
	double tmp;
	if ((x1 <= -1.95e+116) || !(x1 <= 3.5e+152)) {
		tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
	} else {
		tmp = (x2 * -6.0) + (x1 * (-1.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 <= (-1.95d+116)) .or. (.not. (x1 <= 3.5d+152))) then
        tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * 9.0d0)))
    else
        tmp = (x2 * (-6.0d0)) + (x1 * ((-1.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 <= -1.95e+116) || !(x1 <= 3.5e+152)) {
		tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
	} else {
		tmp = (x2 * -6.0) + (x1 * (-1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
	}
	return tmp;
}
def code(x1, x2):
	tmp = 0
	if (x1 <= -1.95e+116) or not (x1 <= 3.5e+152):
		tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)))
	else:
		tmp = (x2 * -6.0) + (x1 * (-1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))))
	return tmp
function code(x1, x2)
	tmp = 0.0
	if ((x1 <= -1.95e+116) || !(x1 <= 3.5e+152))
		tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * 9.0))));
	else
		tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.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 <= -1.95e+116) || ~((x1 <= 3.5e+152)))
		tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
	else
		tmp = (x2 * -6.0) + (x1 * (-1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := If[Or[LessEqual[x1, -1.95e+116], N[Not[LessEqual[x1, 3.5e+152]], $MachinePrecision]], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -1.95 \cdot 10^{+116} \lor \neg \left(x1 \leq 3.5 \cdot 10^{+152}\right):\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot 9\right)\\

\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + 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 < -1.95000000000000016e116 or 3.49999999999999981e152 < x1

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

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

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

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

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

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

    if -1.95000000000000016e116 < x1 < 3.49999999999999981e152

    1. Initial program 96.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. Simplified97.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 68.8%

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

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

Alternative 13: 80.8% accurate, 4.9× speedup?

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

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

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


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

    1. Initial program 0.0%

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

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

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

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

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

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

    if -1.85000000000000006e121 < x1

    1. Initial program 83.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. Simplified83.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)}, x1 + \mathsf{fma}\left(\mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, x1 \cdot \mathsf{fma}\left(\frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}, 4, -6\right), \left(x1 \cdot \left(2 \cdot \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\right)\right) \cdot \left(\frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)} + -3\right)\right), \mathsf{fma}\left(3 \cdot \left(x1 \cdot x1\right), \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}, {x1}^{3}\right)\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in x1 around 0 69.7%

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

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

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

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

Alternative 14: 41.2% accurate, 5.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x1 \leq -1.35 \cdot 10^{-12}:\\ \;\;\;\;x2 \cdot \left(x1 \cdot 12 + \frac{x1}{x2} \cdot -17\right)\\ \mathbf{elif}\;x1 \leq -1.8 \cdot 10^{-138} \lor \neg \left(x1 \leq 6 \cdot 10^{-127}\right):\\ \;\;\;\;x1 \cdot \left(-1 - -2 \cdot \left(x2 \cdot 6\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x2 \cdot -6\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (if (<= x1 -1.35e-12)
   (* x2 (+ (* x1 12.0) (* (/ x1 x2) -17.0)))
   (if (or (<= x1 -1.8e-138) (not (<= x1 6e-127)))
     (* x1 (- -1.0 (* -2.0 (* x2 6.0))))
     (* x2 -6.0))))
double code(double x1, double x2) {
	double tmp;
	if (x1 <= -1.35e-12) {
		tmp = x2 * ((x1 * 12.0) + ((x1 / x2) * -17.0));
	} else if ((x1 <= -1.8e-138) || !(x1 <= 6e-127)) {
		tmp = x1 * (-1.0 - (-2.0 * (x2 * 6.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 <= (-1.35d-12)) then
        tmp = x2 * ((x1 * 12.0d0) + ((x1 / x2) * (-17.0d0)))
    else if ((x1 <= (-1.8d-138)) .or. (.not. (x1 <= 6d-127))) then
        tmp = x1 * ((-1.0d0) - ((-2.0d0) * (x2 * 6.0d0)))
    else
        tmp = x2 * (-6.0d0)
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double tmp;
	if (x1 <= -1.35e-12) {
		tmp = x2 * ((x1 * 12.0) + ((x1 / x2) * -17.0));
	} else if ((x1 <= -1.8e-138) || !(x1 <= 6e-127)) {
		tmp = x1 * (-1.0 - (-2.0 * (x2 * 6.0)));
	} else {
		tmp = x2 * -6.0;
	}
	return tmp;
}
def code(x1, x2):
	tmp = 0
	if x1 <= -1.35e-12:
		tmp = x2 * ((x1 * 12.0) + ((x1 / x2) * -17.0))
	elif (x1 <= -1.8e-138) or not (x1 <= 6e-127):
		tmp = x1 * (-1.0 - (-2.0 * (x2 * 6.0)))
	else:
		tmp = x2 * -6.0
	return tmp
function code(x1, x2)
	tmp = 0.0
	if (x1 <= -1.35e-12)
		tmp = Float64(x2 * Float64(Float64(x1 * 12.0) + Float64(Float64(x1 / x2) * -17.0)));
	elseif ((x1 <= -1.8e-138) || !(x1 <= 6e-127))
		tmp = Float64(x1 * Float64(-1.0 - Float64(-2.0 * Float64(x2 * 6.0))));
	else
		tmp = Float64(x2 * -6.0);
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	tmp = 0.0;
	if (x1 <= -1.35e-12)
		tmp = x2 * ((x1 * 12.0) + ((x1 / x2) * -17.0));
	elseif ((x1 <= -1.8e-138) || ~((x1 <= 6e-127)))
		tmp = x1 * (-1.0 - (-2.0 * (x2 * 6.0)));
	else
		tmp = x2 * -6.0;
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := If[LessEqual[x1, -1.35e-12], N[(x2 * N[(N[(x1 * 12.0), $MachinePrecision] + N[(N[(x1 / x2), $MachinePrecision] * -17.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x1, -1.8e-138], N[Not[LessEqual[x1, 6e-127]], $MachinePrecision]], N[(x1 * N[(-1.0 - N[(-2.0 * N[(x2 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x2 * -6.0), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -1.35 \cdot 10^{-12}:\\
\;\;\;\;x2 \cdot \left(x1 \cdot 12 + \frac{x1}{x2} \cdot -17\right)\\

\mathbf{elif}\;x1 \leq -1.8 \cdot 10^{-138} \lor \neg \left(x1 \leq 6 \cdot 10^{-127}\right):\\
\;\;\;\;x1 \cdot \left(-1 - -2 \cdot \left(x2 \cdot 6\right)\right)\\

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


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

    1. Initial program 39.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. Simplified39.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 92.9%

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

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

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

    if -1.3499999999999999e-12 < x1 < -1.80000000000000009e-138 or 6.00000000000000017e-127 < x1

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

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

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

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

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

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

    if -1.80000000000000009e-138 < x1 < 6.00000000000000017e-127

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

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

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

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

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

Alternative 15: 75.0% accurate, 5.3× speedup?

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

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

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


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

    1. Initial program 0.0%

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

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

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

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

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

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

    if -8.2000000000000001e114 < x1

    1. Initial program 83.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. Simplified83.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)}, x1 + \mathsf{fma}\left(\mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, x1 \cdot \mathsf{fma}\left(\frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}, 4, -6\right), \left(x1 \cdot \left(2 \cdot \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\right)\right) \cdot \left(\frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)} + -3\right)\right), \mathsf{fma}\left(3 \cdot \left(x1 \cdot x1\right), \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}, {x1}^{3}\right)\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in x1 around 0 69.7%

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

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

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

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

Alternative 16: 64.9% accurate, 5.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;2 \cdot x2 \leq 5 \cdot 10^{-82}:\\
\;\;\;\;x1 \cdot \left(-1 + x1 \cdot 9\right) + x2 \cdot \left(x1 \cdot -12 - 6\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 #s(literal 2 binary64) x2) < 4.9999999999999998e-82

    1. Initial program 73.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. Simplified73.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 68.0%

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

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

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

    if 4.9999999999999998e-82 < (*.f64 #s(literal 2 binary64) x2)

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

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

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

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

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

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

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

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

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

Alternative 17: 66.5% accurate, 6.3× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x2 < 5.19999999999999995e34

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

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

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

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

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

    if 5.19999999999999995e34 < x2

    1. Initial program 66.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. 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 71.0%

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

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

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

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

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

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

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

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

Alternative 18: 36.0% accurate, 6.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -4.8 \cdot 10^{-138} \lor \neg \left(x1 \leq 3.9 \cdot 10^{-127}\right):\\
\;\;\;\;x1 \cdot \left(-1 - -2 \cdot \left(x2 \cdot 6\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x1 < -4.7999999999999998e-138 or 3.89999999999999966e-127 < x1

    1. Initial program 59.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. Simplified59.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 65.0%

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

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

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

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

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

    if -4.7999999999999998e-138 < x1 < 3.89999999999999966e-127

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -4.8 \cdot 10^{-138} \lor \neg \left(x1 \leq 3.9 \cdot 10^{-127}\right):\\ \;\;\;\;x1 \cdot \left(-1 - -2 \cdot \left(x2 \cdot 6\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x2 \cdot -6\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 32.0% accurate, 8.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -6000 \lor \neg \left(x1 \leq 8.2 \cdot 10^{+97}\right):\\
\;\;\;\;\left(x1 \cdot x2\right) \cdot 12\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x1 < -6e3 or 8.19999999999999977e97 < x1

    1. Initial program 30.3%

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

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

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

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

    if -6e3 < x1 < 8.19999999999999977e97

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

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

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

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

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

Alternative 20: 32.4% accurate, 8.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(x1 \cdot x2\right) \cdot 12\\ \mathbf{if}\;x1 \leq -4.2 \cdot 10^{-54}:\\ \;\;\;\;x1 \cdot -17 + t\_0\\ \mathbf{elif}\;x1 \leq 8.2 \cdot 10^{+97}:\\ \;\;\;\;x2 \cdot -6\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (* (* x1 x2) 12.0)))
   (if (<= x1 -4.2e-54)
     (+ (* x1 -17.0) t_0)
     (if (<= x1 8.2e+97) (* x2 -6.0) t_0))))
double code(double x1, double x2) {
	double t_0 = (x1 * x2) * 12.0;
	double tmp;
	if (x1 <= -4.2e-54) {
		tmp = (x1 * -17.0) + t_0;
	} else if (x1 <= 8.2e+97) {
		tmp = x2 * -6.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 * x2) * 12.0d0
    if (x1 <= (-4.2d-54)) then
        tmp = (x1 * (-17.0d0)) + t_0
    else if (x1 <= 8.2d+97) then
        tmp = x2 * (-6.0d0)
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double t_0 = (x1 * x2) * 12.0;
	double tmp;
	if (x1 <= -4.2e-54) {
		tmp = (x1 * -17.0) + t_0;
	} else if (x1 <= 8.2e+97) {
		tmp = x2 * -6.0;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x1, x2):
	t_0 = (x1 * x2) * 12.0
	tmp = 0
	if x1 <= -4.2e-54:
		tmp = (x1 * -17.0) + t_0
	elif x1 <= 8.2e+97:
		tmp = x2 * -6.0
	else:
		tmp = t_0
	return tmp
function code(x1, x2)
	t_0 = Float64(Float64(x1 * x2) * 12.0)
	tmp = 0.0
	if (x1 <= -4.2e-54)
		tmp = Float64(Float64(x1 * -17.0) + t_0);
	elseif (x1 <= 8.2e+97)
		tmp = Float64(x2 * -6.0);
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	t_0 = (x1 * x2) * 12.0;
	tmp = 0.0;
	if (x1 <= -4.2e-54)
		tmp = (x1 * -17.0) + t_0;
	elseif (x1 <= 8.2e+97)
		tmp = x2 * -6.0;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x2), $MachinePrecision] * 12.0), $MachinePrecision]}, If[LessEqual[x1, -4.2e-54], N[(N[(x1 * -17.0), $MachinePrecision] + t$95$0), $MachinePrecision], If[LessEqual[x1, 8.2e+97], N[(x2 * -6.0), $MachinePrecision], t$95$0]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left(x1 \cdot x2\right) \cdot 12\\
\mathbf{if}\;x1 \leq -4.2 \cdot 10^{-54}:\\
\;\;\;\;x1 \cdot -17 + t\_0\\

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

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


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

    1. Initial program 47.1%

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

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

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

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

    if -4.2e-54 < x1 < 8.19999999999999977e97

    1. Initial program 99.4%

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

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

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

        \[\leadsto \color{blue}{x2 \cdot -6} \]
    6. Simplified44.2%

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

    if 8.19999999999999977e97 < x1

    1. Initial program 18.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. Simplified18.4%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -4.2 \cdot 10^{-54}:\\ \;\;\;\;x1 \cdot -17 + \left(x1 \cdot x2\right) \cdot 12\\ \mathbf{elif}\;x1 \leq 8.2 \cdot 10^{+97}:\\ \;\;\;\;x2 \cdot -6\\ \mathbf{else}:\\ \;\;\;\;\left(x1 \cdot x2\right) \cdot 12\\ \end{array} \]
  5. Add Preprocessing

Alternative 21: 64.1% accurate, 11.5× speedup?

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

\\
x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot 9\right)
\end{array}
Derivation
  1. Initial program 71.0%

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

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

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

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

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

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

Alternative 22: 26.3% 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 71.0%

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

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

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

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

Alternative 23: 4.6% accurate, 42.3× speedup?

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

\\
x1 \cdot -17
\end{array}
Derivation
  1. Initial program 71.0%

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

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

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

    \[\leadsto \color{blue}{-17 \cdot x1} \]
  7. Step-by-step derivation
    1. *-commutative5.1%

      \[\leadsto \color{blue}{x1 \cdot -17} \]
  8. Simplified5.1%

    \[\leadsto \color{blue}{x1 \cdot -17} \]
  9. Add Preprocessing

Reproduce

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