Rosa's FloatVsDoubleBenchmark

Percentage Accurate: 71.3% → 98.8%
Time: 1.4min
Alternatives: 30
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 30 alternatives:

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

Initial Program: 71.3% accurate, 1.0× speedup?

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

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

Alternative 1: 98.8% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2 - x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}\\ t_1 := x1 + \mathsf{fma}\left(9, x1 \cdot x1, x1 \cdot -2\right)\\ t_2 := x1 \cdot \left(x1 \cdot 3\right)\\ \mathbf{if}\;x1 \leq -1 \cdot 10^{+154}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x1 \leq -1.55 \cdot 10^{+70}:\\ \;\;\;\;x1 + \left(\left(x1 + {x1}^{4} \cdot 6\right) + 3 \cdot \frac{\left(t_2 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right)\\ \mathbf{elif}\;x1 \leq 5 \cdot 10^{+153}:\\ \;\;\;\;x1 + \mathsf{fma}\left(3, \frac{t_2 - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, x1 + \mathsf{fma}\left(\mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, x1 \cdot \mathsf{fma}\left(t_0, 4, -6\right), t_0 \cdot \left(\left(t_0 + -3\right) \cdot \left(x1 \cdot 2\right)\right)\right), \mathsf{fma}\left(t_2, t_0, {x1}^{3}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (/ (fma x1 (* x1 3.0) (- (* 2.0 x2) x1)) (fma x1 x1 1.0)))
        (t_1 (+ x1 (fma 9.0 (* x1 x1) (* x1 -2.0))))
        (t_2 (* x1 (* x1 3.0))))
   (if (<= x1 -1e+154)
     t_1
     (if (<= x1 -1.55e+70)
       (+
        x1
        (+
         (+ x1 (* (pow x1 4.0) 6.0))
         (* 3.0 (/ (- (- t_2 (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)))))
       (if (<= x1 5e+153)
         (+
          x1
          (fma
           3.0
           (/ (- t_2 (fma 2.0 x2 x1)) (fma x1 x1 1.0))
           (+
            x1
            (fma
             (fma x1 x1 1.0)
             (fma
              x1
              (* x1 (fma t_0 4.0 -6.0))
              (* t_0 (* (+ t_0 -3.0) (* x1 2.0))))
             (fma t_2 t_0 (pow x1 3.0))))))
         t_1)))))
double code(double x1, double x2) {
	double t_0 = fma(x1, (x1 * 3.0), ((2.0 * x2) - x1)) / fma(x1, x1, 1.0);
	double t_1 = x1 + fma(9.0, (x1 * x1), (x1 * -2.0));
	double t_2 = x1 * (x1 * 3.0);
	double tmp;
	if (x1 <= -1e+154) {
		tmp = t_1;
	} else if (x1 <= -1.55e+70) {
		tmp = x1 + ((x1 + (pow(x1, 4.0) * 6.0)) + (3.0 * (((t_2 - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))));
	} else if (x1 <= 5e+153) {
		tmp = x1 + fma(3.0, ((t_2 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), (x1 + fma(fma(x1, x1, 1.0), fma(x1, (x1 * fma(t_0, 4.0, -6.0)), (t_0 * ((t_0 + -3.0) * (x1 * 2.0)))), fma(t_2, t_0, pow(x1, 3.0)))));
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x1, x2)
	t_0 = Float64(fma(x1, Float64(x1 * 3.0), Float64(Float64(2.0 * x2) - x1)) / fma(x1, x1, 1.0))
	t_1 = Float64(x1 + fma(9.0, Float64(x1 * x1), Float64(x1 * -2.0)))
	t_2 = Float64(x1 * Float64(x1 * 3.0))
	tmp = 0.0
	if (x1 <= -1e+154)
		tmp = t_1;
	elseif (x1 <= -1.55e+70)
		tmp = Float64(x1 + Float64(Float64(x1 + Float64((x1 ^ 4.0) * 6.0)) + Float64(3.0 * Float64(Float64(Float64(t_2 - Float64(2.0 * x2)) - x1) / Float64(Float64(x1 * x1) + 1.0)))));
	elseif (x1 <= 5e+153)
		tmp = Float64(x1 + fma(3.0, Float64(Float64(t_2 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), Float64(x1 + fma(fma(x1, x1, 1.0), fma(x1, Float64(x1 * fma(t_0, 4.0, -6.0)), Float64(t_0 * Float64(Float64(t_0 + -3.0) * Float64(x1 * 2.0)))), fma(t_2, t_0, (x1 ^ 3.0))))));
	else
		tmp = t_1;
	end
	return tmp
end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision] + N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(9.0 * N[(x1 * x1), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1e+154], t$95$1, If[LessEqual[x1, -1.55e+70], N[(x1 + N[(N[(x1 + N[(N[Power[x1, 4.0], $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$2 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5e+153], N[(x1 + N[(3.0 * N[(N[(t$95$2 - N[(2.0 * x2 + x1), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * x1 + 1.0), $MachinePrecision] * N[(x1 * N[(x1 * N[(t$95$0 * 4.0 + -6.0), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(N[(t$95$0 + -3.0), $MachinePrecision] * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 * t$95$0 + N[Power[x1, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2 - x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}\\
t_1 := x1 + \mathsf{fma}\left(9, x1 \cdot x1, x1 \cdot -2\right)\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
\mathbf{if}\;x1 \leq -1 \cdot 10^{+154}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x1 \leq -1.55 \cdot 10^{+70}:\\
\;\;\;\;x1 + \left(\left(x1 + {x1}^{4} \cdot 6\right) + 3 \cdot \frac{\left(t_2 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right)\\

\mathbf{elif}\;x1 \leq 5 \cdot 10^{+153}:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, \frac{t_2 - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, x1 + \mathsf{fma}\left(\mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, x1 \cdot \mathsf{fma}\left(t_0, 4, -6\right), t_0 \cdot \left(\left(t_0 + -3\right) \cdot \left(x1 \cdot 2\right)\right)\right), \mathsf{fma}\left(t_2, t_0, {x1}^{3}\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t_1\\


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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x1 + \color{blue}{\left(9 \cdot {x1}^{2} + -2 \cdot x1\right)} \]
    7. Step-by-step derivation
      1. fma-def100.0%

        \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(9, {x1}^{2}, -2 \cdot x1\right)} \]
      2. unpow2100.0%

        \[\leadsto x1 + \mathsf{fma}\left(9, \color{blue}{x1 \cdot x1}, -2 \cdot x1\right) \]
      3. *-commutative100.0%

        \[\leadsto x1 + \mathsf{fma}\left(9, x1 \cdot x1, \color{blue}{x1 \cdot -2}\right) \]
    8. Simplified100.0%

      \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(9, x1 \cdot x1, x1 \cdot -2\right)} \]

    if -1.00000000000000004e154 < x1 < -1.55000000000000015e70

    1. Initial program 37.3%

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

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

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

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

    if -1.55000000000000015e70 < x1 < 5.00000000000000018e153

    1. Initial program 97.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -1 \cdot 10^{+154}:\\ \;\;\;\;x1 + \mathsf{fma}\left(9, x1 \cdot x1, x1 \cdot -2\right)\\ \mathbf{elif}\;x1 \leq -1.55 \cdot 10^{+70}:\\ \;\;\;\;x1 + \left(\left(x1 + {x1}^{4} \cdot 6\right) + 3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right)\\ \mathbf{elif}\;x1 \leq 5 \cdot 10^{+153}:\\ \;\;\;\;x1 + \mathsf{fma}\left(3, \frac{x1 \cdot \left(x1 \cdot 3\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 - x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, 4, -6\right), \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2 - x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)} \cdot \left(\left(\frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2 - x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)} + -3\right) \cdot \left(x1 \cdot 2\right)\right)\right), \mathsf{fma}\left(x1 \cdot \left(x1 \cdot 3\right), \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2 - x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, {x1}^{3}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \mathsf{fma}\left(9, x1 \cdot x1, x1 \cdot -2\right)\\ \end{array} \]

Alternative 2: 99.3% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 + \mathsf{fma}\left(9, x1 \cdot x1, x1 \cdot -2\right)\\ t_1 := \frac{\mathsf{fma}\left(x1 \cdot 3, x1, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\\ t_2 := x1 \cdot \left(x1 \cdot 3\right)\\ t_3 := \frac{\mathsf{fma}\left(x1, x1 \cdot 3, \left(x2 + x2\right) - x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}\\ \mathbf{if}\;x1 \leq -1 \cdot 10^{+154}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x1 \leq -1 \cdot 10^{+38}:\\ \;\;\;\;x1 + \mathsf{fma}\left(3, \frac{t_2 - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, x1 \cdot \left(x1 \cdot 9\right) + \mathsf{fma}\left(x1, x1, 1\right) \cdot \left(x1 + x1 \cdot \left(2 \cdot \left(t_3 \cdot \left(-3 + t_3\right)\right) + x1 \cdot \mathsf{fma}\left(t_3, 4, -6\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 5 \cdot 10^{+153}:\\ \;\;\;\;x1 + \left(\left(\mathsf{fma}\left(\mathsf{fma}\left(t_1 \cdot \left(x1 \cdot 2\right), -3 + t_1, \left(x1 \cdot x1\right) \cdot \mathsf{fma}\left(4, t_1, -6\right)\right), \mathsf{fma}\left(x1, x1, 1\right), t_2 \cdot t_1\right) + x1 \cdot \left(x1 \cdot x1\right)\right) + \left(x1 + 3 \cdot \frac{\left(t_2 + -2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (+ x1 (fma 9.0 (* x1 x1) (* x1 -2.0))))
        (t_1 (/ (- (fma (* x1 3.0) x1 (* 2.0 x2)) x1) (fma x1 x1 1.0)))
        (t_2 (* x1 (* x1 3.0)))
        (t_3 (/ (fma x1 (* x1 3.0) (- (+ x2 x2) x1)) (fma x1 x1 1.0))))
   (if (<= x1 -1e+154)
     t_0
     (if (<= x1 -1e+38)
       (+
        x1
        (fma
         3.0
         (/ (- t_2 (fma 2.0 x2 x1)) (fma x1 x1 1.0))
         (+
          (* x1 (* x1 9.0))
          (*
           (fma x1 x1 1.0)
           (+
            x1
            (*
             x1
             (+ (* 2.0 (* t_3 (+ -3.0 t_3))) (* x1 (fma t_3 4.0 -6.0)))))))))
       (if (<= x1 5e+153)
         (+
          x1
          (+
           (+
            (fma
             (fma
              (* t_1 (* x1 2.0))
              (+ -3.0 t_1)
              (* (* x1 x1) (fma 4.0 t_1 -6.0)))
             (fma x1 x1 1.0)
             (* t_2 t_1))
            (* x1 (* x1 x1)))
           (+ x1 (* 3.0 (/ (- (+ t_2 (* -2.0 x2)) x1) (fma x1 x1 1.0))))))
         t_0)))))
double code(double x1, double x2) {
	double t_0 = x1 + fma(9.0, (x1 * x1), (x1 * -2.0));
	double t_1 = (fma((x1 * 3.0), x1, (2.0 * x2)) - x1) / fma(x1, x1, 1.0);
	double t_2 = x1 * (x1 * 3.0);
	double t_3 = fma(x1, (x1 * 3.0), ((x2 + x2) - x1)) / fma(x1, x1, 1.0);
	double tmp;
	if (x1 <= -1e+154) {
		tmp = t_0;
	} else if (x1 <= -1e+38) {
		tmp = x1 + fma(3.0, ((t_2 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), ((x1 * (x1 * 9.0)) + (fma(x1, x1, 1.0) * (x1 + (x1 * ((2.0 * (t_3 * (-3.0 + t_3))) + (x1 * fma(t_3, 4.0, -6.0))))))));
	} else if (x1 <= 5e+153) {
		tmp = x1 + ((fma(fma((t_1 * (x1 * 2.0)), (-3.0 + t_1), ((x1 * x1) * fma(4.0, t_1, -6.0))), fma(x1, x1, 1.0), (t_2 * t_1)) + (x1 * (x1 * x1))) + (x1 + (3.0 * (((t_2 + (-2.0 * x2)) - x1) / fma(x1, x1, 1.0)))));
	} else {
		tmp = t_0;
	}
	return tmp;
}
function code(x1, x2)
	t_0 = Float64(x1 + fma(9.0, Float64(x1 * x1), Float64(x1 * -2.0)))
	t_1 = Float64(Float64(fma(Float64(x1 * 3.0), x1, Float64(2.0 * x2)) - x1) / fma(x1, x1, 1.0))
	t_2 = Float64(x1 * Float64(x1 * 3.0))
	t_3 = Float64(fma(x1, Float64(x1 * 3.0), Float64(Float64(x2 + x2) - x1)) / fma(x1, x1, 1.0))
	tmp = 0.0
	if (x1 <= -1e+154)
		tmp = t_0;
	elseif (x1 <= -1e+38)
		tmp = Float64(x1 + fma(3.0, Float64(Float64(t_2 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), Float64(Float64(x1 * Float64(x1 * 9.0)) + Float64(fma(x1, x1, 1.0) * Float64(x1 + Float64(x1 * Float64(Float64(2.0 * Float64(t_3 * Float64(-3.0 + t_3))) + Float64(x1 * fma(t_3, 4.0, -6.0)))))))));
	elseif (x1 <= 5e+153)
		tmp = Float64(x1 + Float64(Float64(fma(fma(Float64(t_1 * Float64(x1 * 2.0)), Float64(-3.0 + t_1), Float64(Float64(x1 * x1) * fma(4.0, t_1, -6.0))), fma(x1, x1, 1.0), Float64(t_2 * t_1)) + Float64(x1 * Float64(x1 * x1))) + Float64(x1 + Float64(3.0 * Float64(Float64(Float64(t_2 + Float64(-2.0 * x2)) - x1) / fma(x1, x1, 1.0))))));
	else
		tmp = t_0;
	end
	return tmp
end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(9.0 * N[(x1 * x1), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(N[(x1 * 3.0), $MachinePrecision] * x1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision] + N[(N[(x2 + x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1e+154], t$95$0, If[LessEqual[x1, -1e+38], N[(x1 + N[(3.0 * N[(N[(t$95$2 - N[(2.0 * x2 + x1), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1 + 1.0), $MachinePrecision] * N[(x1 + N[(x1 * N[(N[(2.0 * N[(t$95$3 * N[(-3.0 + t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(t$95$3 * 4.0 + -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5e+153], N[(x1 + N[(N[(N[(N[(N[(t$95$1 * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision] * N[(-3.0 + t$95$1), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(4.0 * t$95$1 + -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x1 * x1 + 1.0), $MachinePrecision] + N[(t$95$2 * t$95$1), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(3.0 * N[(N[(N[(t$95$2 + N[(-2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x1 + \mathsf{fma}\left(9, x1 \cdot x1, x1 \cdot -2\right)\\
t_1 := \frac{\mathsf{fma}\left(x1 \cdot 3, x1, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := \frac{\mathsf{fma}\left(x1, x1 \cdot 3, \left(x2 + x2\right) - x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}\\
\mathbf{if}\;x1 \leq -1 \cdot 10^{+154}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;x1 \leq -1 \cdot 10^{+38}:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, \frac{t_2 - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, x1 \cdot \left(x1 \cdot 9\right) + \mathsf{fma}\left(x1, x1, 1\right) \cdot \left(x1 + x1 \cdot \left(2 \cdot \left(t_3 \cdot \left(-3 + t_3\right)\right) + x1 \cdot \mathsf{fma}\left(t_3, 4, -6\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 5 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(\left(\mathsf{fma}\left(\mathsf{fma}\left(t_1 \cdot \left(x1 \cdot 2\right), -3 + t_1, \left(x1 \cdot x1\right) \cdot \mathsf{fma}\left(4, t_1, -6\right)\right), \mathsf{fma}\left(x1, x1, 1\right), t_2 \cdot t_1\right) + x1 \cdot \left(x1 \cdot x1\right)\right) + \left(x1 + 3 \cdot \frac{\left(t_2 + -2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t_0\\


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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x1 + \color{blue}{\left(9 \cdot {x1}^{2} + -2 \cdot x1\right)} \]
    7. Step-by-step derivation
      1. fma-def100.0%

        \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(9, {x1}^{2}, -2 \cdot x1\right)} \]
      2. unpow2100.0%

        \[\leadsto x1 + \mathsf{fma}\left(9, \color{blue}{x1 \cdot x1}, -2 \cdot x1\right) \]
      3. *-commutative100.0%

        \[\leadsto x1 + \mathsf{fma}\left(9, x1 \cdot x1, \color{blue}{x1 \cdot -2}\right) \]
    8. Simplified100.0%

      \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(9, x1 \cdot x1, x1 \cdot -2\right)} \]

    if -1.00000000000000004e154 < x1 < -9.99999999999999977e37

    1. Initial program 56.1%

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

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

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

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

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

    if -9.99999999999999977e37 < x1 < 5.00000000000000018e153

    1. Initial program 97.7%

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

      \[\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{\left(x1 \cdot \left(x1 \cdot 3\right) + -2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\right)\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification98.5%

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

Alternative 3: 99.3% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 + \mathsf{fma}\left(9, x1 \cdot x1, x1 \cdot -2\right)\\ t_1 := x1 \cdot x1 + 1\\ t_2 := x1 \cdot \left(x1 \cdot 3\right)\\ t_3 := \frac{\left(t_2 + 2 \cdot x2\right) - x1}{t_1}\\ t_4 := \frac{\mathsf{fma}\left(x1, x1 \cdot 3, \left(x2 + x2\right) - x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}\\ \mathbf{if}\;x1 \leq -1 \cdot 10^{+154}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x1 \leq -1 \cdot 10^{+38}:\\ \;\;\;\;x1 + \mathsf{fma}\left(3, \frac{t_2 - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, x1 \cdot \left(x1 \cdot 9\right) + \mathsf{fma}\left(x1, x1, 1\right) \cdot \left(x1 + x1 \cdot \left(2 \cdot \left(t_4 \cdot \left(-3 + t_4\right)\right) + x1 \cdot \mathsf{fma}\left(t_4, 4, -6\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 5 \cdot 10^{+153}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(t_2 - 2 \cdot x2\right) - x1}{t_1} + \left(x1 + \left(\left(t_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_3\right) \cdot \left(t_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t_3 - 6\right)\right) + t_2 \cdot t_3\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 (fma 9.0 (* x1 x1) (* x1 -2.0))))
        (t_1 (+ (* x1 x1) 1.0))
        (t_2 (* x1 (* x1 3.0)))
        (t_3 (/ (- (+ t_2 (* 2.0 x2)) x1) t_1))
        (t_4 (/ (fma x1 (* x1 3.0) (- (+ x2 x2) x1)) (fma x1 x1 1.0))))
   (if (<= x1 -1e+154)
     t_0
     (if (<= x1 -1e+38)
       (+
        x1
        (fma
         3.0
         (/ (- t_2 (fma 2.0 x2 x1)) (fma x1 x1 1.0))
         (+
          (* x1 (* x1 9.0))
          (*
           (fma x1 x1 1.0)
           (+
            x1
            (*
             x1
             (+ (* 2.0 (* t_4 (+ -3.0 t_4))) (* x1 (fma t_4 4.0 -6.0)))))))))
       (if (<= x1 5e+153)
         (+
          x1
          (+
           (* 3.0 (/ (- (- t_2 (* 2.0 x2)) x1) t_1))
           (+
            x1
            (+
             (+
              (*
               t_1
               (+
                (* (* (* x1 2.0) t_3) (- t_3 3.0))
                (* (* x1 x1) (- (* 4.0 t_3) 6.0))))
              (* t_2 t_3))
             (* x1 (* x1 x1))))))
         t_0)))))
double code(double x1, double x2) {
	double t_0 = x1 + fma(9.0, (x1 * x1), (x1 * -2.0));
	double t_1 = (x1 * x1) + 1.0;
	double t_2 = x1 * (x1 * 3.0);
	double t_3 = ((t_2 + (2.0 * x2)) - x1) / t_1;
	double t_4 = fma(x1, (x1 * 3.0), ((x2 + x2) - x1)) / fma(x1, x1, 1.0);
	double tmp;
	if (x1 <= -1e+154) {
		tmp = t_0;
	} else if (x1 <= -1e+38) {
		tmp = x1 + fma(3.0, ((t_2 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), ((x1 * (x1 * 9.0)) + (fma(x1, x1, 1.0) * (x1 + (x1 * ((2.0 * (t_4 * (-3.0 + t_4))) + (x1 * fma(t_4, 4.0, -6.0))))))));
	} else if (x1 <= 5e+153) {
		tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_1)) + (x1 + (((t_1 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((4.0 * t_3) - 6.0)))) + (t_2 * t_3)) + (x1 * (x1 * x1)))));
	} else {
		tmp = t_0;
	}
	return tmp;
}
function code(x1, x2)
	t_0 = Float64(x1 + fma(9.0, Float64(x1 * x1), Float64(x1 * -2.0)))
	t_1 = Float64(Float64(x1 * x1) + 1.0)
	t_2 = Float64(x1 * Float64(x1 * 3.0))
	t_3 = Float64(Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) / t_1)
	t_4 = Float64(fma(x1, Float64(x1 * 3.0), Float64(Float64(x2 + x2) - x1)) / fma(x1, x1, 1.0))
	tmp = 0.0
	if (x1 <= -1e+154)
		tmp = t_0;
	elseif (x1 <= -1e+38)
		tmp = Float64(x1 + fma(3.0, Float64(Float64(t_2 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), Float64(Float64(x1 * Float64(x1 * 9.0)) + Float64(fma(x1, x1, 1.0) * Float64(x1 + Float64(x1 * Float64(Float64(2.0 * Float64(t_4 * Float64(-3.0 + t_4))) + Float64(x1 * fma(t_4, 4.0, -6.0)))))))));
	elseif (x1 <= 5e+153)
		tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_2 - Float64(2.0 * x2)) - x1) / t_1)) + Float64(x1 + Float64(Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_3) - 6.0)))) + Float64(t_2 * t_3)) + Float64(x1 * Float64(x1 * x1))))));
	else
		tmp = t_0;
	end
	return tmp
end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(9.0 * N[(x1 * x1), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision] + N[(N[(x2 + x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1e+154], t$95$0, If[LessEqual[x1, -1e+38], N[(x1 + N[(3.0 * N[(N[(t$95$2 - N[(2.0 * x2 + x1), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1 + 1.0), $MachinePrecision] * N[(x1 + N[(x1 * N[(N[(2.0 * N[(t$95$4 * N[(-3.0 + t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(t$95$4 * 4.0 + -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5e+153], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$2 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$3), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 * t$95$3), $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 + \mathsf{fma}\left(9, x1 \cdot x1, x1 \cdot -2\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := \frac{\left(t_2 + 2 \cdot x2\right) - x1}{t_1}\\
t_4 := \frac{\mathsf{fma}\left(x1, x1 \cdot 3, \left(x2 + x2\right) - x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}\\
\mathbf{if}\;x1 \leq -1 \cdot 10^{+154}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;x1 \leq -1 \cdot 10^{+38}:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, \frac{t_2 - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, x1 \cdot \left(x1 \cdot 9\right) + \mathsf{fma}\left(x1, x1, 1\right) \cdot \left(x1 + x1 \cdot \left(2 \cdot \left(t_4 \cdot \left(-3 + t_4\right)\right) + x1 \cdot \mathsf{fma}\left(t_4, 4, -6\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 5 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_2 - 2 \cdot x2\right) - x1}{t_1} + \left(x1 + \left(\left(t_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_3\right) \cdot \left(t_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t_3 - 6\right)\right) + t_2 \cdot t_3\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 < -1.00000000000000004e154 or 5.00000000000000018e153 < x1

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x1 + \color{blue}{\left(9 \cdot {x1}^{2} + -2 \cdot x1\right)} \]
    7. Step-by-step derivation
      1. fma-def100.0%

        \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(9, {x1}^{2}, -2 \cdot x1\right)} \]
      2. unpow2100.0%

        \[\leadsto x1 + \mathsf{fma}\left(9, \color{blue}{x1 \cdot x1}, -2 \cdot x1\right) \]
      3. *-commutative100.0%

        \[\leadsto x1 + \mathsf{fma}\left(9, x1 \cdot x1, \color{blue}{x1 \cdot -2}\right) \]
    8. Simplified100.0%

      \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(9, x1 \cdot x1, x1 \cdot -2\right)} \]

    if -1.00000000000000004e154 < x1 < -9.99999999999999977e37

    1. Initial program 56.1%

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

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

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

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

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

    if -9.99999999999999977e37 < x1 < 5.00000000000000018e153

    1. Initial program 97.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) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification98.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -1 \cdot 10^{+154}:\\ \;\;\;\;x1 + \mathsf{fma}\left(9, x1 \cdot x1, x1 \cdot -2\right)\\ \mathbf{elif}\;x1 \leq -1 \cdot 10^{+38}:\\ \;\;\;\;x1 + \mathsf{fma}\left(3, \frac{x1 \cdot \left(x1 \cdot 3\right) - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, x1 \cdot \left(x1 \cdot 9\right) + \mathsf{fma}\left(x1, x1, 1\right) \cdot \left(x1 + x1 \cdot \left(2 \cdot \left(\frac{\mathsf{fma}\left(x1, x1 \cdot 3, \left(x2 + x2\right) - x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)} \cdot \left(-3 + \frac{\mathsf{fma}\left(x1, x1 \cdot 3, \left(x2 + x2\right) - x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}\right)\right) + x1 \cdot \mathsf{fma}\left(\frac{\mathsf{fma}\left(x1, x1 \cdot 3, \left(x2 + x2\right) - x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, 4, -6\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 5 \cdot 10^{+153}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + \left(\left(\left(x1 \cdot x1 + 1\right) \cdot \left(\left(\left(x1 \cdot 2\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) + \left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \mathsf{fma}\left(9, x1 \cdot x1, x1 \cdot -2\right)\\ \end{array} \]

Alternative 4: 95.9% accurate, 0.5× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;x1 + \mathsf{fma}\left(9, x1 \cdot x1, x1 \cdot -2\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 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) < +inf.0

    1. Initial program 99.5%

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

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

    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. Taylor expanded in x1 around 0 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x1 + \color{blue}{\left(9 \cdot {x1}^{2} + -2 \cdot x1\right)} \]
    7. Step-by-step derivation
      1. fma-def85.8%

        \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(9, {x1}^{2}, -2 \cdot x1\right)} \]
      2. unpow285.8%

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

        \[\leadsto x1 + \mathsf{fma}\left(9, x1 \cdot x1, \color{blue}{x1 \cdot -2}\right) \]
    8. Simplified85.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + \left(\left(\left(x1 \cdot x1 + 1\right) \cdot \left(\left(\left(x1 \cdot 2\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) + \left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right)\right) \leq \infty:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + \left(\left(\left(x1 \cdot x1 + 1\right) \cdot \left(\left(\left(x1 \cdot 2\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) + \left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \mathsf{fma}\left(9, x1 \cdot x1, x1 \cdot -2\right)\\ \end{array} \]

Alternative 5: 98.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 \cdot x1 + 1\\ t_1 := x1 \cdot \left(x1 \cdot 3\right)\\ t_2 := \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_0}\\ t_3 := x1 + \mathsf{fma}\left(9, x1 \cdot x1, x1 \cdot -2\right)\\ t_4 := 3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_0}\\ \mathbf{if}\;x1 \leq -1 \cdot 10^{+154}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x1 \leq -1.75 \cdot 10^{+70}:\\ \;\;\;\;x1 + \left(\left(x1 + {x1}^{4} \cdot 6\right) + t_4\right)\\ \mathbf{elif}\;x1 \leq 5 \cdot 10^{+153}:\\ \;\;\;\;x1 + \left(t_4 + \left(x1 + \left(\left(t_0 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t_2 - 6\right)\right) + t_1 \cdot t_2\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (+ (* x1 x1) 1.0))
        (t_1 (* x1 (* x1 3.0)))
        (t_2 (/ (- (+ t_1 (* 2.0 x2)) x1) t_0))
        (t_3 (+ x1 (fma 9.0 (* x1 x1) (* x1 -2.0))))
        (t_4 (* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_0))))
   (if (<= x1 -1e+154)
     t_3
     (if (<= x1 -1.75e+70)
       (+ x1 (+ (+ x1 (* (pow x1 4.0) 6.0)) t_4))
       (if (<= x1 5e+153)
         (+
          x1
          (+
           t_4
           (+
            x1
            (+
             (+
              (*
               t_0
               (+
                (* (* (* x1 2.0) t_2) (- t_2 3.0))
                (* (* x1 x1) (- (* 4.0 t_2) 6.0))))
              (* t_1 t_2))
             (* x1 (* x1 x1))))))
         t_3)))))
double code(double x1, double x2) {
	double t_0 = (x1 * x1) + 1.0;
	double t_1 = x1 * (x1 * 3.0);
	double t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0;
	double t_3 = x1 + fma(9.0, (x1 * x1), (x1 * -2.0));
	double t_4 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0);
	double tmp;
	if (x1 <= -1e+154) {
		tmp = t_3;
	} else if (x1 <= -1.75e+70) {
		tmp = x1 + ((x1 + (pow(x1, 4.0) * 6.0)) + t_4);
	} else if (x1 <= 5e+153) {
		tmp = x1 + (t_4 + (x1 + (((t_0 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0)))) + (t_1 * t_2)) + (x1 * (x1 * x1)))));
	} else {
		tmp = t_3;
	}
	return tmp;
}
function code(x1, x2)
	t_0 = Float64(Float64(x1 * x1) + 1.0)
	t_1 = Float64(x1 * Float64(x1 * 3.0))
	t_2 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_0)
	t_3 = Float64(x1 + fma(9.0, Float64(x1 * x1), Float64(x1 * -2.0)))
	t_4 = Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_0))
	tmp = 0.0
	if (x1 <= -1e+154)
		tmp = t_3;
	elseif (x1 <= -1.75e+70)
		tmp = Float64(x1 + Float64(Float64(x1 + Float64((x1 ^ 4.0) * 6.0)) + t_4));
	elseif (x1 <= 5e+153)
		tmp = Float64(x1 + Float64(t_4 + Float64(x1 + Float64(Float64(Float64(t_0 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0)))) + Float64(t_1 * t_2)) + Float64(x1 * Float64(x1 * x1))))));
	else
		tmp = t_3;
	end
	return tmp
end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$3 = N[(x1 + N[(9.0 * N[(x1 * x1), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1e+154], t$95$3, If[LessEqual[x1, -1.75e+70], N[(x1 + N[(N[(x1 + N[(N[Power[x1, 4.0], $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision] + t$95$4), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5e+153], N[(x1 + N[(t$95$4 + N[(x1 + N[(N[(N[(t$95$0 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_0}\\
t_3 := x1 + \mathsf{fma}\left(9, x1 \cdot x1, x1 \cdot -2\right)\\
t_4 := 3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_0}\\
\mathbf{if}\;x1 \leq -1 \cdot 10^{+154}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;x1 \leq -1.75 \cdot 10^{+70}:\\
\;\;\;\;x1 + \left(\left(x1 + {x1}^{4} \cdot 6\right) + t_4\right)\\

\mathbf{elif}\;x1 \leq 5 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(t_4 + \left(x1 + \left(\left(t_0 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t_2 - 6\right)\right) + t_1 \cdot t_2\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t_3\\


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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x1 + \color{blue}{\left(9 \cdot {x1}^{2} + -2 \cdot x1\right)} \]
    7. Step-by-step derivation
      1. fma-def100.0%

        \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(9, {x1}^{2}, -2 \cdot x1\right)} \]
      2. unpow2100.0%

        \[\leadsto x1 + \mathsf{fma}\left(9, \color{blue}{x1 \cdot x1}, -2 \cdot x1\right) \]
      3. *-commutative100.0%

        \[\leadsto x1 + \mathsf{fma}\left(9, x1 \cdot x1, \color{blue}{x1 \cdot -2}\right) \]
    8. Simplified100.0%

      \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(9, x1 \cdot x1, x1 \cdot -2\right)} \]

    if -1.00000000000000004e154 < x1 < -1.75000000000000001e70

    1. Initial program 37.3%

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

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

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

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

    if -1.75000000000000001e70 < x1 < 5.00000000000000018e153

    1. Initial program 97.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) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification98.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -1 \cdot 10^{+154}:\\ \;\;\;\;x1 + \mathsf{fma}\left(9, x1 \cdot x1, x1 \cdot -2\right)\\ \mathbf{elif}\;x1 \leq -1.75 \cdot 10^{+70}:\\ \;\;\;\;x1 + \left(\left(x1 + {x1}^{4} \cdot 6\right) + 3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right)\\ \mathbf{elif}\;x1 \leq 5 \cdot 10^{+153}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + \left(\left(\left(x1 \cdot x1 + 1\right) \cdot \left(\left(\left(x1 \cdot 2\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) + \left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \mathsf{fma}\left(9, x1 \cdot x1, x1 \cdot -2\right)\\ \end{array} \]

Alternative 6: 95.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 + \mathsf{fma}\left(9, x1 \cdot x1, x1 \cdot -2\right)\\ t_1 := x1 \cdot \left(x1 \cdot x1\right)\\ t_2 := x1 \cdot x1 + 1\\ t_3 := x1 \cdot \left(x1 \cdot 3\right)\\ t_4 := \frac{\left(t_3 + 2 \cdot x2\right) - x1}{t_2}\\ t_5 := \left(x1 \cdot 2\right) \cdot t_4\\ t_6 := \left(x1 \cdot x1\right) \cdot \left(4 \cdot t_4 - 6\right)\\ t_7 := x1 + \left(\left(x1 + \left(\left(t_2 \cdot \left(t_5 \cdot \left(t_4 - 3\right) + t_6\right) + t_3 \cdot t_4\right) + t_1\right)\right) + 3 \cdot \left(3 + \frac{-1}{x1}\right)\right)\\ \mathbf{if}\;x1 \leq -5.8 \cdot 10^{+102}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x1 \leq -0.014:\\ \;\;\;\;t_7\\ \mathbf{elif}\;x1 \leq 0.014:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(t_3 - 2 \cdot x2\right) - x1}{t_2} + \left(x1 + \left(t_1 + \left(t_2 \cdot \left(t_6 + t_5 \cdot \left(\left(x2 + x2\right) - 3\right)\right) + t_3 \cdot \left(x2 + x2\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 5 \cdot 10^{+153}:\\ \;\;\;\;t_7\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (+ x1 (fma 9.0 (* x1 x1) (* x1 -2.0))))
        (t_1 (* x1 (* x1 x1)))
        (t_2 (+ (* x1 x1) 1.0))
        (t_3 (* x1 (* x1 3.0)))
        (t_4 (/ (- (+ t_3 (* 2.0 x2)) x1) t_2))
        (t_5 (* (* x1 2.0) t_4))
        (t_6 (* (* x1 x1) (- (* 4.0 t_4) 6.0)))
        (t_7
         (+
          x1
          (+
           (+ x1 (+ (+ (* t_2 (+ (* t_5 (- t_4 3.0)) t_6)) (* t_3 t_4)) t_1))
           (* 3.0 (+ 3.0 (/ -1.0 x1)))))))
   (if (<= x1 -5.8e+102)
     t_0
     (if (<= x1 -0.014)
       t_7
       (if (<= x1 0.014)
         (+
          x1
          (+
           (* 3.0 (/ (- (- t_3 (* 2.0 x2)) x1) t_2))
           (+
            x1
            (+
             t_1
             (+
              (* t_2 (+ t_6 (* t_5 (- (+ x2 x2) 3.0))))
              (* t_3 (+ x2 x2)))))))
         (if (<= x1 5e+153) t_7 t_0))))))
double code(double x1, double x2) {
	double t_0 = x1 + fma(9.0, (x1 * x1), (x1 * -2.0));
	double t_1 = x1 * (x1 * x1);
	double t_2 = (x1 * x1) + 1.0;
	double t_3 = x1 * (x1 * 3.0);
	double t_4 = ((t_3 + (2.0 * x2)) - x1) / t_2;
	double t_5 = (x1 * 2.0) * t_4;
	double t_6 = (x1 * x1) * ((4.0 * t_4) - 6.0);
	double t_7 = x1 + ((x1 + (((t_2 * ((t_5 * (t_4 - 3.0)) + t_6)) + (t_3 * t_4)) + t_1)) + (3.0 * (3.0 + (-1.0 / x1))));
	double tmp;
	if (x1 <= -5.8e+102) {
		tmp = t_0;
	} else if (x1 <= -0.014) {
		tmp = t_7;
	} else if (x1 <= 0.014) {
		tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_2)) + (x1 + (t_1 + ((t_2 * (t_6 + (t_5 * ((x2 + x2) - 3.0)))) + (t_3 * (x2 + x2))))));
	} else if (x1 <= 5e+153) {
		tmp = t_7;
	} else {
		tmp = t_0;
	}
	return tmp;
}
function code(x1, x2)
	t_0 = Float64(x1 + fma(9.0, Float64(x1 * x1), Float64(x1 * -2.0)))
	t_1 = Float64(x1 * Float64(x1 * x1))
	t_2 = Float64(Float64(x1 * x1) + 1.0)
	t_3 = Float64(x1 * Float64(x1 * 3.0))
	t_4 = Float64(Float64(Float64(t_3 + Float64(2.0 * x2)) - x1) / t_2)
	t_5 = Float64(Float64(x1 * 2.0) * t_4)
	t_6 = Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_4) - 6.0))
	t_7 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_2 * Float64(Float64(t_5 * Float64(t_4 - 3.0)) + t_6)) + Float64(t_3 * t_4)) + t_1)) + Float64(3.0 * Float64(3.0 + Float64(-1.0 / x1)))))
	tmp = 0.0
	if (x1 <= -5.8e+102)
		tmp = t_0;
	elseif (x1 <= -0.014)
		tmp = t_7;
	elseif (x1 <= 0.014)
		tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_3 - Float64(2.0 * x2)) - x1) / t_2)) + Float64(x1 + Float64(t_1 + Float64(Float64(t_2 * Float64(t_6 + Float64(t_5 * Float64(Float64(x2 + x2) - 3.0)))) + Float64(t_3 * Float64(x2 + x2)))))));
	elseif (x1 <= 5e+153)
		tmp = t_7;
	else
		tmp = t_0;
	end
	return tmp
end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(9.0 * N[(x1 * x1), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$3 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$5 = N[(N[(x1 * 2.0), $MachinePrecision] * t$95$4), $MachinePrecision]}, Block[{t$95$6 = N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$4), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$2 * N[(N[(t$95$5 * N[(t$95$4 - 3.0), $MachinePrecision]), $MachinePrecision] + t$95$6), $MachinePrecision]), $MachinePrecision] + N[(t$95$3 * t$95$4), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(3.0 + N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.8e+102], t$95$0, If[LessEqual[x1, -0.014], t$95$7, If[LessEqual[x1, 0.014], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$3 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(t$95$1 + N[(N[(t$95$2 * N[(t$95$6 + N[(t$95$5 * N[(N[(x2 + x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$3 * N[(x2 + x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5e+153], t$95$7, t$95$0]]]]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x1 + \mathsf{fma}\left(9, x1 \cdot x1, x1 \cdot -2\right)\\
t_1 := x1 \cdot \left(x1 \cdot x1\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := x1 \cdot \left(x1 \cdot 3\right)\\
t_4 := \frac{\left(t_3 + 2 \cdot x2\right) - x1}{t_2}\\
t_5 := \left(x1 \cdot 2\right) \cdot t_4\\
t_6 := \left(x1 \cdot x1\right) \cdot \left(4 \cdot t_4 - 6\right)\\
t_7 := x1 + \left(\left(x1 + \left(\left(t_2 \cdot \left(t_5 \cdot \left(t_4 - 3\right) + t_6\right) + t_3 \cdot t_4\right) + t_1\right)\right) + 3 \cdot \left(3 + \frac{-1}{x1}\right)\right)\\
\mathbf{if}\;x1 \leq -5.8 \cdot 10^{+102}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;x1 \leq -0.014:\\
\;\;\;\;t_7\\

\mathbf{elif}\;x1 \leq 0.014:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_3 - 2 \cdot x2\right) - x1}{t_2} + \left(x1 + \left(t_1 + \left(t_2 \cdot \left(t_6 + t_5 \cdot \left(\left(x2 + x2\right) - 3\right)\right) + t_3 \cdot \left(x2 + x2\right)\right)\right)\right)\right)\\

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

\mathbf{else}:\\
\;\;\;\;t_0\\


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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x1 + \color{blue}{\left(9 \cdot {x1}^{2} + -2 \cdot x1\right)} \]
    7. Step-by-step derivation
      1. fma-def88.9%

        \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(9, {x1}^{2}, -2 \cdot x1\right)} \]
      2. unpow288.9%

        \[\leadsto x1 + \mathsf{fma}\left(9, \color{blue}{x1 \cdot x1}, -2 \cdot x1\right) \]
      3. *-commutative88.9%

        \[\leadsto x1 + \mathsf{fma}\left(9, x1 \cdot x1, \color{blue}{x1 \cdot -2}\right) \]
    8. Simplified88.9%

      \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(9, x1 \cdot x1, x1 \cdot -2\right)} \]

    if -5.8000000000000005e102 < x1 < -0.0140000000000000003 or 0.0140000000000000003 < x1 < 5.00000000000000018e153

    1. Initial program 93.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. Taylor expanded in x1 around inf 92.8%

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

    if -0.0140000000000000003 < x1 < 0.0140000000000000003

    1. Initial program 99.6%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -5.8 \cdot 10^{+102}:\\ \;\;\;\;x1 + \mathsf{fma}\left(9, x1 \cdot x1, x1 \cdot -2\right)\\ \mathbf{elif}\;x1 \leq -0.014:\\ \;\;\;\;x1 + \left(\left(x1 + \left(\left(\left(x1 \cdot x1 + 1\right) \cdot \left(\left(\left(x1 \cdot 2\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) + \left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \left(3 + \frac{-1}{x1}\right)\right)\\ \mathbf{elif}\;x1 \leq 0.014:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(\left(x1 \cdot x1 + 1\right) \cdot \left(\left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right) + \left(\left(x1 \cdot 2\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\left(x2 + x2\right) - 3\right)\right) + \left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \left(x2 + x2\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 5 \cdot 10^{+153}:\\ \;\;\;\;x1 + \left(\left(x1 + \left(\left(\left(x1 \cdot x1 + 1\right) \cdot \left(\left(\left(x1 \cdot 2\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) + \left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \left(3 + \frac{-1}{x1}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \mathsf{fma}\left(9, x1 \cdot x1, x1 \cdot -2\right)\\ \end{array} \]

Alternative 7: 93.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 + \mathsf{fma}\left(9, x1 \cdot x1, x1 \cdot -2\right)\\ t_1 := x1 \cdot \left(x1 \cdot x1\right)\\ t_2 := x1 \cdot \left(x1 \cdot 3\right)\\ t_3 := x1 \cdot x1 + 1\\ t_4 := \frac{\left(t_2 + 2 \cdot x2\right) - x1}{t_3}\\ t_5 := t_4 - 3\\ t_6 := t_2 \cdot t_4\\ t_7 := \left(x1 \cdot x1\right) \cdot \left(4 \cdot t_4 - 6\right)\\ \mathbf{if}\;x1 \leq -6.4 \cdot 10^{+102}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x1 \leq -0.05:\\ \;\;\;\;x1 + \left(\left(x1 + \left(\left(t_3 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_4\right) \cdot t_5 + t_7\right) + t_6\right) + t_1\right)\right) + 3 \cdot \left(3 + \frac{-1}{x1}\right)\right)\\ \mathbf{elif}\;x1 \leq 7.5 \cdot 10^{+149}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(t_2 - 2 \cdot x2\right) - x1}{t_3} + \left(x1 + \left(t_1 + \left(t_6 + t_3 \cdot \left(t_7 + t_5 \cdot \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2 - x1\right)\right)\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (+ x1 (fma 9.0 (* x1 x1) (* x1 -2.0))))
        (t_1 (* x1 (* x1 x1)))
        (t_2 (* x1 (* x1 3.0)))
        (t_3 (+ (* x1 x1) 1.0))
        (t_4 (/ (- (+ t_2 (* 2.0 x2)) x1) t_3))
        (t_5 (- t_4 3.0))
        (t_6 (* t_2 t_4))
        (t_7 (* (* x1 x1) (- (* 4.0 t_4) 6.0))))
   (if (<= x1 -6.4e+102)
     t_0
     (if (<= x1 -0.05)
       (+
        x1
        (+
         (+ x1 (+ (+ (* t_3 (+ (* (* (* x1 2.0) t_4) t_5) t_7)) t_6) t_1))
         (* 3.0 (+ 3.0 (/ -1.0 x1)))))
       (if (<= x1 7.5e+149)
         (+
          x1
          (+
           (* 3.0 (/ (- (- t_2 (* 2.0 x2)) x1) t_3))
           (+
            x1
            (+
             t_1
             (+
              t_6
              (* t_3 (+ t_7 (* t_5 (* (* x1 2.0) (- (* 2.0 x2) x1))))))))))
         t_0)))))
double code(double x1, double x2) {
	double t_0 = x1 + fma(9.0, (x1 * x1), (x1 * -2.0));
	double t_1 = x1 * (x1 * x1);
	double t_2 = x1 * (x1 * 3.0);
	double t_3 = (x1 * x1) + 1.0;
	double t_4 = ((t_2 + (2.0 * x2)) - x1) / t_3;
	double t_5 = t_4 - 3.0;
	double t_6 = t_2 * t_4;
	double t_7 = (x1 * x1) * ((4.0 * t_4) - 6.0);
	double tmp;
	if (x1 <= -6.4e+102) {
		tmp = t_0;
	} else if (x1 <= -0.05) {
		tmp = x1 + ((x1 + (((t_3 * ((((x1 * 2.0) * t_4) * t_5) + t_7)) + t_6) + t_1)) + (3.0 * (3.0 + (-1.0 / x1))));
	} else if (x1 <= 7.5e+149) {
		tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_3)) + (x1 + (t_1 + (t_6 + (t_3 * (t_7 + (t_5 * ((x1 * 2.0) * ((2.0 * x2) - x1)))))))));
	} else {
		tmp = t_0;
	}
	return tmp;
}
function code(x1, x2)
	t_0 = Float64(x1 + fma(9.0, Float64(x1 * x1), Float64(x1 * -2.0)))
	t_1 = Float64(x1 * Float64(x1 * x1))
	t_2 = Float64(x1 * Float64(x1 * 3.0))
	t_3 = Float64(Float64(x1 * x1) + 1.0)
	t_4 = Float64(Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) / t_3)
	t_5 = Float64(t_4 - 3.0)
	t_6 = Float64(t_2 * t_4)
	t_7 = Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_4) - 6.0))
	tmp = 0.0
	if (x1 <= -6.4e+102)
		tmp = t_0;
	elseif (x1 <= -0.05)
		tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_3 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_4) * t_5) + t_7)) + t_6) + t_1)) + Float64(3.0 * Float64(3.0 + Float64(-1.0 / x1)))));
	elseif (x1 <= 7.5e+149)
		tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_2 - Float64(2.0 * x2)) - x1) / t_3)) + Float64(x1 + Float64(t_1 + Float64(t_6 + Float64(t_3 * Float64(t_7 + Float64(t_5 * Float64(Float64(x1 * 2.0) * Float64(Float64(2.0 * x2) - x1))))))))));
	else
		tmp = t_0;
	end
	return tmp
end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(9.0 * N[(x1 * x1), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$4 - 3.0), $MachinePrecision]}, Block[{t$95$6 = N[(t$95$2 * t$95$4), $MachinePrecision]}, Block[{t$95$7 = N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$4), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -6.4e+102], t$95$0, If[LessEqual[x1, -0.05], N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$3 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$4), $MachinePrecision] * t$95$5), $MachinePrecision] + t$95$7), $MachinePrecision]), $MachinePrecision] + t$95$6), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(3.0 + N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 7.5e+149], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$2 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(t$95$1 + N[(t$95$6 + N[(t$95$3 * N[(t$95$7 + N[(t$95$5 * N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x1 + \mathsf{fma}\left(9, x1 \cdot x1, x1 \cdot -2\right)\\
t_1 := x1 \cdot \left(x1 \cdot x1\right)\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := x1 \cdot x1 + 1\\
t_4 := \frac{\left(t_2 + 2 \cdot x2\right) - x1}{t_3}\\
t_5 := t_4 - 3\\
t_6 := t_2 \cdot t_4\\
t_7 := \left(x1 \cdot x1\right) \cdot \left(4 \cdot t_4 - 6\right)\\
\mathbf{if}\;x1 \leq -6.4 \cdot 10^{+102}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;x1 \leq -0.05:\\
\;\;\;\;x1 + \left(\left(x1 + \left(\left(t_3 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_4\right) \cdot t_5 + t_7\right) + t_6\right) + t_1\right)\right) + 3 \cdot \left(3 + \frac{-1}{x1}\right)\right)\\

\mathbf{elif}\;x1 \leq 7.5 \cdot 10^{+149}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_2 - 2 \cdot x2\right) - x1}{t_3} + \left(x1 + \left(t_1 + \left(t_6 + t_3 \cdot \left(t_7 + t_5 \cdot \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2 - x1\right)\right)\right)\right)\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x1 < -6.3999999999999999e102 or 7.50000000000000031e149 < x1

    1. Initial program 1.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. Taylor expanded in x1 around 0 1.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x1 + \color{blue}{\left(9 \cdot {x1}^{2} + -2 \cdot x1\right)} \]
    7. Step-by-step derivation
      1. fma-def87.9%

        \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(9, {x1}^{2}, -2 \cdot x1\right)} \]
      2. unpow287.9%

        \[\leadsto x1 + \mathsf{fma}\left(9, \color{blue}{x1 \cdot x1}, -2 \cdot x1\right) \]
      3. *-commutative87.9%

        \[\leadsto x1 + \mathsf{fma}\left(9, x1 \cdot x1, \color{blue}{x1 \cdot -2}\right) \]
    8. Simplified87.9%

      \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(9, x1 \cdot x1, x1 \cdot -2\right)} \]

    if -6.3999999999999999e102 < x1 < -0.050000000000000003

    1. Initial program 99.3%

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

    if -0.050000000000000003 < x1 < 7.50000000000000031e149

    1. Initial program 97.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. Taylor expanded in x1 around 0 95.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -6.4 \cdot 10^{+102}:\\ \;\;\;\;x1 + \mathsf{fma}\left(9, x1 \cdot x1, x1 \cdot -2\right)\\ \mathbf{elif}\;x1 \leq -0.05:\\ \;\;\;\;x1 + \left(\left(x1 + \left(\left(\left(x1 \cdot x1 + 1\right) \cdot \left(\left(\left(x1 \cdot 2\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) + \left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \left(3 + \frac{-1}{x1}\right)\right)\\ \mathbf{elif}\;x1 \leq 7.5 \cdot 10^{+149}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(\left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 \cdot x1 + 1\right) \cdot \left(\left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right) + \left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2 - x1\right)\right)\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \mathsf{fma}\left(9, x1 \cdot x1, x1 \cdot -2\right)\\ \end{array} \]

Alternative 8: 95.1% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 + \mathsf{fma}\left(9, x1 \cdot x1, x1 \cdot -2\right)\\ t_1 := x1 \cdot \left(x1 \cdot x1\right)\\ t_2 := x1 \cdot x1 + 1\\ t_3 := x1 \cdot \left(x1 \cdot 3\right)\\ t_4 := \frac{\left(t_3 + 2 \cdot x2\right) - x1}{t_2}\\ t_5 := \left(x1 \cdot 2\right) \cdot t_4\\ t_6 := \left(x1 \cdot x1\right) \cdot \left(4 \cdot t_4 - 6\right)\\ t_7 := x1 + \left(9 + \left(x1 + \left(\left(t_2 \cdot \left(t_5 \cdot \left(t_4 - 3\right) + t_6\right) + t_3 \cdot t_4\right) + t_1\right)\right)\right)\\ \mathbf{if}\;x1 \leq -1.4 \cdot 10^{+103}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x1 \leq -0.0096:\\ \;\;\;\;t_7\\ \mathbf{elif}\;x1 \leq 0.0115:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(t_3 - 2 \cdot x2\right) - x1}{t_2} + \left(x1 + \left(t_1 + \left(t_2 \cdot \left(t_6 + t_5 \cdot \left(\left(x2 + x2\right) - 3\right)\right) + t_3 \cdot \left(x2 + x2\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 5 \cdot 10^{+153}:\\ \;\;\;\;t_7\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (+ x1 (fma 9.0 (* x1 x1) (* x1 -2.0))))
        (t_1 (* x1 (* x1 x1)))
        (t_2 (+ (* x1 x1) 1.0))
        (t_3 (* x1 (* x1 3.0)))
        (t_4 (/ (- (+ t_3 (* 2.0 x2)) x1) t_2))
        (t_5 (* (* x1 2.0) t_4))
        (t_6 (* (* x1 x1) (- (* 4.0 t_4) 6.0)))
        (t_7
         (+
          x1
          (+
           9.0
           (+
            x1
            (+ (+ (* t_2 (+ (* t_5 (- t_4 3.0)) t_6)) (* t_3 t_4)) t_1))))))
   (if (<= x1 -1.4e+103)
     t_0
     (if (<= x1 -0.0096)
       t_7
       (if (<= x1 0.0115)
         (+
          x1
          (+
           (* 3.0 (/ (- (- t_3 (* 2.0 x2)) x1) t_2))
           (+
            x1
            (+
             t_1
             (+
              (* t_2 (+ t_6 (* t_5 (- (+ x2 x2) 3.0))))
              (* t_3 (+ x2 x2)))))))
         (if (<= x1 5e+153) t_7 t_0))))))
double code(double x1, double x2) {
	double t_0 = x1 + fma(9.0, (x1 * x1), (x1 * -2.0));
	double t_1 = x1 * (x1 * x1);
	double t_2 = (x1 * x1) + 1.0;
	double t_3 = x1 * (x1 * 3.0);
	double t_4 = ((t_3 + (2.0 * x2)) - x1) / t_2;
	double t_5 = (x1 * 2.0) * t_4;
	double t_6 = (x1 * x1) * ((4.0 * t_4) - 6.0);
	double t_7 = x1 + (9.0 + (x1 + (((t_2 * ((t_5 * (t_4 - 3.0)) + t_6)) + (t_3 * t_4)) + t_1)));
	double tmp;
	if (x1 <= -1.4e+103) {
		tmp = t_0;
	} else if (x1 <= -0.0096) {
		tmp = t_7;
	} else if (x1 <= 0.0115) {
		tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_2)) + (x1 + (t_1 + ((t_2 * (t_6 + (t_5 * ((x2 + x2) - 3.0)))) + (t_3 * (x2 + x2))))));
	} else if (x1 <= 5e+153) {
		tmp = t_7;
	} else {
		tmp = t_0;
	}
	return tmp;
}
function code(x1, x2)
	t_0 = Float64(x1 + fma(9.0, Float64(x1 * x1), Float64(x1 * -2.0)))
	t_1 = Float64(x1 * Float64(x1 * x1))
	t_2 = Float64(Float64(x1 * x1) + 1.0)
	t_3 = Float64(x1 * Float64(x1 * 3.0))
	t_4 = Float64(Float64(Float64(t_3 + Float64(2.0 * x2)) - x1) / t_2)
	t_5 = Float64(Float64(x1 * 2.0) * t_4)
	t_6 = Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_4) - 6.0))
	t_7 = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(Float64(Float64(t_2 * Float64(Float64(t_5 * Float64(t_4 - 3.0)) + t_6)) + Float64(t_3 * t_4)) + t_1))))
	tmp = 0.0
	if (x1 <= -1.4e+103)
		tmp = t_0;
	elseif (x1 <= -0.0096)
		tmp = t_7;
	elseif (x1 <= 0.0115)
		tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_3 - Float64(2.0 * x2)) - x1) / t_2)) + Float64(x1 + Float64(t_1 + Float64(Float64(t_2 * Float64(t_6 + Float64(t_5 * Float64(Float64(x2 + x2) - 3.0)))) + Float64(t_3 * Float64(x2 + x2)))))));
	elseif (x1 <= 5e+153)
		tmp = t_7;
	else
		tmp = t_0;
	end
	return tmp
end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(9.0 * N[(x1 * x1), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$3 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$5 = N[(N[(x1 * 2.0), $MachinePrecision] * t$95$4), $MachinePrecision]}, Block[{t$95$6 = N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$4), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(x1 + N[(9.0 + N[(x1 + N[(N[(N[(t$95$2 * N[(N[(t$95$5 * N[(t$95$4 - 3.0), $MachinePrecision]), $MachinePrecision] + t$95$6), $MachinePrecision]), $MachinePrecision] + N[(t$95$3 * t$95$4), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.4e+103], t$95$0, If[LessEqual[x1, -0.0096], t$95$7, If[LessEqual[x1, 0.0115], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$3 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(t$95$1 + N[(N[(t$95$2 * N[(t$95$6 + N[(t$95$5 * N[(N[(x2 + x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$3 * N[(x2 + x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5e+153], t$95$7, t$95$0]]]]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x1 + \mathsf{fma}\left(9, x1 \cdot x1, x1 \cdot -2\right)\\
t_1 := x1 \cdot \left(x1 \cdot x1\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := x1 \cdot \left(x1 \cdot 3\right)\\
t_4 := \frac{\left(t_3 + 2 \cdot x2\right) - x1}{t_2}\\
t_5 := \left(x1 \cdot 2\right) \cdot t_4\\
t_6 := \left(x1 \cdot x1\right) \cdot \left(4 \cdot t_4 - 6\right)\\
t_7 := x1 + \left(9 + \left(x1 + \left(\left(t_2 \cdot \left(t_5 \cdot \left(t_4 - 3\right) + t_6\right) + t_3 \cdot t_4\right) + t_1\right)\right)\right)\\
\mathbf{if}\;x1 \leq -1.4 \cdot 10^{+103}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;x1 \leq -0.0096:\\
\;\;\;\;t_7\\

\mathbf{elif}\;x1 \leq 0.0115:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_3 - 2 \cdot x2\right) - x1}{t_2} + \left(x1 + \left(t_1 + \left(t_2 \cdot \left(t_6 + t_5 \cdot \left(\left(x2 + x2\right) - 3\right)\right) + t_3 \cdot \left(x2 + x2\right)\right)\right)\right)\right)\\

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

\mathbf{else}:\\
\;\;\;\;t_0\\


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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x1 + \color{blue}{\left(9 \cdot {x1}^{2} + -2 \cdot x1\right)} \]
    7. Step-by-step derivation
      1. fma-def88.9%

        \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(9, {x1}^{2}, -2 \cdot x1\right)} \]
      2. unpow288.9%

        \[\leadsto x1 + \mathsf{fma}\left(9, \color{blue}{x1 \cdot x1}, -2 \cdot x1\right) \]
      3. *-commutative88.9%

        \[\leadsto x1 + \mathsf{fma}\left(9, x1 \cdot x1, \color{blue}{x1 \cdot -2}\right) \]
    8. Simplified88.9%

      \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(9, x1 \cdot x1, x1 \cdot -2\right)} \]

    if -1.40000000000000004e103 < x1 < -0.00959999999999999916 or 0.0115 < x1 < 5.00000000000000018e153

    1. Initial program 93.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. Taylor expanded in x1 around inf 92.5%

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

    if -0.00959999999999999916 < x1 < 0.0115

    1. Initial program 99.6%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -1.4 \cdot 10^{+103}:\\ \;\;\;\;x1 + \mathsf{fma}\left(9, x1 \cdot x1, x1 \cdot -2\right)\\ \mathbf{elif}\;x1 \leq -0.0096:\\ \;\;\;\;x1 + \left(9 + \left(x1 + \left(\left(\left(x1 \cdot x1 + 1\right) \cdot \left(\left(\left(x1 \cdot 2\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) + \left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 0.0115:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(\left(x1 \cdot x1 + 1\right) \cdot \left(\left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right) + \left(\left(x1 \cdot 2\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\left(x2 + x2\right) - 3\right)\right) + \left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \left(x2 + x2\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 5 \cdot 10^{+153}:\\ \;\;\;\;x1 + \left(9 + \left(x1 + \left(\left(\left(x1 \cdot x1 + 1\right) \cdot \left(\left(\left(x1 \cdot 2\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) + \left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \mathsf{fma}\left(9, x1 \cdot x1, x1 \cdot -2\right)\\ \end{array} \]

Alternative 9: 89.6% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 \cdot \left(x1 \cdot 3\right)\\ t_1 := x1 \cdot x1 + 1\\ t_2 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\ \mathbf{if}\;x1 \leq -6.4 \cdot 10^{+102} \lor \neg \left(x1 \leq 7.5 \cdot 10^{+149}\right):\\ \;\;\;\;x1 + \mathsf{fma}\left(9, x1 \cdot x1, x1 \cdot -2\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_1 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(4 \cdot t_2 - 6\right) + \left(\left(x1 \cdot 2\right) \cdot t_2\right) \cdot \left(\left(x2 + x2\right) - 3\right)\right) + t_0 \cdot \left(x2 + x2\right)\right)\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (* x1 (* x1 3.0)))
        (t_1 (+ (* x1 x1) 1.0))
        (t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
   (if (or (<= x1 -6.4e+102) (not (<= x1 7.5e+149)))
     (+ x1 (fma 9.0 (* x1 x1) (* x1 -2.0)))
     (+
      x1
      (+
       (* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))
       (+
        x1
        (+
         (* x1 (* x1 x1))
         (+
          (*
           t_1
           (+
            (* (* x1 x1) (- (* 4.0 t_2) 6.0))
            (* (* (* x1 2.0) t_2) (- (+ x2 x2) 3.0))))
          (* t_0 (+ x2 x2))))))))))
double code(double x1, double x2) {
	double t_0 = x1 * (x1 * 3.0);
	double t_1 = (x1 * x1) + 1.0;
	double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
	double tmp;
	if ((x1 <= -6.4e+102) || !(x1 <= 7.5e+149)) {
		tmp = x1 + fma(9.0, (x1 * x1), (x1 * -2.0));
	} else {
		tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((x1 * x1) * ((4.0 * t_2) - 6.0)) + (((x1 * 2.0) * t_2) * ((x2 + x2) - 3.0)))) + (t_0 * (x2 + x2))))));
	}
	return tmp;
}
function code(x1, x2)
	t_0 = Float64(x1 * Float64(x1 * 3.0))
	t_1 = Float64(Float64(x1 * x1) + 1.0)
	t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1)
	tmp = 0.0
	if ((x1 <= -6.4e+102) || !(x1 <= 7.5e+149))
		tmp = Float64(x1 + fma(9.0, Float64(x1 * x1), Float64(x1 * -2.0)));
	else
		tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_1 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0)) + Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(Float64(x2 + x2) - 3.0)))) + Float64(t_0 * Float64(x2 + x2)))))));
	end
	return tmp
end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[Or[LessEqual[x1, -6.4e+102], N[Not[LessEqual[x1, 7.5e+149]], $MachinePrecision]], N[(x1 + N[(9.0 * N[(x1 * x1), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(N[(x2 + x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(x2 + x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\
\mathbf{if}\;x1 \leq -6.4 \cdot 10^{+102} \lor \neg \left(x1 \leq 7.5 \cdot 10^{+149}\right):\\
\;\;\;\;x1 + \mathsf{fma}\left(9, x1 \cdot x1, x1 \cdot -2\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x1 < -6.3999999999999999e102 or 7.50000000000000031e149 < x1

    1. Initial program 1.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. Taylor expanded in x1 around 0 1.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x1 + \color{blue}{\left(9 \cdot {x1}^{2} + -2 \cdot x1\right)} \]
    7. Step-by-step derivation
      1. fma-def87.9%

        \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(9, {x1}^{2}, -2 \cdot x1\right)} \]
      2. unpow287.9%

        \[\leadsto x1 + \mathsf{fma}\left(9, \color{blue}{x1 \cdot x1}, -2 \cdot x1\right) \]
      3. *-commutative87.9%

        \[\leadsto x1 + \mathsf{fma}\left(9, x1 \cdot x1, \color{blue}{x1 \cdot -2}\right) \]
    8. Simplified87.9%

      \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(9, x1 \cdot x1, x1 \cdot -2\right)} \]

    if -6.3999999999999999e102 < x1 < 7.50000000000000031e149

    1. Initial program 97.8%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -6.4 \cdot 10^{+102} \lor \neg \left(x1 \leq 7.5 \cdot 10^{+149}\right):\\ \;\;\;\;x1 + \mathsf{fma}\left(9, x1 \cdot x1, x1 \cdot -2\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(\left(x1 \cdot x1 + 1\right) \cdot \left(\left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right) + \left(\left(x1 \cdot 2\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\left(x2 + x2\right) - 3\right)\right) + \left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \left(x2 + x2\right)\right)\right)\right)\right)\\ \end{array} \]

Alternative 10: 84.3% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 \cdot x1 + 1\\ t_1 := x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + 2 \cdot x2\right)\right)\right)\\ t_2 := x1 \cdot \left(x1 \cdot x1\right)\\ t_3 := x1 \cdot \left(x1 \cdot 3\right)\\ t_4 := \frac{\left(t_3 + 2 \cdot x2\right) - x1}{t_0}\\ t_5 := t_3 \cdot t_4\\ t_6 := x1 + \left(9 + \left(x1 + \left(t_2 + \left(t_5 + t_0 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(4 \cdot t_4 - 6\right) + \left(t_4 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2 - x1\right)\right)\right)\right)\right)\right)\right)\\ \mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x1 \leq -0.48:\\ \;\;\;\;t_6\\ \mathbf{elif}\;x1 \leq 0.039:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(t_3 - 2 \cdot x2\right) - x1}{t_0} + \left(x1 + \left(t_2 + \left(t_5 + t_0 \cdot \left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 2.1 \cdot 10^{+113}:\\ \;\;\;\;t_6\\ \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 (* 3.0 (+ 3.0 (* 2.0 x2)))))))
        (t_2 (* x1 (* x1 x1)))
        (t_3 (* x1 (* x1 3.0)))
        (t_4 (/ (- (+ t_3 (* 2.0 x2)) x1) t_0))
        (t_5 (* t_3 t_4))
        (t_6
         (+
          x1
          (+
           9.0
           (+
            x1
            (+
             t_2
             (+
              t_5
              (*
               t_0
               (+
                (* (* x1 x1) (- (* 4.0 t_4) 6.0))
                (* (- t_4 3.0) (* (* x1 2.0) (- (* 2.0 x2) x1))))))))))))
   (if (<= x1 -5.6e+102)
     t_1
     (if (<= x1 -0.48)
       t_6
       (if (<= x1 0.039)
         (+
          x1
          (+
           (* 3.0 (/ (- (- t_3 (* 2.0 x2)) x1) t_0))
           (+
            x1
            (+ t_2 (+ t_5 (* t_0 (* 4.0 (* x2 (* x1 (- (* 2.0 x2) 3.0))))))))))
         (if (<= x1 2.1e+113) t_6 t_1))))))
double code(double x1, double x2) {
	double t_0 = (x1 * x1) + 1.0;
	double t_1 = x1 + (x1 * (x1 * (3.0 * (3.0 + (2.0 * x2)))));
	double t_2 = x1 * (x1 * x1);
	double t_3 = x1 * (x1 * 3.0);
	double t_4 = ((t_3 + (2.0 * x2)) - x1) / t_0;
	double t_5 = t_3 * t_4;
	double t_6 = x1 + (9.0 + (x1 + (t_2 + (t_5 + (t_0 * (((x1 * x1) * ((4.0 * t_4) - 6.0)) + ((t_4 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1)))))))));
	double tmp;
	if (x1 <= -5.6e+102) {
		tmp = t_1;
	} else if (x1 <= -0.48) {
		tmp = t_6;
	} else if (x1 <= 0.039) {
		tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_0)) + (x1 + (t_2 + (t_5 + (t_0 * (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0)))))))));
	} else if (x1 <= 2.1e+113) {
		tmp = t_6;
	} 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) :: t_6
    real(8) :: tmp
    t_0 = (x1 * x1) + 1.0d0
    t_1 = x1 + (x1 * (x1 * (3.0d0 * (3.0d0 + (2.0d0 * x2)))))
    t_2 = x1 * (x1 * x1)
    t_3 = x1 * (x1 * 3.0d0)
    t_4 = ((t_3 + (2.0d0 * x2)) - x1) / t_0
    t_5 = t_3 * t_4
    t_6 = x1 + (9.0d0 + (x1 + (t_2 + (t_5 + (t_0 * (((x1 * x1) * ((4.0d0 * t_4) - 6.0d0)) + ((t_4 - 3.0d0) * ((x1 * 2.0d0) * ((2.0d0 * x2) - x1)))))))))
    if (x1 <= (-5.6d+102)) then
        tmp = t_1
    else if (x1 <= (-0.48d0)) then
        tmp = t_6
    else if (x1 <= 0.039d0) then
        tmp = x1 + ((3.0d0 * (((t_3 - (2.0d0 * x2)) - x1) / t_0)) + (x1 + (t_2 + (t_5 + (t_0 * (4.0d0 * (x2 * (x1 * ((2.0d0 * x2) - 3.0d0)))))))))
    else if (x1 <= 2.1d+113) then
        tmp = t_6
    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 * (3.0 * (3.0 + (2.0 * x2)))));
	double t_2 = x1 * (x1 * x1);
	double t_3 = x1 * (x1 * 3.0);
	double t_4 = ((t_3 + (2.0 * x2)) - x1) / t_0;
	double t_5 = t_3 * t_4;
	double t_6 = x1 + (9.0 + (x1 + (t_2 + (t_5 + (t_0 * (((x1 * x1) * ((4.0 * t_4) - 6.0)) + ((t_4 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1)))))))));
	double tmp;
	if (x1 <= -5.6e+102) {
		tmp = t_1;
	} else if (x1 <= -0.48) {
		tmp = t_6;
	} else if (x1 <= 0.039) {
		tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_0)) + (x1 + (t_2 + (t_5 + (t_0 * (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0)))))))));
	} else if (x1 <= 2.1e+113) {
		tmp = t_6;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x1, x2):
	t_0 = (x1 * x1) + 1.0
	t_1 = x1 + (x1 * (x1 * (3.0 * (3.0 + (2.0 * x2)))))
	t_2 = x1 * (x1 * x1)
	t_3 = x1 * (x1 * 3.0)
	t_4 = ((t_3 + (2.0 * x2)) - x1) / t_0
	t_5 = t_3 * t_4
	t_6 = x1 + (9.0 + (x1 + (t_2 + (t_5 + (t_0 * (((x1 * x1) * ((4.0 * t_4) - 6.0)) + ((t_4 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1)))))))))
	tmp = 0
	if x1 <= -5.6e+102:
		tmp = t_1
	elif x1 <= -0.48:
		tmp = t_6
	elif x1 <= 0.039:
		tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_0)) + (x1 + (t_2 + (t_5 + (t_0 * (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0)))))))))
	elif x1 <= 2.1e+113:
		tmp = t_6
	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(x1 * Float64(3.0 * Float64(3.0 + Float64(2.0 * x2))))))
	t_2 = Float64(x1 * Float64(x1 * x1))
	t_3 = Float64(x1 * Float64(x1 * 3.0))
	t_4 = Float64(Float64(Float64(t_3 + Float64(2.0 * x2)) - x1) / t_0)
	t_5 = Float64(t_3 * t_4)
	t_6 = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(t_2 + Float64(t_5 + Float64(t_0 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_4) - 6.0)) + Float64(Float64(t_4 - 3.0) * Float64(Float64(x1 * 2.0) * Float64(Float64(2.0 * x2) - x1))))))))))
	tmp = 0.0
	if (x1 <= -5.6e+102)
		tmp = t_1;
	elseif (x1 <= -0.48)
		tmp = t_6;
	elseif (x1 <= 0.039)
		tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_3 - Float64(2.0 * x2)) - x1) / t_0)) + Float64(x1 + Float64(t_2 + Float64(t_5 + Float64(t_0 * Float64(4.0 * Float64(x2 * Float64(x1 * Float64(Float64(2.0 * x2) - 3.0))))))))));
	elseif (x1 <= 2.1e+113)
		tmp = t_6;
	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 * (3.0 * (3.0 + (2.0 * x2)))));
	t_2 = x1 * (x1 * x1);
	t_3 = x1 * (x1 * 3.0);
	t_4 = ((t_3 + (2.0 * x2)) - x1) / t_0;
	t_5 = t_3 * t_4;
	t_6 = x1 + (9.0 + (x1 + (t_2 + (t_5 + (t_0 * (((x1 * x1) * ((4.0 * t_4) - 6.0)) + ((t_4 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1)))))))));
	tmp = 0.0;
	if (x1 <= -5.6e+102)
		tmp = t_1;
	elseif (x1 <= -0.48)
		tmp = t_6;
	elseif (x1 <= 0.039)
		tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_0)) + (x1 + (t_2 + (t_5 + (t_0 * (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0)))))))));
	elseif (x1 <= 2.1e+113)
		tmp = t_6;
	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[(x1 * N[(3.0 * N[(3.0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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[(N[(t$95$3 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$3 * t$95$4), $MachinePrecision]}, Block[{t$95$6 = N[(x1 + N[(9.0 + N[(x1 + N[(t$95$2 + N[(t$95$5 + N[(t$95$0 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$4), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$4 - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], t$95$1, If[LessEqual[x1, -0.48], t$95$6, If[LessEqual[x1, 0.039], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$3 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(t$95$2 + N[(t$95$5 + N[(t$95$0 * N[(4.0 * N[(x2 * N[(x1 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2.1e+113], t$95$6, t$95$1]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x1 \leq -0.48:\\
\;\;\;\;t_6\\

\mathbf{elif}\;x1 \leq 0.039:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_3 - 2 \cdot x2\right) - x1}{t_0} + \left(x1 + \left(t_2 + \left(t_5 + t_0 \cdot \left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 2.1 \cdot 10^{+113}:\\
\;\;\;\;t_6\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x1 < -5.60000000000000037e102 or 2.0999999999999999e113 < x1

    1. Initial program 3.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. Taylor expanded in x1 around 0 2.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x1 + \color{blue}{\left(3 \cdot {x1}^{2}\right) \cdot \left(3 - -2 \cdot x2\right)} \]
      2. *-commutative75.7%

        \[\leadsto x1 + \color{blue}{\left({x1}^{2} \cdot 3\right)} \cdot \left(3 - -2 \cdot x2\right) \]
      3. unpow275.7%

        \[\leadsto x1 + \left(\color{blue}{\left(x1 \cdot x1\right)} \cdot 3\right) \cdot \left(3 - -2 \cdot x2\right) \]
      4. associate-*r*75.7%

        \[\leadsto x1 + \color{blue}{\left(x1 \cdot \left(x1 \cdot 3\right)\right)} \cdot \left(3 - -2 \cdot x2\right) \]
      5. *-commutative75.7%

        \[\leadsto x1 + \left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \left(3 - \color{blue}{x2 \cdot -2}\right) \]
      6. associate-*r*75.7%

        \[\leadsto x1 + \color{blue}{x1 \cdot \left(\left(x1 \cdot 3\right) \cdot \left(3 - x2 \cdot -2\right)\right)} \]
      7. associate-*l*75.7%

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

        \[\leadsto x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 - \color{blue}{-2 \cdot x2}\right)\right)\right) \]
      9. cancel-sign-sub-inv75.7%

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

        \[\leadsto x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + \color{blue}{2} \cdot x2\right)\right)\right) \]
      11. *-commutative75.7%

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

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

    if -5.60000000000000037e102 < x1 < -0.47999999999999998 or 0.0389999999999999999 < x1 < 2.0999999999999999e113

    1. Initial program 97.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. Taylor expanded in x1 around 0 81.9%

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

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

    if -0.47999999999999998 < x1 < 0.0389999999999999999

    1. Initial program 99.6%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\ \;\;\;\;x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + 2 \cdot x2\right)\right)\right)\\ \mathbf{elif}\;x1 \leq -0.48:\\ \;\;\;\;x1 + \left(9 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(\left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 \cdot x1 + 1\right) \cdot \left(\left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right) + \left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2 - x1\right)\right)\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 0.039:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(\left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 \cdot x1 + 1\right) \cdot \left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 2.1 \cdot 10^{+113}:\\ \;\;\;\;x1 + \left(9 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(\left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 \cdot x1 + 1\right) \cdot \left(\left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right) + \left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2 - x1\right)\right)\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + 2 \cdot x2\right)\right)\right)\\ \end{array} \]

Alternative 11: 82.7% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102} \lor \neg \left(x1 \leq 2.1 \cdot 10^{+113}\right):\\
\;\;\;\;x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + 2 \cdot x2\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x1 < -5.60000000000000037e102 or 2.0999999999999999e113 < x1

    1. Initial program 3.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. Taylor expanded in x1 around 0 2.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x1 + \color{blue}{\left(3 \cdot {x1}^{2}\right) \cdot \left(3 - -2 \cdot x2\right)} \]
      2. *-commutative75.7%

        \[\leadsto x1 + \color{blue}{\left({x1}^{2} \cdot 3\right)} \cdot \left(3 - -2 \cdot x2\right) \]
      3. unpow275.7%

        \[\leadsto x1 + \left(\color{blue}{\left(x1 \cdot x1\right)} \cdot 3\right) \cdot \left(3 - -2 \cdot x2\right) \]
      4. associate-*r*75.7%

        \[\leadsto x1 + \color{blue}{\left(x1 \cdot \left(x1 \cdot 3\right)\right)} \cdot \left(3 - -2 \cdot x2\right) \]
      5. *-commutative75.7%

        \[\leadsto x1 + \left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \left(3 - \color{blue}{x2 \cdot -2}\right) \]
      6. associate-*r*75.7%

        \[\leadsto x1 + \color{blue}{x1 \cdot \left(\left(x1 \cdot 3\right) \cdot \left(3 - x2 \cdot -2\right)\right)} \]
      7. associate-*l*75.7%

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

        \[\leadsto x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 - \color{blue}{-2 \cdot x2}\right)\right)\right) \]
      9. cancel-sign-sub-inv75.7%

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

        \[\leadsto x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + \color{blue}{2} \cdot x2\right)\right)\right) \]
      11. *-commutative75.7%

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

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

    if -5.60000000000000037e102 < x1 < 2.0999999999999999e113

    1. Initial program 98.9%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102} \lor \neg \left(x1 \leq 2.1 \cdot 10^{+113}\right):\\ \;\;\;\;x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + 2 \cdot x2\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(\left(x1 \cdot x1 + 1\right) \cdot \left(\left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right) + \left(\left(x1 \cdot 2\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\left(x2 + x2\right) - 3\right)\right) + \left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \left(x2 + x2\right)\right)\right)\right)\right)\\ \end{array} \]

Alternative 12: 84.1% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
t_0 := x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + 2 \cdot x2\right)\right)\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := 3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_2}\\
t_4 := x1 \cdot \left(x1 \cdot x1\right)\\
t_5 := \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_2}\\
t_6 := t_1 \cdot t_5\\
t_7 := x1 + \left(t_3 + \left(x1 + \left(t_4 + \left(t_6 + t_2 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(4 \cdot t_5 - 6\right) + 12 \cdot \frac{x2}{x1}\right)\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;x1 \leq -70:\\
\;\;\;\;t_7\\

\mathbf{elif}\;x1 \leq 13.2:\\
\;\;\;\;x1 + \left(t_3 + \left(x1 + \left(t_4 + \left(t_6 + t_2 \cdot \left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 2.1 \cdot 10^{+113}:\\
\;\;\;\;t_7\\

\mathbf{else}:\\
\;\;\;\;t_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x1 < -5.60000000000000037e102 or 2.0999999999999999e113 < x1

    1. Initial program 3.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. Taylor expanded in x1 around 0 2.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x1 + \color{blue}{\left(3 \cdot {x1}^{2}\right) \cdot \left(3 - -2 \cdot x2\right)} \]
      2. *-commutative75.7%

        \[\leadsto x1 + \color{blue}{\left({x1}^{2} \cdot 3\right)} \cdot \left(3 - -2 \cdot x2\right) \]
      3. unpow275.7%

        \[\leadsto x1 + \left(\color{blue}{\left(x1 \cdot x1\right)} \cdot 3\right) \cdot \left(3 - -2 \cdot x2\right) \]
      4. associate-*r*75.7%

        \[\leadsto x1 + \color{blue}{\left(x1 \cdot \left(x1 \cdot 3\right)\right)} \cdot \left(3 - -2 \cdot x2\right) \]
      5. *-commutative75.7%

        \[\leadsto x1 + \left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \left(3 - \color{blue}{x2 \cdot -2}\right) \]
      6. associate-*r*75.7%

        \[\leadsto x1 + \color{blue}{x1 \cdot \left(\left(x1 \cdot 3\right) \cdot \left(3 - x2 \cdot -2\right)\right)} \]
      7. associate-*l*75.7%

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

        \[\leadsto x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 - \color{blue}{-2 \cdot x2}\right)\right)\right) \]
      9. cancel-sign-sub-inv75.7%

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

        \[\leadsto x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + \color{blue}{2} \cdot x2\right)\right)\right) \]
      11. *-commutative75.7%

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

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

    if -5.60000000000000037e102 < x1 < -70 or 13.199999999999999 < x1 < 2.0999999999999999e113

    1. Initial program 97.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. Taylor expanded in x2 around inf 94.6%

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

        \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \color{blue}{\frac{2 \cdot x2}{1 + {x1}^{2}}} + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
      2. associate-/l*94.6%

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

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

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

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

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

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

    if -70 < x1 < 13.199999999999999

    1. Initial program 99.6%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\ \;\;\;\;x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + 2 \cdot x2\right)\right)\right)\\ \mathbf{elif}\;x1 \leq -70:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(\left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 \cdot x1 + 1\right) \cdot \left(\left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right) + 12 \cdot \frac{x2}{x1}\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 13.2:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(\left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 \cdot x1 + 1\right) \cdot \left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 2.1 \cdot 10^{+113}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(\left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 \cdot x1 + 1\right) \cdot \left(\left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right) + 12 \cdot \frac{x2}{x1}\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + 2 \cdot x2\right)\right)\right)\\ \end{array} \]

Alternative 13: 83.5% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;x1 \leq -195:\\
\;\;\;\;x1 + \left(t_4 + \left(x1 + \left(t_6 + \left(t_3 + t_5\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 13.2:\\
\;\;\;\;x1 + \left(t_4 + \left(x1 + \left(t_6 + \left(t_3 + t_2 \cdot \left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 2.1 \cdot 10^{+113}:\\
\;\;\;\;x1 + \left(t_4 + \left(x1 + \left(t_6 + \left(t_1 \cdot \left(x2 + x2\right) + t_5\right)\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x1 < -5.60000000000000037e102 or 2.0999999999999999e113 < x1

    1. Initial program 3.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. Taylor expanded in x1 around 0 2.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x1 + \color{blue}{\left(3 \cdot {x1}^{2}\right) \cdot \left(3 - -2 \cdot x2\right)} \]
      2. *-commutative75.7%

        \[\leadsto x1 + \color{blue}{\left({x1}^{2} \cdot 3\right)} \cdot \left(3 - -2 \cdot x2\right) \]
      3. unpow275.7%

        \[\leadsto x1 + \left(\color{blue}{\left(x1 \cdot x1\right)} \cdot 3\right) \cdot \left(3 - -2 \cdot x2\right) \]
      4. associate-*r*75.7%

        \[\leadsto x1 + \color{blue}{\left(x1 \cdot \left(x1 \cdot 3\right)\right)} \cdot \left(3 - -2 \cdot x2\right) \]
      5. *-commutative75.7%

        \[\leadsto x1 + \left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \left(3 - \color{blue}{x2 \cdot -2}\right) \]
      6. associate-*r*75.7%

        \[\leadsto x1 + \color{blue}{x1 \cdot \left(\left(x1 \cdot 3\right) \cdot \left(3 - x2 \cdot -2\right)\right)} \]
      7. associate-*l*75.7%

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

        \[\leadsto x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 - \color{blue}{-2 \cdot x2}\right)\right)\right) \]
      9. cancel-sign-sub-inv75.7%

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

        \[\leadsto x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + \color{blue}{2} \cdot x2\right)\right)\right) \]
      11. *-commutative75.7%

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

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

    if -5.60000000000000037e102 < x1 < -195

    1. Initial program 99.3%

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

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

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

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

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

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

        \[\leadsto x1 + \left(\left(\left(\left(\left(2 \cdot x1 + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \left(3 + \left(2 \cdot \frac{x2}{x1 \cdot x1} - \color{blue}{\left(\frac{1}{x1} + 3 \cdot \frac{1}{{x1}^{2}}\right)}\right)\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. associate-*r/72.4%

        \[\leadsto x1 + \left(\left(\left(\left(\left(2 \cdot x1 + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \left(3 + \left(2 \cdot \frac{x2}{x1 \cdot x1} - \left(\frac{1}{x1} + \color{blue}{\frac{3 \cdot 1}{{x1}^{2}}}\right)\right)\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) \]
      5. metadata-eval72.4%

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

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

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

    if -195 < x1 < 13.199999999999999

    1. Initial program 99.6%

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

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

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

    if 13.199999999999999 < x1 < 2.0999999999999999e113

    1. Initial program 94.8%

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

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

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

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

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

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

        \[\leadsto x1 + \left(\left(\left(\left(\left(2 \cdot x1 + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \left(3 + \left(2 \cdot \frac{x2}{x1 \cdot x1} - \color{blue}{\left(\frac{1}{x1} + 3 \cdot \frac{1}{{x1}^{2}}\right)}\right)\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. associate-*r/81.8%

        \[\leadsto x1 + \left(\left(\left(\left(\left(2 \cdot x1 + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \left(3 + \left(2 \cdot \frac{x2}{x1 \cdot x1} - \left(\frac{1}{x1} + \color{blue}{\frac{3 \cdot 1}{{x1}^{2}}}\right)\right)\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) \]
      5. metadata-eval81.8%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\ \;\;\;\;x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + 2 \cdot x2\right)\right)\right)\\ \mathbf{elif}\;x1 \leq -195:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(\left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 \cdot x1 + 1\right) \cdot \left(x1 \cdot 2 + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \left(3 + \left(2 \cdot \frac{x2}{x1 \cdot x1} + \left(\frac{-1}{x1} - \frac{3}{x1 \cdot x1}\right)\right)\right) - 6\right)\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 13.2:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(\left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 \cdot x1 + 1\right) \cdot \left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 2.1 \cdot 10^{+113}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(\left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \left(x2 + x2\right) + \left(x1 \cdot x1 + 1\right) \cdot \left(x1 \cdot 2 + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \left(3 + \left(2 \cdot \frac{x2}{x1 \cdot x1} + \left(\frac{-1}{x1} - \frac{3}{x1 \cdot x1}\right)\right)\right) - 6\right)\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + 2 \cdot x2\right)\right)\right)\\ \end{array} \]

Alternative 14: 83.5% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;x1 \leq -490:\\
\;\;\;\;x1 + \left(9 + \left(x1 + \left(t_5 + \left(t_4 + t_1\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 13.2:\\
\;\;\;\;x1 + \left(t_6 + \left(x1 + \left(t_5 + \left(t_4 + t_0 \cdot \left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 2.1 \cdot 10^{+113}:\\
\;\;\;\;x1 + \left(t_6 + \left(x1 + \left(t_5 + \left(t_3 \cdot \left(x2 + x2\right) + t_1\right)\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x1 < -5.60000000000000037e102 or 2.0999999999999999e113 < x1

    1. Initial program 3.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. Taylor expanded in x1 around 0 2.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x1 + \color{blue}{\left(3 \cdot {x1}^{2}\right) \cdot \left(3 - -2 \cdot x2\right)} \]
      2. *-commutative75.7%

        \[\leadsto x1 + \color{blue}{\left({x1}^{2} \cdot 3\right)} \cdot \left(3 - -2 \cdot x2\right) \]
      3. unpow275.7%

        \[\leadsto x1 + \left(\color{blue}{\left(x1 \cdot x1\right)} \cdot 3\right) \cdot \left(3 - -2 \cdot x2\right) \]
      4. associate-*r*75.7%

        \[\leadsto x1 + \color{blue}{\left(x1 \cdot \left(x1 \cdot 3\right)\right)} \cdot \left(3 - -2 \cdot x2\right) \]
      5. *-commutative75.7%

        \[\leadsto x1 + \left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \left(3 - \color{blue}{x2 \cdot -2}\right) \]
      6. associate-*r*75.7%

        \[\leadsto x1 + \color{blue}{x1 \cdot \left(\left(x1 \cdot 3\right) \cdot \left(3 - x2 \cdot -2\right)\right)} \]
      7. associate-*l*75.7%

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

        \[\leadsto x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 - \color{blue}{-2 \cdot x2}\right)\right)\right) \]
      9. cancel-sign-sub-inv75.7%

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

        \[\leadsto x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + \color{blue}{2} \cdot x2\right)\right)\right) \]
      11. *-commutative75.7%

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

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

    if -5.60000000000000037e102 < x1 < -490

    1. Initial program 99.3%

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

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

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

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

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

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

        \[\leadsto x1 + \left(\left(\left(\left(\left(2 \cdot x1 + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \left(3 + \left(2 \cdot \frac{x2}{x1 \cdot x1} - \color{blue}{\left(\frac{1}{x1} + 3 \cdot \frac{1}{{x1}^{2}}\right)}\right)\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. associate-*r/72.4%

        \[\leadsto x1 + \left(\left(\left(\left(\left(2 \cdot x1 + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \left(3 + \left(2 \cdot \frac{x2}{x1 \cdot x1} - \left(\frac{1}{x1} + \color{blue}{\frac{3 \cdot 1}{{x1}^{2}}}\right)\right)\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) \]
      5. metadata-eval72.4%

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

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

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

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

    if -490 < x1 < 13.199999999999999

    1. Initial program 99.6%

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

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

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

    if 13.199999999999999 < x1 < 2.0999999999999999e113

    1. Initial program 94.8%

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

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

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

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

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

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

        \[\leadsto x1 + \left(\left(\left(\left(\left(2 \cdot x1 + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \left(3 + \left(2 \cdot \frac{x2}{x1 \cdot x1} - \color{blue}{\left(\frac{1}{x1} + 3 \cdot \frac{1}{{x1}^{2}}\right)}\right)\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. associate-*r/81.8%

        \[\leadsto x1 + \left(\left(\left(\left(\left(2 \cdot x1 + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \left(3 + \left(2 \cdot \frac{x2}{x1 \cdot x1} - \left(\frac{1}{x1} + \color{blue}{\frac{3 \cdot 1}{{x1}^{2}}}\right)\right)\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) \]
      5. metadata-eval81.8%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\ \;\;\;\;x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + 2 \cdot x2\right)\right)\right)\\ \mathbf{elif}\;x1 \leq -490:\\ \;\;\;\;x1 + \left(9 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(\left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 \cdot x1 + 1\right) \cdot \left(x1 \cdot 2 + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \left(3 + \left(2 \cdot \frac{x2}{x1 \cdot x1} + \left(\frac{-1}{x1} - \frac{3}{x1 \cdot x1}\right)\right)\right) - 6\right)\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 13.2:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(\left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 \cdot x1 + 1\right) \cdot \left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 2.1 \cdot 10^{+113}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(\left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \left(x2 + x2\right) + \left(x1 \cdot x1 + 1\right) \cdot \left(x1 \cdot 2 + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \left(3 + \left(2 \cdot \frac{x2}{x1 \cdot x1} + \left(\frac{-1}{x1} - \frac{3}{x1 \cdot x1}\right)\right)\right) - 6\right)\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + 2 \cdot x2\right)\right)\right)\\ \end{array} \]

Alternative 15: 83.5% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;x1 \leq -300:\\
\;\;\;\;x1 + \left(9 + \left(x1 + \left(t_5 + \left(t_4 + t_0 \cdot \left(x1 \cdot 2 + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \left(3 + \left(2 \cdot \frac{x2}{x1 \cdot x1} + \left(\frac{-1}{x1} - \frac{3}{x1 \cdot x1}\right)\right)\right) - 6\right)\right)\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 13.2:\\
\;\;\;\;x1 + \left(t_6 + \left(x1 + \left(t_5 + \left(t_4 + t_0 \cdot \left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 2.1 \cdot 10^{+113}:\\
\;\;\;\;x1 + \left(t_6 + \left(x1 + \left(t_5 + \left(t_2 \cdot \left(x2 + x2\right) + t_0 \cdot \left(x1 \cdot 2 + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t_3 - 6\right)\right)\right)\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x1 < -5.60000000000000037e102 or 2.0999999999999999e113 < x1

    1. Initial program 3.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. Taylor expanded in x1 around 0 2.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x1 + \color{blue}{\left(3 \cdot {x1}^{2}\right) \cdot \left(3 - -2 \cdot x2\right)} \]
      2. *-commutative75.7%

        \[\leadsto x1 + \color{blue}{\left({x1}^{2} \cdot 3\right)} \cdot \left(3 - -2 \cdot x2\right) \]
      3. unpow275.7%

        \[\leadsto x1 + \left(\color{blue}{\left(x1 \cdot x1\right)} \cdot 3\right) \cdot \left(3 - -2 \cdot x2\right) \]
      4. associate-*r*75.7%

        \[\leadsto x1 + \color{blue}{\left(x1 \cdot \left(x1 \cdot 3\right)\right)} \cdot \left(3 - -2 \cdot x2\right) \]
      5. *-commutative75.7%

        \[\leadsto x1 + \left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \left(3 - \color{blue}{x2 \cdot -2}\right) \]
      6. associate-*r*75.7%

        \[\leadsto x1 + \color{blue}{x1 \cdot \left(\left(x1 \cdot 3\right) \cdot \left(3 - x2 \cdot -2\right)\right)} \]
      7. associate-*l*75.7%

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

        \[\leadsto x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 - \color{blue}{-2 \cdot x2}\right)\right)\right) \]
      9. cancel-sign-sub-inv75.7%

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

        \[\leadsto x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + \color{blue}{2} \cdot x2\right)\right)\right) \]
      11. *-commutative75.7%

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

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

    if -5.60000000000000037e102 < x1 < -300

    1. Initial program 99.3%

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

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

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

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

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

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

        \[\leadsto x1 + \left(\left(\left(\left(\left(2 \cdot x1 + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \left(3 + \left(2 \cdot \frac{x2}{x1 \cdot x1} - \color{blue}{\left(\frac{1}{x1} + 3 \cdot \frac{1}{{x1}^{2}}\right)}\right)\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. associate-*r/72.4%

        \[\leadsto x1 + \left(\left(\left(\left(\left(2 \cdot x1 + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \left(3 + \left(2 \cdot \frac{x2}{x1 \cdot x1} - \left(\frac{1}{x1} + \color{blue}{\frac{3 \cdot 1}{{x1}^{2}}}\right)\right)\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) \]
      5. metadata-eval72.4%

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

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

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

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

    if -300 < x1 < 13.199999999999999

    1. Initial program 99.6%

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

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

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

    if 13.199999999999999 < x1 < 2.0999999999999999e113

    1. Initial program 94.8%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\ \;\;\;\;x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + 2 \cdot x2\right)\right)\right)\\ \mathbf{elif}\;x1 \leq -300:\\ \;\;\;\;x1 + \left(9 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(\left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 \cdot x1 + 1\right) \cdot \left(x1 \cdot 2 + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \left(3 + \left(2 \cdot \frac{x2}{x1 \cdot x1} + \left(\frac{-1}{x1} - \frac{3}{x1 \cdot x1}\right)\right)\right) - 6\right)\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 13.2:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(\left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 \cdot x1 + 1\right) \cdot \left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 2.1 \cdot 10^{+113}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(\left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \left(x2 + x2\right) + \left(x1 \cdot x1 + 1\right) \cdot \left(x1 \cdot 2 + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + 2 \cdot x2\right)\right)\right)\\ \end{array} \]

Alternative 16: 83.8% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 \cdot x1 + 1\\ t_1 := x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + 2 \cdot x2\right)\right)\right)\\ t_2 := x1 \cdot \left(x1 \cdot x1\right)\\ t_3 := x1 \cdot \left(x1 \cdot 3\right)\\ t_4 := t_3 \cdot \frac{\left(t_3 + 2 \cdot x2\right) - x1}{t_0}\\ t_5 := x1 + \left(9 + \left(x1 + \left(t_2 + \left(t_4 + t_0 \cdot \left(x1 \cdot 2 + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \left(3 + \left(2 \cdot \frac{x2}{x1 \cdot x1} + \left(\frac{-1}{x1} - \frac{3}{x1 \cdot x1}\right)\right)\right) - 6\right)\right)\right)\right)\right)\right)\\ \mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x1 \leq -60:\\ \;\;\;\;t_5\\ \mathbf{elif}\;x1 \leq 13.2:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(t_3 - 2 \cdot x2\right) - x1}{t_0} + \left(x1 + \left(t_2 + \left(t_4 + t_0 \cdot \left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 2.1 \cdot 10^{+113}:\\ \;\;\;\;t_5\\ \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 (* 3.0 (+ 3.0 (* 2.0 x2)))))))
        (t_2 (* x1 (* x1 x1)))
        (t_3 (* x1 (* x1 3.0)))
        (t_4 (* t_3 (/ (- (+ t_3 (* 2.0 x2)) x1) t_0)))
        (t_5
         (+
          x1
          (+
           9.0
           (+
            x1
            (+
             t_2
             (+
              t_4
              (*
               t_0
               (+
                (* x1 2.0)
                (*
                 (* x1 x1)
                 (-
                  (*
                   4.0
                   (+
                    3.0
                    (+
                     (* 2.0 (/ x2 (* x1 x1)))
                     (- (/ -1.0 x1) (/ 3.0 (* x1 x1))))))
                  6.0)))))))))))
   (if (<= x1 -5.6e+102)
     t_1
     (if (<= x1 -60.0)
       t_5
       (if (<= x1 13.2)
         (+
          x1
          (+
           (* 3.0 (/ (- (- t_3 (* 2.0 x2)) x1) t_0))
           (+
            x1
            (+ t_2 (+ t_4 (* t_0 (* 4.0 (* x2 (* x1 (- (* 2.0 x2) 3.0))))))))))
         (if (<= x1 2.1e+113) t_5 t_1))))))
double code(double x1, double x2) {
	double t_0 = (x1 * x1) + 1.0;
	double t_1 = x1 + (x1 * (x1 * (3.0 * (3.0 + (2.0 * x2)))));
	double t_2 = x1 * (x1 * x1);
	double t_3 = x1 * (x1 * 3.0);
	double t_4 = t_3 * (((t_3 + (2.0 * x2)) - x1) / t_0);
	double t_5 = x1 + (9.0 + (x1 + (t_2 + (t_4 + (t_0 * ((x1 * 2.0) + ((x1 * x1) * ((4.0 * (3.0 + ((2.0 * (x2 / (x1 * x1))) + ((-1.0 / x1) - (3.0 / (x1 * x1)))))) - 6.0))))))));
	double tmp;
	if (x1 <= -5.6e+102) {
		tmp = t_1;
	} else if (x1 <= -60.0) {
		tmp = t_5;
	} else if (x1 <= 13.2) {
		tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_0)) + (x1 + (t_2 + (t_4 + (t_0 * (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0)))))))));
	} else if (x1 <= 2.1e+113) {
		tmp = 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 * (3.0d0 * (3.0d0 + (2.0d0 * x2)))))
    t_2 = x1 * (x1 * x1)
    t_3 = x1 * (x1 * 3.0d0)
    t_4 = t_3 * (((t_3 + (2.0d0 * x2)) - x1) / t_0)
    t_5 = x1 + (9.0d0 + (x1 + (t_2 + (t_4 + (t_0 * ((x1 * 2.0d0) + ((x1 * x1) * ((4.0d0 * (3.0d0 + ((2.0d0 * (x2 / (x1 * x1))) + (((-1.0d0) / x1) - (3.0d0 / (x1 * x1)))))) - 6.0d0))))))))
    if (x1 <= (-5.6d+102)) then
        tmp = t_1
    else if (x1 <= (-60.0d0)) then
        tmp = t_5
    else if (x1 <= 13.2d0) then
        tmp = x1 + ((3.0d0 * (((t_3 - (2.0d0 * x2)) - x1) / t_0)) + (x1 + (t_2 + (t_4 + (t_0 * (4.0d0 * (x2 * (x1 * ((2.0d0 * x2) - 3.0d0)))))))))
    else if (x1 <= 2.1d+113) then
        tmp = 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 * (3.0 * (3.0 + (2.0 * x2)))));
	double t_2 = x1 * (x1 * x1);
	double t_3 = x1 * (x1 * 3.0);
	double t_4 = t_3 * (((t_3 + (2.0 * x2)) - x1) / t_0);
	double t_5 = x1 + (9.0 + (x1 + (t_2 + (t_4 + (t_0 * ((x1 * 2.0) + ((x1 * x1) * ((4.0 * (3.0 + ((2.0 * (x2 / (x1 * x1))) + ((-1.0 / x1) - (3.0 / (x1 * x1)))))) - 6.0))))))));
	double tmp;
	if (x1 <= -5.6e+102) {
		tmp = t_1;
	} else if (x1 <= -60.0) {
		tmp = t_5;
	} else if (x1 <= 13.2) {
		tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_0)) + (x1 + (t_2 + (t_4 + (t_0 * (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0)))))))));
	} else if (x1 <= 2.1e+113) {
		tmp = t_5;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x1, x2):
	t_0 = (x1 * x1) + 1.0
	t_1 = x1 + (x1 * (x1 * (3.0 * (3.0 + (2.0 * x2)))))
	t_2 = x1 * (x1 * x1)
	t_3 = x1 * (x1 * 3.0)
	t_4 = t_3 * (((t_3 + (2.0 * x2)) - x1) / t_0)
	t_5 = x1 + (9.0 + (x1 + (t_2 + (t_4 + (t_0 * ((x1 * 2.0) + ((x1 * x1) * ((4.0 * (3.0 + ((2.0 * (x2 / (x1 * x1))) + ((-1.0 / x1) - (3.0 / (x1 * x1)))))) - 6.0))))))))
	tmp = 0
	if x1 <= -5.6e+102:
		tmp = t_1
	elif x1 <= -60.0:
		tmp = t_5
	elif x1 <= 13.2:
		tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_0)) + (x1 + (t_2 + (t_4 + (t_0 * (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0)))))))))
	elif x1 <= 2.1e+113:
		tmp = 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(x1 * Float64(3.0 * Float64(3.0 + Float64(2.0 * x2))))))
	t_2 = Float64(x1 * Float64(x1 * x1))
	t_3 = Float64(x1 * Float64(x1 * 3.0))
	t_4 = Float64(t_3 * Float64(Float64(Float64(t_3 + Float64(2.0 * x2)) - x1) / t_0))
	t_5 = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(t_2 + Float64(t_4 + Float64(t_0 * Float64(Float64(x1 * 2.0) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * Float64(3.0 + Float64(Float64(2.0 * Float64(x2 / Float64(x1 * x1))) + Float64(Float64(-1.0 / x1) - Float64(3.0 / Float64(x1 * x1)))))) - 6.0)))))))))
	tmp = 0.0
	if (x1 <= -5.6e+102)
		tmp = t_1;
	elseif (x1 <= -60.0)
		tmp = t_5;
	elseif (x1 <= 13.2)
		tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_3 - Float64(2.0 * x2)) - x1) / t_0)) + Float64(x1 + Float64(t_2 + Float64(t_4 + Float64(t_0 * Float64(4.0 * Float64(x2 * Float64(x1 * Float64(Float64(2.0 * x2) - 3.0))))))))));
	elseif (x1 <= 2.1e+113)
		tmp = 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 * (3.0 * (3.0 + (2.0 * x2)))));
	t_2 = x1 * (x1 * x1);
	t_3 = x1 * (x1 * 3.0);
	t_4 = t_3 * (((t_3 + (2.0 * x2)) - x1) / t_0);
	t_5 = x1 + (9.0 + (x1 + (t_2 + (t_4 + (t_0 * ((x1 * 2.0) + ((x1 * x1) * ((4.0 * (3.0 + ((2.0 * (x2 / (x1 * x1))) + ((-1.0 / x1) - (3.0 / (x1 * x1)))))) - 6.0))))))));
	tmp = 0.0;
	if (x1 <= -5.6e+102)
		tmp = t_1;
	elseif (x1 <= -60.0)
		tmp = t_5;
	elseif (x1 <= 13.2)
		tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_0)) + (x1 + (t_2 + (t_4 + (t_0 * (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0)))))))));
	elseif (x1 <= 2.1e+113)
		tmp = 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[(x1 * N[(3.0 * N[(3.0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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[(t$95$3 * N[(N[(N[(t$95$3 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(x1 + N[(9.0 + N[(x1 + N[(t$95$2 + N[(t$95$4 + N[(t$95$0 * N[(N[(x1 * 2.0), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * N[(3.0 + N[(N[(2.0 * N[(x2 / N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(-1.0 / x1), $MachinePrecision] - N[(3.0 / N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], t$95$1, If[LessEqual[x1, -60.0], t$95$5, If[LessEqual[x1, 13.2], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$3 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(t$95$2 + N[(t$95$4 + N[(t$95$0 * N[(4.0 * N[(x2 * N[(x1 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2.1e+113], t$95$5, t$95$1]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x1 \leq -60:\\
\;\;\;\;t_5\\

\mathbf{elif}\;x1 \leq 13.2:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_3 - 2 \cdot x2\right) - x1}{t_0} + \left(x1 + \left(t_2 + \left(t_4 + t_0 \cdot \left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 2.1 \cdot 10^{+113}:\\
\;\;\;\;t_5\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x1 < -5.60000000000000037e102 or 2.0999999999999999e113 < x1

    1. Initial program 3.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. Taylor expanded in x1 around 0 2.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x1 + \color{blue}{\left(3 \cdot {x1}^{2}\right) \cdot \left(3 - -2 \cdot x2\right)} \]
      2. *-commutative75.7%

        \[\leadsto x1 + \color{blue}{\left({x1}^{2} \cdot 3\right)} \cdot \left(3 - -2 \cdot x2\right) \]
      3. unpow275.7%

        \[\leadsto x1 + \left(\color{blue}{\left(x1 \cdot x1\right)} \cdot 3\right) \cdot \left(3 - -2 \cdot x2\right) \]
      4. associate-*r*75.7%

        \[\leadsto x1 + \color{blue}{\left(x1 \cdot \left(x1 \cdot 3\right)\right)} \cdot \left(3 - -2 \cdot x2\right) \]
      5. *-commutative75.7%

        \[\leadsto x1 + \left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \left(3 - \color{blue}{x2 \cdot -2}\right) \]
      6. associate-*r*75.7%

        \[\leadsto x1 + \color{blue}{x1 \cdot \left(\left(x1 \cdot 3\right) \cdot \left(3 - x2 \cdot -2\right)\right)} \]
      7. associate-*l*75.7%

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

        \[\leadsto x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 - \color{blue}{-2 \cdot x2}\right)\right)\right) \]
      9. cancel-sign-sub-inv75.7%

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

        \[\leadsto x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + \color{blue}{2} \cdot x2\right)\right)\right) \]
      11. *-commutative75.7%

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

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

    if -5.60000000000000037e102 < x1 < -60 or 13.199999999999999 < x1 < 2.0999999999999999e113

    1. Initial program 97.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. Taylor expanded in x1 around 0 81.5%

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

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

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

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

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

        \[\leadsto x1 + \left(\left(\left(\left(\left(2 \cdot x1 + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \left(3 + \left(2 \cdot \frac{x2}{x1 \cdot x1} - \color{blue}{\left(\frac{1}{x1} + 3 \cdot \frac{1}{{x1}^{2}}\right)}\right)\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. associate-*r/76.9%

        \[\leadsto x1 + \left(\left(\left(\left(\left(2 \cdot x1 + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \left(3 + \left(2 \cdot \frac{x2}{x1 \cdot x1} - \left(\frac{1}{x1} + \color{blue}{\frac{3 \cdot 1}{{x1}^{2}}}\right)\right)\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) \]
      5. metadata-eval76.9%

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

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

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

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

    if -60 < x1 < 13.199999999999999

    1. Initial program 99.6%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\ \;\;\;\;x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + 2 \cdot x2\right)\right)\right)\\ \mathbf{elif}\;x1 \leq -60:\\ \;\;\;\;x1 + \left(9 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(\left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 \cdot x1 + 1\right) \cdot \left(x1 \cdot 2 + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \left(3 + \left(2 \cdot \frac{x2}{x1 \cdot x1} + \left(\frac{-1}{x1} - \frac{3}{x1 \cdot x1}\right)\right)\right) - 6\right)\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 13.2:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(\left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 \cdot x1 + 1\right) \cdot \left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 2.1 \cdot 10^{+113}:\\ \;\;\;\;x1 + \left(9 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(\left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 \cdot x1 + 1\right) \cdot \left(x1 \cdot 2 + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \left(3 + \left(2 \cdot \frac{x2}{x1 \cdot x1} + \left(\frac{-1}{x1} - \frac{3}{x1 \cdot x1}\right)\right)\right) - 6\right)\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + 2 \cdot x2\right)\right)\right)\\ \end{array} \]

Alternative 17: 83.8% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 \cdot x1 + 1\\ t_1 := x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + 2 \cdot x2\right)\right)\right)\\ t_2 := x1 \cdot \left(x1 \cdot x1\right)\\ t_3 := x1 \cdot \left(x1 \cdot 3\right)\\ t_4 := \frac{\left(t_3 + 2 \cdot x2\right) - x1}{t_0}\\ t_5 := t_3 \cdot t_4\\ t_6 := x1 + \left(9 + \left(x1 + \left(t_2 + \left(t_5 + t_0 \cdot \left(x1 \cdot 2 + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t_4 - 6\right)\right)\right)\right)\right)\right)\\ \mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x1 \leq -430:\\ \;\;\;\;t_6\\ \mathbf{elif}\;x1 \leq 13.2:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(t_3 - 2 \cdot x2\right) - x1}{t_0} + \left(x1 + \left(t_2 + \left(t_5 + t_0 \cdot \left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 2.1 \cdot 10^{+113}:\\ \;\;\;\;t_6\\ \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 (* 3.0 (+ 3.0 (* 2.0 x2)))))))
        (t_2 (* x1 (* x1 x1)))
        (t_3 (* x1 (* x1 3.0)))
        (t_4 (/ (- (+ t_3 (* 2.0 x2)) x1) t_0))
        (t_5 (* t_3 t_4))
        (t_6
         (+
          x1
          (+
           9.0
           (+
            x1
            (+
             t_2
             (+
              t_5
              (* t_0 (+ (* x1 2.0) (* (* x1 x1) (- (* 4.0 t_4) 6.0)))))))))))
   (if (<= x1 -5.6e+102)
     t_1
     (if (<= x1 -430.0)
       t_6
       (if (<= x1 13.2)
         (+
          x1
          (+
           (* 3.0 (/ (- (- t_3 (* 2.0 x2)) x1) t_0))
           (+
            x1
            (+ t_2 (+ t_5 (* t_0 (* 4.0 (* x2 (* x1 (- (* 2.0 x2) 3.0))))))))))
         (if (<= x1 2.1e+113) t_6 t_1))))))
double code(double x1, double x2) {
	double t_0 = (x1 * x1) + 1.0;
	double t_1 = x1 + (x1 * (x1 * (3.0 * (3.0 + (2.0 * x2)))));
	double t_2 = x1 * (x1 * x1);
	double t_3 = x1 * (x1 * 3.0);
	double t_4 = ((t_3 + (2.0 * x2)) - x1) / t_0;
	double t_5 = t_3 * t_4;
	double t_6 = x1 + (9.0 + (x1 + (t_2 + (t_5 + (t_0 * ((x1 * 2.0) + ((x1 * x1) * ((4.0 * t_4) - 6.0))))))));
	double tmp;
	if (x1 <= -5.6e+102) {
		tmp = t_1;
	} else if (x1 <= -430.0) {
		tmp = t_6;
	} else if (x1 <= 13.2) {
		tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_0)) + (x1 + (t_2 + (t_5 + (t_0 * (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0)))))))));
	} else if (x1 <= 2.1e+113) {
		tmp = t_6;
	} 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) :: t_6
    real(8) :: tmp
    t_0 = (x1 * x1) + 1.0d0
    t_1 = x1 + (x1 * (x1 * (3.0d0 * (3.0d0 + (2.0d0 * x2)))))
    t_2 = x1 * (x1 * x1)
    t_3 = x1 * (x1 * 3.0d0)
    t_4 = ((t_3 + (2.0d0 * x2)) - x1) / t_0
    t_5 = t_3 * t_4
    t_6 = x1 + (9.0d0 + (x1 + (t_2 + (t_5 + (t_0 * ((x1 * 2.0d0) + ((x1 * x1) * ((4.0d0 * t_4) - 6.0d0))))))))
    if (x1 <= (-5.6d+102)) then
        tmp = t_1
    else if (x1 <= (-430.0d0)) then
        tmp = t_6
    else if (x1 <= 13.2d0) then
        tmp = x1 + ((3.0d0 * (((t_3 - (2.0d0 * x2)) - x1) / t_0)) + (x1 + (t_2 + (t_5 + (t_0 * (4.0d0 * (x2 * (x1 * ((2.0d0 * x2) - 3.0d0)))))))))
    else if (x1 <= 2.1d+113) then
        tmp = t_6
    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 * (3.0 * (3.0 + (2.0 * x2)))));
	double t_2 = x1 * (x1 * x1);
	double t_3 = x1 * (x1 * 3.0);
	double t_4 = ((t_3 + (2.0 * x2)) - x1) / t_0;
	double t_5 = t_3 * t_4;
	double t_6 = x1 + (9.0 + (x1 + (t_2 + (t_5 + (t_0 * ((x1 * 2.0) + ((x1 * x1) * ((4.0 * t_4) - 6.0))))))));
	double tmp;
	if (x1 <= -5.6e+102) {
		tmp = t_1;
	} else if (x1 <= -430.0) {
		tmp = t_6;
	} else if (x1 <= 13.2) {
		tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_0)) + (x1 + (t_2 + (t_5 + (t_0 * (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0)))))))));
	} else if (x1 <= 2.1e+113) {
		tmp = t_6;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x1, x2):
	t_0 = (x1 * x1) + 1.0
	t_1 = x1 + (x1 * (x1 * (3.0 * (3.0 + (2.0 * x2)))))
	t_2 = x1 * (x1 * x1)
	t_3 = x1 * (x1 * 3.0)
	t_4 = ((t_3 + (2.0 * x2)) - x1) / t_0
	t_5 = t_3 * t_4
	t_6 = x1 + (9.0 + (x1 + (t_2 + (t_5 + (t_0 * ((x1 * 2.0) + ((x1 * x1) * ((4.0 * t_4) - 6.0))))))))
	tmp = 0
	if x1 <= -5.6e+102:
		tmp = t_1
	elif x1 <= -430.0:
		tmp = t_6
	elif x1 <= 13.2:
		tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_0)) + (x1 + (t_2 + (t_5 + (t_0 * (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0)))))))))
	elif x1 <= 2.1e+113:
		tmp = t_6
	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(x1 * Float64(3.0 * Float64(3.0 + Float64(2.0 * x2))))))
	t_2 = Float64(x1 * Float64(x1 * x1))
	t_3 = Float64(x1 * Float64(x1 * 3.0))
	t_4 = Float64(Float64(Float64(t_3 + Float64(2.0 * x2)) - x1) / t_0)
	t_5 = Float64(t_3 * t_4)
	t_6 = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(t_2 + Float64(t_5 + Float64(t_0 * Float64(Float64(x1 * 2.0) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_4) - 6.0)))))))))
	tmp = 0.0
	if (x1 <= -5.6e+102)
		tmp = t_1;
	elseif (x1 <= -430.0)
		tmp = t_6;
	elseif (x1 <= 13.2)
		tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_3 - Float64(2.0 * x2)) - x1) / t_0)) + Float64(x1 + Float64(t_2 + Float64(t_5 + Float64(t_0 * Float64(4.0 * Float64(x2 * Float64(x1 * Float64(Float64(2.0 * x2) - 3.0))))))))));
	elseif (x1 <= 2.1e+113)
		tmp = t_6;
	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 * (3.0 * (3.0 + (2.0 * x2)))));
	t_2 = x1 * (x1 * x1);
	t_3 = x1 * (x1 * 3.0);
	t_4 = ((t_3 + (2.0 * x2)) - x1) / t_0;
	t_5 = t_3 * t_4;
	t_6 = x1 + (9.0 + (x1 + (t_2 + (t_5 + (t_0 * ((x1 * 2.0) + ((x1 * x1) * ((4.0 * t_4) - 6.0))))))));
	tmp = 0.0;
	if (x1 <= -5.6e+102)
		tmp = t_1;
	elseif (x1 <= -430.0)
		tmp = t_6;
	elseif (x1 <= 13.2)
		tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_0)) + (x1 + (t_2 + (t_5 + (t_0 * (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0)))))))));
	elseif (x1 <= 2.1e+113)
		tmp = t_6;
	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[(x1 * N[(3.0 * N[(3.0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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[(N[(t$95$3 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$3 * t$95$4), $MachinePrecision]}, Block[{t$95$6 = N[(x1 + N[(9.0 + N[(x1 + N[(t$95$2 + N[(t$95$5 + N[(t$95$0 * N[(N[(x1 * 2.0), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$4), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], t$95$1, If[LessEqual[x1, -430.0], t$95$6, If[LessEqual[x1, 13.2], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$3 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(t$95$2 + N[(t$95$5 + N[(t$95$0 * N[(4.0 * N[(x2 * N[(x1 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2.1e+113], t$95$6, t$95$1]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x1 \leq -430:\\
\;\;\;\;t_6\\

\mathbf{elif}\;x1 \leq 13.2:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_3 - 2 \cdot x2\right) - x1}{t_0} + \left(x1 + \left(t_2 + \left(t_5 + t_0 \cdot \left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 2.1 \cdot 10^{+113}:\\
\;\;\;\;t_6\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x1 < -5.60000000000000037e102 or 2.0999999999999999e113 < x1

    1. Initial program 3.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. Taylor expanded in x1 around 0 2.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x1 + \color{blue}{\left(3 \cdot {x1}^{2}\right) \cdot \left(3 - -2 \cdot x2\right)} \]
      2. *-commutative75.7%

        \[\leadsto x1 + \color{blue}{\left({x1}^{2} \cdot 3\right)} \cdot \left(3 - -2 \cdot x2\right) \]
      3. unpow275.7%

        \[\leadsto x1 + \left(\color{blue}{\left(x1 \cdot x1\right)} \cdot 3\right) \cdot \left(3 - -2 \cdot x2\right) \]
      4. associate-*r*75.7%

        \[\leadsto x1 + \color{blue}{\left(x1 \cdot \left(x1 \cdot 3\right)\right)} \cdot \left(3 - -2 \cdot x2\right) \]
      5. *-commutative75.7%

        \[\leadsto x1 + \left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \left(3 - \color{blue}{x2 \cdot -2}\right) \]
      6. associate-*r*75.7%

        \[\leadsto x1 + \color{blue}{x1 \cdot \left(\left(x1 \cdot 3\right) \cdot \left(3 - x2 \cdot -2\right)\right)} \]
      7. associate-*l*75.7%

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

        \[\leadsto x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 - \color{blue}{-2 \cdot x2}\right)\right)\right) \]
      9. cancel-sign-sub-inv75.7%

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

        \[\leadsto x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + \color{blue}{2} \cdot x2\right)\right)\right) \]
      11. *-commutative75.7%

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

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

    if -5.60000000000000037e102 < x1 < -430 or 13.199999999999999 < x1 < 2.0999999999999999e113

    1. Initial program 97.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. Taylor expanded in x1 around 0 81.5%

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

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

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

    if -430 < x1 < 13.199999999999999

    1. Initial program 99.6%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\ \;\;\;\;x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + 2 \cdot x2\right)\right)\right)\\ \mathbf{elif}\;x1 \leq -430:\\ \;\;\;\;x1 + \left(9 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(\left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 \cdot x1 + 1\right) \cdot \left(x1 \cdot 2 + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 13.2:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(\left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 \cdot x1 + 1\right) \cdot \left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 2.1 \cdot 10^{+113}:\\ \;\;\;\;x1 + \left(9 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(\left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 \cdot x1 + 1\right) \cdot \left(x1 \cdot 2 + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + 2 \cdot x2\right)\right)\right)\\ \end{array} \]

Alternative 18: 82.0% accurate, 1.6× speedup?

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

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

\mathbf{elif}\;x1 \leq -195:\\
\;\;\;\;t_6\\

\mathbf{elif}\;x1 \leq 13.2:\\
\;\;\;\;x1 + \left(t_4 + \left(x1 + \left(t_5 + \left(t_3 + t_2 \cdot \left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 2.1 \cdot 10^{+113}:\\
\;\;\;\;t_6\\

\mathbf{else}:\\
\;\;\;\;t_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x1 < -5.60000000000000037e102 or 2.0999999999999999e113 < x1

    1. Initial program 3.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. Taylor expanded in x1 around 0 2.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x1 + \color{blue}{\left(3 \cdot {x1}^{2}\right) \cdot \left(3 - -2 \cdot x2\right)} \]
      2. *-commutative75.7%

        \[\leadsto x1 + \color{blue}{\left({x1}^{2} \cdot 3\right)} \cdot \left(3 - -2 \cdot x2\right) \]
      3. unpow275.7%

        \[\leadsto x1 + \left(\color{blue}{\left(x1 \cdot x1\right)} \cdot 3\right) \cdot \left(3 - -2 \cdot x2\right) \]
      4. associate-*r*75.7%

        \[\leadsto x1 + \color{blue}{\left(x1 \cdot \left(x1 \cdot 3\right)\right)} \cdot \left(3 - -2 \cdot x2\right) \]
      5. *-commutative75.7%

        \[\leadsto x1 + \left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \left(3 - \color{blue}{x2 \cdot -2}\right) \]
      6. associate-*r*75.7%

        \[\leadsto x1 + \color{blue}{x1 \cdot \left(\left(x1 \cdot 3\right) \cdot \left(3 - x2 \cdot -2\right)\right)} \]
      7. associate-*l*75.7%

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

        \[\leadsto x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 - \color{blue}{-2 \cdot x2}\right)\right)\right) \]
      9. cancel-sign-sub-inv75.7%

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

        \[\leadsto x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + \color{blue}{2} \cdot x2\right)\right)\right) \]
      11. *-commutative75.7%

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

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

    if -5.60000000000000037e102 < x1 < -195 or 13.199999999999999 < x1 < 2.0999999999999999e113

    1. Initial program 97.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. Taylor expanded in x1 around 0 77.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(\color{blue}{2 \cdot x2} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    3. Step-by-step derivation
      1. count-277.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(\color{blue}{\left(x2 + x2\right)} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\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. Simplified77.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(\color{blue}{\left(x2 + x2\right)} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\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 64.1%

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

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

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

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

    1. Initial program 99.6%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\ \;\;\;\;x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + 2 \cdot x2\right)\right)\right)\\ \mathbf{elif}\;x1 \leq -195:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(\left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 \cdot x1 + 1\right) \cdot \left(\left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 13.2:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(\left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 \cdot x1 + 1\right) \cdot \left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 2.1 \cdot 10^{+113}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(\left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 \cdot x1 + 1\right) \cdot \left(\left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + 2 \cdot x2\right)\right)\right)\\ \end{array} \]

Alternative 19: 82.0% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + 2 \cdot x2\right)\right)\right)\\ t_1 := x1 \cdot \left(x1 \cdot 3\right)\\ t_2 := x1 \cdot x1 + 1\\ t_3 := 3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_2}\\ t_4 := x1 + \left(t_3 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_1 \cdot \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_2} + t_2 \cdot \left(\left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\ \mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x1 \leq -480:\\ \;\;\;\;t_4\\ \mathbf{elif}\;x1 \leq 13.2:\\ \;\;\;\;x1 + \left(t_3 + \left(x1 + x2 \cdot \left(8 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 2.1 \cdot 10^{+113}:\\ \;\;\;\;t_4\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (+ x1 (* x1 (* x1 (* 3.0 (+ 3.0 (* 2.0 x2)))))))
        (t_1 (* x1 (* x1 3.0)))
        (t_2 (+ (* x1 x1) 1.0))
        (t_3 (* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2)))
        (t_4
         (+
          x1
          (+
           t_3
           (+
            x1
            (+
             (* x1 (* x1 x1))
             (+
              (* t_1 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2))
              (* t_2 (* (* x1 x1) 6.0)))))))))
   (if (<= x1 -5.6e+102)
     t_0
     (if (<= x1 -480.0)
       t_4
       (if (<= x1 13.2)
         (+ x1 (+ t_3 (+ x1 (* x2 (* 8.0 (* x1 x2))))))
         (if (<= x1 2.1e+113) t_4 t_0))))))
double code(double x1, double x2) {
	double t_0 = x1 + (x1 * (x1 * (3.0 * (3.0 + (2.0 * x2)))));
	double t_1 = x1 * (x1 * 3.0);
	double t_2 = (x1 * x1) + 1.0;
	double t_3 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2);
	double t_4 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_1 + (2.0 * x2)) - x1) / t_2)) + (t_2 * ((x1 * x1) * 6.0))))));
	double tmp;
	if (x1 <= -5.6e+102) {
		tmp = t_0;
	} else if (x1 <= -480.0) {
		tmp = t_4;
	} else if (x1 <= 13.2) {
		tmp = x1 + (t_3 + (x1 + (x2 * (8.0 * (x1 * x2)))));
	} else if (x1 <= 2.1e+113) {
		tmp = t_4;
	} 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 * (3.0d0 * (3.0d0 + (2.0d0 * x2)))))
    t_1 = x1 * (x1 * 3.0d0)
    t_2 = (x1 * x1) + 1.0d0
    t_3 = 3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_2)
    t_4 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_1 + (2.0d0 * x2)) - x1) / t_2)) + (t_2 * ((x1 * x1) * 6.0d0))))))
    if (x1 <= (-5.6d+102)) then
        tmp = t_0
    else if (x1 <= (-480.0d0)) then
        tmp = t_4
    else if (x1 <= 13.2d0) then
        tmp = x1 + (t_3 + (x1 + (x2 * (8.0d0 * (x1 * x2)))))
    else if (x1 <= 2.1d+113) then
        tmp = t_4
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double t_0 = x1 + (x1 * (x1 * (3.0 * (3.0 + (2.0 * x2)))));
	double t_1 = x1 * (x1 * 3.0);
	double t_2 = (x1 * x1) + 1.0;
	double t_3 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2);
	double t_4 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_1 + (2.0 * x2)) - x1) / t_2)) + (t_2 * ((x1 * x1) * 6.0))))));
	double tmp;
	if (x1 <= -5.6e+102) {
		tmp = t_0;
	} else if (x1 <= -480.0) {
		tmp = t_4;
	} else if (x1 <= 13.2) {
		tmp = x1 + (t_3 + (x1 + (x2 * (8.0 * (x1 * x2)))));
	} else if (x1 <= 2.1e+113) {
		tmp = t_4;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x1, x2):
	t_0 = x1 + (x1 * (x1 * (3.0 * (3.0 + (2.0 * x2)))))
	t_1 = x1 * (x1 * 3.0)
	t_2 = (x1 * x1) + 1.0
	t_3 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)
	t_4 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_1 + (2.0 * x2)) - x1) / t_2)) + (t_2 * ((x1 * x1) * 6.0))))))
	tmp = 0
	if x1 <= -5.6e+102:
		tmp = t_0
	elif x1 <= -480.0:
		tmp = t_4
	elif x1 <= 13.2:
		tmp = x1 + (t_3 + (x1 + (x2 * (8.0 * (x1 * x2)))))
	elif x1 <= 2.1e+113:
		tmp = t_4
	else:
		tmp = t_0
	return tmp
function code(x1, x2)
	t_0 = Float64(x1 + Float64(x1 * Float64(x1 * Float64(3.0 * Float64(3.0 + Float64(2.0 * x2))))))
	t_1 = Float64(x1 * Float64(x1 * 3.0))
	t_2 = Float64(Float64(x1 * x1) + 1.0)
	t_3 = Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2))
	t_4 = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_1 * Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2)) + Float64(t_2 * Float64(Float64(x1 * x1) * 6.0)))))))
	tmp = 0.0
	if (x1 <= -5.6e+102)
		tmp = t_0;
	elseif (x1 <= -480.0)
		tmp = t_4;
	elseif (x1 <= 13.2)
		tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(x2 * Float64(8.0 * Float64(x1 * x2))))));
	elseif (x1 <= 2.1e+113)
		tmp = t_4;
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	t_0 = x1 + (x1 * (x1 * (3.0 * (3.0 + (2.0 * x2)))));
	t_1 = x1 * (x1 * 3.0);
	t_2 = (x1 * x1) + 1.0;
	t_3 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2);
	t_4 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_1 + (2.0 * x2)) - x1) / t_2)) + (t_2 * ((x1 * x1) * 6.0))))));
	tmp = 0.0;
	if (x1 <= -5.6e+102)
		tmp = t_0;
	elseif (x1 <= -480.0)
		tmp = t_4;
	elseif (x1 <= 13.2)
		tmp = x1 + (t_3 + (x1 + (x2 * (8.0 * (x1 * x2)))));
	elseif (x1 <= 2.1e+113)
		tmp = t_4;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(x1 * N[(x1 * N[(3.0 * N[(3.0 + N[(2.0 * x2), $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[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(t$95$3 + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 * N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 * N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], t$95$0, If[LessEqual[x1, -480.0], t$95$4, If[LessEqual[x1, 13.2], N[(x1 + N[(t$95$3 + N[(x1 + N[(x2 * N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2.1e+113], t$95$4, t$95$0]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x1 \leq -480:\\
\;\;\;\;t_4\\

\mathbf{elif}\;x1 \leq 13.2:\\
\;\;\;\;x1 + \left(t_3 + \left(x1 + x2 \cdot \left(8 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 2.1 \cdot 10^{+113}:\\
\;\;\;\;t_4\\

\mathbf{else}:\\
\;\;\;\;t_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x1 < -5.60000000000000037e102 or 2.0999999999999999e113 < x1

    1. Initial program 3.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. Taylor expanded in x1 around 0 2.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x1 + \color{blue}{\left(3 \cdot {x1}^{2}\right) \cdot \left(3 - -2 \cdot x2\right)} \]
      2. *-commutative75.7%

        \[\leadsto x1 + \color{blue}{\left({x1}^{2} \cdot 3\right)} \cdot \left(3 - -2 \cdot x2\right) \]
      3. unpow275.7%

        \[\leadsto x1 + \left(\color{blue}{\left(x1 \cdot x1\right)} \cdot 3\right) \cdot \left(3 - -2 \cdot x2\right) \]
      4. associate-*r*75.7%

        \[\leadsto x1 + \color{blue}{\left(x1 \cdot \left(x1 \cdot 3\right)\right)} \cdot \left(3 - -2 \cdot x2\right) \]
      5. *-commutative75.7%

        \[\leadsto x1 + \left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \left(3 - \color{blue}{x2 \cdot -2}\right) \]
      6. associate-*r*75.7%

        \[\leadsto x1 + \color{blue}{x1 \cdot \left(\left(x1 \cdot 3\right) \cdot \left(3 - x2 \cdot -2\right)\right)} \]
      7. associate-*l*75.7%

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

        \[\leadsto x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 - \color{blue}{-2 \cdot x2}\right)\right)\right) \]
      9. cancel-sign-sub-inv75.7%

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

        \[\leadsto x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + \color{blue}{2} \cdot x2\right)\right)\right) \]
      11. *-commutative75.7%

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

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

    if -5.60000000000000037e102 < x1 < -480 or 13.199999999999999 < x1 < 2.0999999999999999e113

    1. Initial program 97.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. Taylor expanded in x1 around 0 77.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(\color{blue}{2 \cdot x2} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    3. Step-by-step derivation
      1. count-277.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(\color{blue}{\left(x2 + x2\right)} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\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. Simplified77.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(\color{blue}{\left(x2 + x2\right)} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\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 64.1%

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

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

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

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

    1. Initial program 99.6%

      \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    2. Taylor expanded in x1 around 0 98.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(\color{blue}{2 \cdot x2} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    3. Step-by-step derivation
      1. count-298.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(\color{blue}{\left(x2 + x2\right)} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\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. Simplified98.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(\color{blue}{\left(x2 + x2\right)} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\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 x2 around inf 87.2%

      \[\leadsto x1 + \left(\left(\color{blue}{8 \cdot \left({x2}^{2} \cdot x1\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. Step-by-step derivation
      1. unpow287.2%

        \[\leadsto x1 + \left(\left(8 \cdot \left(\color{blue}{\left(x2 \cdot x2\right)} \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
      2. associate-*r*98.9%

        \[\leadsto x1 + \left(\left(8 \cdot \color{blue}{\left(x2 \cdot \left(x2 \cdot x1\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) \]
      3. *-commutative98.9%

        \[\leadsto x1 + \left(\left(8 \cdot \left(x2 \cdot \color{blue}{\left(x1 \cdot x2\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) \]
      4. associate-*r*98.9%

        \[\leadsto x1 + \left(\left(\color{blue}{\left(8 \cdot x2\right) \cdot \left(x1 \cdot x2\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. *-commutative98.9%

        \[\leadsto x1 + \left(\left(\color{blue}{\left(x2 \cdot 8\right)} \cdot \left(x1 \cdot x2\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. associate-*l*98.9%

        \[\leadsto x1 + \left(\left(\color{blue}{x2 \cdot \left(8 \cdot \left(x1 \cdot x2\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) \]
      7. *-commutative98.9%

        \[\leadsto x1 + \left(\left(x2 \cdot \left(8 \cdot \color{blue}{\left(x2 \cdot x1\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) \]
    7. Simplified98.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\ \;\;\;\;x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + 2 \cdot x2\right)\right)\right)\\ \mathbf{elif}\;x1 \leq -480:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(\left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 \cdot x1 + 1\right) \cdot \left(\left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 13.2:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + x2 \cdot \left(8 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 2.1 \cdot 10^{+113}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(\left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 \cdot x1 + 1\right) \cdot \left(\left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + 2 \cdot x2\right)\right)\right)\\ \end{array} \]

Alternative 20: 75.0% accurate, 3.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -6 \cdot 10^{+60} \lor \neg \left(x1 \leq 1.02 \cdot 10^{+76}\right):\\
\;\;\;\;x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + 2 \cdot x2\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x1 < -5.9999999999999997e60 or 1.02000000000000007e76 < x1

    1. Initial program 18.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. Taylor expanded in x1 around 0 3.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x1 + \color{blue}{\left(3 \cdot {x1}^{2}\right) \cdot \left(3 - -2 \cdot x2\right)} \]
      2. *-commutative67.0%

        \[\leadsto x1 + \color{blue}{\left({x1}^{2} \cdot 3\right)} \cdot \left(3 - -2 \cdot x2\right) \]
      3. unpow267.0%

        \[\leadsto x1 + \left(\color{blue}{\left(x1 \cdot x1\right)} \cdot 3\right) \cdot \left(3 - -2 \cdot x2\right) \]
      4. associate-*r*67.0%

        \[\leadsto x1 + \color{blue}{\left(x1 \cdot \left(x1 \cdot 3\right)\right)} \cdot \left(3 - -2 \cdot x2\right) \]
      5. *-commutative67.0%

        \[\leadsto x1 + \left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \left(3 - \color{blue}{x2 \cdot -2}\right) \]
      6. associate-*r*67.0%

        \[\leadsto x1 + \color{blue}{x1 \cdot \left(\left(x1 \cdot 3\right) \cdot \left(3 - x2 \cdot -2\right)\right)} \]
      7. associate-*l*67.0%

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

        \[\leadsto x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 - \color{blue}{-2 \cdot x2}\right)\right)\right) \]
      9. cancel-sign-sub-inv67.0%

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

        \[\leadsto x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + \color{blue}{2} \cdot x2\right)\right)\right) \]
      11. *-commutative67.0%

        \[\leadsto x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + \color{blue}{x2 \cdot 2}\right)\right)\right) \]
    8. Simplified67.0%

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

    if -5.9999999999999997e60 < x1 < 1.02000000000000007e76

    1. Initial program 99.5%

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

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

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

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

      \[\leadsto x1 + \left(\left(\color{blue}{8 \cdot \left({x2}^{2} \cdot x1\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. Step-by-step derivation
      1. unpow275.8%

        \[\leadsto x1 + \left(\left(8 \cdot \left(\color{blue}{\left(x2 \cdot x2\right)} \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
      2. associate-*r*85.3%

        \[\leadsto x1 + \left(\left(8 \cdot \color{blue}{\left(x2 \cdot \left(x2 \cdot x1\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) \]
      3. *-commutative85.3%

        \[\leadsto x1 + \left(\left(8 \cdot \left(x2 \cdot \color{blue}{\left(x1 \cdot x2\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) \]
      4. associate-*r*85.3%

        \[\leadsto x1 + \left(\left(\color{blue}{\left(8 \cdot x2\right) \cdot \left(x1 \cdot x2\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. *-commutative85.3%

        \[\leadsto x1 + \left(\left(\color{blue}{\left(x2 \cdot 8\right)} \cdot \left(x1 \cdot x2\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. associate-*l*85.3%

        \[\leadsto x1 + \left(\left(\color{blue}{x2 \cdot \left(8 \cdot \left(x1 \cdot x2\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) \]
      7. *-commutative85.3%

        \[\leadsto x1 + \left(\left(x2 \cdot \left(8 \cdot \color{blue}{\left(x2 \cdot x1\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) \]
    7. Simplified85.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -6 \cdot 10^{+60} \lor \neg \left(x1 \leq 1.02 \cdot 10^{+76}\right):\\ \;\;\;\;x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + 2 \cdot x2\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + x2 \cdot \left(8 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\\ \end{array} \]

Alternative 21: 70.2% accurate, 4.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 + \left(x2 \cdot -6 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right)\right)\\ t_1 := x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + 2 \cdot x2\right)\right)\right)\\ \mathbf{if}\;x1 \leq -1.85 \cdot 10^{+61}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x1 \leq -3.8 \cdot 10^{-166}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x1 \leq 9.5 \cdot 10^{-165}:\\ \;\;\;\;x1 + \left(8 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right) - 6 \cdot x2\right)\\ \mathbf{elif}\;x1 \leq 1.12 \cdot 10^{+29}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0
         (+
          x1
          (+ (* x2 -6.0) (* x1 (- (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) 2.0)))))
        (t_1 (+ x1 (* x1 (* x1 (* 3.0 (+ 3.0 (* 2.0 x2))))))))
   (if (<= x1 -1.85e+61)
     t_1
     (if (<= x1 -3.8e-166)
       t_0
       (if (<= x1 9.5e-165)
         (+ x1 (- (* 8.0 (* x2 (* x1 x2))) (* 6.0 x2)))
         (if (<= x1 1.12e+29) t_0 t_1))))))
double code(double x1, double x2) {
	double t_0 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)));
	double t_1 = x1 + (x1 * (x1 * (3.0 * (3.0 + (2.0 * x2)))));
	double tmp;
	if (x1 <= -1.85e+61) {
		tmp = t_1;
	} else if (x1 <= -3.8e-166) {
		tmp = t_0;
	} else if (x1 <= 9.5e-165) {
		tmp = x1 + ((8.0 * (x2 * (x1 * x2))) - (6.0 * x2));
	} else if (x1 <= 1.12e+29) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x1, x2)
    real(8), intent (in) :: x1
    real(8), intent (in) :: x2
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = x1 + ((x2 * (-6.0d0)) + (x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) - 2.0d0)))
    t_1 = x1 + (x1 * (x1 * (3.0d0 * (3.0d0 + (2.0d0 * x2)))))
    if (x1 <= (-1.85d+61)) then
        tmp = t_1
    else if (x1 <= (-3.8d-166)) then
        tmp = t_0
    else if (x1 <= 9.5d-165) then
        tmp = x1 + ((8.0d0 * (x2 * (x1 * x2))) - (6.0d0 * x2))
    else if (x1 <= 1.12d+29) then
        tmp = t_0
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double t_0 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)));
	double t_1 = x1 + (x1 * (x1 * (3.0 * (3.0 + (2.0 * x2)))));
	double tmp;
	if (x1 <= -1.85e+61) {
		tmp = t_1;
	} else if (x1 <= -3.8e-166) {
		tmp = t_0;
	} else if (x1 <= 9.5e-165) {
		tmp = x1 + ((8.0 * (x2 * (x1 * x2))) - (6.0 * x2));
	} else if (x1 <= 1.12e+29) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x1, x2):
	t_0 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)))
	t_1 = x1 + (x1 * (x1 * (3.0 * (3.0 + (2.0 * x2)))))
	tmp = 0
	if x1 <= -1.85e+61:
		tmp = t_1
	elif x1 <= -3.8e-166:
		tmp = t_0
	elif x1 <= 9.5e-165:
		tmp = x1 + ((8.0 * (x2 * (x1 * x2))) - (6.0 * x2))
	elif x1 <= 1.12e+29:
		tmp = t_0
	else:
		tmp = t_1
	return tmp
function code(x1, x2)
	t_0 = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 2.0))))
	t_1 = Float64(x1 + Float64(x1 * Float64(x1 * Float64(3.0 * Float64(3.0 + Float64(2.0 * x2))))))
	tmp = 0.0
	if (x1 <= -1.85e+61)
		tmp = t_1;
	elseif (x1 <= -3.8e-166)
		tmp = t_0;
	elseif (x1 <= 9.5e-165)
		tmp = Float64(x1 + Float64(Float64(8.0 * Float64(x2 * Float64(x1 * x2))) - Float64(6.0 * x2)));
	elseif (x1 <= 1.12e+29)
		tmp = t_0;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	t_0 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)));
	t_1 = x1 + (x1 * (x1 * (3.0 * (3.0 + (2.0 * x2)))));
	tmp = 0.0;
	if (x1 <= -1.85e+61)
		tmp = t_1;
	elseif (x1 <= -3.8e-166)
		tmp = t_0;
	elseif (x1 <= 9.5e-165)
		tmp = x1 + ((8.0 * (x2 * (x1 * x2))) - (6.0 * x2));
	elseif (x1 <= 1.12e+29)
		tmp = t_0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(x1 * N[(x1 * N[(3.0 * N[(3.0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.85e+61], t$95$1, If[LessEqual[x1, -3.8e-166], t$95$0, If[LessEqual[x1, 9.5e-165], N[(x1 + N[(N[(8.0 * N[(x2 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(6.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.12e+29], t$95$0, t$95$1]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x1 \leq -3.8 \cdot 10^{-166}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;x1 \leq 1.12 \cdot 10^{+29}:\\
\;\;\;\;t_0\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x1 < -1.85000000000000001e61 or 1.1200000000000001e29 < x1

    1. Initial program 22.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. Taylor expanded in x1 around 0 4.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x1 + \color{blue}{\left(3 \cdot {x1}^{2}\right) \cdot \left(3 - -2 \cdot x2\right)} \]
      2. *-commutative64.5%

        \[\leadsto x1 + \color{blue}{\left({x1}^{2} \cdot 3\right)} \cdot \left(3 - -2 \cdot x2\right) \]
      3. unpow264.5%

        \[\leadsto x1 + \left(\color{blue}{\left(x1 \cdot x1\right)} \cdot 3\right) \cdot \left(3 - -2 \cdot x2\right) \]
      4. associate-*r*64.5%

        \[\leadsto x1 + \color{blue}{\left(x1 \cdot \left(x1 \cdot 3\right)\right)} \cdot \left(3 - -2 \cdot x2\right) \]
      5. *-commutative64.5%

        \[\leadsto x1 + \left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \left(3 - \color{blue}{x2 \cdot -2}\right) \]
      6. associate-*r*64.5%

        \[\leadsto x1 + \color{blue}{x1 \cdot \left(\left(x1 \cdot 3\right) \cdot \left(3 - x2 \cdot -2\right)\right)} \]
      7. associate-*l*64.5%

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

        \[\leadsto x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 - \color{blue}{-2 \cdot x2}\right)\right)\right) \]
      9. cancel-sign-sub-inv64.5%

        \[\leadsto x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \color{blue}{\left(3 + \left(--2\right) \cdot x2\right)}\right)\right) \]
      10. metadata-eval64.5%

        \[\leadsto x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + \color{blue}{2} \cdot x2\right)\right)\right) \]
      11. *-commutative64.5%

        \[\leadsto x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + \color{blue}{x2 \cdot 2}\right)\right)\right) \]
    8. Simplified64.5%

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

    if -1.85000000000000001e61 < x1 < -3.79999999999999982e-166 or 9.49999999999999973e-165 < x1 < 1.1200000000000001e29

    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. Taylor expanded in x1 around 0 80.2%

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

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

    if -3.79999999999999982e-166 < x1 < 9.49999999999999973e-165

    1. Initial program 99.8%

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

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

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

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

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

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

      \[\leadsto x1 + \color{blue}{\left(-1 \cdot \left(x2 \cdot \left(6 + 12 \cdot x1\right)\right) + 8 \cdot \left({x2}^{2} \cdot x1\right)\right)} \]
    7. Step-by-step derivation
      1. +-commutative69.7%

        \[\leadsto x1 + \color{blue}{\left(8 \cdot \left({x2}^{2} \cdot x1\right) + -1 \cdot \left(x2 \cdot \left(6 + 12 \cdot x1\right)\right)\right)} \]
      2. mul-1-neg69.7%

        \[\leadsto x1 + \left(8 \cdot \left({x2}^{2} \cdot x1\right) + \color{blue}{\left(-x2 \cdot \left(6 + 12 \cdot x1\right)\right)}\right) \]
      3. unsub-neg69.7%

        \[\leadsto x1 + \color{blue}{\left(8 \cdot \left({x2}^{2} \cdot x1\right) - x2 \cdot \left(6 + 12 \cdot x1\right)\right)} \]
      4. *-commutative69.7%

        \[\leadsto x1 + \left(8 \cdot \color{blue}{\left(x1 \cdot {x2}^{2}\right)} - x2 \cdot \left(6 + 12 \cdot x1\right)\right) \]
      5. unpow269.7%

        \[\leadsto x1 + \left(8 \cdot \left(x1 \cdot \color{blue}{\left(x2 \cdot x2\right)}\right) - x2 \cdot \left(6 + 12 \cdot x1\right)\right) \]
      6. associate-*r*91.4%

        \[\leadsto x1 + \left(8 \cdot \color{blue}{\left(\left(x1 \cdot x2\right) \cdot x2\right)} - x2 \cdot \left(6 + 12 \cdot x1\right)\right) \]
      7. *-commutative91.4%

        \[\leadsto x1 + \left(8 \cdot \left(\color{blue}{\left(x2 \cdot x1\right)} \cdot x2\right) - x2 \cdot \left(6 + 12 \cdot x1\right)\right) \]
      8. *-commutative91.4%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -1.85 \cdot 10^{+61}:\\ \;\;\;\;x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + 2 \cdot x2\right)\right)\right)\\ \mathbf{elif}\;x1 \leq -3.8 \cdot 10^{-166}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right)\right)\\ \mathbf{elif}\;x1 \leq 9.5 \cdot 10^{-165}:\\ \;\;\;\;x1 + \left(8 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right) - 6 \cdot x2\right)\\ \mathbf{elif}\;x1 \leq 1.12 \cdot 10^{+29}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + 2 \cdot x2\right)\right)\right)\\ \end{array} \]

Alternative 22: 74.4% accurate, 4.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -1.7 \cdot 10^{+61} \lor \neg \left(x1 \leq 1.12 \cdot 10^{+29}\right):\\
\;\;\;\;x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + 2 \cdot x2\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x1 < -1.70000000000000013e61 or 1.1200000000000001e29 < x1

    1. Initial program 22.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. Taylor expanded in x1 around 0 4.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x1 + \color{blue}{\left(3 \cdot {x1}^{2}\right) \cdot \left(3 - -2 \cdot x2\right)} \]
      2. *-commutative64.5%

        \[\leadsto x1 + \color{blue}{\left({x1}^{2} \cdot 3\right)} \cdot \left(3 - -2 \cdot x2\right) \]
      3. unpow264.5%

        \[\leadsto x1 + \left(\color{blue}{\left(x1 \cdot x1\right)} \cdot 3\right) \cdot \left(3 - -2 \cdot x2\right) \]
      4. associate-*r*64.5%

        \[\leadsto x1 + \color{blue}{\left(x1 \cdot \left(x1 \cdot 3\right)\right)} \cdot \left(3 - -2 \cdot x2\right) \]
      5. *-commutative64.5%

        \[\leadsto x1 + \left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \left(3 - \color{blue}{x2 \cdot -2}\right) \]
      6. associate-*r*64.5%

        \[\leadsto x1 + \color{blue}{x1 \cdot \left(\left(x1 \cdot 3\right) \cdot \left(3 - x2 \cdot -2\right)\right)} \]
      7. associate-*l*64.5%

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

        \[\leadsto x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 - \color{blue}{-2 \cdot x2}\right)\right)\right) \]
      9. cancel-sign-sub-inv64.5%

        \[\leadsto x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \color{blue}{\left(3 + \left(--2\right) \cdot x2\right)}\right)\right) \]
      10. metadata-eval64.5%

        \[\leadsto x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + \color{blue}{2} \cdot x2\right)\right)\right) \]
      11. *-commutative64.5%

        \[\leadsto x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + \color{blue}{x2 \cdot 2}\right)\right)\right) \]
    8. Simplified64.5%

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

    if -1.70000000000000013e61 < x1 < 1.1200000000000001e29

    1. Initial program 99.5%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -1.7 \cdot 10^{+61} \lor \neg \left(x1 \leq 1.12 \cdot 10^{+29}\right):\\ \;\;\;\;x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + 2 \cdot x2\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right) + \left(x1 \cdot -3 + x2 \cdot -6\right)\right)\\ \end{array} \]

Alternative 23: 52.9% accurate, 6.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 + 8 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\\ t_1 := x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + 2 \cdot x2\right)\right)\right)\\ \mathbf{if}\;x1 \leq -1.55 \cdot 10^{+61}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x1 \leq -8.5 \cdot 10^{-72}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x1 \leq 1.45 \cdot 10^{-59}:\\ \;\;\;\;x1 + x2 \cdot -6\\ \mathbf{elif}\;x1 \leq 5.4 \cdot 10^{+75}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (+ x1 (* 8.0 (* x2 (* x1 x2)))))
        (t_1 (+ x1 (* x1 (* x1 (* 3.0 (+ 3.0 (* 2.0 x2))))))))
   (if (<= x1 -1.55e+61)
     t_1
     (if (<= x1 -8.5e-72)
       t_0
       (if (<= x1 1.45e-59)
         (+ x1 (* x2 -6.0))
         (if (<= x1 5.4e+75) t_0 t_1))))))
double code(double x1, double x2) {
	double t_0 = x1 + (8.0 * (x2 * (x1 * x2)));
	double t_1 = x1 + (x1 * (x1 * (3.0 * (3.0 + (2.0 * x2)))));
	double tmp;
	if (x1 <= -1.55e+61) {
		tmp = t_1;
	} else if (x1 <= -8.5e-72) {
		tmp = t_0;
	} else if (x1 <= 1.45e-59) {
		tmp = x1 + (x2 * -6.0);
	} else if (x1 <= 5.4e+75) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x1, x2)
    real(8), intent (in) :: x1
    real(8), intent (in) :: x2
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = x1 + (8.0d0 * (x2 * (x1 * x2)))
    t_1 = x1 + (x1 * (x1 * (3.0d0 * (3.0d0 + (2.0d0 * x2)))))
    if (x1 <= (-1.55d+61)) then
        tmp = t_1
    else if (x1 <= (-8.5d-72)) then
        tmp = t_0
    else if (x1 <= 1.45d-59) then
        tmp = x1 + (x2 * (-6.0d0))
    else if (x1 <= 5.4d+75) then
        tmp = t_0
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double t_0 = x1 + (8.0 * (x2 * (x1 * x2)));
	double t_1 = x1 + (x1 * (x1 * (3.0 * (3.0 + (2.0 * x2)))));
	double tmp;
	if (x1 <= -1.55e+61) {
		tmp = t_1;
	} else if (x1 <= -8.5e-72) {
		tmp = t_0;
	} else if (x1 <= 1.45e-59) {
		tmp = x1 + (x2 * -6.0);
	} else if (x1 <= 5.4e+75) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x1, x2):
	t_0 = x1 + (8.0 * (x2 * (x1 * x2)))
	t_1 = x1 + (x1 * (x1 * (3.0 * (3.0 + (2.0 * x2)))))
	tmp = 0
	if x1 <= -1.55e+61:
		tmp = t_1
	elif x1 <= -8.5e-72:
		tmp = t_0
	elif x1 <= 1.45e-59:
		tmp = x1 + (x2 * -6.0)
	elif x1 <= 5.4e+75:
		tmp = t_0
	else:
		tmp = t_1
	return tmp
function code(x1, x2)
	t_0 = Float64(x1 + Float64(8.0 * Float64(x2 * Float64(x1 * x2))))
	t_1 = Float64(x1 + Float64(x1 * Float64(x1 * Float64(3.0 * Float64(3.0 + Float64(2.0 * x2))))))
	tmp = 0.0
	if (x1 <= -1.55e+61)
		tmp = t_1;
	elseif (x1 <= -8.5e-72)
		tmp = t_0;
	elseif (x1 <= 1.45e-59)
		tmp = Float64(x1 + Float64(x2 * -6.0));
	elseif (x1 <= 5.4e+75)
		tmp = t_0;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	t_0 = x1 + (8.0 * (x2 * (x1 * x2)));
	t_1 = x1 + (x1 * (x1 * (3.0 * (3.0 + (2.0 * x2)))));
	tmp = 0.0;
	if (x1 <= -1.55e+61)
		tmp = t_1;
	elseif (x1 <= -8.5e-72)
		tmp = t_0;
	elseif (x1 <= 1.45e-59)
		tmp = x1 + (x2 * -6.0);
	elseif (x1 <= 5.4e+75)
		tmp = t_0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(8.0 * N[(x2 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(x1 * N[(x1 * N[(3.0 * N[(3.0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.55e+61], t$95$1, If[LessEqual[x1, -8.5e-72], t$95$0, If[LessEqual[x1, 1.45e-59], N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5.4e+75], t$95$0, t$95$1]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x1 + 8 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\\
t_1 := x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + 2 \cdot x2\right)\right)\right)\\
\mathbf{if}\;x1 \leq -1.55 \cdot 10^{+61}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x1 \leq -8.5 \cdot 10^{-72}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;x1 \leq 5.4 \cdot 10^{+75}:\\
\;\;\;\;t_0\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x1 < -1.55e61 or 5.39999999999999996e75 < x1

    1. Initial program 18.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. Taylor expanded in x1 around 0 3.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x1 + \color{blue}{\left(3 \cdot {x1}^{2}\right) \cdot \left(3 - -2 \cdot x2\right)} \]
      2. *-commutative67.0%

        \[\leadsto x1 + \color{blue}{\left({x1}^{2} \cdot 3\right)} \cdot \left(3 - -2 \cdot x2\right) \]
      3. unpow267.0%

        \[\leadsto x1 + \left(\color{blue}{\left(x1 \cdot x1\right)} \cdot 3\right) \cdot \left(3 - -2 \cdot x2\right) \]
      4. associate-*r*67.0%

        \[\leadsto x1 + \color{blue}{\left(x1 \cdot \left(x1 \cdot 3\right)\right)} \cdot \left(3 - -2 \cdot x2\right) \]
      5. *-commutative67.0%

        \[\leadsto x1 + \left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \left(3 - \color{blue}{x2 \cdot -2}\right) \]
      6. associate-*r*67.0%

        \[\leadsto x1 + \color{blue}{x1 \cdot \left(\left(x1 \cdot 3\right) \cdot \left(3 - x2 \cdot -2\right)\right)} \]
      7. associate-*l*67.0%

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

        \[\leadsto x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 - \color{blue}{-2 \cdot x2}\right)\right)\right) \]
      9. cancel-sign-sub-inv67.0%

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

        \[\leadsto x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + \color{blue}{2} \cdot x2\right)\right)\right) \]
      11. *-commutative67.0%

        \[\leadsto x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + \color{blue}{x2 \cdot 2}\right)\right)\right) \]
    8. Simplified67.0%

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

    if -1.55e61 < x1 < -8.50000000000000008e-72 or 1.45000000000000008e-59 < x1 < 5.39999999999999996e75

    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. Taylor expanded in x1 around 0 57.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x1 + 8 \cdot \left(x1 \cdot \color{blue}{\left(x2 \cdot x2\right)}\right) \]
      3. associate-*r*37.6%

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

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

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

    if -8.50000000000000008e-72 < x1 < 1.45000000000000008e-59

    1. Initial program 99.7%

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

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

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

        \[\leadsto x1 + \color{blue}{x2 \cdot -6} \]
    5. Simplified67.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -1.55 \cdot 10^{+61}:\\ \;\;\;\;x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + 2 \cdot x2\right)\right)\right)\\ \mathbf{elif}\;x1 \leq -8.5 \cdot 10^{-72}:\\ \;\;\;\;x1 + 8 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\\ \mathbf{elif}\;x1 \leq 1.45 \cdot 10^{-59}:\\ \;\;\;\;x1 + x2 \cdot -6\\ \mathbf{elif}\;x1 \leq 5.4 \cdot 10^{+75}:\\ \;\;\;\;x1 + 8 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + 2 \cdot x2\right)\right)\right)\\ \end{array} \]

Alternative 24: 62.6% accurate, 6.0× speedup?

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

\\
\begin{array}{l}
t_0 := x1 + \left(8 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right) - 6 \cdot x2\right)\\
t_1 := x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + 2 \cdot x2\right)\right)\right)\\
\mathbf{if}\;x1 \leq -1.9 \cdot 10^{+61}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x1 \leq -6.2 \cdot 10^{-137}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;x1 \leq 1.32 \cdot 10^{+76}:\\
\;\;\;\;t_0\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x1 < -1.89999999999999998e61 or 1.31999999999999999e76 < x1

    1. Initial program 18.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. Taylor expanded in x1 around 0 3.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x1 + \color{blue}{\left(3 \cdot {x1}^{2}\right) \cdot \left(3 - -2 \cdot x2\right)} \]
      2. *-commutative67.0%

        \[\leadsto x1 + \color{blue}{\left({x1}^{2} \cdot 3\right)} \cdot \left(3 - -2 \cdot x2\right) \]
      3. unpow267.0%

        \[\leadsto x1 + \left(\color{blue}{\left(x1 \cdot x1\right)} \cdot 3\right) \cdot \left(3 - -2 \cdot x2\right) \]
      4. associate-*r*67.0%

        \[\leadsto x1 + \color{blue}{\left(x1 \cdot \left(x1 \cdot 3\right)\right)} \cdot \left(3 - -2 \cdot x2\right) \]
      5. *-commutative67.0%

        \[\leadsto x1 + \left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \left(3 - \color{blue}{x2 \cdot -2}\right) \]
      6. associate-*r*67.0%

        \[\leadsto x1 + \color{blue}{x1 \cdot \left(\left(x1 \cdot 3\right) \cdot \left(3 - x2 \cdot -2\right)\right)} \]
      7. associate-*l*67.0%

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

        \[\leadsto x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 - \color{blue}{-2 \cdot x2}\right)\right)\right) \]
      9. cancel-sign-sub-inv67.0%

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

        \[\leadsto x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + \color{blue}{2} \cdot x2\right)\right)\right) \]
      11. *-commutative67.0%

        \[\leadsto x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + \color{blue}{x2 \cdot 2}\right)\right)\right) \]
    8. Simplified67.0%

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

    if -1.89999999999999998e61 < x1 < -6.19999999999999955e-137 or 2.59999999999999985e-185 < x1 < 1.31999999999999999e76

    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. Taylor expanded in x1 around 0 75.7%

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

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

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

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

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

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

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

        \[\leadsto x1 + \left(8 \cdot \left({x2}^{2} \cdot x1\right) + \color{blue}{\left(-x2 \cdot \left(6 + 12 \cdot x1\right)\right)}\right) \]
      3. unsub-neg52.5%

        \[\leadsto x1 + \color{blue}{\left(8 \cdot \left({x2}^{2} \cdot x1\right) - x2 \cdot \left(6 + 12 \cdot x1\right)\right)} \]
      4. *-commutative52.5%

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

        \[\leadsto x1 + \left(8 \cdot \left(x1 \cdot \color{blue}{\left(x2 \cdot x2\right)}\right) - x2 \cdot \left(6 + 12 \cdot x1\right)\right) \]
      6. associate-*r*57.7%

        \[\leadsto x1 + \left(8 \cdot \color{blue}{\left(\left(x1 \cdot x2\right) \cdot x2\right)} - x2 \cdot \left(6 + 12 \cdot x1\right)\right) \]
      7. *-commutative57.7%

        \[\leadsto x1 + \left(8 \cdot \left(\color{blue}{\left(x2 \cdot x1\right)} \cdot x2\right) - x2 \cdot \left(6 + 12 \cdot x1\right)\right) \]
      8. *-commutative57.7%

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

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

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

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

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

    if -6.19999999999999955e-137 < x1 < 2.59999999999999985e-185

    1. Initial program 99.7%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -1.9 \cdot 10^{+61}:\\ \;\;\;\;x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + 2 \cdot x2\right)\right)\right)\\ \mathbf{elif}\;x1 \leq -6.2 \cdot 10^{-137}:\\ \;\;\;\;x1 + \left(8 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right) - 6 \cdot x2\right)\\ \mathbf{elif}\;x1 \leq 2.6 \cdot 10^{-185}:\\ \;\;\;\;x1 + \left(x2 \cdot \left(x1 \cdot -12 - 6\right) + \left(x1 + x1 \cdot -3\right)\right)\\ \mathbf{elif}\;x1 \leq 1.32 \cdot 10^{+76}:\\ \;\;\;\;x1 + \left(8 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right) - 6 \cdot x2\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + 2 \cdot x2\right)\right)\right)\\ \end{array} \]

Alternative 25: 44.3% accurate, 7.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 + 8 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\\ t_1 := x1 + x2 \cdot -6\\ \mathbf{if}\;x2 \leq -1.3 \cdot 10^{+170}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x2 \leq -1.7 \cdot 10^{-293}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x2 \leq 2.95 \cdot 10^{-176}:\\ \;\;\;\;x1 + x1 \cdot -2\\ \mathbf{elif}\;x2 \leq 2.45 \cdot 10^{+125}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (+ x1 (* 8.0 (* x2 (* x1 x2))))) (t_1 (+ x1 (* x2 -6.0))))
   (if (<= x2 -1.3e+170)
     t_0
     (if (<= x2 -1.7e-293)
       t_1
       (if (<= x2 2.95e-176)
         (+ x1 (* x1 -2.0))
         (if (<= x2 2.45e+125) t_1 t_0))))))
double code(double x1, double x2) {
	double t_0 = x1 + (8.0 * (x2 * (x1 * x2)));
	double t_1 = x1 + (x2 * -6.0);
	double tmp;
	if (x2 <= -1.3e+170) {
		tmp = t_0;
	} else if (x2 <= -1.7e-293) {
		tmp = t_1;
	} else if (x2 <= 2.95e-176) {
		tmp = x1 + (x1 * -2.0);
	} else if (x2 <= 2.45e+125) {
		tmp = t_1;
	} 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) :: tmp
    t_0 = x1 + (8.0d0 * (x2 * (x1 * x2)))
    t_1 = x1 + (x2 * (-6.0d0))
    if (x2 <= (-1.3d+170)) then
        tmp = t_0
    else if (x2 <= (-1.7d-293)) then
        tmp = t_1
    else if (x2 <= 2.95d-176) then
        tmp = x1 + (x1 * (-2.0d0))
    else if (x2 <= 2.45d+125) then
        tmp = t_1
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double t_0 = x1 + (8.0 * (x2 * (x1 * x2)));
	double t_1 = x1 + (x2 * -6.0);
	double tmp;
	if (x2 <= -1.3e+170) {
		tmp = t_0;
	} else if (x2 <= -1.7e-293) {
		tmp = t_1;
	} else if (x2 <= 2.95e-176) {
		tmp = x1 + (x1 * -2.0);
	} else if (x2 <= 2.45e+125) {
		tmp = t_1;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x1, x2):
	t_0 = x1 + (8.0 * (x2 * (x1 * x2)))
	t_1 = x1 + (x2 * -6.0)
	tmp = 0
	if x2 <= -1.3e+170:
		tmp = t_0
	elif x2 <= -1.7e-293:
		tmp = t_1
	elif x2 <= 2.95e-176:
		tmp = x1 + (x1 * -2.0)
	elif x2 <= 2.45e+125:
		tmp = t_1
	else:
		tmp = t_0
	return tmp
function code(x1, x2)
	t_0 = Float64(x1 + Float64(8.0 * Float64(x2 * Float64(x1 * x2))))
	t_1 = Float64(x1 + Float64(x2 * -6.0))
	tmp = 0.0
	if (x2 <= -1.3e+170)
		tmp = t_0;
	elseif (x2 <= -1.7e-293)
		tmp = t_1;
	elseif (x2 <= 2.95e-176)
		tmp = Float64(x1 + Float64(x1 * -2.0));
	elseif (x2 <= 2.45e+125)
		tmp = t_1;
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	t_0 = x1 + (8.0 * (x2 * (x1 * x2)));
	t_1 = x1 + (x2 * -6.0);
	tmp = 0.0;
	if (x2 <= -1.3e+170)
		tmp = t_0;
	elseif (x2 <= -1.7e-293)
		tmp = t_1;
	elseif (x2 <= 2.95e-176)
		tmp = x1 + (x1 * -2.0);
	elseif (x2 <= 2.45e+125)
		tmp = t_1;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(8.0 * N[(x2 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x2, -1.3e+170], t$95$0, If[LessEqual[x2, -1.7e-293], t$95$1, If[LessEqual[x2, 2.95e-176], N[(x1 + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x2, 2.45e+125], t$95$1, t$95$0]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x1 + 8 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\\
t_1 := x1 + x2 \cdot -6\\
\mathbf{if}\;x2 \leq -1.3 \cdot 10^{+170}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;x2 \leq -1.7 \cdot 10^{-293}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x2 \leq 2.95 \cdot 10^{-176}:\\
\;\;\;\;x1 + x1 \cdot -2\\

\mathbf{elif}\;x2 \leq 2.45 \cdot 10^{+125}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x2 < -1.2999999999999999e170 or 2.45000000000000008e125 < x2

    1. Initial program 57.7%

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

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

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

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

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

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

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

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

        \[\leadsto x1 + \mathsf{fma}\left(x1, \mathsf{fma}\left(x2 \cdot 4, \color{blue}{\mathsf{fma}\left(2, x2, -3\right)}, -2\right), -6 \cdot x2 + 3 \cdot \left({x1}^{2} \cdot \left(3 - -2 \cdot x2\right)\right)\right) \]
      7. metadata-eval50.9%

        \[\leadsto x1 + \mathsf{fma}\left(x1, \mathsf{fma}\left(x2 \cdot 4, \mathsf{fma}\left(2, x2, \color{blue}{-3}\right), -2\right), -6 \cdot x2 + 3 \cdot \left({x1}^{2} \cdot \left(3 - -2 \cdot x2\right)\right)\right) \]
      8. *-commutative50.9%

        \[\leadsto x1 + \mathsf{fma}\left(x1, \mathsf{fma}\left(x2 \cdot 4, \mathsf{fma}\left(2, x2, -3\right), -2\right), \color{blue}{x2 \cdot -6} + 3 \cdot \left({x1}^{2} \cdot \left(3 - -2 \cdot x2\right)\right)\right) \]
      9. fma-def50.9%

        \[\leadsto x1 + \mathsf{fma}\left(x1, \mathsf{fma}\left(x2 \cdot 4, \mathsf{fma}\left(2, x2, -3\right), -2\right), \color{blue}{\mathsf{fma}\left(x2, -6, 3 \cdot \left({x1}^{2} \cdot \left(3 - -2 \cdot x2\right)\right)\right)}\right) \]
      10. associate-*r*50.9%

        \[\leadsto x1 + \mathsf{fma}\left(x1, \mathsf{fma}\left(x2 \cdot 4, \mathsf{fma}\left(2, x2, -3\right), -2\right), \mathsf{fma}\left(x2, -6, \color{blue}{\left(3 \cdot {x1}^{2}\right) \cdot \left(3 - -2 \cdot x2\right)}\right)\right) \]
      11. *-commutative50.9%

        \[\leadsto x1 + \mathsf{fma}\left(x1, \mathsf{fma}\left(x2 \cdot 4, \mathsf{fma}\left(2, x2, -3\right), -2\right), \mathsf{fma}\left(x2, -6, \color{blue}{\left({x1}^{2} \cdot 3\right)} \cdot \left(3 - -2 \cdot x2\right)\right)\right) \]
      12. unpow250.9%

        \[\leadsto x1 + \mathsf{fma}\left(x1, \mathsf{fma}\left(x2 \cdot 4, \mathsf{fma}\left(2, x2, -3\right), -2\right), \mathsf{fma}\left(x2, -6, \left(\color{blue}{\left(x1 \cdot x1\right)} \cdot 3\right) \cdot \left(3 - -2 \cdot x2\right)\right)\right) \]
      13. associate-*r*50.9%

        \[\leadsto x1 + \mathsf{fma}\left(x1, \mathsf{fma}\left(x2 \cdot 4, \mathsf{fma}\left(2, x2, -3\right), -2\right), \mathsf{fma}\left(x2, -6, \color{blue}{\left(x1 \cdot \left(x1 \cdot 3\right)\right)} \cdot \left(3 - -2 \cdot x2\right)\right)\right) \]
      14. associate-*l*50.9%

        \[\leadsto x1 + \mathsf{fma}\left(x1, \mathsf{fma}\left(x2 \cdot 4, \mathsf{fma}\left(2, x2, -3\right), -2\right), \mathsf{fma}\left(x2, -6, \color{blue}{x1 \cdot \left(\left(x1 \cdot 3\right) \cdot \left(3 - -2 \cdot x2\right)\right)}\right)\right) \]
      15. *-commutative50.9%

        \[\leadsto x1 + \mathsf{fma}\left(x1, \mathsf{fma}\left(x2 \cdot 4, \mathsf{fma}\left(2, x2, -3\right), -2\right), \mathsf{fma}\left(x2, -6, x1 \cdot \left(\color{blue}{\left(3 \cdot x1\right)} \cdot \left(3 - -2 \cdot x2\right)\right)\right)\right) \]
      16. *-commutative50.9%

        \[\leadsto x1 + \mathsf{fma}\left(x1, \mathsf{fma}\left(x2 \cdot 4, \mathsf{fma}\left(2, x2, -3\right), -2\right), \mathsf{fma}\left(x2, -6, x1 \cdot \left(\left(3 \cdot x1\right) \cdot \left(3 - \color{blue}{x2 \cdot -2}\right)\right)\right)\right) \]
    5. Simplified50.9%

      \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(x1, \mathsf{fma}\left(x2 \cdot 4, \mathsf{fma}\left(2, x2, -3\right), -2\right), \mathsf{fma}\left(x2, -6, x1 \cdot \left(\left(3 \cdot x1\right) \cdot \left(3 - x2 \cdot -2\right)\right)\right)\right)} \]
    6. Taylor expanded in x2 around inf 64.7%

      \[\leadsto x1 + \color{blue}{8 \cdot \left({x2}^{2} \cdot x1\right)} \]
    7. Step-by-step derivation
      1. *-commutative64.7%

        \[\leadsto x1 + 8 \cdot \color{blue}{\left(x1 \cdot {x2}^{2}\right)} \]
      2. unpow264.7%

        \[\leadsto x1 + 8 \cdot \left(x1 \cdot \color{blue}{\left(x2 \cdot x2\right)}\right) \]
      3. associate-*r*73.0%

        \[\leadsto x1 + 8 \cdot \color{blue}{\left(\left(x1 \cdot x2\right) \cdot x2\right)} \]
      4. *-commutative73.0%

        \[\leadsto x1 + 8 \cdot \left(\color{blue}{\left(x2 \cdot x1\right)} \cdot x2\right) \]
    8. Simplified73.0%

      \[\leadsto x1 + \color{blue}{8 \cdot \left(\left(x2 \cdot x1\right) \cdot x2\right)} \]

    if -1.2999999999999999e170 < x2 < -1.7e-293 or 2.9499999999999998e-176 < x2 < 2.45000000000000008e125

    1. Initial program 69.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. Taylor expanded in x1 around 0 51.6%

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    3. Taylor expanded in x1 around 0 42.0%

      \[\leadsto x1 + \color{blue}{-6 \cdot x2} \]
    4. Step-by-step derivation
      1. *-commutative42.0%

        \[\leadsto x1 + \color{blue}{x2 \cdot -6} \]
    5. Simplified42.0%

      \[\leadsto x1 + \color{blue}{x2 \cdot -6} \]

    if -1.7e-293 < x2 < 2.9499999999999998e-176

    1. Initial program 68.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. Taylor expanded in x1 around 0 42.6%

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    3. Taylor expanded in x1 around 0 43.9%

      \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right) + x1\right) + \color{blue}{\left(-3 \cdot x1 + -6 \cdot x2\right)}\right) \]
    4. Step-by-step derivation
      1. fma-def43.9%

        \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right) + x1\right) + \color{blue}{\mathsf{fma}\left(-3, x1, -6 \cdot x2\right)}\right) \]
      2. *-commutative43.9%

        \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right) + x1\right) + \mathsf{fma}\left(-3, x1, \color{blue}{x2 \cdot -6}\right)\right) \]
    5. Simplified43.9%

      \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right) + x1\right) + \color{blue}{\mathsf{fma}\left(-3, x1, x2 \cdot -6\right)}\right) \]
    6. Taylor expanded in x2 around 0 41.9%

      \[\leadsto x1 + \color{blue}{\left(x1 + -3 \cdot x1\right)} \]
    7. Step-by-step derivation
      1. distribute-rgt1-in42.3%

        \[\leadsto x1 + \color{blue}{\left(-3 + 1\right) \cdot x1} \]
      2. metadata-eval42.3%

        \[\leadsto x1 + \color{blue}{-2} \cdot x1 \]
      3. *-commutative42.3%

        \[\leadsto x1 + \color{blue}{x1 \cdot -2} \]
    8. Simplified42.3%

      \[\leadsto x1 + \color{blue}{x1 \cdot -2} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification49.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x2 \leq -1.3 \cdot 10^{+170}:\\ \;\;\;\;x1 + 8 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\\ \mathbf{elif}\;x2 \leq -1.7 \cdot 10^{-293}:\\ \;\;\;\;x1 + x2 \cdot -6\\ \mathbf{elif}\;x2 \leq 2.95 \cdot 10^{-176}:\\ \;\;\;\;x1 + x1 \cdot -2\\ \mathbf{elif}\;x2 \leq 2.45 \cdot 10^{+125}:\\ \;\;\;\;x1 + x2 \cdot -6\\ \mathbf{else}:\\ \;\;\;\;x1 + 8 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\\ \end{array} \]

Alternative 26: 45.7% accurate, 7.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 + 8 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\\ t_1 := x1 + x2 \cdot \left(-6 - x1 \cdot 12\right)\\ \mathbf{if}\;x2 \leq -1.3 \cdot 10^{+170}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x2 \leq -1.7 \cdot 10^{-293}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x2 \leq 3.1 \cdot 10^{-176}:\\ \;\;\;\;x1 + x1 \cdot -2\\ \mathbf{elif}\;x2 \leq 2.35 \cdot 10^{+126}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (+ x1 (* 8.0 (* x2 (* x1 x2)))))
        (t_1 (+ x1 (* x2 (- -6.0 (* x1 12.0))))))
   (if (<= x2 -1.3e+170)
     t_0
     (if (<= x2 -1.7e-293)
       t_1
       (if (<= x2 3.1e-176)
         (+ x1 (* x1 -2.0))
         (if (<= x2 2.35e+126) t_1 t_0))))))
double code(double x1, double x2) {
	double t_0 = x1 + (8.0 * (x2 * (x1 * x2)));
	double t_1 = x1 + (x2 * (-6.0 - (x1 * 12.0)));
	double tmp;
	if (x2 <= -1.3e+170) {
		tmp = t_0;
	} else if (x2 <= -1.7e-293) {
		tmp = t_1;
	} else if (x2 <= 3.1e-176) {
		tmp = x1 + (x1 * -2.0);
	} else if (x2 <= 2.35e+126) {
		tmp = t_1;
	} 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) :: tmp
    t_0 = x1 + (8.0d0 * (x2 * (x1 * x2)))
    t_1 = x1 + (x2 * ((-6.0d0) - (x1 * 12.0d0)))
    if (x2 <= (-1.3d+170)) then
        tmp = t_0
    else if (x2 <= (-1.7d-293)) then
        tmp = t_1
    else if (x2 <= 3.1d-176) then
        tmp = x1 + (x1 * (-2.0d0))
    else if (x2 <= 2.35d+126) then
        tmp = t_1
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double t_0 = x1 + (8.0 * (x2 * (x1 * x2)));
	double t_1 = x1 + (x2 * (-6.0 - (x1 * 12.0)));
	double tmp;
	if (x2 <= -1.3e+170) {
		tmp = t_0;
	} else if (x2 <= -1.7e-293) {
		tmp = t_1;
	} else if (x2 <= 3.1e-176) {
		tmp = x1 + (x1 * -2.0);
	} else if (x2 <= 2.35e+126) {
		tmp = t_1;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x1, x2):
	t_0 = x1 + (8.0 * (x2 * (x1 * x2)))
	t_1 = x1 + (x2 * (-6.0 - (x1 * 12.0)))
	tmp = 0
	if x2 <= -1.3e+170:
		tmp = t_0
	elif x2 <= -1.7e-293:
		tmp = t_1
	elif x2 <= 3.1e-176:
		tmp = x1 + (x1 * -2.0)
	elif x2 <= 2.35e+126:
		tmp = t_1
	else:
		tmp = t_0
	return tmp
function code(x1, x2)
	t_0 = Float64(x1 + Float64(8.0 * Float64(x2 * Float64(x1 * x2))))
	t_1 = Float64(x1 + Float64(x2 * Float64(-6.0 - Float64(x1 * 12.0))))
	tmp = 0.0
	if (x2 <= -1.3e+170)
		tmp = t_0;
	elseif (x2 <= -1.7e-293)
		tmp = t_1;
	elseif (x2 <= 3.1e-176)
		tmp = Float64(x1 + Float64(x1 * -2.0));
	elseif (x2 <= 2.35e+126)
		tmp = t_1;
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	t_0 = x1 + (8.0 * (x2 * (x1 * x2)));
	t_1 = x1 + (x2 * (-6.0 - (x1 * 12.0)));
	tmp = 0.0;
	if (x2 <= -1.3e+170)
		tmp = t_0;
	elseif (x2 <= -1.7e-293)
		tmp = t_1;
	elseif (x2 <= 3.1e-176)
		tmp = x1 + (x1 * -2.0);
	elseif (x2 <= 2.35e+126)
		tmp = t_1;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(8.0 * N[(x2 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(x2 * N[(-6.0 - N[(x1 * 12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x2, -1.3e+170], t$95$0, If[LessEqual[x2, -1.7e-293], t$95$1, If[LessEqual[x2, 3.1e-176], N[(x1 + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x2, 2.35e+126], t$95$1, t$95$0]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x1 + 8 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\\
t_1 := x1 + x2 \cdot \left(-6 - x1 \cdot 12\right)\\
\mathbf{if}\;x2 \leq -1.3 \cdot 10^{+170}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;x2 \leq -1.7 \cdot 10^{-293}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x2 \leq 3.1 \cdot 10^{-176}:\\
\;\;\;\;x1 + x1 \cdot -2\\

\mathbf{elif}\;x2 \leq 2.35 \cdot 10^{+126}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x2 < -1.2999999999999999e170 or 2.3499999999999999e126 < x2

    1. Initial program 57.7%

      \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    2. Taylor expanded in x1 around 0 56.2%

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    3. Taylor expanded in x1 around 0 50.9%

      \[\leadsto x1 + \color{blue}{\left(x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right) + \left(-6 \cdot x2 + 3 \cdot \left({x1}^{2} \cdot \left(3 - -2 \cdot x2\right)\right)\right)\right)} \]
    4. Step-by-step derivation
      1. fma-def50.9%

        \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(x1, 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2, -6 \cdot x2 + 3 \cdot \left({x1}^{2} \cdot \left(3 - -2 \cdot x2\right)\right)\right)} \]
      2. associate-*r*50.9%

        \[\leadsto x1 + \mathsf{fma}\left(x1, \color{blue}{\left(4 \cdot x2\right) \cdot \left(2 \cdot x2 - 3\right)} - 2, -6 \cdot x2 + 3 \cdot \left({x1}^{2} \cdot \left(3 - -2 \cdot x2\right)\right)\right) \]
      3. fma-neg50.9%

        \[\leadsto x1 + \mathsf{fma}\left(x1, \color{blue}{\mathsf{fma}\left(4 \cdot x2, 2 \cdot x2 - 3, -2\right)}, -6 \cdot x2 + 3 \cdot \left({x1}^{2} \cdot \left(3 - -2 \cdot x2\right)\right)\right) \]
      4. metadata-eval50.9%

        \[\leadsto x1 + \mathsf{fma}\left(x1, \mathsf{fma}\left(4 \cdot x2, 2 \cdot x2 - 3, \color{blue}{-2}\right), -6 \cdot x2 + 3 \cdot \left({x1}^{2} \cdot \left(3 - -2 \cdot x2\right)\right)\right) \]
      5. *-commutative50.9%

        \[\leadsto x1 + \mathsf{fma}\left(x1, \mathsf{fma}\left(\color{blue}{x2 \cdot 4}, 2 \cdot x2 - 3, -2\right), -6 \cdot x2 + 3 \cdot \left({x1}^{2} \cdot \left(3 - -2 \cdot x2\right)\right)\right) \]
      6. fma-neg50.9%

        \[\leadsto x1 + \mathsf{fma}\left(x1, \mathsf{fma}\left(x2 \cdot 4, \color{blue}{\mathsf{fma}\left(2, x2, -3\right)}, -2\right), -6 \cdot x2 + 3 \cdot \left({x1}^{2} \cdot \left(3 - -2 \cdot x2\right)\right)\right) \]
      7. metadata-eval50.9%

        \[\leadsto x1 + \mathsf{fma}\left(x1, \mathsf{fma}\left(x2 \cdot 4, \mathsf{fma}\left(2, x2, \color{blue}{-3}\right), -2\right), -6 \cdot x2 + 3 \cdot \left({x1}^{2} \cdot \left(3 - -2 \cdot x2\right)\right)\right) \]
      8. *-commutative50.9%

        \[\leadsto x1 + \mathsf{fma}\left(x1, \mathsf{fma}\left(x2 \cdot 4, \mathsf{fma}\left(2, x2, -3\right), -2\right), \color{blue}{x2 \cdot -6} + 3 \cdot \left({x1}^{2} \cdot \left(3 - -2 \cdot x2\right)\right)\right) \]
      9. fma-def50.9%

        \[\leadsto x1 + \mathsf{fma}\left(x1, \mathsf{fma}\left(x2 \cdot 4, \mathsf{fma}\left(2, x2, -3\right), -2\right), \color{blue}{\mathsf{fma}\left(x2, -6, 3 \cdot \left({x1}^{2} \cdot \left(3 - -2 \cdot x2\right)\right)\right)}\right) \]
      10. associate-*r*50.9%

        \[\leadsto x1 + \mathsf{fma}\left(x1, \mathsf{fma}\left(x2 \cdot 4, \mathsf{fma}\left(2, x2, -3\right), -2\right), \mathsf{fma}\left(x2, -6, \color{blue}{\left(3 \cdot {x1}^{2}\right) \cdot \left(3 - -2 \cdot x2\right)}\right)\right) \]
      11. *-commutative50.9%

        \[\leadsto x1 + \mathsf{fma}\left(x1, \mathsf{fma}\left(x2 \cdot 4, \mathsf{fma}\left(2, x2, -3\right), -2\right), \mathsf{fma}\left(x2, -6, \color{blue}{\left({x1}^{2} \cdot 3\right)} \cdot \left(3 - -2 \cdot x2\right)\right)\right) \]
      12. unpow250.9%

        \[\leadsto x1 + \mathsf{fma}\left(x1, \mathsf{fma}\left(x2 \cdot 4, \mathsf{fma}\left(2, x2, -3\right), -2\right), \mathsf{fma}\left(x2, -6, \left(\color{blue}{\left(x1 \cdot x1\right)} \cdot 3\right) \cdot \left(3 - -2 \cdot x2\right)\right)\right) \]
      13. associate-*r*50.9%

        \[\leadsto x1 + \mathsf{fma}\left(x1, \mathsf{fma}\left(x2 \cdot 4, \mathsf{fma}\left(2, x2, -3\right), -2\right), \mathsf{fma}\left(x2, -6, \color{blue}{\left(x1 \cdot \left(x1 \cdot 3\right)\right)} \cdot \left(3 - -2 \cdot x2\right)\right)\right) \]
      14. associate-*l*50.9%

        \[\leadsto x1 + \mathsf{fma}\left(x1, \mathsf{fma}\left(x2 \cdot 4, \mathsf{fma}\left(2, x2, -3\right), -2\right), \mathsf{fma}\left(x2, -6, \color{blue}{x1 \cdot \left(\left(x1 \cdot 3\right) \cdot \left(3 - -2 \cdot x2\right)\right)}\right)\right) \]
      15. *-commutative50.9%

        \[\leadsto x1 + \mathsf{fma}\left(x1, \mathsf{fma}\left(x2 \cdot 4, \mathsf{fma}\left(2, x2, -3\right), -2\right), \mathsf{fma}\left(x2, -6, x1 \cdot \left(\color{blue}{\left(3 \cdot x1\right)} \cdot \left(3 - -2 \cdot x2\right)\right)\right)\right) \]
      16. *-commutative50.9%

        \[\leadsto x1 + \mathsf{fma}\left(x1, \mathsf{fma}\left(x2 \cdot 4, \mathsf{fma}\left(2, x2, -3\right), -2\right), \mathsf{fma}\left(x2, -6, x1 \cdot \left(\left(3 \cdot x1\right) \cdot \left(3 - \color{blue}{x2 \cdot -2}\right)\right)\right)\right) \]
    5. Simplified50.9%

      \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(x1, \mathsf{fma}\left(x2 \cdot 4, \mathsf{fma}\left(2, x2, -3\right), -2\right), \mathsf{fma}\left(x2, -6, x1 \cdot \left(\left(3 \cdot x1\right) \cdot \left(3 - x2 \cdot -2\right)\right)\right)\right)} \]
    6. Taylor expanded in x2 around inf 64.7%

      \[\leadsto x1 + \color{blue}{8 \cdot \left({x2}^{2} \cdot x1\right)} \]
    7. Step-by-step derivation
      1. *-commutative64.7%

        \[\leadsto x1 + 8 \cdot \color{blue}{\left(x1 \cdot {x2}^{2}\right)} \]
      2. unpow264.7%

        \[\leadsto x1 + 8 \cdot \left(x1 \cdot \color{blue}{\left(x2 \cdot x2\right)}\right) \]
      3. associate-*r*73.0%

        \[\leadsto x1 + 8 \cdot \color{blue}{\left(\left(x1 \cdot x2\right) \cdot x2\right)} \]
      4. *-commutative73.0%

        \[\leadsto x1 + 8 \cdot \left(\color{blue}{\left(x2 \cdot x1\right)} \cdot x2\right) \]
    8. Simplified73.0%

      \[\leadsto x1 + \color{blue}{8 \cdot \left(\left(x2 \cdot x1\right) \cdot x2\right)} \]

    if -1.2999999999999999e170 < x2 < -1.7e-293 or 3.09999999999999992e-176 < x2 < 2.3499999999999999e126

    1. Initial program 69.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. Taylor expanded in x1 around 0 51.6%

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    3. Taylor expanded in x1 around 0 55.6%

      \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right) + x1\right) + \color{blue}{\left(-3 \cdot x1 + -6 \cdot x2\right)}\right) \]
    4. Step-by-step derivation
      1. fma-def55.6%

        \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right) + x1\right) + \color{blue}{\mathsf{fma}\left(-3, x1, -6 \cdot x2\right)}\right) \]
      2. *-commutative55.6%

        \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right) + x1\right) + \mathsf{fma}\left(-3, x1, \color{blue}{x2 \cdot -6}\right)\right) \]
    5. Simplified55.6%

      \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right) + x1\right) + \color{blue}{\mathsf{fma}\left(-3, x1, x2 \cdot -6\right)}\right) \]
    6. Taylor expanded in x2 around -inf 44.6%

      \[\leadsto x1 + \color{blue}{\left(-1 \cdot \left(x2 \cdot \left(6 + 12 \cdot x1\right)\right) + 8 \cdot \left({x2}^{2} \cdot x1\right)\right)} \]
    7. Step-by-step derivation
      1. +-commutative44.6%

        \[\leadsto x1 + \color{blue}{\left(8 \cdot \left({x2}^{2} \cdot x1\right) + -1 \cdot \left(x2 \cdot \left(6 + 12 \cdot x1\right)\right)\right)} \]
      2. mul-1-neg44.6%

        \[\leadsto x1 + \left(8 \cdot \left({x2}^{2} \cdot x1\right) + \color{blue}{\left(-x2 \cdot \left(6 + 12 \cdot x1\right)\right)}\right) \]
      3. unsub-neg44.6%

        \[\leadsto x1 + \color{blue}{\left(8 \cdot \left({x2}^{2} \cdot x1\right) - x2 \cdot \left(6 + 12 \cdot x1\right)\right)} \]
      4. *-commutative44.6%

        \[\leadsto x1 + \left(8 \cdot \color{blue}{\left(x1 \cdot {x2}^{2}\right)} - x2 \cdot \left(6 + 12 \cdot x1\right)\right) \]
      5. unpow244.6%

        \[\leadsto x1 + \left(8 \cdot \left(x1 \cdot \color{blue}{\left(x2 \cdot x2\right)}\right) - x2 \cdot \left(6 + 12 \cdot x1\right)\right) \]
      6. associate-*r*47.0%

        \[\leadsto x1 + \left(8 \cdot \color{blue}{\left(\left(x1 \cdot x2\right) \cdot x2\right)} - x2 \cdot \left(6 + 12 \cdot x1\right)\right) \]
      7. *-commutative47.0%

        \[\leadsto x1 + \left(8 \cdot \left(\color{blue}{\left(x2 \cdot x1\right)} \cdot x2\right) - x2 \cdot \left(6 + 12 \cdot x1\right)\right) \]
      8. *-commutative47.0%

        \[\leadsto x1 + \left(8 \cdot \left(\left(x2 \cdot x1\right) \cdot x2\right) - x2 \cdot \left(6 + \color{blue}{x1 \cdot 12}\right)\right) \]
    8. Simplified47.0%

      \[\leadsto x1 + \color{blue}{\left(8 \cdot \left(\left(x2 \cdot x1\right) \cdot x2\right) - x2 \cdot \left(6 + x1 \cdot 12\right)\right)} \]
    9. Taylor expanded in x2 around 0 44.4%

      \[\leadsto x1 + \color{blue}{-1 \cdot \left(x2 \cdot \left(6 + 12 \cdot x1\right)\right)} \]
    10. Step-by-step derivation
      1. mul-1-neg44.4%

        \[\leadsto x1 + \color{blue}{\left(-x2 \cdot \left(6 + 12 \cdot x1\right)\right)} \]
      2. *-commutative44.4%

        \[\leadsto x1 + \left(-x2 \cdot \left(6 + \color{blue}{x1 \cdot 12}\right)\right) \]
      3. distribute-rgt-neg-in44.4%

        \[\leadsto x1 + \color{blue}{x2 \cdot \left(-\left(6 + x1 \cdot 12\right)\right)} \]
      4. distribute-neg-in44.4%

        \[\leadsto x1 + x2 \cdot \color{blue}{\left(\left(-6\right) + \left(-x1 \cdot 12\right)\right)} \]
      5. metadata-eval44.4%

        \[\leadsto x1 + x2 \cdot \left(\color{blue}{-6} + \left(-x1 \cdot 12\right)\right) \]
    11. Simplified44.4%

      \[\leadsto x1 + \color{blue}{x2 \cdot \left(-6 + \left(-x1 \cdot 12\right)\right)} \]

    if -1.7e-293 < x2 < 3.09999999999999992e-176

    1. Initial program 68.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. Taylor expanded in x1 around 0 42.6%

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    3. Taylor expanded in x1 around 0 43.9%

      \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right) + x1\right) + \color{blue}{\left(-3 \cdot x1 + -6 \cdot x2\right)}\right) \]
    4. Step-by-step derivation
      1. fma-def43.9%

        \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right) + x1\right) + \color{blue}{\mathsf{fma}\left(-3, x1, -6 \cdot x2\right)}\right) \]
      2. *-commutative43.9%

        \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right) + x1\right) + \mathsf{fma}\left(-3, x1, \color{blue}{x2 \cdot -6}\right)\right) \]
    5. Simplified43.9%

      \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right) + x1\right) + \color{blue}{\mathsf{fma}\left(-3, x1, x2 \cdot -6\right)}\right) \]
    6. Taylor expanded in x2 around 0 41.9%

      \[\leadsto x1 + \color{blue}{\left(x1 + -3 \cdot x1\right)} \]
    7. Step-by-step derivation
      1. distribute-rgt1-in42.3%

        \[\leadsto x1 + \color{blue}{\left(-3 + 1\right) \cdot x1} \]
      2. metadata-eval42.3%

        \[\leadsto x1 + \color{blue}{-2} \cdot x1 \]
      3. *-commutative42.3%

        \[\leadsto x1 + \color{blue}{x1 \cdot -2} \]
    8. Simplified42.3%

      \[\leadsto x1 + \color{blue}{x1 \cdot -2} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification51.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x2 \leq -1.3 \cdot 10^{+170}:\\ \;\;\;\;x1 + 8 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\\ \mathbf{elif}\;x2 \leq -1.7 \cdot 10^{-293}:\\ \;\;\;\;x1 + x2 \cdot \left(-6 - x1 \cdot 12\right)\\ \mathbf{elif}\;x2 \leq 3.1 \cdot 10^{-176}:\\ \;\;\;\;x1 + x1 \cdot -2\\ \mathbf{elif}\;x2 \leq 2.35 \cdot 10^{+126}:\\ \;\;\;\;x1 + x2 \cdot \left(-6 - x1 \cdot 12\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + 8 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\\ \end{array} \]

Alternative 27: 62.5% accurate, 7.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x1 \leq -9 \cdot 10^{+60} \lor \neg \left(x1 \leq 5.4 \cdot 10^{+75}\right):\\ \;\;\;\;x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + 2 \cdot x2\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(8 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right) - 6 \cdot x2\right)\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (if (or (<= x1 -9e+60) (not (<= x1 5.4e+75)))
   (+ x1 (* x1 (* x1 (* 3.0 (+ 3.0 (* 2.0 x2))))))
   (+ x1 (- (* 8.0 (* x2 (* x1 x2))) (* 6.0 x2)))))
double code(double x1, double x2) {
	double tmp;
	if ((x1 <= -9e+60) || !(x1 <= 5.4e+75)) {
		tmp = x1 + (x1 * (x1 * (3.0 * (3.0 + (2.0 * x2)))));
	} else {
		tmp = x1 + ((8.0 * (x2 * (x1 * x2))) - (6.0 * x2));
	}
	return tmp;
}
real(8) function code(x1, x2)
    real(8), intent (in) :: x1
    real(8), intent (in) :: x2
    real(8) :: tmp
    if ((x1 <= (-9d+60)) .or. (.not. (x1 <= 5.4d+75))) then
        tmp = x1 + (x1 * (x1 * (3.0d0 * (3.0d0 + (2.0d0 * x2)))))
    else
        tmp = x1 + ((8.0d0 * (x2 * (x1 * x2))) - (6.0d0 * x2))
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double tmp;
	if ((x1 <= -9e+60) || !(x1 <= 5.4e+75)) {
		tmp = x1 + (x1 * (x1 * (3.0 * (3.0 + (2.0 * x2)))));
	} else {
		tmp = x1 + ((8.0 * (x2 * (x1 * x2))) - (6.0 * x2));
	}
	return tmp;
}
def code(x1, x2):
	tmp = 0
	if (x1 <= -9e+60) or not (x1 <= 5.4e+75):
		tmp = x1 + (x1 * (x1 * (3.0 * (3.0 + (2.0 * x2)))))
	else:
		tmp = x1 + ((8.0 * (x2 * (x1 * x2))) - (6.0 * x2))
	return tmp
function code(x1, x2)
	tmp = 0.0
	if ((x1 <= -9e+60) || !(x1 <= 5.4e+75))
		tmp = Float64(x1 + Float64(x1 * Float64(x1 * Float64(3.0 * Float64(3.0 + Float64(2.0 * x2))))));
	else
		tmp = Float64(x1 + Float64(Float64(8.0 * Float64(x2 * Float64(x1 * x2))) - Float64(6.0 * x2)));
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	tmp = 0.0;
	if ((x1 <= -9e+60) || ~((x1 <= 5.4e+75)))
		tmp = x1 + (x1 * (x1 * (3.0 * (3.0 + (2.0 * x2)))));
	else
		tmp = x1 + ((8.0 * (x2 * (x1 * x2))) - (6.0 * x2));
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := If[Or[LessEqual[x1, -9e+60], N[Not[LessEqual[x1, 5.4e+75]], $MachinePrecision]], N[(x1 + N[(x1 * N[(x1 * N[(3.0 * N[(3.0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(8.0 * N[(x2 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(6.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -9 \cdot 10^{+60} \lor \neg \left(x1 \leq 5.4 \cdot 10^{+75}\right):\\
\;\;\;\;x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + 2 \cdot x2\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;x1 + \left(8 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right) - 6 \cdot x2\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x1 < -9.00000000000000026e60 or 5.39999999999999996e75 < x1

    1. Initial program 18.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. Taylor expanded in x1 around 0 3.2%

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    3. Taylor expanded in x1 around 0 55.6%

      \[\leadsto x1 + \color{blue}{\left(x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right) + \left(-6 \cdot x2 + 3 \cdot \left({x1}^{2} \cdot \left(3 - -2 \cdot x2\right)\right)\right)\right)} \]
    4. Step-by-step derivation
      1. fma-def59.4%

        \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(x1, 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2, -6 \cdot x2 + 3 \cdot \left({x1}^{2} \cdot \left(3 - -2 \cdot x2\right)\right)\right)} \]
      2. associate-*r*59.4%

        \[\leadsto x1 + \mathsf{fma}\left(x1, \color{blue}{\left(4 \cdot x2\right) \cdot \left(2 \cdot x2 - 3\right)} - 2, -6 \cdot x2 + 3 \cdot \left({x1}^{2} \cdot \left(3 - -2 \cdot x2\right)\right)\right) \]
      3. fma-neg59.4%

        \[\leadsto x1 + \mathsf{fma}\left(x1, \color{blue}{\mathsf{fma}\left(4 \cdot x2, 2 \cdot x2 - 3, -2\right)}, -6 \cdot x2 + 3 \cdot \left({x1}^{2} \cdot \left(3 - -2 \cdot x2\right)\right)\right) \]
      4. metadata-eval59.4%

        \[\leadsto x1 + \mathsf{fma}\left(x1, \mathsf{fma}\left(4 \cdot x2, 2 \cdot x2 - 3, \color{blue}{-2}\right), -6 \cdot x2 + 3 \cdot \left({x1}^{2} \cdot \left(3 - -2 \cdot x2\right)\right)\right) \]
      5. *-commutative59.4%

        \[\leadsto x1 + \mathsf{fma}\left(x1, \mathsf{fma}\left(\color{blue}{x2 \cdot 4}, 2 \cdot x2 - 3, -2\right), -6 \cdot x2 + 3 \cdot \left({x1}^{2} \cdot \left(3 - -2 \cdot x2\right)\right)\right) \]
      6. fma-neg59.4%

        \[\leadsto x1 + \mathsf{fma}\left(x1, \mathsf{fma}\left(x2 \cdot 4, \color{blue}{\mathsf{fma}\left(2, x2, -3\right)}, -2\right), -6 \cdot x2 + 3 \cdot \left({x1}^{2} \cdot \left(3 - -2 \cdot x2\right)\right)\right) \]
      7. metadata-eval59.4%

        \[\leadsto x1 + \mathsf{fma}\left(x1, \mathsf{fma}\left(x2 \cdot 4, \mathsf{fma}\left(2, x2, \color{blue}{-3}\right), -2\right), -6 \cdot x2 + 3 \cdot \left({x1}^{2} \cdot \left(3 - -2 \cdot x2\right)\right)\right) \]
      8. *-commutative59.4%

        \[\leadsto x1 + \mathsf{fma}\left(x1, \mathsf{fma}\left(x2 \cdot 4, \mathsf{fma}\left(2, x2, -3\right), -2\right), \color{blue}{x2 \cdot -6} + 3 \cdot \left({x1}^{2} \cdot \left(3 - -2 \cdot x2\right)\right)\right) \]
      9. fma-def59.4%

        \[\leadsto x1 + \mathsf{fma}\left(x1, \mathsf{fma}\left(x2 \cdot 4, \mathsf{fma}\left(2, x2, -3\right), -2\right), \color{blue}{\mathsf{fma}\left(x2, -6, 3 \cdot \left({x1}^{2} \cdot \left(3 - -2 \cdot x2\right)\right)\right)}\right) \]
      10. associate-*r*59.4%

        \[\leadsto x1 + \mathsf{fma}\left(x1, \mathsf{fma}\left(x2 \cdot 4, \mathsf{fma}\left(2, x2, -3\right), -2\right), \mathsf{fma}\left(x2, -6, \color{blue}{\left(3 \cdot {x1}^{2}\right) \cdot \left(3 - -2 \cdot x2\right)}\right)\right) \]
      11. *-commutative59.4%

        \[\leadsto x1 + \mathsf{fma}\left(x1, \mathsf{fma}\left(x2 \cdot 4, \mathsf{fma}\left(2, x2, -3\right), -2\right), \mathsf{fma}\left(x2, -6, \color{blue}{\left({x1}^{2} \cdot 3\right)} \cdot \left(3 - -2 \cdot x2\right)\right)\right) \]
      12. unpow259.4%

        \[\leadsto x1 + \mathsf{fma}\left(x1, \mathsf{fma}\left(x2 \cdot 4, \mathsf{fma}\left(2, x2, -3\right), -2\right), \mathsf{fma}\left(x2, -6, \left(\color{blue}{\left(x1 \cdot x1\right)} \cdot 3\right) \cdot \left(3 - -2 \cdot x2\right)\right)\right) \]
      13. associate-*r*59.4%

        \[\leadsto x1 + \mathsf{fma}\left(x1, \mathsf{fma}\left(x2 \cdot 4, \mathsf{fma}\left(2, x2, -3\right), -2\right), \mathsf{fma}\left(x2, -6, \color{blue}{\left(x1 \cdot \left(x1 \cdot 3\right)\right)} \cdot \left(3 - -2 \cdot x2\right)\right)\right) \]
      14. associate-*l*59.4%

        \[\leadsto x1 + \mathsf{fma}\left(x1, \mathsf{fma}\left(x2 \cdot 4, \mathsf{fma}\left(2, x2, -3\right), -2\right), \mathsf{fma}\left(x2, -6, \color{blue}{x1 \cdot \left(\left(x1 \cdot 3\right) \cdot \left(3 - -2 \cdot x2\right)\right)}\right)\right) \]
      15. *-commutative59.4%

        \[\leadsto x1 + \mathsf{fma}\left(x1, \mathsf{fma}\left(x2 \cdot 4, \mathsf{fma}\left(2, x2, -3\right), -2\right), \mathsf{fma}\left(x2, -6, x1 \cdot \left(\color{blue}{\left(3 \cdot x1\right)} \cdot \left(3 - -2 \cdot x2\right)\right)\right)\right) \]
      16. *-commutative59.4%

        \[\leadsto x1 + \mathsf{fma}\left(x1, \mathsf{fma}\left(x2 \cdot 4, \mathsf{fma}\left(2, x2, -3\right), -2\right), \mathsf{fma}\left(x2, -6, x1 \cdot \left(\left(3 \cdot x1\right) \cdot \left(3 - \color{blue}{x2 \cdot -2}\right)\right)\right)\right) \]
    5. Simplified59.4%

      \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(x1, \mathsf{fma}\left(x2 \cdot 4, \mathsf{fma}\left(2, x2, -3\right), -2\right), \mathsf{fma}\left(x2, -6, x1 \cdot \left(\left(3 \cdot x1\right) \cdot \left(3 - x2 \cdot -2\right)\right)\right)\right)} \]
    6. Taylor expanded in x1 around inf 67.0%

      \[\leadsto x1 + \color{blue}{3 \cdot \left({x1}^{2} \cdot \left(3 - -2 \cdot x2\right)\right)} \]
    7. Step-by-step derivation
      1. associate-*r*67.0%

        \[\leadsto x1 + \color{blue}{\left(3 \cdot {x1}^{2}\right) \cdot \left(3 - -2 \cdot x2\right)} \]
      2. *-commutative67.0%

        \[\leadsto x1 + \color{blue}{\left({x1}^{2} \cdot 3\right)} \cdot \left(3 - -2 \cdot x2\right) \]
      3. unpow267.0%

        \[\leadsto x1 + \left(\color{blue}{\left(x1 \cdot x1\right)} \cdot 3\right) \cdot \left(3 - -2 \cdot x2\right) \]
      4. associate-*r*67.0%

        \[\leadsto x1 + \color{blue}{\left(x1 \cdot \left(x1 \cdot 3\right)\right)} \cdot \left(3 - -2 \cdot x2\right) \]
      5. *-commutative67.0%

        \[\leadsto x1 + \left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \left(3 - \color{blue}{x2 \cdot -2}\right) \]
      6. associate-*r*67.0%

        \[\leadsto x1 + \color{blue}{x1 \cdot \left(\left(x1 \cdot 3\right) \cdot \left(3 - x2 \cdot -2\right)\right)} \]
      7. associate-*l*67.0%

        \[\leadsto x1 + x1 \cdot \color{blue}{\left(x1 \cdot \left(3 \cdot \left(3 - x2 \cdot -2\right)\right)\right)} \]
      8. *-commutative67.0%

        \[\leadsto x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 - \color{blue}{-2 \cdot x2}\right)\right)\right) \]
      9. cancel-sign-sub-inv67.0%

        \[\leadsto x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \color{blue}{\left(3 + \left(--2\right) \cdot x2\right)}\right)\right) \]
      10. metadata-eval67.0%

        \[\leadsto x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + \color{blue}{2} \cdot x2\right)\right)\right) \]
      11. *-commutative67.0%

        \[\leadsto x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + \color{blue}{x2 \cdot 2}\right)\right)\right) \]
    8. Simplified67.0%

      \[\leadsto x1 + \color{blue}{x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + x2 \cdot 2\right)\right)\right)} \]

    if -9.00000000000000026e60 < x1 < 5.39999999999999996e75

    1. Initial program 99.5%

      \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    2. Taylor expanded in x1 around 0 85.3%

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    3. Taylor expanded in x1 around 0 85.0%

      \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right) + x1\right) + \color{blue}{\left(-3 \cdot x1 + -6 \cdot x2\right)}\right) \]
    4. Step-by-step derivation
      1. fma-def85.0%

        \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right) + x1\right) + \color{blue}{\mathsf{fma}\left(-3, x1, -6 \cdot x2\right)}\right) \]
      2. *-commutative85.0%

        \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right) + x1\right) + \mathsf{fma}\left(-3, x1, \color{blue}{x2 \cdot -6}\right)\right) \]
    5. Simplified85.0%

      \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right) + x1\right) + \color{blue}{\mathsf{fma}\left(-3, x1, x2 \cdot -6\right)}\right) \]
    6. Taylor expanded in x2 around -inf 59.1%

      \[\leadsto x1 + \color{blue}{\left(-1 \cdot \left(x2 \cdot \left(6 + 12 \cdot x1\right)\right) + 8 \cdot \left({x2}^{2} \cdot x1\right)\right)} \]
    7. Step-by-step derivation
      1. +-commutative59.1%

        \[\leadsto x1 + \color{blue}{\left(8 \cdot \left({x2}^{2} \cdot x1\right) + -1 \cdot \left(x2 \cdot \left(6 + 12 \cdot x1\right)\right)\right)} \]
      2. mul-1-neg59.1%

        \[\leadsto x1 + \left(8 \cdot \left({x2}^{2} \cdot x1\right) + \color{blue}{\left(-x2 \cdot \left(6 + 12 \cdot x1\right)\right)}\right) \]
      3. unsub-neg59.1%

        \[\leadsto x1 + \color{blue}{\left(8 \cdot \left({x2}^{2} \cdot x1\right) - x2 \cdot \left(6 + 12 \cdot x1\right)\right)} \]
      4. *-commutative59.1%

        \[\leadsto x1 + \left(8 \cdot \color{blue}{\left(x1 \cdot {x2}^{2}\right)} - x2 \cdot \left(6 + 12 \cdot x1\right)\right) \]
      5. unpow259.1%

        \[\leadsto x1 + \left(8 \cdot \left(x1 \cdot \color{blue}{\left(x2 \cdot x2\right)}\right) - x2 \cdot \left(6 + 12 \cdot x1\right)\right) \]
      6. associate-*r*68.6%

        \[\leadsto x1 + \left(8 \cdot \color{blue}{\left(\left(x1 \cdot x2\right) \cdot x2\right)} - x2 \cdot \left(6 + 12 \cdot x1\right)\right) \]
      7. *-commutative68.6%

        \[\leadsto x1 + \left(8 \cdot \left(\color{blue}{\left(x2 \cdot x1\right)} \cdot x2\right) - x2 \cdot \left(6 + 12 \cdot x1\right)\right) \]
      8. *-commutative68.6%

        \[\leadsto x1 + \left(8 \cdot \left(\left(x2 \cdot x1\right) \cdot x2\right) - x2 \cdot \left(6 + \color{blue}{x1 \cdot 12}\right)\right) \]
    8. Simplified68.6%

      \[\leadsto x1 + \color{blue}{\left(8 \cdot \left(\left(x2 \cdot x1\right) \cdot x2\right) - x2 \cdot \left(6 + x1 \cdot 12\right)\right)} \]
    9. Taylor expanded in x1 around 0 69.9%

      \[\leadsto x1 + \left(8 \cdot \left(\left(x2 \cdot x1\right) \cdot x2\right) - \color{blue}{6 \cdot x2}\right) \]
    10. Step-by-step derivation
      1. *-commutative69.9%

        \[\leadsto x1 + \left(8 \cdot \left(\left(x2 \cdot x1\right) \cdot x2\right) - \color{blue}{x2 \cdot 6}\right) \]
    11. Simplified69.9%

      \[\leadsto x1 + \left(8 \cdot \left(\left(x2 \cdot x1\right) \cdot x2\right) - \color{blue}{x2 \cdot 6}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification68.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -9 \cdot 10^{+60} \lor \neg \left(x1 \leq 5.4 \cdot 10^{+75}\right):\\ \;\;\;\;x1 + x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + 2 \cdot x2\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(8 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right) - 6 \cdot x2\right)\\ \end{array} \]

Alternative 28: 30.5% accurate, 13.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x2 \leq -1.7 \cdot 10^{-293} \lor \neg \left(x2 \leq 1.12 \cdot 10^{-175}\right):\\ \;\;\;\;x1 + x2 \cdot -6\\ \mathbf{else}:\\ \;\;\;\;x1 + x1 \cdot -2\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (if (or (<= x2 -1.7e-293) (not (<= x2 1.12e-175)))
   (+ x1 (* x2 -6.0))
   (+ x1 (* x1 -2.0))))
double code(double x1, double x2) {
	double tmp;
	if ((x2 <= -1.7e-293) || !(x2 <= 1.12e-175)) {
		tmp = x1 + (x2 * -6.0);
	} else {
		tmp = x1 + (x1 * -2.0);
	}
	return tmp;
}
real(8) function code(x1, x2)
    real(8), intent (in) :: x1
    real(8), intent (in) :: x2
    real(8) :: tmp
    if ((x2 <= (-1.7d-293)) .or. (.not. (x2 <= 1.12d-175))) then
        tmp = x1 + (x2 * (-6.0d0))
    else
        tmp = x1 + (x1 * (-2.0d0))
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double tmp;
	if ((x2 <= -1.7e-293) || !(x2 <= 1.12e-175)) {
		tmp = x1 + (x2 * -6.0);
	} else {
		tmp = x1 + (x1 * -2.0);
	}
	return tmp;
}
def code(x1, x2):
	tmp = 0
	if (x2 <= -1.7e-293) or not (x2 <= 1.12e-175):
		tmp = x1 + (x2 * -6.0)
	else:
		tmp = x1 + (x1 * -2.0)
	return tmp
function code(x1, x2)
	tmp = 0.0
	if ((x2 <= -1.7e-293) || !(x2 <= 1.12e-175))
		tmp = Float64(x1 + Float64(x2 * -6.0));
	else
		tmp = Float64(x1 + Float64(x1 * -2.0));
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	tmp = 0.0;
	if ((x2 <= -1.7e-293) || ~((x2 <= 1.12e-175)))
		tmp = x1 + (x2 * -6.0);
	else
		tmp = x1 + (x1 * -2.0);
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := If[Or[LessEqual[x2, -1.7e-293], N[Not[LessEqual[x2, 1.12e-175]], $MachinePrecision]], N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -1.7 \cdot 10^{-293} \lor \neg \left(x2 \leq 1.12 \cdot 10^{-175}\right):\\
\;\;\;\;x1 + x2 \cdot -6\\

\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot -2\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x2 < -1.7e-293 or 1.1200000000000001e-175 < x2

    1. Initial program 65.8%

      \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    2. Taylor expanded in x1 around 0 52.9%

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    3. Taylor expanded in x1 around 0 32.9%

      \[\leadsto x1 + \color{blue}{-6 \cdot x2} \]
    4. Step-by-step derivation
      1. *-commutative32.9%

        \[\leadsto x1 + \color{blue}{x2 \cdot -6} \]
    5. Simplified32.9%

      \[\leadsto x1 + \color{blue}{x2 \cdot -6} \]

    if -1.7e-293 < x2 < 1.1200000000000001e-175

    1. Initial program 68.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. Taylor expanded in x1 around 0 42.6%

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    3. Taylor expanded in x1 around 0 43.9%

      \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right) + x1\right) + \color{blue}{\left(-3 \cdot x1 + -6 \cdot x2\right)}\right) \]
    4. Step-by-step derivation
      1. fma-def43.9%

        \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right) + x1\right) + \color{blue}{\mathsf{fma}\left(-3, x1, -6 \cdot x2\right)}\right) \]
      2. *-commutative43.9%

        \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right) + x1\right) + \mathsf{fma}\left(-3, x1, \color{blue}{x2 \cdot -6}\right)\right) \]
    5. Simplified43.9%

      \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right) + x1\right) + \color{blue}{\mathsf{fma}\left(-3, x1, x2 \cdot -6\right)}\right) \]
    6. Taylor expanded in x2 around 0 41.9%

      \[\leadsto x1 + \color{blue}{\left(x1 + -3 \cdot x1\right)} \]
    7. Step-by-step derivation
      1. distribute-rgt1-in42.3%

        \[\leadsto x1 + \color{blue}{\left(-3 + 1\right) \cdot x1} \]
      2. metadata-eval42.3%

        \[\leadsto x1 + \color{blue}{-2} \cdot x1 \]
      3. *-commutative42.3%

        \[\leadsto x1 + \color{blue}{x1 \cdot -2} \]
    8. Simplified42.3%

      \[\leadsto x1 + \color{blue}{x1 \cdot -2} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification34.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x2 \leq -1.7 \cdot 10^{-293} \lor \neg \left(x2 \leq 1.12 \cdot 10^{-175}\right):\\ \;\;\;\;x1 + x2 \cdot -6\\ \mathbf{else}:\\ \;\;\;\;x1 + x1 \cdot -2\\ \end{array} \]

Alternative 29: 14.3% accurate, 25.4× speedup?

\[\begin{array}{l} \\ x1 + x1 \cdot -2 \end{array} \]
(FPCore (x1 x2) :precision binary64 (+ x1 (* x1 -2.0)))
double code(double x1, double x2) {
	return x1 + (x1 * -2.0);
}
real(8) function code(x1, x2)
    real(8), intent (in) :: x1
    real(8), intent (in) :: x2
    code = x1 + (x1 * (-2.0d0))
end function
public static double code(double x1, double x2) {
	return x1 + (x1 * -2.0);
}
def code(x1, x2):
	return x1 + (x1 * -2.0)
function code(x1, x2)
	return Float64(x1 + Float64(x1 * -2.0))
end
function tmp = code(x1, x2)
	tmp = x1 + (x1 * -2.0);
end
code[x1_, x2_] := N[(x1 + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x1 + x1 \cdot -2
\end{array}
Derivation
  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. Taylor expanded in x1 around 0 51.6%

    \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
  3. Taylor expanded in x1 around 0 60.5%

    \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right) + x1\right) + \color{blue}{\left(-3 \cdot x1 + -6 \cdot x2\right)}\right) \]
  4. Step-by-step derivation
    1. fma-def60.5%

      \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right) + x1\right) + \color{blue}{\mathsf{fma}\left(-3, x1, -6 \cdot x2\right)}\right) \]
    2. *-commutative60.5%

      \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right) + x1\right) + \mathsf{fma}\left(-3, x1, \color{blue}{x2 \cdot -6}\right)\right) \]
  5. Simplified60.5%

    \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right) + x1\right) + \color{blue}{\mathsf{fma}\left(-3, x1, x2 \cdot -6\right)}\right) \]
  6. Taylor expanded in x2 around 0 11.1%

    \[\leadsto x1 + \color{blue}{\left(x1 + -3 \cdot x1\right)} \]
  7. Step-by-step derivation
    1. distribute-rgt1-in11.2%

      \[\leadsto x1 + \color{blue}{\left(-3 + 1\right) \cdot x1} \]
    2. metadata-eval11.2%

      \[\leadsto x1 + \color{blue}{-2} \cdot x1 \]
    3. *-commutative11.2%

      \[\leadsto x1 + \color{blue}{x1 \cdot -2} \]
  8. Simplified11.2%

    \[\leadsto x1 + \color{blue}{x1 \cdot -2} \]
  9. Final simplification11.2%

    \[\leadsto x1 + x1 \cdot -2 \]

Alternative 30: 3.3% accurate, 127.0× speedup?

\[\begin{array}{l} \\ x1 \end{array} \]
(FPCore (x1 x2) :precision binary64 x1)
double code(double x1, double x2) {
	return x1;
}
real(8) function code(x1, x2)
    real(8), intent (in) :: x1
    real(8), intent (in) :: x2
    code = x1
end function
public static double code(double x1, double x2) {
	return x1;
}
def code(x1, x2):
	return x1
function code(x1, x2)
	return x1
end
function tmp = code(x1, x2)
	tmp = x1;
end
code[x1_, x2_] := x1
\begin{array}{l}

\\
x1
\end{array}
Derivation
  1. Initial program 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. Taylor expanded in x1 around 0 51.6%

    \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
  3. Taylor expanded in x1 around 0 29.1%

    \[\leadsto x1 + \color{blue}{-6 \cdot x2} \]
  4. Step-by-step derivation
    1. *-commutative29.1%

      \[\leadsto x1 + \color{blue}{x2 \cdot -6} \]
  5. Simplified29.1%

    \[\leadsto x1 + \color{blue}{x2 \cdot -6} \]
  6. Taylor expanded in x1 around inf 3.3%

    \[\leadsto \color{blue}{x1} \]
  7. Final simplification3.3%

    \[\leadsto x1 \]

Reproduce

?
herbie shell --seed 2023274 
(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))))))