Rosa's FloatVsDoubleBenchmark

Percentage Accurate: 69.9% → 99.5%
Time: 43.5s
Alternatives: 27
Speedup: 4.7×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 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: 69.9% 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.5% accurate, 0.1× speedup?

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

\mathbf{else}:\\
\;\;\;\;{x1}^{4} \cdot \left(6 + \frac{\frac{15 - \left(6 + -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.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. Simplified99.5%

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

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

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

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

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

Alternative 2: 99.4% accurate, 0.2× speedup?

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

\mathbf{else}:\\
\;\;\;\;{x1}^{4} \cdot \left(6 + \frac{\frac{15 - \left(6 + -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.2%

      \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. fma-define99.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{\color{blue}{\mathsf{fma}\left(3 \cdot x1, x1, 2 \cdot x2\right)} - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
      2. *-commutative99.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{\mathsf{fma}\left(\color{blue}{x1 \cdot 3}, x1, 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
      3. fma-define99.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{\mathsf{fma}\left(x1 \cdot 3, x1, 2 \cdot x2\right) - x1}{\color{blue}{\mathsf{fma}\left(x1, x1, 1\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 \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
      4. clear-num99.2%

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

        \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \color{blue}{{\left(\frac{\mathsf{fma}\left(x1, x1, 1\right)}{\mathsf{fma}\left(x1 \cdot 3, x1, 2 \cdot x2\right) - x1}\right)}^{-1}} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
      6. *-commutative99.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 {\left(\frac{\mathsf{fma}\left(x1, x1, 1\right)}{\mathsf{fma}\left(\color{blue}{3 \cdot x1}, x1, 2 \cdot x2\right) - x1}\right)}^{-1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
      7. fma-define99.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 {\left(\frac{\mathsf{fma}\left(x1, x1, 1\right)}{\color{blue}{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right)} - x1}\right)}^{-1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
      8. associate-*r*99.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 {\left(\frac{\mathsf{fma}\left(x1, x1, 1\right)}{\left(\color{blue}{3 \cdot \left(x1 \cdot x1\right)} + 2 \cdot x2\right) - x1}\right)}^{-1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
      9. fma-define99.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 {\left(\frac{\mathsf{fma}\left(x1, x1, 1\right)}{\color{blue}{\mathsf{fma}\left(3, x1 \cdot x1, 2 \cdot x2\right)} - x1}\right)}^{-1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
      10. pow299.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 {\left(\frac{\mathsf{fma}\left(x1, x1, 1\right)}{\mathsf{fma}\left(3, \color{blue}{{x1}^{2}}, 2 \cdot x2\right) - x1}\right)}^{-1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    4. Applied egg-rr99.2%

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

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

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

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

    1. Initial program 0.0%

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

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

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

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

Alternative 3: 99.4% accurate, 0.4× speedup?

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

\mathbf{else}:\\
\;\;\;\;{x1}^{4} \cdot \left(6 + \frac{\frac{15 - \left(6 + -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.2%

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

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

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

    1. Initial program 0.0%

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

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

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

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

Alternative 4: 99.4% accurate, 0.5× speedup?

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

\mathbf{else}:\\
\;\;\;\;{x1}^{4} \cdot \left(6 + \frac{\frac{15 - \left(6 + -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.2%

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

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

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

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

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

Alternative 5: 97.8% accurate, 0.9× speedup?

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

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

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

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

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


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

    1. Initial program 0.0%

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

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

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

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

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

    if -3.99999999999999973e146 < x1 < -5.60000000000000037e102

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

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

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

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

    if -5.60000000000000037e102 < x1 < 2e153

    1. Initial program 98.7%

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

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

Alternative 6: 95.5% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x2 \cdot -6 - x1 \cdot \left(\left(x2 \cdot \left(12 - x2 \cdot 8\right) + x1 \cdot \left(3 \cdot t\_1 - \left(x2 \cdot 6 + x1 \cdot \left(x2 \cdot \left(24 + x2 \cdot -8\right) - 19\right)\right)\right)\right) - -1\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x1 < -3.99999999999999973e146 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. Add Preprocessing
    3. Taylor expanded in x1 around inf 0.0%

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

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

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

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

    if -3.99999999999999973e146 < x1 < -5.60000000000000037e102

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

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

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

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

    if -5.60000000000000037e102 < x1 < 4.5000000000000001e153

    1. Initial program 98.7%

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

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

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

Alternative 7: 97.0% accurate, 1.0× speedup?

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

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

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

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

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


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

    1. Initial program 0.0%

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

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

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

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

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

    if -3.99999999999999973e146 < x1 < -5.60000000000000037e102

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

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

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

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

    if -5.60000000000000037e102 < x1 < 2e153

    1. Initial program 98.7%

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

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

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

Alternative 8: 95.4% accurate, 1.0× speedup?

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

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

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

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

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


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

    1. Initial program 0.0%

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

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

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

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

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

    if -3.99999999999999973e146 < x1 < -5.60000000000000037e102

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

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

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

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

    if -5.60000000000000037e102 < x1 < 2e153

    1. Initial program 98.7%

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

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

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

Alternative 9: 95.8% accurate, 1.1× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x1 < -3.99999999999999973e146 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. Add Preprocessing
    3. Taylor expanded in x1 around inf 0.0%

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

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

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

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

    if -3.99999999999999973e146 < x1 < -5.60000000000000037e102

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

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

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

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

    if -5.60000000000000037e102 < x1 < -5e-53

    1. Initial program 99.0%

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

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

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

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

    if -5e-53 < x1 < 4.5000000000000001e153

    1. Initial program 98.6%

      \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in x1 around 0 97.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 \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) \]
    4. Taylor expanded in x1 around inf 96.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 \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \color{blue}{3} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \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) \]
  3. Recombined 4 regimes into one program.
  4. Final simplification97.3%

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

Alternative 10: 94.0% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;x1 \leq -1 \cdot 10^{+105}:\\
\;\;\;\;x2 \cdot -6 - x1 \cdot \left(\left(x2 \cdot \left(12 - x2 \cdot 8\right) + x1 \cdot \left(3 \cdot \left(x2 \cdot -2 - 3\right) - \left(x2 \cdot 6 + x1 \cdot \left(x2 \cdot \left(24 + x2 \cdot -8\right) - 19\right)\right)\right)\right) - -1\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x1 < -3.99999999999999973e146 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. Add Preprocessing
    3. Taylor expanded in x1 around inf 0.0%

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

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

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

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

    if -3.99999999999999973e146 < x1 < -9.9999999999999994e104

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

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

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

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

    if -9.9999999999999994e104 < x1 < 4.5000000000000001e153

    1. Initial program 98.7%

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

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

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

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

Alternative 11: 93.6% accurate, 1.2× speedup?

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

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

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

\mathbf{elif}\;x1 \leq -460000000000:\\
\;\;\;\;x1 + \left(t\_3 + \left(x1 + \left(t\_0 - \left(t\_6 - t\_4 \cdot \left(2 \cdot x2\right)\right)\right)\right)\right)\\

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

\mathbf{elif}\;x1 \leq 2 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(t\_3 + \left(x1 + \left(t\_0 + \left(3 \cdot t\_4 - t\_6\right)\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if x1 < -3.99999999999999973e146 or 2e153 < x1

    1. Initial program 0.0%

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

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

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

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

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

    if -3.99999999999999973e146 < x1 < -5.60000000000000037e102

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

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

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

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

    if -5.60000000000000037e102 < x1 < -4.6e11

    1. Initial program 99.1%

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

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

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

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

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

    if -4.6e11 < x1 < 7

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

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

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

    if 7 < x1 < 2e153

    1. Initial program 96.2%

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

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

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

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

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

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

Alternative 12: 93.9% accurate, 1.2× speedup?

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

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

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

\mathbf{elif}\;x1 \leq -460000000000:\\
\;\;\;\;x1 + \left(3 \cdot \frac{x1 + \left(2 \cdot x2 - t\_4\right)}{-1 - x1 \cdot x1} + \left(x1 + \left(t\_0 - \left(t\_1 \cdot \left(\frac{1}{x1} \cdot t\_3 + t\_7\right) - t\_5\right)\right)\right)\right)\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if x1 < -3.99999999999999973e146 or 2e153 < x1

    1. Initial program 0.0%

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

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

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

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

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

    if -3.99999999999999973e146 < x1 < -5.60000000000000037e102

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

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

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

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

    if -5.60000000000000037e102 < x1 < -4.6e11

    1. Initial program 99.1%

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

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

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

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

    if -4.6e11 < x1 < 7.79999999999999982

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

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

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

    if 7.79999999999999982 < x1 < 2e153

    1. Initial program 96.2%

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

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

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

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

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

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

Alternative 13: 93.1% accurate, 1.2× speedup?

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

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x1 < -3.99999999999999973e146 or 2e153 < x1

    1. Initial program 0.0%

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

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

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

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

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

    if -3.99999999999999973e146 < x1 < -5.60000000000000037e102

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

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

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

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

    if -5.60000000000000037e102 < x1 < -4.6e11 or 5.6999999999999999e29 < x1 < 2e153

    1. Initial program 97.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 86.4%

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

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

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

    if -4.6e11 < x1 < 5.6999999999999999e29

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

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

      \[\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 4 regimes into one program.
  4. Final simplification92.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -4 \cdot 10^{+146}:\\ \;\;\;\;x1 + \left(x1 + \left(x1 \cdot -18 + 3 \cdot \left(x1 \cdot \left(x1 \cdot 3 + -1\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq -5.6 \cdot 10^{+102}:\\ \;\;\;\;x2 \cdot -6 - x1 \cdot \left(\left(x2 \cdot \left(12 - x2 \cdot 8\right) + x1 \cdot \left(3 \cdot \left(x2 \cdot -2 - 3\right) - \left(x2 \cdot 6 + x1 \cdot \left(x2 \cdot \left(24 + x2 \cdot -8\right) - 19\right)\right)\right)\right) - -1\right)\\ \mathbf{elif}\;x1 \leq -460000000000:\\ \;\;\;\;x1 + \left(3 \cdot \frac{x1 + \left(2 \cdot x2 - x1 \cdot \left(x1 \cdot 3\right)\right)}{-1 - x1 \cdot x1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) - \left(\left(x1 \cdot x1 + 1\right) \cdot \left(\frac{1}{x1} \cdot \left(\left(x1 \cdot 2\right) \cdot 3\right) + \left(x1 \cdot x1\right) \cdot \left(6 - \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} \cdot 4\right)\right) - 3 \cdot \left(x1 \cdot \left(x1 \cdot 3\right)\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 5.7 \cdot 10^{+29}:\\ \;\;\;\;x2 \cdot \left(\left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right) - x1\\ \mathbf{elif}\;x1 \leq 2 \cdot 10^{+153}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{x1 + \left(2 \cdot x2 - x1 \cdot \left(x1 \cdot 3\right)\right)}{-1 - x1 \cdot x1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) - \left(\left(x1 \cdot x1 + 1\right) \cdot \left(\frac{1}{x1} \cdot \left(\left(x1 \cdot 2\right) \cdot 3\right) + \left(x1 \cdot x1\right) \cdot \left(6 - \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} \cdot 4\right)\right) - 3 \cdot \left(x1 \cdot \left(x1 \cdot 3\right)\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x1 + \left(x1 \cdot -18 + 3 \cdot \left(x1 \cdot \left(x1 \cdot 3 + -1\right)\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 91.4% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
t_0 := 6 \cdot \left(3 - 2 \cdot x2\right)\\
t_1 := x1 + \left(3 \cdot \frac{x1 + \left(2 \cdot x2 - x1 \cdot \left(x1 \cdot 3\right)\right)}{-1 - x1 \cdot x1} + \left(x1 - x1 \cdot \left(x1 \cdot \left(3 + \left(x1 \cdot \left(3 + \left(\left(x1 \cdot \left(6 + \left(4 \cdot \left(2 \cdot x2 - 3\right) - x2 \cdot 8\right)\right) + t\_0\right) - 6 \cdot \left(3 + x2 \cdot -2\right)\right)\right) - x2 \cdot 8\right)\right) + t\_0\right)\right)\right)\\
t_2 := x1 + \left(x1 + \left(x1 \cdot -18 + 3 \cdot \left(x1 \cdot \left(x1 \cdot 3 + -1\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -4.5 \cdot 10^{+153}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;x1 \leq -520000000000:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;x1 \leq 4.5 \cdot 10^{+153}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x1 < -4.5000000000000001e153 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. Add Preprocessing
    3. Taylor expanded in x1 around inf 0.0%

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

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

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

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

    if -4.5000000000000001e153 < x1 < -5.2e11 or 22 < x1 < 4.5000000000000001e153

    1. Initial program 81.6%

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

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

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

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

    if -5.2e11 < x1 < 22

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

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

      \[\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 3 regimes into one program.
  4. Final simplification89.2%

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

Alternative 15: 91.5% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;x1 \leq -460000000000:\\
\;\;\;\;x1 + \left(t\_4 + \left(x1 - x1 \cdot \left(x1 \cdot \left(3 + \left(x1 \cdot \left(3 + \left(\left(x1 \cdot \left(6 + \left(4 \cdot \left(2 \cdot x2 - 3\right) - x2 \cdot 8\right)\right) + t\_0\right) - 6 \cdot \left(3 + x2 \cdot -2\right)\right)\right) - x2 \cdot 8\right)\right) + t\_0\right)\right)\right)\\

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

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

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


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

    1. Initial program 0.0%

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

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

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

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

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

    if -4.5000000000000001e153 < x1 < -4.6e11

    1. Initial program 66.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. Add Preprocessing
    3. Taylor expanded in x1 around inf 53.9%

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

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

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

    if -4.6e11 < x1 < 5.6999999999999999e29

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

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

    1. Initial program 95.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. Add Preprocessing
    3. Taylor expanded in x1 around inf 91.2%

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

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

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

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

Alternative 16: 83.6% accurate, 1.5× speedup?

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

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

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

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

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


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

    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. Add Preprocessing
    3. Taylor expanded in x1 around inf 0.0%

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

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

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

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

    if -3.99999999999999973e146 < x1 < -5.80000000000000014e71

    1. Initial program 49.9%

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

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

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

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

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

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

    if -5.80000000000000014e71 < x1 < 1.14e30

    1. Initial program 99.1%

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

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

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

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

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

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

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

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

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

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

      \[\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.14e30 < x1

    1. Initial program 42.9%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -4 \cdot 10^{+146}:\\ \;\;\;\;x1 + \left(x1 + \left(x1 \cdot -18 + 3 \cdot \left(x1 \cdot \left(x1 \cdot 3 + -1\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq -5.8 \cdot 10^{+71}:\\ \;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2\right) + \left(x1 + x1 \cdot \left(6 \cdot \left(2 \cdot x2 - 3\right) - x1 \cdot \left(12 - \left(x2 \cdot 6 - \left(x1 \cdot \left(6 - \left(6 \cdot \left(3 + x2 \cdot -2\right) + \left(6 \cdot \left(2 \cdot x2 - 3\right) - x1 \cdot \left(6 + \left(3 \cdot \left(2 \cdot x2 - 3\right) + \left(4 \cdot \left(2 \cdot x2 - 3\right) - x2 \cdot 8\right)\right)\right)\right)\right)\right) - x2 \cdot 8\right)\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 1.14 \cdot 10^{+30}:\\ \;\;\;\;x2 \cdot \left(\left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right) - x1\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(\left(x1 - 6 \cdot \left(x1 \cdot \left(3 - 2 \cdot x2\right)\right)\right) + 3 \cdot \left(x2 \cdot -2 - x1 \cdot \left(x1 \cdot \left(x2 \cdot -2 - \left(x1 + 3\right)\right) - -1\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 82.8% accurate, 2.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -4 \cdot 10^{+146}:\\
\;\;\;\;x1 + \left(x1 + \left(x1 \cdot -18 + 3 \cdot \left(x1 \cdot \left(x1 \cdot 3 + -1\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq -6.2 \cdot 10^{+71}:\\
\;\;\;\;x2 \cdot -6 - x1 \cdot \left(\left(x2 \cdot \left(12 - x2 \cdot 8\right) + x1 \cdot \left(3 \cdot \left(x2 \cdot -2 - 3\right) - \left(x2 \cdot 6 + x1 \cdot \left(x2 \cdot \left(24 + x2 \cdot -8\right) - 19\right)\right)\right)\right) - -1\right)\\

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

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


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

    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. Add Preprocessing
    3. Taylor expanded in x1 around inf 0.0%

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

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

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

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

    if -3.99999999999999973e146 < x1 < -6.20000000000000036e71

    1. Initial program 49.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. Simplified100.0%

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

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

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

    if -6.20000000000000036e71 < x1 < 1.14e30

    1. Initial program 99.1%

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

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

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

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

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

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

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

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

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

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

      \[\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.14e30 < x1

    1. Initial program 42.9%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -4 \cdot 10^{+146}:\\ \;\;\;\;x1 + \left(x1 + \left(x1 \cdot -18 + 3 \cdot \left(x1 \cdot \left(x1 \cdot 3 + -1\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq -6.2 \cdot 10^{+71}:\\ \;\;\;\;x2 \cdot -6 - x1 \cdot \left(\left(x2 \cdot \left(12 - x2 \cdot 8\right) + x1 \cdot \left(3 \cdot \left(x2 \cdot -2 - 3\right) - \left(x2 \cdot 6 + x1 \cdot \left(x2 \cdot \left(24 + x2 \cdot -8\right) - 19\right)\right)\right)\right) - -1\right)\\ \mathbf{elif}\;x1 \leq 1.14 \cdot 10^{+30}:\\ \;\;\;\;x2 \cdot \left(\left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right) - x1\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(\left(x1 - 6 \cdot \left(x1 \cdot \left(3 - 2 \cdot x2\right)\right)\right) + 3 \cdot \left(x2 \cdot -2 - x1 \cdot \left(x1 \cdot \left(x2 \cdot -2 - \left(x1 + 3\right)\right) - -1\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 80.9% accurate, 2.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x1 \leq -9.5 \cdot 10^{+128}:\\ \;\;\;\;x1 + \left(x1 + \left(x1 \cdot -18 + 3 \cdot \left(x1 \cdot \left(x1 \cdot 3 + -1\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq -6.2 \cdot 10^{+71}:\\ \;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2 + x1 \cdot \left(-1 - x1 \cdot \left(x2 \cdot -2 - 3\right)\right)\right) + x2 \cdot \left(\frac{x1 \cdot -17}{x2} - x1 \cdot -12\right)\right)\\ \mathbf{elif}\;x1 \leq 8.2 \cdot 10^{+29}:\\ \;\;\;\;x2 \cdot \left(\left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right) - x1\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(\left(x1 - 6 \cdot \left(x1 \cdot \left(3 - 2 \cdot x2\right)\right)\right) + 3 \cdot \left(x2 \cdot -2 - x1 \cdot \left(x1 \cdot \left(x2 \cdot -2 - \left(x1 + 3\right)\right) - -1\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (if (<= x1 -9.5e+128)
   (+ x1 (+ x1 (+ (* x1 -18.0) (* 3.0 (* x1 (+ (* x1 3.0) -1.0))))))
   (if (<= x1 -6.2e+71)
     (+
      x1
      (+
       (* 3.0 (+ (* x2 -2.0) (* x1 (- -1.0 (* x1 (- (* x2 -2.0) 3.0))))))
       (* x2 (- (/ (* x1 -17.0) x2) (* x1 -12.0)))))
     (if (<= x1 8.2e+29)
       (- (* x2 (- (+ (* x1 -12.0) (* 8.0 (* x1 x2))) 6.0)) x1)
       (+
        x1
        (+
         (- x1 (* 6.0 (* x1 (- 3.0 (* 2.0 x2)))))
         (*
          3.0
          (-
           (* x2 -2.0)
           (* x1 (- (* x1 (- (* x2 -2.0) (+ x1 3.0))) -1.0))))))))))
double code(double x1, double x2) {
	double tmp;
	if (x1 <= -9.5e+128) {
		tmp = x1 + (x1 + ((x1 * -18.0) + (3.0 * (x1 * ((x1 * 3.0) + -1.0)))));
	} else if (x1 <= -6.2e+71) {
		tmp = x1 + ((3.0 * ((x2 * -2.0) + (x1 * (-1.0 - (x1 * ((x2 * -2.0) - 3.0)))))) + (x2 * (((x1 * -17.0) / x2) - (x1 * -12.0))));
	} else if (x1 <= 8.2e+29) {
		tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
	} else {
		tmp = x1 + ((x1 - (6.0 * (x1 * (3.0 - (2.0 * x2))))) + (3.0 * ((x2 * -2.0) - (x1 * ((x1 * ((x2 * -2.0) - (x1 + 3.0))) - -1.0)))));
	}
	return tmp;
}
real(8) function code(x1, x2)
    real(8), intent (in) :: x1
    real(8), intent (in) :: x2
    real(8) :: tmp
    if (x1 <= (-9.5d+128)) then
        tmp = x1 + (x1 + ((x1 * (-18.0d0)) + (3.0d0 * (x1 * ((x1 * 3.0d0) + (-1.0d0))))))
    else if (x1 <= (-6.2d+71)) then
        tmp = x1 + ((3.0d0 * ((x2 * (-2.0d0)) + (x1 * ((-1.0d0) - (x1 * ((x2 * (-2.0d0)) - 3.0d0)))))) + (x2 * (((x1 * (-17.0d0)) / x2) - (x1 * (-12.0d0)))))
    else if (x1 <= 8.2d+29) then
        tmp = (x2 * (((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))) - 6.0d0)) - x1
    else
        tmp = x1 + ((x1 - (6.0d0 * (x1 * (3.0d0 - (2.0d0 * x2))))) + (3.0d0 * ((x2 * (-2.0d0)) - (x1 * ((x1 * ((x2 * (-2.0d0)) - (x1 + 3.0d0))) - (-1.0d0))))))
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double tmp;
	if (x1 <= -9.5e+128) {
		tmp = x1 + (x1 + ((x1 * -18.0) + (3.0 * (x1 * ((x1 * 3.0) + -1.0)))));
	} else if (x1 <= -6.2e+71) {
		tmp = x1 + ((3.0 * ((x2 * -2.0) + (x1 * (-1.0 - (x1 * ((x2 * -2.0) - 3.0)))))) + (x2 * (((x1 * -17.0) / x2) - (x1 * -12.0))));
	} else if (x1 <= 8.2e+29) {
		tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
	} else {
		tmp = x1 + ((x1 - (6.0 * (x1 * (3.0 - (2.0 * x2))))) + (3.0 * ((x2 * -2.0) - (x1 * ((x1 * ((x2 * -2.0) - (x1 + 3.0))) - -1.0)))));
	}
	return tmp;
}
def code(x1, x2):
	tmp = 0
	if x1 <= -9.5e+128:
		tmp = x1 + (x1 + ((x1 * -18.0) + (3.0 * (x1 * ((x1 * 3.0) + -1.0)))))
	elif x1 <= -6.2e+71:
		tmp = x1 + ((3.0 * ((x2 * -2.0) + (x1 * (-1.0 - (x1 * ((x2 * -2.0) - 3.0)))))) + (x2 * (((x1 * -17.0) / x2) - (x1 * -12.0))))
	elif x1 <= 8.2e+29:
		tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1
	else:
		tmp = x1 + ((x1 - (6.0 * (x1 * (3.0 - (2.0 * x2))))) + (3.0 * ((x2 * -2.0) - (x1 * ((x1 * ((x2 * -2.0) - (x1 + 3.0))) - -1.0)))))
	return tmp
function code(x1, x2)
	tmp = 0.0
	if (x1 <= -9.5e+128)
		tmp = Float64(x1 + Float64(x1 + Float64(Float64(x1 * -18.0) + Float64(3.0 * Float64(x1 * Float64(Float64(x1 * 3.0) + -1.0))))));
	elseif (x1 <= -6.2e+71)
		tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(x2 * -2.0) + Float64(x1 * Float64(-1.0 - Float64(x1 * Float64(Float64(x2 * -2.0) - 3.0)))))) + Float64(x2 * Float64(Float64(Float64(x1 * -17.0) / x2) - Float64(x1 * -12.0)))));
	elseif (x1 <= 8.2e+29)
		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(x1 - Float64(6.0 * Float64(x1 * Float64(3.0 - Float64(2.0 * x2))))) + Float64(3.0 * Float64(Float64(x2 * -2.0) - Float64(x1 * Float64(Float64(x1 * Float64(Float64(x2 * -2.0) - Float64(x1 + 3.0))) - -1.0))))));
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	tmp = 0.0;
	if (x1 <= -9.5e+128)
		tmp = x1 + (x1 + ((x1 * -18.0) + (3.0 * (x1 * ((x1 * 3.0) + -1.0)))));
	elseif (x1 <= -6.2e+71)
		tmp = x1 + ((3.0 * ((x2 * -2.0) + (x1 * (-1.0 - (x1 * ((x2 * -2.0) - 3.0)))))) + (x2 * (((x1 * -17.0) / x2) - (x1 * -12.0))));
	elseif (x1 <= 8.2e+29)
		tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
	else
		tmp = x1 + ((x1 - (6.0 * (x1 * (3.0 - (2.0 * x2))))) + (3.0 * ((x2 * -2.0) - (x1 * ((x1 * ((x2 * -2.0) - (x1 + 3.0))) - -1.0)))));
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := If[LessEqual[x1, -9.5e+128], N[(x1 + N[(x1 + N[(N[(x1 * -18.0), $MachinePrecision] + N[(3.0 * N[(x1 * N[(N[(x1 * 3.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -6.2e+71], N[(x1 + N[(N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] + N[(x1 * N[(-1.0 - N[(x1 * N[(N[(x2 * -2.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x2 * N[(N[(N[(x1 * -17.0), $MachinePrecision] / x2), $MachinePrecision] - N[(x1 * -12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 8.2e+29], 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[(x1 - N[(6.0 * N[(x1 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - N[(x1 * N[(N[(x1 * N[(N[(x2 * -2.0), $MachinePrecision] - N[(x1 + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -9.5 \cdot 10^{+128}:\\
\;\;\;\;x1 + \left(x1 + \left(x1 \cdot -18 + 3 \cdot \left(x1 \cdot \left(x1 \cdot 3 + -1\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq -6.2 \cdot 10^{+71}:\\
\;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2 + x1 \cdot \left(-1 - x1 \cdot \left(x2 \cdot -2 - 3\right)\right)\right) + x2 \cdot \left(\frac{x1 \cdot -17}{x2} - x1 \cdot -12\right)\right)\\

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

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


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

    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. Add Preprocessing
    3. Taylor expanded in x1 around inf 0.0%

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

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

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

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

    if -9.50000000000000014e128 < x1 < -6.20000000000000036e71

    1. Initial program 59.9%

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

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

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

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

      \[\leadsto x1 + \left(\color{blue}{-1 \cdot \left(x2 \cdot \left(-12 \cdot x1 + -1 \cdot \frac{x1 + -18 \cdot x1}{x2}\right)\right)} + 3 \cdot \left(-2 \cdot x2 + x1 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right) - 1\right)\right)\right) \]
    7. Step-by-step derivation
      1. mul-1-neg42.9%

        \[\leadsto x1 + \left(\color{blue}{\left(-x2 \cdot \left(-12 \cdot x1 + -1 \cdot \frac{x1 + -18 \cdot x1}{x2}\right)\right)} + 3 \cdot \left(-2 \cdot x2 + x1 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right) - 1\right)\right)\right) \]
      2. distribute-rgt-neg-in42.9%

        \[\leadsto x1 + \left(\color{blue}{x2 \cdot \left(-\left(-12 \cdot x1 + -1 \cdot \frac{x1 + -18 \cdot x1}{x2}\right)\right)} + 3 \cdot \left(-2 \cdot x2 + x1 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right) - 1\right)\right)\right) \]
      3. mul-1-neg42.9%

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

        \[\leadsto x1 + \left(x2 \cdot \left(-\color{blue}{\left(-12 \cdot x1 - \frac{x1 + -18 \cdot x1}{x2}\right)}\right) + 3 \cdot \left(-2 \cdot x2 + x1 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right) - 1\right)\right)\right) \]
      5. *-commutative42.9%

        \[\leadsto x1 + \left(x2 \cdot \left(-\left(\color{blue}{x1 \cdot -12} - \frac{x1 + -18 \cdot x1}{x2}\right)\right) + 3 \cdot \left(-2 \cdot x2 + x1 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right) - 1\right)\right)\right) \]
      6. distribute-rgt1-in42.9%

        \[\leadsto x1 + \left(x2 \cdot \left(-\left(x1 \cdot -12 - \frac{\color{blue}{\left(-18 + 1\right) \cdot x1}}{x2}\right)\right) + 3 \cdot \left(-2 \cdot x2 + x1 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right) - 1\right)\right)\right) \]
      7. metadata-eval42.9%

        \[\leadsto x1 + \left(x2 \cdot \left(-\left(x1 \cdot -12 - \frac{\color{blue}{-17} \cdot x1}{x2}\right)\right) + 3 \cdot \left(-2 \cdot x2 + x1 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right) - 1\right)\right)\right) \]
    8. Simplified42.9%

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

    if -6.20000000000000036e71 < x1 < 8.2000000000000007e29

    1. Initial program 99.1%

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

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

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

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

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

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

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

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

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

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

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

    if 8.2000000000000007e29 < x1

    1. Initial program 42.9%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -9.5 \cdot 10^{+128}:\\ \;\;\;\;x1 + \left(x1 + \left(x1 \cdot -18 + 3 \cdot \left(x1 \cdot \left(x1 \cdot 3 + -1\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq -6.2 \cdot 10^{+71}:\\ \;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2 + x1 \cdot \left(-1 - x1 \cdot \left(x2 \cdot -2 - 3\right)\right)\right) + x2 \cdot \left(\frac{x1 \cdot -17}{x2} - x1 \cdot -12\right)\right)\\ \mathbf{elif}\;x1 \leq 8.2 \cdot 10^{+29}:\\ \;\;\;\;x2 \cdot \left(\left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right) - x1\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(\left(x1 - 6 \cdot \left(x1 \cdot \left(3 - 2 \cdot x2\right)\right)\right) + 3 \cdot \left(x2 \cdot -2 - x1 \cdot \left(x1 \cdot \left(x2 \cdot -2 - \left(x1 + 3\right)\right) - -1\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 77.4% accurate, 3.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 3 \cdot \left(x2 \cdot -2 + x1 \cdot \left(-1 - x1 \cdot \left(x2 \cdot -2 - 3\right)\right)\right)\\ \mathbf{if}\;x1 \leq -9.5 \cdot 10^{+128}:\\ \;\;\;\;x1 + \left(x1 + \left(x1 \cdot -18 + 3 \cdot \left(x1 \cdot \left(x1 \cdot 3 + -1\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq -5.4 \cdot 10^{+71}:\\ \;\;\;\;x1 + \left(t\_0 + x2 \cdot \left(\frac{x1 \cdot -17}{x2} - x1 \cdot -12\right)\right)\\ \mathbf{elif}\;x1 \leq 9.8 \cdot 10^{+29}:\\ \;\;\;\;x2 \cdot \left(\left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right) - x1\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(t\_0 + x1 \cdot -17\right)\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0
         (* 3.0 (+ (* x2 -2.0) (* x1 (- -1.0 (* x1 (- (* x2 -2.0) 3.0))))))))
   (if (<= x1 -9.5e+128)
     (+ x1 (+ x1 (+ (* x1 -18.0) (* 3.0 (* x1 (+ (* x1 3.0) -1.0))))))
     (if (<= x1 -5.4e+71)
       (+ x1 (+ t_0 (* x2 (- (/ (* x1 -17.0) x2) (* x1 -12.0)))))
       (if (<= x1 9.8e+29)
         (- (* x2 (- (+ (* x1 -12.0) (* 8.0 (* x1 x2))) 6.0)) x1)
         (+ x1 (+ t_0 (* x1 -17.0))))))))
double code(double x1, double x2) {
	double t_0 = 3.0 * ((x2 * -2.0) + (x1 * (-1.0 - (x1 * ((x2 * -2.0) - 3.0)))));
	double tmp;
	if (x1 <= -9.5e+128) {
		tmp = x1 + (x1 + ((x1 * -18.0) + (3.0 * (x1 * ((x1 * 3.0) + -1.0)))));
	} else if (x1 <= -5.4e+71) {
		tmp = x1 + (t_0 + (x2 * (((x1 * -17.0) / x2) - (x1 * -12.0))));
	} else if (x1 <= 9.8e+29) {
		tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
	} else {
		tmp = x1 + (t_0 + (x1 * -17.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 = 3.0d0 * ((x2 * (-2.0d0)) + (x1 * ((-1.0d0) - (x1 * ((x2 * (-2.0d0)) - 3.0d0)))))
    if (x1 <= (-9.5d+128)) then
        tmp = x1 + (x1 + ((x1 * (-18.0d0)) + (3.0d0 * (x1 * ((x1 * 3.0d0) + (-1.0d0))))))
    else if (x1 <= (-5.4d+71)) then
        tmp = x1 + (t_0 + (x2 * (((x1 * (-17.0d0)) / x2) - (x1 * (-12.0d0)))))
    else if (x1 <= 9.8d+29) then
        tmp = (x2 * (((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))) - 6.0d0)) - x1
    else
        tmp = x1 + (t_0 + (x1 * (-17.0d0)))
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double t_0 = 3.0 * ((x2 * -2.0) + (x1 * (-1.0 - (x1 * ((x2 * -2.0) - 3.0)))));
	double tmp;
	if (x1 <= -9.5e+128) {
		tmp = x1 + (x1 + ((x1 * -18.0) + (3.0 * (x1 * ((x1 * 3.0) + -1.0)))));
	} else if (x1 <= -5.4e+71) {
		tmp = x1 + (t_0 + (x2 * (((x1 * -17.0) / x2) - (x1 * -12.0))));
	} else if (x1 <= 9.8e+29) {
		tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
	} else {
		tmp = x1 + (t_0 + (x1 * -17.0));
	}
	return tmp;
}
def code(x1, x2):
	t_0 = 3.0 * ((x2 * -2.0) + (x1 * (-1.0 - (x1 * ((x2 * -2.0) - 3.0)))))
	tmp = 0
	if x1 <= -9.5e+128:
		tmp = x1 + (x1 + ((x1 * -18.0) + (3.0 * (x1 * ((x1 * 3.0) + -1.0)))))
	elif x1 <= -5.4e+71:
		tmp = x1 + (t_0 + (x2 * (((x1 * -17.0) / x2) - (x1 * -12.0))))
	elif x1 <= 9.8e+29:
		tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1
	else:
		tmp = x1 + (t_0 + (x1 * -17.0))
	return tmp
function code(x1, x2)
	t_0 = Float64(3.0 * Float64(Float64(x2 * -2.0) + Float64(x1 * Float64(-1.0 - Float64(x1 * Float64(Float64(x2 * -2.0) - 3.0))))))
	tmp = 0.0
	if (x1 <= -9.5e+128)
		tmp = Float64(x1 + Float64(x1 + Float64(Float64(x1 * -18.0) + Float64(3.0 * Float64(x1 * Float64(Float64(x1 * 3.0) + -1.0))))));
	elseif (x1 <= -5.4e+71)
		tmp = Float64(x1 + Float64(t_0 + Float64(x2 * Float64(Float64(Float64(x1 * -17.0) / x2) - Float64(x1 * -12.0)))));
	elseif (x1 <= 9.8e+29)
		tmp = Float64(Float64(x2 * Float64(Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))) - 6.0)) - x1);
	else
		tmp = Float64(x1 + Float64(t_0 + Float64(x1 * -17.0)));
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	t_0 = 3.0 * ((x2 * -2.0) + (x1 * (-1.0 - (x1 * ((x2 * -2.0) - 3.0)))));
	tmp = 0.0;
	if (x1 <= -9.5e+128)
		tmp = x1 + (x1 + ((x1 * -18.0) + (3.0 * (x1 * ((x1 * 3.0) + -1.0)))));
	elseif (x1 <= -5.4e+71)
		tmp = x1 + (t_0 + (x2 * (((x1 * -17.0) / x2) - (x1 * -12.0))));
	elseif (x1 <= 9.8e+29)
		tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
	else
		tmp = x1 + (t_0 + (x1 * -17.0));
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := Block[{t$95$0 = N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] + N[(x1 * N[(-1.0 - N[(x1 * N[(N[(x2 * -2.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -9.5e+128], N[(x1 + N[(x1 + N[(N[(x1 * -18.0), $MachinePrecision] + N[(3.0 * N[(x1 * N[(N[(x1 * 3.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -5.4e+71], N[(x1 + N[(t$95$0 + N[(x2 * N[(N[(N[(x1 * -17.0), $MachinePrecision] / x2), $MachinePrecision] - N[(x1 * -12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 9.8e+29], 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[(t$95$0 + N[(x1 * -17.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 3 \cdot \left(x2 \cdot -2 + x1 \cdot \left(-1 - x1 \cdot \left(x2 \cdot -2 - 3\right)\right)\right)\\
\mathbf{if}\;x1 \leq -9.5 \cdot 10^{+128}:\\
\;\;\;\;x1 + \left(x1 + \left(x1 \cdot -18 + 3 \cdot \left(x1 \cdot \left(x1 \cdot 3 + -1\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq -5.4 \cdot 10^{+71}:\\
\;\;\;\;x1 + \left(t\_0 + x2 \cdot \left(\frac{x1 \cdot -17}{x2} - x1 \cdot -12\right)\right)\\

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

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


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

    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. Add Preprocessing
    3. Taylor expanded in x1 around inf 0.0%

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

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

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

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

    if -9.50000000000000014e128 < x1 < -5.39999999999999993e71

    1. Initial program 59.9%

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

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

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

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

      \[\leadsto x1 + \left(\color{blue}{-1 \cdot \left(x2 \cdot \left(-12 \cdot x1 + -1 \cdot \frac{x1 + -18 \cdot x1}{x2}\right)\right)} + 3 \cdot \left(-2 \cdot x2 + x1 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right) - 1\right)\right)\right) \]
    7. Step-by-step derivation
      1. mul-1-neg42.9%

        \[\leadsto x1 + \left(\color{blue}{\left(-x2 \cdot \left(-12 \cdot x1 + -1 \cdot \frac{x1 + -18 \cdot x1}{x2}\right)\right)} + 3 \cdot \left(-2 \cdot x2 + x1 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right) - 1\right)\right)\right) \]
      2. distribute-rgt-neg-in42.9%

        \[\leadsto x1 + \left(\color{blue}{x2 \cdot \left(-\left(-12 \cdot x1 + -1 \cdot \frac{x1 + -18 \cdot x1}{x2}\right)\right)} + 3 \cdot \left(-2 \cdot x2 + x1 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right) - 1\right)\right)\right) \]
      3. mul-1-neg42.9%

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

        \[\leadsto x1 + \left(x2 \cdot \left(-\color{blue}{\left(-12 \cdot x1 - \frac{x1 + -18 \cdot x1}{x2}\right)}\right) + 3 \cdot \left(-2 \cdot x2 + x1 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right) - 1\right)\right)\right) \]
      5. *-commutative42.9%

        \[\leadsto x1 + \left(x2 \cdot \left(-\left(\color{blue}{x1 \cdot -12} - \frac{x1 + -18 \cdot x1}{x2}\right)\right) + 3 \cdot \left(-2 \cdot x2 + x1 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right) - 1\right)\right)\right) \]
      6. distribute-rgt1-in42.9%

        \[\leadsto x1 + \left(x2 \cdot \left(-\left(x1 \cdot -12 - \frac{\color{blue}{\left(-18 + 1\right) \cdot x1}}{x2}\right)\right) + 3 \cdot \left(-2 \cdot x2 + x1 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right) - 1\right)\right)\right) \]
      7. metadata-eval42.9%

        \[\leadsto x1 + \left(x2 \cdot \left(-\left(x1 \cdot -12 - \frac{\color{blue}{-17} \cdot x1}{x2}\right)\right) + 3 \cdot \left(-2 \cdot x2 + x1 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right) - 1\right)\right)\right) \]
    8. Simplified42.9%

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

    if -5.39999999999999993e71 < x1 < 9.8000000000000003e29

    1. Initial program 99.1%

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

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

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

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

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

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

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

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

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

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

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

    if 9.8000000000000003e29 < x1

    1. Initial program 42.9%

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

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

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

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

      \[\leadsto x1 + \left(\color{blue}{\left(x1 + -18 \cdot x1\right)} + 3 \cdot \left(-2 \cdot x2 + x1 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right) - 1\right)\right)\right) \]
    7. Step-by-step derivation
      1. distribute-rgt1-in66.7%

        \[\leadsto x1 + \left(\color{blue}{\left(-18 + 1\right) \cdot x1} + 3 \cdot \left(-2 \cdot x2 + x1 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right) - 1\right)\right)\right) \]
      2. metadata-eval66.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -9.5 \cdot 10^{+128}:\\ \;\;\;\;x1 + \left(x1 + \left(x1 \cdot -18 + 3 \cdot \left(x1 \cdot \left(x1 \cdot 3 + -1\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq -5.4 \cdot 10^{+71}:\\ \;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2 + x1 \cdot \left(-1 - x1 \cdot \left(x2 \cdot -2 - 3\right)\right)\right) + x2 \cdot \left(\frac{x1 \cdot -17}{x2} - x1 \cdot -12\right)\right)\\ \mathbf{elif}\;x1 \leq 9.8 \cdot 10^{+29}:\\ \;\;\;\;x2 \cdot \left(\left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right) - x1\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2 + x1 \cdot \left(-1 - x1 \cdot \left(x2 \cdot -2 - 3\right)\right)\right) + x1 \cdot -17\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 20: 76.3% accurate, 3.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -6.2 \cdot 10^{+71}:\\
\;\;\;\;x1 + \left(x1 + \left(x1 \cdot -18 + 3 \cdot \left(x1 \cdot \left(x1 \cdot 3 + -1\right)\right)\right)\right)\\

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

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


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

    1. Initial program 20.4%

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

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

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

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

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

    if -6.20000000000000036e71 < x1 < 1.14e30

    1. Initial program 99.1%

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

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

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

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

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

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

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

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

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

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

      \[\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.14e30 < x1

    1. Initial program 42.9%

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

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

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

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

      \[\leadsto x1 + \left(\color{blue}{\left(x1 + -18 \cdot x1\right)} + 3 \cdot \left(-2 \cdot x2 + x1 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right) - 1\right)\right)\right) \]
    7. Step-by-step derivation
      1. distribute-rgt1-in66.7%

        \[\leadsto x1 + \left(\color{blue}{\left(-18 + 1\right) \cdot x1} + 3 \cdot \left(-2 \cdot x2 + x1 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right) - 1\right)\right)\right) \]
      2. metadata-eval66.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -6.2 \cdot 10^{+71}:\\ \;\;\;\;x1 + \left(x1 + \left(x1 \cdot -18 + 3 \cdot \left(x1 \cdot \left(x1 \cdot 3 + -1\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 1.14 \cdot 10^{+30}:\\ \;\;\;\;x2 \cdot \left(\left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right) - x1\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2 + x1 \cdot \left(-1 - x1 \cdot \left(x2 \cdot -2 - 3\right)\right)\right) + x1 \cdot -17\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 21: 79.8% accurate, 4.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x1 \leq -6.2 \cdot 10^{+71} \lor \neg \left(x1 \leq 4.5 \cdot 10^{+153}\right):\\ \;\;\;\;x1 + \left(x1 + \left(x1 \cdot -18 + 3 \cdot \left(x1 \cdot \left(x1 \cdot 3 + -1\right)\right)\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 -6.2e+71) (not (<= x1 4.5e+153)))
   (+ x1 (+ x1 (+ (* x1 -18.0) (* 3.0 (* x1 (+ (* x1 3.0) -1.0))))))
   (- (* x2 (- (+ (* x1 -12.0) (* 8.0 (* x1 x2))) 6.0)) x1)))
double code(double x1, double x2) {
	double tmp;
	if ((x1 <= -6.2e+71) || !(x1 <= 4.5e+153)) {
		tmp = x1 + (x1 + ((x1 * -18.0) + (3.0 * (x1 * ((x1 * 3.0) + -1.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 <= (-6.2d+71)) .or. (.not. (x1 <= 4.5d+153))) then
        tmp = x1 + (x1 + ((x1 * (-18.0d0)) + (3.0d0 * (x1 * ((x1 * 3.0d0) + (-1.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 <= -6.2e+71) || !(x1 <= 4.5e+153)) {
		tmp = x1 + (x1 + ((x1 * -18.0) + (3.0 * (x1 * ((x1 * 3.0) + -1.0)))));
	} else {
		tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
	}
	return tmp;
}
def code(x1, x2):
	tmp = 0
	if (x1 <= -6.2e+71) or not (x1 <= 4.5e+153):
		tmp = x1 + (x1 + ((x1 * -18.0) + (3.0 * (x1 * ((x1 * 3.0) + -1.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 <= -6.2e+71) || !(x1 <= 4.5e+153))
		tmp = Float64(x1 + Float64(x1 + Float64(Float64(x1 * -18.0) + Float64(3.0 * Float64(x1 * Float64(Float64(x1 * 3.0) + -1.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 <= -6.2e+71) || ~((x1 <= 4.5e+153)))
		tmp = x1 + (x1 + ((x1 * -18.0) + (3.0 * (x1 * ((x1 * 3.0) + -1.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, -6.2e+71], N[Not[LessEqual[x1, 4.5e+153]], $MachinePrecision]], N[(x1 + N[(x1 + N[(N[(x1 * -18.0), $MachinePrecision] + N[(3.0 * N[(x1 * N[(N[(x1 * 3.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $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 -6.2 \cdot 10^{+71} \lor \neg \left(x1 \leq 4.5 \cdot 10^{+153}\right):\\
\;\;\;\;x1 + \left(x1 + \left(x1 \cdot -18 + 3 \cdot \left(x1 \cdot \left(x1 \cdot 3 + -1\right)\right)\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 < -6.20000000000000036e71 or 4.5000000000000001e153 < x1

    1. Initial program 12.5%

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

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

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

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

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

    if -6.20000000000000036e71 < x1 < 4.5000000000000001e153

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

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

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

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

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

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

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

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

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

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

      \[\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 -6.2 \cdot 10^{+71} \lor \neg \left(x1 \leq 4.5 \cdot 10^{+153}\right):\\ \;\;\;\;x1 + \left(x1 + \left(x1 \cdot -18 + 3 \cdot \left(x1 \cdot \left(x1 \cdot 3 + -1\right)\right)\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 22: 73.9% accurate, 4.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -6.2 \cdot 10^{+71} \lor \neg \left(x1 \leq 4.5 \cdot 10^{+153}\right):\\
\;\;\;\;x1 + \left(x1 + \left(x1 \cdot -18 + 3 \cdot \left(x1 \cdot \left(x1 \cdot 3 + -1\right)\right)\right)\right)\\

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


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

    1. Initial program 12.5%

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

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

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

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

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

    if -6.20000000000000036e71 < x1 < 4.5000000000000001e153

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

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

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

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

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

Alternative 23: 46.0% accurate, 6.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -7.4 \cdot 10^{-90} \lor \neg \left(x1 \leq 9.2 \cdot 10^{-124}\right):\\
\;\;\;\;x1 \cdot \left(-1 + x2 \cdot \left(x2 \cdot 8 - 12\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x1 < -7.40000000000000035e-90 or 9.20000000000000048e-124 < x1

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

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

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

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

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

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

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

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

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

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

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

    if -7.40000000000000035e-90 < x1 < 9.20000000000000048e-124

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

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

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

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

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

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

Alternative 24: 57.6% accurate, 6.3× speedup?

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

    if -5.5e71 < x1

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

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

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

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

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

Alternative 25: 47.2% accurate, 7.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x2 \leq 5.1 \cdot 10^{+104}:\\ \;\;\;\;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 (<= x2 5.1e+104)
   (- (* 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 (x2 <= 5.1e+104) {
		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 (x2 <= 5.1d+104) 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 (x2 <= 5.1e+104) {
		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 x2 <= 5.1e+104:
		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 (x2 <= 5.1e+104)
		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 (x2 <= 5.1e+104)
		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[x2, 5.1e+104], 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}\;x2 \leq 5.1 \cdot 10^{+104}:\\
\;\;\;\;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 x2 < 5.1000000000000002e104

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

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

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

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

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

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

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

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

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

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

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

    if 5.1000000000000002e104 < x2

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

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

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

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

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

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

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

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

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

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

      \[\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 63.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x2 \leq 5.1 \cdot 10^{+104}:\\ \;\;\;\;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: 30.4% accurate, 9.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -5.8 \cdot 10^{-148} \lor \neg \left(x2 \leq 5.5 \cdot 10^{-252}\right):\\
\;\;\;\;x2 \cdot -6\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x2 < -5.7999999999999997e-148 or 5.5e-252 < x2

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

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

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

        \[\leadsto \color{blue}{x2 \cdot -6} \]
    6. Simplified32.1%

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

    if -5.7999999999999997e-148 < x2 < 5.5e-252

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot x1} \]
    8. Step-by-step derivation
      1. mul-1-neg49.8%

        \[\leadsto \color{blue}{-x1} \]
    9. Simplified49.8%

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

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

Alternative 27: 14.2% 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 74.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. Simplified73.3%

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{-1 \cdot x1} \]
  8. Step-by-step derivation
    1. mul-1-neg14.8%

      \[\leadsto \color{blue}{-x1} \]
  9. Simplified14.8%

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

Reproduce

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