Rosa's FloatVsDoubleBenchmark

Percentage Accurate: 70.3% → 99.6%
Time: 32.1s
Alternatives: 27
Speedup: 5.1×

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 27 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.3% accurate, 1.0× speedup?

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

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

Alternative 1: 99.6% accurate, 0.1× speedup?

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

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

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


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

    1. Initial program 99.4%

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

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

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

    1. Initial program 0.0%

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

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

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

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

Alternative 2: 99.5% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 99.4%

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

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

    1. Initial program 0.0%

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

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

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

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

Alternative 3: 95.9% accurate, 0.5× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 - 2\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 0 64.2%

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

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

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

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

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

Alternative 4: 94.8% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{2 \cdot x2 - 3}{x1}\\
t_1 := x1 \cdot \left(x1 \cdot x1\right)\\
t_2 := x1 \cdot x1 + 1\\
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\_2}\\
t_6 := x1 \cdot \left(x1 \cdot 9 - 2\right)\\
t_7 := x1 + \left(x2 \cdot -6 + t\_6\right)\\
t_8 := -1 - x1 \cdot x1\\
t_9 := \frac{t\_4}{t\_8}\\
t_10 := \left(x1 \cdot 2\right) \cdot t\_5\\
\mathbf{if}\;x1 \leq -4.6 \cdot 10^{+113}:\\
\;\;\;\;t\_7\\

\mathbf{elif}\;x1 \leq -1.15 \cdot 10^{-5}:\\
\;\;\;\;x1 + \left(9 + \left(x1 + \left(t\_1 + \left(t\_8 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_9\right) + t\_10 \cdot \left(3 + t\_9\right)\right) + t\_3 \cdot \left(3 + \frac{-1 + t\_0}{x1}\right)\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 1.9 \cdot 10^{-22}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + \left(t\_6 + x2 \cdot \left(x2 \cdot \left(x1 \cdot 8\right)\right)\right)\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x1 < -4.59999999999999993e113 or 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 64.2%

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

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

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

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

    if -4.59999999999999993e113 < x1 < -1.15e-5

    1. Initial program 99.5%

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

      \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \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 -1.15e-5 < x1 < 1.90000000000000012e-22

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

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

      \[\leadsto x1 + \left(-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) - 2\right)\right) \]
    6. Taylor expanded in x2 around 0 99.6%

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

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

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

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

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

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

    if 1.90000000000000012e-22 < x1 < 5.00000000000000018e153

    1. Initial program 99.5%

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

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

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

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

Alternative 5: 94.6% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;x1 \leq -0.029:\\
\;\;\;\;t\_5\\

\mathbf{elif}\;x1 \leq 1.9 \cdot 10^{-22}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + \left(t\_1 + x2 \cdot \left(x2 \cdot \left(x1 \cdot 8\right)\right)\right)\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x1 < -3.59999999999999992e113 or 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 64.2%

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

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

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

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

    if -3.59999999999999992e113 < x1 < -0.0290000000000000015 or 1.90000000000000012e-22 < x1 < 5.00000000000000018e153

    1. Initial program 99.5%

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

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

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

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

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

      \[\leadsto x1 + \left(-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) - 2\right)\right) \]
    6. Taylor expanded in x2 around 0 99.6%

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

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

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

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

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

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

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

Alternative 6: 93.2% accurate, 1.0× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x1 < -3e113 or 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 64.2%

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

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

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

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

    if -3e113 < x1 < 1.90000000000000012e-22

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

      \[\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. +-commutative97.1%

        \[\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-neg97.1%

        \[\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-neg97.1%

        \[\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. Simplified97.1%

      \[\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.90000000000000012e-22 < x1 < 5.00000000000000018e153

    1. Initial program 99.5%

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

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

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

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

Alternative 7: 94.7% accurate, 1.0× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x1 < -1.2e115 or 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 64.2%

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

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

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

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

    if -1.2e115 < x1 < -0.92000000000000004 or 2.1999999999999999e-10 < x1 < 5.00000000000000018e153

    1. Initial program 99.5%

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

      \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \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 97.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}{\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/97.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 \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-eval97.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 \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. Simplified97.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}{\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 -0.92000000000000004 < x1 < 2.1999999999999999e-10

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

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

      \[\leadsto x1 + \left(-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) - 2\right)\right) \]
    6. Taylor expanded in x2 around 0 99.6%

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

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

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

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

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

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

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

Alternative 8: 92.2% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;x1 \leq -0.0024:\\
\;\;\;\;x1 + \left(9 + \left(x1 + \left(t\_0 + \left(t\_5 \cdot \left(t\_7 + \left(\left(x1 \cdot 2\right) \cdot \frac{t\_2}{t\_8}\right) \cdot \left(3 + t\_6\right)\right) + t\_1 \cdot \left(2 \cdot x2\right)\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 7 \cdot 10^{+18}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + \left(t\_3 + x2 \cdot \left(x2 \cdot \left(x1 \cdot 8\right)\right)\right)\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x1 < -6e111 or 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 64.2%

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

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

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

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

    if -6e111 < x1 < -0.00239999999999999979

    1. Initial program 99.5%

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

    if -0.00239999999999999979 < x1 < 7e18

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

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

      \[\leadsto x1 + \left(-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) - 2\right)\right) \]
    6. Taylor expanded in x2 around 0 97.6%

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

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

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

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

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

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

    if 7e18 < x1 < 5.00000000000000018e153

    1. Initial program 99.4%

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

      \[\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. +-commutative79.7%

        \[\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-neg79.7%

        \[\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-neg79.7%

        \[\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. Simplified79.7%

      \[\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) \]
    6. Taylor expanded in x1 around inf 94.4%

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

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

Alternative 9: 91.7% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;x1 \leq -46:\\
\;\;\;\;x1 + \left(9 + \left(x1 + \left(t\_1 + \left(t\_5 \cdot \frac{t\_6}{t\_0} + \left(\frac{-1}{x1} \cdot \left(\left(x1 \cdot 2\right) \cdot t\_7\right) + t\_8\right) \cdot t\_2\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 7 \cdot 10^{+18}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + \left(t\_3 + x2 \cdot \left(x2 \cdot \left(x1 \cdot 8\right)\right)\right)\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x1 < -1.9e114 or 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 64.2%

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

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

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

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

    if -1.9e114 < x1 < -46

    1. Initial program 99.5%

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

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

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

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

      \[\leadsto x1 + \left(-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) - 2\right)\right) \]
    6. Taylor expanded in x2 around 0 97.0%

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

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

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

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

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

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

    if 7e18 < x1 < 5.00000000000000018e153

    1. Initial program 99.4%

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

      \[\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. +-commutative79.7%

        \[\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-neg79.7%

        \[\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-neg79.7%

        \[\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. Simplified79.7%

      \[\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) \]
    6. Taylor expanded in x1 around inf 94.4%

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

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

Alternative 10: 90.6% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;x1 \leq -21:\\
\;\;\;\;x1 + \left(t\_7 + \left(x1 + \left(t\_0 + \left(t\_1 \cdot \left(2 \cdot x2\right) - t\_6 \cdot \left(4 \cdot \left(x1 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right) + t\_5\right)\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 7.1 \cdot 10^{+18}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + \left(t\_3 + x2 \cdot \left(x2 \cdot \left(x1 \cdot 8\right)\right)\right)\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x1 < -1.24999999999999995e110 or 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 64.2%

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

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

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

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

    if -1.24999999999999995e110 < x1 < -21

    1. Initial program 99.5%

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

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

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

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

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

      \[\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) \]
    6. Taylor expanded in x1 around 0 86.6%

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

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

    if -21 < x1 < 7.1e18

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

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

      \[\leadsto x1 + \left(-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) - 2\right)\right) \]
    6. Taylor expanded in x2 around 0 97.0%

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

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

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

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

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

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

    if 7.1e18 < x1 < 5.00000000000000018e153

    1. Initial program 99.4%

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

      \[\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. +-commutative79.7%

        \[\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-neg79.7%

        \[\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-neg79.7%

        \[\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. Simplified79.7%

      \[\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) \]
    6. Taylor expanded in x1 around inf 94.4%

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

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

Alternative 11: 90.8% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;x1 \leq -21:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_5} + \left(x1 + \left(t\_0 + \left(t\_1 \cdot \left(2 \cdot x2\right) - t\_6\right)\right)\right)\right)\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x1 < -7.60000000000000015e112 or 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 64.2%

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

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

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

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

    if -7.60000000000000015e112 < x1 < -21

    1. Initial program 99.5%

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

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

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

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

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

      \[\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) \]
    6. Taylor expanded in x1 around 0 86.6%

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

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

    if -21 < x1 < 2.2e5

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

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

      \[\leadsto x1 + \left(-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) - 2\right)\right) \]
    6. Taylor expanded in x2 around 0 98.3%

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

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

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

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

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

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

    if 2.2e5 < x1 < 5.00000000000000018e153

    1. Initial program 99.4%

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

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

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

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

Alternative 12: 91.2% accurate, 1.3× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x1 < -1.25e114 or 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 64.2%

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

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

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

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

    if -1.25e114 < x1 < -21 or 2.2e5 < x1 < 5.00000000000000018e153

    1. Initial program 99.5%

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

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

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

    if -21 < x1 < 2.2e5

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

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

      \[\leadsto x1 + \left(-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) - 2\right)\right) \]
    6. Taylor expanded in x2 around 0 98.3%

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

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

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

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

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

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

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

Alternative 13: 83.7% accurate, 1.9× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x1 < -6.09999999999999977e125 or 4.5000000000000001e153 < x1

    1. Initial program 0.0%

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

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

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

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

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

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

    if -6.09999999999999977e125 < x1 < 5.9999999999999997e97

    1. Initial program 98.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. Simplified99.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 67.8%

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

      \[\leadsto x1 + \left(-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) - 2\right)\right) \]
    6. Taylor expanded in x2 around 0 76.4%

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

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

    if 5.9999999999999997e97 < x1 < 4.5000000000000001e153

    1. Initial program 100.0%

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

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

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

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

Alternative 14: 80.8% accurate, 4.1× speedup?

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

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

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

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


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

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

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

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

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

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

    if -2.90000000000000007e108 < x1 < 1.85e-22

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-6, x2, x1 \cdot \mathsf{fma}\left(4 \cdot x2, \color{blue}{\mathsf{fma}\left(2, x2, -3\right)}, -1\right)\right) \]
      5. metadata-eval76.2%

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

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

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

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

    if 1.85e-22 < x1

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

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

      \[\leadsto x1 + \left(-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) - 2\right)\right) \]
    6. Taylor expanded in x2 around 0 53.2%

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

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

Alternative 15: 52.9% accurate, 4.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -8 \cdot 10^{+44}:\\
\;\;\;\;x1 \cdot \left(-1 + x2 \cdot -12\right)\\

\mathbf{elif}\;x1 \leq -4.4 \cdot 10^{-39} \lor \neg \left(x1 \leq 1.95 \cdot 10^{-151}\right):\\
\;\;\;\;x1 \cdot \left(-1 + x2 \cdot \left(x2 \cdot 8 - 12\right)\right)\\

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


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

    1. Initial program 27.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. Simplified26.9%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-6, x2, x1 \cdot \mathsf{fma}\left(4 \cdot x2, \color{blue}{\mathsf{fma}\left(2, x2, -3\right)}, -1\right)\right) \]
      5. metadata-eval7.7%

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

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

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

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

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

    if -8.0000000000000007e44 < x1 < -4.40000000000000002e-39 or 1.95000000000000003e-151 < x1

    1. Initial program 77.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. Simplified77.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 49.6%

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-6, x2, x1 \cdot \mathsf{fma}\left(4 \cdot x2, \color{blue}{\mathsf{fma}\left(2, x2, -3\right)}, -1\right)\right) \]
      5. metadata-eval49.6%

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

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

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

      \[\leadsto \mathsf{fma}\left(-6, x2, x1 \cdot \color{blue}{\left(x2 \cdot \left(8 \cdot x2 - 12\right) - 1\right)}\right) \]
    8. Taylor expanded in x1 around inf 42.4%

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

    if -4.40000000000000002e-39 < x1 < 1.95000000000000003e-151

    1. Initial program 99.5%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-6, x2, x1 \cdot \mathsf{fma}\left(4 \cdot x2, \color{blue}{\mathsf{fma}\left(2, x2, -3\right)}, -1\right)\right) \]
      5. metadata-eval84.5%

        \[\leadsto \mathsf{fma}\left(-6, x2, x1 \cdot \mathsf{fma}\left(4 \cdot x2, \mathsf{fma}\left(2, x2, \color{blue}{-3}\right), -1\right)\right) \]
      6. metadata-eval84.5%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -8 \cdot 10^{+44}:\\ \;\;\;\;x1 \cdot \left(-1 + x2 \cdot -12\right)\\ \mathbf{elif}\;x1 \leq -4.4 \cdot 10^{-39} \lor \neg \left(x1 \leq 1.95 \cdot 10^{-151}\right):\\ \;\;\;\;x1 \cdot \left(-1 + x2 \cdot \left(x2 \cdot 8 - 12\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x2 \cdot -6 - x1\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 81.1% accurate, 4.9× speedup?

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

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

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


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

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

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

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

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

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

    if -2.0200000000000001e127 < x1

    1. Initial program 87.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. Simplified87.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 65.0%

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

      \[\leadsto x1 + \left(-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) - 2\right)\right) \]
    6. Taylor expanded in x2 around 0 76.3%

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

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

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

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

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

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

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

Alternative 17: 80.3% accurate, 5.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -3.6 \cdot 10^{+114} \lor \neg \left(x1 \leq 7 \cdot 10^{+151}\right):\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 - 2\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x1 < -3.6000000000000001e114 or 7.0000000000000006e151 < x1

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

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

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

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

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

    if -3.6000000000000001e114 < x1 < 7.0000000000000006e151

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-6, x2, x1 \cdot \mathsf{fma}\left(4 \cdot x2, \color{blue}{\mathsf{fma}\left(2, x2, -3\right)}, -1\right)\right) \]
      5. metadata-eval65.0%

        \[\leadsto \mathsf{fma}\left(-6, x2, x1 \cdot \mathsf{fma}\left(4 \cdot x2, \mathsf{fma}\left(2, x2, \color{blue}{-3}\right), -1\right)\right) \]
      6. metadata-eval65.0%

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

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

      \[\leadsto \color{blue}{-1 \cdot x1 + 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 simplification77.8%

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

Alternative 18: 74.5% accurate, 5.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -1.3 \cdot 10^{+116} \lor \neg \left(x1 \leq 7 \cdot 10^{+151}\right):\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 - 2\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x1 < -1.29999999999999993e116 or 7.0000000000000006e151 < x1

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

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

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

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

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

    if -1.29999999999999993e116 < x1 < 7.0000000000000006e151

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-6, x2, x1 \cdot \mathsf{fma}\left(4 \cdot x2, \color{blue}{\mathsf{fma}\left(2, x2, -3\right)}, -1\right)\right) \]
      5. metadata-eval65.0%

        \[\leadsto \mathsf{fma}\left(-6, x2, x1 \cdot \mathsf{fma}\left(4 \cdot x2, \mathsf{fma}\left(2, x2, \color{blue}{-3}\right), -1\right)\right) \]
      6. metadata-eval65.0%

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

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

      \[\leadsto \mathsf{fma}\left(-6, x2, x1 \cdot \color{blue}{\left(x2 \cdot \left(8 \cdot x2 - 12\right) - 1\right)}\right) \]
    8. Taylor expanded in x1 around 0 64.9%

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

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

Alternative 19: 68.2% accurate, 5.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -1.8 \cdot 10^{+148} \lor \neg \left(x2 \leq 4.6 \cdot 10^{+209}\right):\\
\;\;\;\;x1 \cdot \left(-1 + x2 \cdot \left(x2 \cdot 8 - 12\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x2 < -1.80000000000000003e148 or 4.60000000000000019e209 < x2

    1. Initial program 78.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. Simplified78.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 59.2%

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-6, x2, x1 \cdot \mathsf{fma}\left(4 \cdot x2, \color{blue}{\mathsf{fma}\left(2, x2, -3\right)}, -1\right)\right) \]
      5. metadata-eval59.2%

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

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

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

      \[\leadsto \mathsf{fma}\left(-6, x2, x1 \cdot \color{blue}{\left(x2 \cdot \left(8 \cdot x2 - 12\right) - 1\right)}\right) \]
    8. Taylor expanded in x1 around inf 59.2%

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

    if -1.80000000000000003e148 < x2 < 4.60000000000000019e209

    1. Initial program 75.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. Simplified75.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 67.5%

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

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

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

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

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

Alternative 20: 43.1% accurate, 6.3× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x2 < -2.10000000000000019e-9

    1. Initial program 79.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. Simplified79.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 61.5%

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-6, x2, x1 \cdot \mathsf{fma}\left(4 \cdot x2, \color{blue}{\mathsf{fma}\left(2, x2, -3\right)}, -1\right)\right) \]
      5. metadata-eval61.6%

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

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

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

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

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

    if -2.10000000000000019e-9 < x2 < 4.7999999999999999e206

    1. Initial program 76.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. Simplified76.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 50.4%

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-6, x2, x1 \cdot \mathsf{fma}\left(4 \cdot x2, \color{blue}{\mathsf{fma}\left(2, x2, -3\right)}, -1\right)\right) \]
      5. metadata-eval50.5%

        \[\leadsto \mathsf{fma}\left(-6, x2, x1 \cdot \mathsf{fma}\left(4 \cdot x2, \mathsf{fma}\left(2, x2, \color{blue}{-3}\right), -1\right)\right) \]
      6. metadata-eval50.5%

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

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

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

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

    if 4.7999999999999999e206 < x2

    1. Initial program 61.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. Simplified61.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 61.6%

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-6, x2, x1 \cdot \mathsf{fma}\left(4 \cdot x2, \color{blue}{\mathsf{fma}\left(2, x2, -3\right)}, -1\right)\right) \]
      5. metadata-eval61.6%

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(x1 \cdot \left(x2 \cdot \left(12 + 6 \cdot \frac{1}{x1}\right)\right)\right)} \]
    10. Step-by-step derivation
      1. associate-*r*50.8%

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

        \[\leadsto \color{blue}{\left(-x1\right)} \cdot \left(x2 \cdot \left(12 + 6 \cdot \frac{1}{x1}\right)\right) \]
      3. associate-*r/50.8%

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

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

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

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

Alternative 21: 37.4% accurate, 7.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -8.5 \cdot 10^{-236} \lor \neg \left(x2 \leq 1.36 \cdot 10^{-120}\right):\\
\;\;\;\;x2 \cdot \left(x1 \cdot -12 - 6\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x2 < -8.49999999999999929e-236 or 1.36000000000000001e-120 < x2

    1. Initial program 74.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. Simplified74.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 54.9%

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-6, x2, x1 \cdot \mathsf{fma}\left(4 \cdot x2, \color{blue}{\mathsf{fma}\left(2, x2, -3\right)}, -1\right)\right) \]
      5. metadata-eval55.0%

        \[\leadsto \mathsf{fma}\left(-6, x2, x1 \cdot \mathsf{fma}\left(4 \cdot x2, \mathsf{fma}\left(2, x2, \color{blue}{-3}\right), -1\right)\right) \]
      6. metadata-eval55.0%

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

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

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

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

    if -8.49999999999999929e-236 < x2 < 1.36000000000000001e-120

    1. Initial program 80.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. Simplified80.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 50.8%

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-6, x2, x1 \cdot \mathsf{fma}\left(4 \cdot x2, \color{blue}{\mathsf{fma}\left(2, x2, -3\right)}, -1\right)\right) \]
      5. metadata-eval50.8%

        \[\leadsto \mathsf{fma}\left(-6, x2, x1 \cdot \mathsf{fma}\left(4 \cdot x2, \mathsf{fma}\left(2, x2, \color{blue}{-3}\right), -1\right)\right) \]
      6. metadata-eval50.8%

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

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

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

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

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

Alternative 22: 36.0% accurate, 7.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -5.2 \cdot 10^{-109} \lor \neg \left(x1 \leq 5 \cdot 10^{-102}\right):\\
\;\;\;\;x1 \cdot \left(-1 + x2 \cdot -12\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x1 < -5.1999999999999997e-109 or 5.00000000000000026e-102 < x1

    1. Initial program 63.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. Simplified63.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 38.0%

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-6, x2, x1 \cdot \mathsf{fma}\left(4 \cdot x2, \color{blue}{\mathsf{fma}\left(2, x2, -3\right)}, -1\right)\right) \]
      5. metadata-eval38.0%

        \[\leadsto \mathsf{fma}\left(-6, x2, x1 \cdot \mathsf{fma}\left(4 \cdot x2, \mathsf{fma}\left(2, x2, \color{blue}{-3}\right), -1\right)\right) \]
      6. metadata-eval38.0%

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

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

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

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

    if -5.1999999999999997e-109 < x1 < 5.00000000000000026e-102

    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. 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 66.0%

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

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

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

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

Alternative 23: 44.3% accurate, 7.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x1 \leq -3.4 \cdot 10^{-25}:\\ \;\;\;\;x1 \cdot \left(-1 + x2 \cdot -12\right)\\ \mathbf{elif}\;x1 \leq 220000:\\ \;\;\;\;x2 \cdot -6 - x1\\ \mathbf{else}:\\ \;\;\;\;x2 \cdot \left(x1 \cdot -12 - 6\right)\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (if (<= x1 -3.4e-25)
   (* x1 (+ -1.0 (* x2 -12.0)))
   (if (<= x1 220000.0) (- (* x2 -6.0) x1) (* x2 (- (* x1 -12.0) 6.0)))))
double code(double x1, double x2) {
	double tmp;
	if (x1 <= -3.4e-25) {
		tmp = x1 * (-1.0 + (x2 * -12.0));
	} else if (x1 <= 220000.0) {
		tmp = (x2 * -6.0) - x1;
	} else {
		tmp = x2 * ((x1 * -12.0) - 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 <= (-3.4d-25)) then
        tmp = x1 * ((-1.0d0) + (x2 * (-12.0d0)))
    else if (x1 <= 220000.0d0) then
        tmp = (x2 * (-6.0d0)) - x1
    else
        tmp = x2 * ((x1 * (-12.0d0)) - 6.0d0)
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double tmp;
	if (x1 <= -3.4e-25) {
		tmp = x1 * (-1.0 + (x2 * -12.0));
	} else if (x1 <= 220000.0) {
		tmp = (x2 * -6.0) - x1;
	} else {
		tmp = x2 * ((x1 * -12.0) - 6.0);
	}
	return tmp;
}
def code(x1, x2):
	tmp = 0
	if x1 <= -3.4e-25:
		tmp = x1 * (-1.0 + (x2 * -12.0))
	elif x1 <= 220000.0:
		tmp = (x2 * -6.0) - x1
	else:
		tmp = x2 * ((x1 * -12.0) - 6.0)
	return tmp
function code(x1, x2)
	tmp = 0.0
	if (x1 <= -3.4e-25)
		tmp = Float64(x1 * Float64(-1.0 + Float64(x2 * -12.0)));
	elseif (x1 <= 220000.0)
		tmp = Float64(Float64(x2 * -6.0) - x1);
	else
		tmp = Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0));
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	tmp = 0.0;
	if (x1 <= -3.4e-25)
		tmp = x1 * (-1.0 + (x2 * -12.0));
	elseif (x1 <= 220000.0)
		tmp = (x2 * -6.0) - x1;
	else
		tmp = x2 * ((x1 * -12.0) - 6.0);
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := If[LessEqual[x1, -3.4e-25], N[(x1 * N[(-1.0 + N[(x2 * -12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 220000.0], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision], N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -3.4 \cdot 10^{-25}:\\
\;\;\;\;x1 \cdot \left(-1 + x2 \cdot -12\right)\\

\mathbf{elif}\;x1 \leq 220000:\\
\;\;\;\;x2 \cdot -6 - x1\\

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


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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-6, x2, x1 \cdot \mathsf{fma}\left(4 \cdot x2, \color{blue}{\mathsf{fma}\left(2, x2, -3\right)}, -1\right)\right) \]
      5. metadata-eval17.4%

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

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

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

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

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

    if -3.40000000000000002e-25 < x1 < 2.2e5

    1. Initial program 99.5%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-6, x2, x1 \cdot \mathsf{fma}\left(4 \cdot x2, \color{blue}{\mathsf{fma}\left(2, x2, -3\right)}, -1\right)\right) \]
      5. metadata-eval86.8%

        \[\leadsto \mathsf{fma}\left(-6, x2, x1 \cdot \mathsf{fma}\left(4 \cdot x2, \mathsf{fma}\left(2, x2, \color{blue}{-3}\right), -1\right)\right) \]
      6. metadata-eval86.8%

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

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

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

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

    if 2.2e5 < x1

    1. Initial program 57.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. Simplified57.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 25.9%

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-6, x2, x1 \cdot \mathsf{fma}\left(4 \cdot x2, \color{blue}{\mathsf{fma}\left(2, x2, -3\right)}, -1\right)\right) \]
      5. metadata-eval25.9%

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

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

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

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

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

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

Alternative 24: 56.6% accurate, 7.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq 1.95 \cdot 10^{-151}:\\
\;\;\;\;x2 \cdot \left(\left(x1 \cdot -12 - \frac{x1}{x2}\right) - 6\right)\\

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


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

    1. Initial program 77.8%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-6, x2, x1 \cdot \mathsf{fma}\left(4 \cdot x2, \color{blue}{\mathsf{fma}\left(2, x2, -3\right)}, -1\right)\right) \]
      5. metadata-eval57.3%

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

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

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

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

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

    if 1.95000000000000003e-151 < x1

    1. Initial program 72.2%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-6, x2, x1 \cdot \mathsf{fma}\left(4 \cdot x2, \color{blue}{\mathsf{fma}\left(2, x2, -3\right)}, -1\right)\right) \]
      5. metadata-eval48.7%

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

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

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

      \[\leadsto \mathsf{fma}\left(-6, x2, x1 \cdot \color{blue}{\left(x2 \cdot \left(8 \cdot x2 - 12\right) - 1\right)}\right) \]
    8. Taylor expanded in x1 around inf 40.9%

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

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

Alternative 25: 51.3% accurate, 7.9× speedup?

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

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

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


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

    1. Initial program 77.8%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-6, x2, x1 \cdot \mathsf{fma}\left(4 \cdot x2, \color{blue}{\mathsf{fma}\left(2, x2, -3\right)}, -1\right)\right) \]
      5. metadata-eval57.3%

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

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

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

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

    if 1.95000000000000003e-151 < x1

    1. Initial program 72.2%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-6, x2, x1 \cdot \mathsf{fma}\left(4 \cdot x2, \color{blue}{\mathsf{fma}\left(2, x2, -3\right)}, -1\right)\right) \]
      5. metadata-eval48.7%

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

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

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

      \[\leadsto \mathsf{fma}\left(-6, x2, x1 \cdot \color{blue}{\left(x2 \cdot \left(8 \cdot x2 - 12\right) - 1\right)}\right) \]
    8. Taylor expanded in x1 around inf 40.9%

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

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

Alternative 26: 31.2% accurate, 9.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -8.5 \cdot 10^{-236} \lor \neg \left(x2 \leq 4.2 \cdot 10^{-120}\right):\\
\;\;\;\;x2 \cdot -6\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x2 < -8.49999999999999929e-236 or 4.2000000000000001e-120 < x2

    1. Initial program 74.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. Simplified74.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 30.9%

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

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

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

    if -8.49999999999999929e-236 < x2 < 4.2000000000000001e-120

    1. Initial program 80.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. Simplified80.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 50.8%

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-6, x2, x1 \cdot \mathsf{fma}\left(4 \cdot x2, \color{blue}{\mathsf{fma}\left(2, x2, -3\right)}, -1\right)\right) \]
      5. metadata-eval50.8%

        \[\leadsto \mathsf{fma}\left(-6, x2, x1 \cdot \mathsf{fma}\left(4 \cdot x2, \mathsf{fma}\left(2, x2, \color{blue}{-3}\right), -1\right)\right) \]
      6. metadata-eval50.8%

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

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

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

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

        \[\leadsto \color{blue}{-x1} \]
    10. Simplified40.7%

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

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

Alternative 27: 13.8% accurate, 63.5× speedup?

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(-6, x2, x1 \cdot \mathsf{fma}\left(4 \cdot x2, \color{blue}{\mathsf{fma}\left(2, x2, -3\right)}, -1\right)\right) \]
    5. metadata-eval54.1%

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

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

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

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

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

      \[\leadsto \color{blue}{-x1} \]
  10. Simplified13.0%

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

Reproduce

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