Rosa's FloatVsDoubleBenchmark

Percentage Accurate: 70.0% → 99.5%
Time: 1.2min
Alternatives: 25
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 25 alternatives:

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

Initial Program: 70.0% accurate, 1.0× speedup?

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

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

Alternative 1: 99.5% accurate, 0.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}\\ t_3 := \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2 - x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}\\ \mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_2 \cdot 4 - 6\right)\right) + t_0 \cdot t_2\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1}\right) \leq \infty:\\ \;\;\;\;x1 + \mathsf{fma}\left(3, \frac{t_0 - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, x1 + \mathsf{fma}\left(\mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, x1 \cdot \mathsf{fma}\left(t_3, 4, -6\right), t_3 \cdot \left(\left(x1 \cdot 2\right) \cdot \left(t_3 + -3\right)\right)\right), \mathsf{fma}\left(t_0, t_3, {x1}^{3}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\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))
        (t_3 (/ (fma x1 (* x1 3.0) (- (* 2.0 x2) x1)) (fma x1 x1 1.0))))
   (if (<=
        (+
         x1
         (+
          (+
           x1
           (+
            (+
             (*
              t_1
              (+
               (* (* (* x1 2.0) t_2) (- t_2 3.0))
               (* (* x1 x1) (- (* t_2 4.0) 6.0))))
             (* t_0 t_2))
            (* x1 (* x1 x1))))
          (* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))
        INFINITY)
     (+
      x1
      (fma
       3.0
       (/ (- t_0 (fma 2.0 x2 x1)) (fma x1 x1 1.0))
       (+
        x1
        (fma
         (fma x1 x1 1.0)
         (fma x1 (* x1 (fma t_3 4.0 -6.0)) (* t_3 (* (* x1 2.0) (+ t_3 -3.0))))
         (fma t_0 t_3 (pow x1 3.0))))))
     (+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) 9.0)))))
double code(double x1, double x2) {
	double t_0 = x1 * (x1 * 3.0);
	double t_1 = (x1 * x1) + 1.0;
	double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
	double t_3 = fma(x1, (x1 * 3.0), ((2.0 * x2) - x1)) / fma(x1, x1, 1.0);
	double tmp;
	if ((x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))) <= ((double) INFINITY)) {
		tmp = x1 + fma(3.0, ((t_0 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), (x1 + fma(fma(x1, x1, 1.0), fma(x1, (x1 * fma(t_3, 4.0, -6.0)), (t_3 * ((x1 * 2.0) * (t_3 + -3.0)))), fma(t_0, t_3, pow(x1, 3.0)))));
	} else {
		tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + 9.0);
	}
	return tmp;
}
function code(x1, x2)
	t_0 = Float64(x1 * Float64(x1 * 3.0))
	t_1 = Float64(Float64(x1 * x1) + 1.0)
	t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1)
	t_3 = Float64(fma(x1, Float64(x1 * 3.0), Float64(Float64(2.0 * x2) - x1)) / fma(x1, x1, 1.0))
	tmp = 0.0
	if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(t_0 * t_2)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) <= Inf)
		tmp = Float64(x1 + fma(3.0, Float64(Float64(t_0 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), Float64(x1 + fma(fma(x1, x1, 1.0), fma(x1, Float64(x1 * fma(t_3, 4.0, -6.0)), Float64(t_3 * Float64(Float64(x1 * 2.0) * Float64(t_3 + -3.0)))), fma(t_0, t_3, (x1 ^ 3.0))))));
	else
		tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + 9.0));
	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]}, Block[{t$95$3 = N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision] + N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(3.0 * N[(N[(t$95$0 - N[(2.0 * x2 + x1), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * x1 + 1.0), $MachinePrecision] * N[(x1 * N[(x1 * N[(t$95$3 * 4.0 + -6.0), $MachinePrecision]), $MachinePrecision] + N[(t$95$3 * N[(N[(x1 * 2.0), $MachinePrecision] * N[(t$95$3 + -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$3 + N[Power[x1, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

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

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

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

      \[\leadsto \color{blue}{x1 + \mathsf{fma}\left(3, \frac{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)} \]

    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 inf 0.0%

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

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

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

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

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

Alternative 2: 99.3% accurate, 0.2× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\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.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. Step-by-step derivation
      1. fma-def99.4%

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

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

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

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

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

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

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

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

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

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

Alternative 3: 99.3% accurate, 0.5× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\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.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) \]

    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 inf 0.0%

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

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

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

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

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

Alternative 4: 93.2% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -1100000000 \lor \neg \left(x1 \leq 24\right):\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x1 < -1.1e9 or 24 < x1

    1. Initial program 36.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 34.1%

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

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

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

      \[\leadsto x1 + \left(\left(\color{blue}{6 \cdot {x1}^{4}} + x1\right) + 9\right) \]

    if -1.1e9 < x1 < 24

    1. Initial program 98.7%

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

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

Alternative 5: 96.5% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := t_0 + 2 \cdot x2\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{x1 - t_1}{t_2}\\
\mathbf{if}\;x1 \leq -9.5 \cdot 10^{+105} \lor \neg \left(x1 \leq 4 \cdot 10^{+75}\right):\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x1 < -9.4999999999999995e105 or 3.99999999999999971e75 < x1

    1. Initial program 11.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 inf 11.5%

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

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

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

      \[\leadsto x1 + \left(\left(\color{blue}{6 \cdot {x1}^{4}} + x1\right) + 9\right) \]

    if -9.4999999999999995e105 < x1 < 3.99999999999999971e75

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -9.5 \cdot 10^{+105} \lor \neg \left(x1 \leq 4 \cdot 10^{+75}\right):\\ \;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\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(\left(\left(\left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{x1 - \left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right)}{x1 \cdot x1 + 1} + \left(x1 \cdot x1 + 1\right) \cdot \left(\left(\left(x1 \cdot 2\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(3 + \frac{x1 - \left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right)}{x1 \cdot x1 + 1}\right) - \left(x1 \cdot x1\right) \cdot 6\right)\right) - x1 \cdot \left(x1 \cdot x1\right)\right) - x1\right)\right)\\ \end{array} \]

Alternative 6: 91.4% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;x1 \leq -7400000:\\
\;\;\;\;x1 + \left(9 + \left(x1 + \left(t_2 + \left(t_5 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(t_6 \cdot 4 - 6\right) + \frac{1}{x1} \cdot t_7\right) + t_1 \cdot \left(3 + \frac{-1}{x1}\right)\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 75:\\
\;\;\;\;x1 - \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(3 - 2 \cdot x2\right)\right)\right) - x1\right) + 3 \cdot \frac{x1 - \left(t_1 - 2 \cdot x2\right)}{t_5}\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x1 < -5.99999999999999968e108 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 inf 0.0%

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

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

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

        \[\leadsto x1 + \left(\left(-2 \cdot \left(2 \cdot x2 + \color{blue}{-3}\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. distribute-lft-in0.1%

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

        \[\leadsto x1 + \left(\left(\left(-2 \cdot \color{blue}{\left(x2 \cdot 2\right)} + -2 \cdot -3\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. associate-*l*0.1%

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

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

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

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

        \[\leadsto x1 + \left(\left(2 \cdot \color{blue}{\left(3 + -2 \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) \]
      10. distribute-lft-in0.1%

        \[\leadsto x1 + \left(\left(\color{blue}{\left(2 \cdot 3 + 2 \cdot \left(-2 \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) \]
      11. metadata-eval0.1%

        \[\leadsto x1 + \left(\left(\left(\color{blue}{6} + 2 \cdot \left(-2 \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) \]
      12. associate-*r*0.1%

        \[\leadsto x1 + \left(\left(\left(6 + \color{blue}{\left(2 \cdot -2\right) \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) \]
      13. metadata-eval0.1%

        \[\leadsto x1 + \left(\left(\left(6 + \color{blue}{-4} \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. Simplified0.1%

      \[\leadsto x1 + \left(\left(\color{blue}{\left(6 + -4 \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. Taylor expanded in x1 around 0 61.9%

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

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

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

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

        \[\leadsto x1 + \left(\left(\left(6 + -4 \cdot x2\right) + x1\right) + 3 \cdot \left(\left(3 - -2 \cdot x2\right) \cdot {x1}^{2} + \left(\color{blue}{\left(-2\right)} \cdot x2 + -1 \cdot x1\right)\right)\right) \]
      5. distribute-lft-neg-in61.9%

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

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

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

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

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

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

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

        \[\leadsto x1 + \left(\left(\left(6 + -4 \cdot x2\right) + x1\right) + 3 \cdot \left(\color{blue}{x1 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right)} - \mathsf{fma}\left(2, x2, x1\right)\right)\right) \]
      13. cancel-sign-sub-inv61.9%

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

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

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

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

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

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

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

        \[\leadsto x1 + \left(\left(\left(6 + -4 \cdot x2\right) + x1\right) + 3 \cdot \left(\color{blue}{\left(x1 \cdot x1\right)} \cdot 3 - x1\right)\right) \]
    11. Simplified86.9%

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

    if -5.99999999999999968e108 < x1 < -7.4e6

    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 inf 99.4%

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

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

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

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

    if -7.4e6 < x1 < 75

    1. Initial program 98.7%

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

    if 75 < x1 < 5.00000000000000018e153

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

Alternative 7: 91.4% accurate, 1.4× speedup?

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

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

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

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

\mathbf{elif}\;x1 \leq 5 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(9 + \left(x1 - \left(\left(t_4 \cdot \left(\left(t_5 - 3\right) \cdot t_6 + \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot \frac{x1 - t_3}{t_4}\right)\right) - x1 \cdot \left(-3 + x1 \cdot 9\right)\right) - t_1\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x1 < -2.6000000000000002e108 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 inf 0.0%

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

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

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

        \[\leadsto x1 + \left(\left(-2 \cdot \left(2 \cdot x2 + \color{blue}{-3}\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. distribute-lft-in0.1%

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

        \[\leadsto x1 + \left(\left(\left(-2 \cdot \color{blue}{\left(x2 \cdot 2\right)} + -2 \cdot -3\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. associate-*l*0.1%

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

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

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

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

        \[\leadsto x1 + \left(\left(2 \cdot \color{blue}{\left(3 + -2 \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) \]
      10. distribute-lft-in0.1%

        \[\leadsto x1 + \left(\left(\color{blue}{\left(2 \cdot 3 + 2 \cdot \left(-2 \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) \]
      11. metadata-eval0.1%

        \[\leadsto x1 + \left(\left(\left(\color{blue}{6} + 2 \cdot \left(-2 \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) \]
      12. associate-*r*0.1%

        \[\leadsto x1 + \left(\left(\left(6 + \color{blue}{\left(2 \cdot -2\right) \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) \]
      13. metadata-eval0.1%

        \[\leadsto x1 + \left(\left(\left(6 + \color{blue}{-4} \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. Simplified0.1%

      \[\leadsto x1 + \left(\left(\color{blue}{\left(6 + -4 \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. Taylor expanded in x1 around 0 61.9%

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

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

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

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

        \[\leadsto x1 + \left(\left(\left(6 + -4 \cdot x2\right) + x1\right) + 3 \cdot \left(\left(3 - -2 \cdot x2\right) \cdot {x1}^{2} + \left(\color{blue}{\left(-2\right)} \cdot x2 + -1 \cdot x1\right)\right)\right) \]
      5. distribute-lft-neg-in61.9%

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

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

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

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

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

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

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

        \[\leadsto x1 + \left(\left(\left(6 + -4 \cdot x2\right) + x1\right) + 3 \cdot \left(\color{blue}{x1 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right)} - \mathsf{fma}\left(2, x2, x1\right)\right)\right) \]
      13. cancel-sign-sub-inv61.9%

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

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

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

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

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

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

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

        \[\leadsto x1 + \left(\left(\left(6 + -4 \cdot x2\right) + x1\right) + 3 \cdot \left(\color{blue}{\left(x1 \cdot x1\right)} \cdot 3 - x1\right)\right) \]
    11. Simplified86.9%

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

    if -2.6000000000000002e108 < x1 < -6e5

    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 inf 99.4%

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

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

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

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

    if -6e5 < x1 < 145

    1. Initial program 98.7%

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

    if 145 < x1 < 5.00000000000000018e153

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -2.6 \cdot 10^{+108}:\\ \;\;\;\;x1 + \left(\left(x1 + \left(6 + x2 \cdot -4\right)\right) - 3 \cdot \left(x1 - 3 \cdot \left(x1 \cdot x1\right)\right)\right)\\ \mathbf{elif}\;x1 \leq -600000:\\ \;\;\;\;x1 + \left(9 + \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(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} \cdot 4 - 6\right) + \frac{1}{x1} \cdot \left(\left(x1 \cdot 2\right) \cdot \left(\frac{1}{x1} - 3\right)\right)\right) + \left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \left(3 + \frac{-1}{x1}\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 145:\\ \;\;\;\;x1 - \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(3 - 2 \cdot x2\right)\right)\right) - x1\right) + 3 \cdot \frac{x1 - \left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right)}{x1 \cdot x1 + 1}\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(\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(\frac{1}{x1} - 3\right)\right) + \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot \frac{x1 - \left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right)}{x1 \cdot x1 + 1}\right)\right) - x1 \cdot \left(-3 + x1 \cdot 9\right)\right) - x1 \cdot \left(x1 \cdot x1\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(\left(x1 + \left(6 + x2 \cdot -4\right)\right) - 3 \cdot \left(x1 - 3 \cdot \left(x1 \cdot x1\right)\right)\right)\\ \end{array} \]

Alternative 8: 91.4% accurate, 1.5× speedup?

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

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

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

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

\mathbf{elif}\;x1 \leq 5 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(9 - \left(\left(\left(t_4 \cdot \left(\left(t_5 - 3\right) \cdot t_6 + \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot \frac{x1 - t_3}{t_4}\right)\right) - \left(x1 \cdot x1\right) \cdot 9\right) - t_1\right) - x1\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x1 < -5.4e108 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 inf 0.0%

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

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

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

        \[\leadsto x1 + \left(\left(-2 \cdot \left(2 \cdot x2 + \color{blue}{-3}\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. distribute-lft-in0.1%

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

        \[\leadsto x1 + \left(\left(\left(-2 \cdot \color{blue}{\left(x2 \cdot 2\right)} + -2 \cdot -3\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. associate-*l*0.1%

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

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

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

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

        \[\leadsto x1 + \left(\left(2 \cdot \color{blue}{\left(3 + -2 \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) \]
      10. distribute-lft-in0.1%

        \[\leadsto x1 + \left(\left(\color{blue}{\left(2 \cdot 3 + 2 \cdot \left(-2 \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) \]
      11. metadata-eval0.1%

        \[\leadsto x1 + \left(\left(\left(\color{blue}{6} + 2 \cdot \left(-2 \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) \]
      12. associate-*r*0.1%

        \[\leadsto x1 + \left(\left(\left(6 + \color{blue}{\left(2 \cdot -2\right) \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) \]
      13. metadata-eval0.1%

        \[\leadsto x1 + \left(\left(\left(6 + \color{blue}{-4} \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. Simplified0.1%

      \[\leadsto x1 + \left(\left(\color{blue}{\left(6 + -4 \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. Taylor expanded in x1 around 0 61.9%

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

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

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

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

        \[\leadsto x1 + \left(\left(\left(6 + -4 \cdot x2\right) + x1\right) + 3 \cdot \left(\left(3 - -2 \cdot x2\right) \cdot {x1}^{2} + \left(\color{blue}{\left(-2\right)} \cdot x2 + -1 \cdot x1\right)\right)\right) \]
      5. distribute-lft-neg-in61.9%

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

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

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

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

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

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

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

        \[\leadsto x1 + \left(\left(\left(6 + -4 \cdot x2\right) + x1\right) + 3 \cdot \left(\color{blue}{x1 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right)} - \mathsf{fma}\left(2, x2, x1\right)\right)\right) \]
      13. cancel-sign-sub-inv61.9%

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

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

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

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

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

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

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

        \[\leadsto x1 + \left(\left(\left(6 + -4 \cdot x2\right) + x1\right) + 3 \cdot \left(\color{blue}{\left(x1 \cdot x1\right)} \cdot 3 - x1\right)\right) \]
    11. Simplified86.9%

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

    if -5.4e108 < x1 < -6e5

    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 inf 99.4%

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

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

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

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

    if -6e5 < x1 < 195

    1. Initial program 98.7%

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

    if 195 < x1 < 5.00000000000000018e153

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

Alternative 9: 91.4% accurate, 1.6× speedup?

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

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

\mathbf{elif}\;x1 \leq -600000:\\
\;\;\;\;t_3\\

\mathbf{elif}\;x1 \leq 50:\\
\;\;\;\;x1 - \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(3 - 2 \cdot x2\right)\right)\right) - x1\right) + 3 \cdot \frac{x1 - \left(t_0 - 2 \cdot x2\right)}{t_1}\right)\\

\mathbf{elif}\;x1 \leq 1.5 \cdot 10^{+154}:\\
\;\;\;\;t_3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x1 < -1.1e107 or 1.50000000000000013e154 < 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 inf 0.0%

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

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

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

        \[\leadsto x1 + \left(\left(-2 \cdot \left(2 \cdot x2 + \color{blue}{-3}\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. distribute-lft-in0.1%

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

        \[\leadsto x1 + \left(\left(\left(-2 \cdot \color{blue}{\left(x2 \cdot 2\right)} + -2 \cdot -3\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. associate-*l*0.1%

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

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

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

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

        \[\leadsto x1 + \left(\left(2 \cdot \color{blue}{\left(3 + -2 \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) \]
      10. distribute-lft-in0.1%

        \[\leadsto x1 + \left(\left(\color{blue}{\left(2 \cdot 3 + 2 \cdot \left(-2 \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) \]
      11. metadata-eval0.1%

        \[\leadsto x1 + \left(\left(\left(\color{blue}{6} + 2 \cdot \left(-2 \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) \]
      12. associate-*r*0.1%

        \[\leadsto x1 + \left(\left(\left(6 + \color{blue}{\left(2 \cdot -2\right) \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) \]
      13. metadata-eval0.1%

        \[\leadsto x1 + \left(\left(\left(6 + \color{blue}{-4} \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. Simplified0.1%

      \[\leadsto x1 + \left(\left(\color{blue}{\left(6 + -4 \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. Taylor expanded in x1 around 0 61.9%

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

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

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

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

        \[\leadsto x1 + \left(\left(\left(6 + -4 \cdot x2\right) + x1\right) + 3 \cdot \left(\left(3 - -2 \cdot x2\right) \cdot {x1}^{2} + \left(\color{blue}{\left(-2\right)} \cdot x2 + -1 \cdot x1\right)\right)\right) \]
      5. distribute-lft-neg-in61.9%

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

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

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

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

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

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

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

        \[\leadsto x1 + \left(\left(\left(6 + -4 \cdot x2\right) + x1\right) + 3 \cdot \left(\color{blue}{x1 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right)} - \mathsf{fma}\left(2, x2, x1\right)\right)\right) \]
      13. cancel-sign-sub-inv61.9%

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

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

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

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

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

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

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

        \[\leadsto x1 + \left(\left(\left(6 + -4 \cdot x2\right) + x1\right) + 3 \cdot \left(\color{blue}{\left(x1 \cdot x1\right)} \cdot 3 - x1\right)\right) \]
    11. Simplified86.9%

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

    if -1.1e107 < x1 < -6e5 or 50 < x1 < 1.50000000000000013e154

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

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

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

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

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

    if -6e5 < x1 < 50

    1. Initial program 98.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -1.1 \cdot 10^{+107}:\\ \;\;\;\;x1 + \left(\left(x1 + \left(6 + x2 \cdot -4\right)\right) - 3 \cdot \left(x1 - 3 \cdot \left(x1 \cdot x1\right)\right)\right)\\ \mathbf{elif}\;x1 \leq -600000:\\ \;\;\;\;x1 + \left(9 + \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(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} \cdot 4 - 6\right) + \frac{1}{x1} \cdot \left(\left(x1 \cdot 2\right) \cdot \left(\frac{1}{x1} - 3\right)\right)\right) + \left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \left(3 + \frac{-1}{x1}\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 50:\\ \;\;\;\;x1 - \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(3 - 2 \cdot x2\right)\right)\right) - x1\right) + 3 \cdot \frac{x1 - \left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right)}{x1 \cdot x1 + 1}\right)\\ \mathbf{elif}\;x1 \leq 1.5 \cdot 10^{+154}:\\ \;\;\;\;x1 + \left(9 + \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(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} \cdot 4 - 6\right) + \frac{1}{x1} \cdot \left(\left(x1 \cdot 2\right) \cdot \left(\frac{1}{x1} - 3\right)\right)\right) + \left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \left(3 + \frac{-1}{x1}\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(\left(x1 + \left(6 + x2 \cdot -4\right)\right) - 3 \cdot \left(x1 - 3 \cdot \left(x1 \cdot x1\right)\right)\right)\\ \end{array} \]

Alternative 10: 89.7% accurate, 1.7× speedup?

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

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

\mathbf{elif}\;x1 \leq -8200000:\\
\;\;\;\;t_3\\

\mathbf{elif}\;x1 \leq 520:\\
\;\;\;\;x1 - \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(3 - 2 \cdot x2\right)\right)\right) - x1\right) + 3 \cdot \frac{x1 - \left(t_1 - 2 \cdot x2\right)}{t_0}\right)\\

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

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


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

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

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

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

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

        \[\leadsto x1 + \left(\left(-2 \cdot \left(2 \cdot x2 + \color{blue}{-3}\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. distribute-lft-in0.1%

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

        \[\leadsto x1 + \left(\left(\left(-2 \cdot \color{blue}{\left(x2 \cdot 2\right)} + -2 \cdot -3\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. associate-*l*0.1%

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

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

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

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

        \[\leadsto x1 + \left(\left(2 \cdot \color{blue}{\left(3 + -2 \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) \]
      10. distribute-lft-in0.1%

        \[\leadsto x1 + \left(\left(\color{blue}{\left(2 \cdot 3 + 2 \cdot \left(-2 \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) \]
      11. metadata-eval0.1%

        \[\leadsto x1 + \left(\left(\left(\color{blue}{6} + 2 \cdot \left(-2 \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) \]
      12. associate-*r*0.1%

        \[\leadsto x1 + \left(\left(\left(6 + \color{blue}{\left(2 \cdot -2\right) \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) \]
      13. metadata-eval0.1%

        \[\leadsto x1 + \left(\left(\left(6 + \color{blue}{-4} \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. Simplified0.1%

      \[\leadsto x1 + \left(\left(\color{blue}{\left(6 + -4 \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. Taylor expanded in x1 around 0 62.3%

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

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

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

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

        \[\leadsto x1 + \left(\left(\left(6 + -4 \cdot x2\right) + x1\right) + 3 \cdot \left(\left(3 - -2 \cdot x2\right) \cdot {x1}^{2} + \left(\color{blue}{\left(-2\right)} \cdot x2 + -1 \cdot x1\right)\right)\right) \]
      5. distribute-lft-neg-in62.3%

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

        \[\leadsto x1 + \left(\left(\left(6 + -4 \cdot x2\right) + x1\right) + 3 \cdot \left(\left(3 - -2 \cdot x2\right) \cdot {x1}^{2} + \left(\left(-2 \cdot x2\right) + \color{blue}{\left(-x1\right)}\right)\right)\right) \]
      7. distribute-neg-in62.3%

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

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

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

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

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

        \[\leadsto x1 + \left(\left(\left(6 + -4 \cdot x2\right) + x1\right) + 3 \cdot \left(\color{blue}{x1 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right)} - \mathsf{fma}\left(2, x2, x1\right)\right)\right) \]
      13. cancel-sign-sub-inv62.3%

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

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

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

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

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

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

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

        \[\leadsto x1 + \left(\left(\left(6 + -4 \cdot x2\right) + x1\right) + 3 \cdot \left(\color{blue}{\left(x1 \cdot x1\right)} \cdot 3 - x1\right)\right) \]
    11. Simplified85.8%

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

    if -5.49999999999999981e102 < x1 < -8.2e6 or 520 < x1 < 5.00000000000000018e153

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

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

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

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

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

    if -8.2e6 < x1 < 520

    1. Initial program 98.7%

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

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

Alternative 11: 80.0% accurate, 3.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -2.6 \cdot 10^{+108} \lor \neg \left(x1 \leq 1.5 \cdot 10^{+154}\right):\\
\;\;\;\;x1 + \left(\left(x1 + \left(6 + x2 \cdot -4\right)\right) - 3 \cdot \left(x1 - 3 \cdot \left(x1 \cdot x1\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x1 < -2.6000000000000002e108 or 1.50000000000000013e154 < 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 inf 0.0%

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

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

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

        \[\leadsto x1 + \left(\left(-2 \cdot \left(2 \cdot x2 + \color{blue}{-3}\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. distribute-lft-in0.1%

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

        \[\leadsto x1 + \left(\left(\left(-2 \cdot \color{blue}{\left(x2 \cdot 2\right)} + -2 \cdot -3\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. associate-*l*0.1%

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

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

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

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

        \[\leadsto x1 + \left(\left(2 \cdot \color{blue}{\left(3 + -2 \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) \]
      10. distribute-lft-in0.1%

        \[\leadsto x1 + \left(\left(\color{blue}{\left(2 \cdot 3 + 2 \cdot \left(-2 \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) \]
      11. metadata-eval0.1%

        \[\leadsto x1 + \left(\left(\left(\color{blue}{6} + 2 \cdot \left(-2 \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) \]
      12. associate-*r*0.1%

        \[\leadsto x1 + \left(\left(\left(6 + \color{blue}{\left(2 \cdot -2\right) \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) \]
      13. metadata-eval0.1%

        \[\leadsto x1 + \left(\left(\left(6 + \color{blue}{-4} \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. Simplified0.1%

      \[\leadsto x1 + \left(\left(\color{blue}{\left(6 + -4 \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. Taylor expanded in x1 around 0 61.9%

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

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

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

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

        \[\leadsto x1 + \left(\left(\left(6 + -4 \cdot x2\right) + x1\right) + 3 \cdot \left(\left(3 - -2 \cdot x2\right) \cdot {x1}^{2} + \left(\color{blue}{\left(-2\right)} \cdot x2 + -1 \cdot x1\right)\right)\right) \]
      5. distribute-lft-neg-in61.9%

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

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

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

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

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

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

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

        \[\leadsto x1 + \left(\left(\left(6 + -4 \cdot x2\right) + x1\right) + 3 \cdot \left(\color{blue}{x1 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right)} - \mathsf{fma}\left(2, x2, x1\right)\right)\right) \]
      13. cancel-sign-sub-inv61.9%

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

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

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

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

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

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

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

        \[\leadsto x1 + \left(\left(\left(6 + -4 \cdot x2\right) + x1\right) + 3 \cdot \left(\color{blue}{\left(x1 \cdot x1\right)} \cdot 3 - x1\right)\right) \]
    11. Simplified86.9%

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

    if -2.6000000000000002e108 < x1 < 1.50000000000000013e154

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

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

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

Alternative 12: 69.8% accurate, 4.7× speedup?

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

\\
\begin{array}{l}
t_0 := x1 + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right) + x2 \cdot -6\right)\\
\mathbf{if}\;x1 \leq -2.25 \cdot 10^{+77}:\\
\;\;\;\;x1 - x2 \cdot \left(\left(x1 \cdot x1\right) \cdot -6 + 10\right)\\

\mathbf{elif}\;x1 \leq -1.06 \cdot 10^{-163}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;x1 \leq 5 \cdot 10^{-178}:\\
\;\;\;\;x2 \cdot -6 - x1\\

\mathbf{elif}\;x1 \leq 1.4 \cdot 10^{+154}:\\
\;\;\;\;t_0\\

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


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

    1. Initial program 14.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 inf 14.8%

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

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

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

        \[\leadsto x1 + \left(\left(-2 \cdot \left(2 \cdot x2 + \color{blue}{-3}\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. distribute-lft-in0.3%

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

        \[\leadsto x1 + \left(\left(\left(-2 \cdot \color{blue}{\left(x2 \cdot 2\right)} + -2 \cdot -3\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. associate-*l*0.3%

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

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

        \[\leadsto x1 + \left(\left(\left(\left(-2 \cdot x2\right) \cdot 2 + \color{blue}{3 \cdot 2}\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. distribute-rgt-in0.3%

        \[\leadsto x1 + \left(\left(\color{blue}{2 \cdot \left(-2 \cdot x2 + 3\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. +-commutative0.3%

        \[\leadsto x1 + \left(\left(2 \cdot \color{blue}{\left(3 + -2 \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) \]
      10. distribute-lft-in0.3%

        \[\leadsto x1 + \left(\left(\color{blue}{\left(2 \cdot 3 + 2 \cdot \left(-2 \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) \]
      11. metadata-eval0.3%

        \[\leadsto x1 + \left(\left(\left(\color{blue}{6} + 2 \cdot \left(-2 \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) \]
      12. associate-*r*0.3%

        \[\leadsto x1 + \left(\left(\left(6 + \color{blue}{\left(2 \cdot -2\right) \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) \]
      13. metadata-eval0.3%

        \[\leadsto x1 + \left(\left(\left(6 + \color{blue}{-4} \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. Simplified0.3%

      \[\leadsto x1 + \left(\left(\color{blue}{\left(6 + -4 \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. Taylor expanded in x1 around 0 51.4%

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

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

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

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

        \[\leadsto x1 + \left(\left(\left(6 + -4 \cdot x2\right) + x1\right) + 3 \cdot \left(\left(3 - -2 \cdot x2\right) \cdot {x1}^{2} + \left(\color{blue}{\left(-2\right)} \cdot x2 + -1 \cdot x1\right)\right)\right) \]
      5. distribute-lft-neg-in51.4%

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

        \[\leadsto x1 + \left(\left(\left(6 + -4 \cdot x2\right) + x1\right) + 3 \cdot \left(\left(3 - -2 \cdot x2\right) \cdot {x1}^{2} + \left(\left(-2 \cdot x2\right) + \color{blue}{\left(-x1\right)}\right)\right)\right) \]
      7. distribute-neg-in51.4%

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

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

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

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

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

        \[\leadsto x1 + \left(\left(\left(6 + -4 \cdot x2\right) + x1\right) + 3 \cdot \left(\color{blue}{x1 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right)} - \mathsf{fma}\left(2, x2, x1\right)\right)\right) \]
      13. cancel-sign-sub-inv51.4%

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

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

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

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

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

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

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

        \[\leadsto x1 + \left(-\color{blue}{\left(3 \cdot \left(-2 \cdot {x1}^{2} + 2\right) + 4\right) \cdot x2}\right) \]
      3. distribute-rgt-neg-in37.5%

        \[\leadsto x1 + \color{blue}{\left(3 \cdot \left(-2 \cdot {x1}^{2} + 2\right) + 4\right) \cdot \left(-x2\right)} \]
      4. distribute-rgt-in37.5%

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

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

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

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

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

        \[\leadsto x1 + \left({x1}^{2} \cdot \color{blue}{-6} + \left(6 + 4\right)\right) \cdot \left(-x2\right) \]
      10. unpow237.5%

        \[\leadsto x1 + \left(\color{blue}{\left(x1 \cdot x1\right)} \cdot -6 + \left(6 + 4\right)\right) \cdot \left(-x2\right) \]
      11. metadata-eval37.5%

        \[\leadsto x1 + \left(\left(x1 \cdot x1\right) \cdot -6 + \color{blue}{10}\right) \cdot \left(-x2\right) \]
    11. Simplified37.5%

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

    if -2.25000000000000012e77 < x1 < -1.06000000000000006e-163 or 4.99999999999999976e-178 < x1 < 1.4e154

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

      \[\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 -1.06000000000000006e-163 < x1 < 4.99999999999999976e-178

    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 x2 around inf 77.1%

      \[\leadsto x1 + \left(\left(\color{blue}{8 \cdot \frac{{x2}^{2} \cdot x1}{1 + {x1}^{2}}} + 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-/l*77.1%

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

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

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

        \[\leadsto x1 + \left(\left(8 \cdot \frac{x2 \cdot x2}{\frac{\color{blue}{x1 \cdot x1} + 1}{x1}} + 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-udef77.1%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-6 \cdot x2 + \left(x1 + -2 \cdot x1\right)} \]
      4. distribute-rgt1-in84.6%

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

        \[\leadsto -6 \cdot x2 + \color{blue}{-1} \cdot x1 \]
      6. mul-1-neg84.6%

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

        \[\leadsto \color{blue}{-6 \cdot x2 - x1} \]
      8. *-commutative84.6%

        \[\leadsto \color{blue}{x2 \cdot -6} - x1 \]
    10. Simplified84.6%

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

    if 1.4e154 < 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 6.1%

      \[\leadsto x1 + \color{blue}{-6 \cdot x2} \]
    4. Step-by-step derivation
      1. *-commutative6.1%

        \[\leadsto x1 + \color{blue}{x2 \cdot -6} \]
    5. Simplified6.1%

      \[\leadsto x1 + \color{blue}{x2 \cdot -6} \]
    6. Step-by-step derivation
      1. flip-+77.4%

        \[\leadsto \color{blue}{\frac{x1 \cdot x1 - \left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6}} \]
    7. Applied egg-rr77.4%

      \[\leadsto \color{blue}{\frac{x1 \cdot x1 - \left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6}} \]
    8. Step-by-step derivation
      1. swap-sqr77.4%

        \[\leadsto \frac{x1 \cdot x1 - \color{blue}{\left(x2 \cdot x2\right) \cdot \left(-6 \cdot -6\right)}}{x1 - x2 \cdot -6} \]
      2. metadata-eval77.4%

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

      \[\leadsto \color{blue}{\frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}} \]
    10. Taylor expanded in x1 around inf 93.5%

      \[\leadsto \frac{\color{blue}{{x1}^{2}}}{x1 - x2 \cdot -6} \]
    11. Step-by-step derivation
      1. unpow293.5%

        \[\leadsto \frac{\color{blue}{x1 \cdot x1}}{x1 - x2 \cdot -6} \]
    12. Simplified93.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -2.25 \cdot 10^{+77}:\\ \;\;\;\;x1 - x2 \cdot \left(\left(x1 \cdot x1\right) \cdot -6 + 10\right)\\ \mathbf{elif}\;x1 \leq -1.06 \cdot 10^{-163}:\\ \;\;\;\;x1 + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right) + x2 \cdot -6\right)\\ \mathbf{elif}\;x1 \leq 5 \cdot 10^{-178}:\\ \;\;\;\;x2 \cdot -6 - x1\\ \mathbf{elif}\;x1 \leq 1.4 \cdot 10^{+154}:\\ \;\;\;\;x1 + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right) + x2 \cdot -6\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x1 \cdot x1}{x1 - x2 \cdot -6}\\ \end{array} \]

Alternative 13: 75.8% accurate, 4.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 + \left(\left(x1 + \left(6 + x2 \cdot -4\right)\right) - 3 \cdot \left(x1 - 3 \cdot \left(x1 \cdot x1\right)\right)\right)\\ t_1 := x1 + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right) + x2 \cdot -6\right)\\ \mathbf{if}\;x1 \leq -2.4 \cdot 10^{+107}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x1 \leq -5.5 \cdot 10^{-167}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x1 \leq 5 \cdot 10^{-178}:\\ \;\;\;\;x2 \cdot -6 - x1\\ \mathbf{elif}\;x1 \leq 4.4 \cdot 10^{+153}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0
         (+
          x1
          (- (+ x1 (+ 6.0 (* x2 -4.0))) (* 3.0 (- x1 (* 3.0 (* x1 x1)))))))
        (t_1
         (+
          x1
          (+ (* x1 (- (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) 2.0)) (* x2 -6.0)))))
   (if (<= x1 -2.4e+107)
     t_0
     (if (<= x1 -5.5e-167)
       t_1
       (if (<= x1 5e-178) (- (* x2 -6.0) x1) (if (<= x1 4.4e+153) t_1 t_0))))))
double code(double x1, double x2) {
	double t_0 = x1 + ((x1 + (6.0 + (x2 * -4.0))) - (3.0 * (x1 - (3.0 * (x1 * x1)))));
	double t_1 = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0));
	double tmp;
	if (x1 <= -2.4e+107) {
		tmp = t_0;
	} else if (x1 <= -5.5e-167) {
		tmp = t_1;
	} else if (x1 <= 5e-178) {
		tmp = (x2 * -6.0) - x1;
	} else if (x1 <= 4.4e+153) {
		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 + ((x1 + (6.0d0 + (x2 * (-4.0d0)))) - (3.0d0 * (x1 - (3.0d0 * (x1 * x1)))))
    t_1 = x1 + ((x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) - 2.0d0)) + (x2 * (-6.0d0)))
    if (x1 <= (-2.4d+107)) then
        tmp = t_0
    else if (x1 <= (-5.5d-167)) then
        tmp = t_1
    else if (x1 <= 5d-178) then
        tmp = (x2 * (-6.0d0)) - x1
    else if (x1 <= 4.4d+153) 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 + ((x1 + (6.0 + (x2 * -4.0))) - (3.0 * (x1 - (3.0 * (x1 * x1)))));
	double t_1 = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0));
	double tmp;
	if (x1 <= -2.4e+107) {
		tmp = t_0;
	} else if (x1 <= -5.5e-167) {
		tmp = t_1;
	} else if (x1 <= 5e-178) {
		tmp = (x2 * -6.0) - x1;
	} else if (x1 <= 4.4e+153) {
		tmp = t_1;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x1, x2):
	t_0 = x1 + ((x1 + (6.0 + (x2 * -4.0))) - (3.0 * (x1 - (3.0 * (x1 * x1)))))
	t_1 = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0))
	tmp = 0
	if x1 <= -2.4e+107:
		tmp = t_0
	elif x1 <= -5.5e-167:
		tmp = t_1
	elif x1 <= 5e-178:
		tmp = (x2 * -6.0) - x1
	elif x1 <= 4.4e+153:
		tmp = t_1
	else:
		tmp = t_0
	return tmp
function code(x1, x2)
	t_0 = Float64(x1 + Float64(Float64(x1 + Float64(6.0 + Float64(x2 * -4.0))) - Float64(3.0 * Float64(x1 - Float64(3.0 * Float64(x1 * x1))))))
	t_1 = Float64(x1 + Float64(Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 2.0)) + Float64(x2 * -6.0)))
	tmp = 0.0
	if (x1 <= -2.4e+107)
		tmp = t_0;
	elseif (x1 <= -5.5e-167)
		tmp = t_1;
	elseif (x1 <= 5e-178)
		tmp = Float64(Float64(x2 * -6.0) - x1);
	elseif (x1 <= 4.4e+153)
		tmp = t_1;
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	t_0 = x1 + ((x1 + (6.0 + (x2 * -4.0))) - (3.0 * (x1 - (3.0 * (x1 * x1)))));
	t_1 = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0));
	tmp = 0.0;
	if (x1 <= -2.4e+107)
		tmp = t_0;
	elseif (x1 <= -5.5e-167)
		tmp = t_1;
	elseif (x1 <= 5e-178)
		tmp = (x2 * -6.0) - x1;
	elseif (x1 <= 4.4e+153)
		tmp = t_1;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(N[(x1 + N[(6.0 + N[(x2 * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(3.0 * N[(x1 - N[(3.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -2.4e+107], t$95$0, If[LessEqual[x1, -5.5e-167], t$95$1, If[LessEqual[x1, 5e-178], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision], If[LessEqual[x1, 4.4e+153], t$95$1, t$95$0]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x1 \leq -5.5 \cdot 10^{-167}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x1 \leq 5 \cdot 10^{-178}:\\
\;\;\;\;x2 \cdot -6 - x1\\

\mathbf{elif}\;x1 \leq 4.4 \cdot 10^{+153}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x1 < -2.4000000000000001e107 or 4.3999999999999999e153 < 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 inf 0.0%

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

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

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

        \[\leadsto x1 + \left(\left(-2 \cdot \left(2 \cdot x2 + \color{blue}{-3}\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. distribute-lft-in0.1%

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

        \[\leadsto x1 + \left(\left(\left(-2 \cdot \color{blue}{\left(x2 \cdot 2\right)} + -2 \cdot -3\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. associate-*l*0.1%

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

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

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

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

        \[\leadsto x1 + \left(\left(2 \cdot \color{blue}{\left(3 + -2 \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) \]
      10. distribute-lft-in0.1%

        \[\leadsto x1 + \left(\left(\color{blue}{\left(2 \cdot 3 + 2 \cdot \left(-2 \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) \]
      11. metadata-eval0.1%

        \[\leadsto x1 + \left(\left(\left(\color{blue}{6} + 2 \cdot \left(-2 \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) \]
      12. associate-*r*0.1%

        \[\leadsto x1 + \left(\left(\left(6 + \color{blue}{\left(2 \cdot -2\right) \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) \]
      13. metadata-eval0.1%

        \[\leadsto x1 + \left(\left(\left(6 + \color{blue}{-4} \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. Simplified0.1%

      \[\leadsto x1 + \left(\left(\color{blue}{\left(6 + -4 \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. Taylor expanded in x1 around 0 61.9%

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

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

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

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

        \[\leadsto x1 + \left(\left(\left(6 + -4 \cdot x2\right) + x1\right) + 3 \cdot \left(\left(3 - -2 \cdot x2\right) \cdot {x1}^{2} + \left(\color{blue}{\left(-2\right)} \cdot x2 + -1 \cdot x1\right)\right)\right) \]
      5. distribute-lft-neg-in61.9%

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

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

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

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

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

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

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

        \[\leadsto x1 + \left(\left(\left(6 + -4 \cdot x2\right) + x1\right) + 3 \cdot \left(\color{blue}{x1 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right)} - \mathsf{fma}\left(2, x2, x1\right)\right)\right) \]
      13. cancel-sign-sub-inv61.9%

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

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

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

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

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

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

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

        \[\leadsto x1 + \left(\left(\left(6 + -4 \cdot x2\right) + x1\right) + 3 \cdot \left(\color{blue}{\left(x1 \cdot x1\right)} \cdot 3 - x1\right)\right) \]
    11. Simplified86.9%

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

    if -2.4000000000000001e107 < x1 < -5.5000000000000003e-167 or 4.99999999999999976e-178 < x1 < 4.3999999999999999e153

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

      \[\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 -5.5000000000000003e-167 < x1 < 4.99999999999999976e-178

    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 x2 around inf 77.1%

      \[\leadsto x1 + \left(\left(\color{blue}{8 \cdot \frac{{x2}^{2} \cdot x1}{1 + {x1}^{2}}} + 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-/l*77.1%

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

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

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

        \[\leadsto x1 + \left(\left(8 \cdot \frac{x2 \cdot x2}{\frac{\color{blue}{x1 \cdot x1} + 1}{x1}} + 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-udef77.1%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-6 \cdot x2 + \left(x1 + -2 \cdot x1\right)} \]
      4. distribute-rgt1-in84.6%

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

        \[\leadsto -6 \cdot x2 + \color{blue}{-1} \cdot x1 \]
      6. mul-1-neg84.6%

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

        \[\leadsto \color{blue}{-6 \cdot x2 - x1} \]
      8. *-commutative84.6%

        \[\leadsto \color{blue}{x2 \cdot -6} - x1 \]
    10. Simplified84.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -2.4 \cdot 10^{+107}:\\ \;\;\;\;x1 + \left(\left(x1 + \left(6 + x2 \cdot -4\right)\right) - 3 \cdot \left(x1 - 3 \cdot \left(x1 \cdot x1\right)\right)\right)\\ \mathbf{elif}\;x1 \leq -5.5 \cdot 10^{-167}:\\ \;\;\;\;x1 + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right) + x2 \cdot -6\right)\\ \mathbf{elif}\;x1 \leq 5 \cdot 10^{-178}:\\ \;\;\;\;x2 \cdot -6 - x1\\ \mathbf{elif}\;x1 \leq 4.4 \cdot 10^{+153}:\\ \;\;\;\;x1 + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right) + x2 \cdot -6\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(\left(x1 + \left(6 + x2 \cdot -4\right)\right) - 3 \cdot \left(x1 - 3 \cdot \left(x1 \cdot x1\right)\right)\right)\\ \end{array} \]

Alternative 14: 75.9% accurate, 4.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 + \left(\left(x1 + \left(6 + x2 \cdot -4\right)\right) - 3 \cdot \left(x1 - 3 \cdot \left(x1 \cdot x1\right)\right)\right)\\ t_1 := x1 + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right) + x2 \cdot -6\right)\\ \mathbf{if}\;x1 \leq -4.6 \cdot 10^{+108}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x1 \leq -6.6 \cdot 10^{-239}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x1 \leq 6 \cdot 10^{-177}:\\ \;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2\right) - \left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(3 - 2 \cdot x2\right)\right)\right) - x1\right)\right)\\ \mathbf{elif}\;x1 \leq 4.5 \cdot 10^{+153}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0
         (+
          x1
          (- (+ x1 (+ 6.0 (* x2 -4.0))) (* 3.0 (- x1 (* 3.0 (* x1 x1)))))))
        (t_1
         (+
          x1
          (+ (* x1 (- (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) 2.0)) (* x2 -6.0)))))
   (if (<= x1 -4.6e+108)
     t_0
     (if (<= x1 -6.6e-239)
       t_1
       (if (<= x1 6e-177)
         (+
          x1
          (-
           (* 3.0 (* x2 -2.0))
           (- (* 4.0 (* x2 (* x1 (- 3.0 (* 2.0 x2))))) x1)))
         (if (<= x1 4.5e+153) t_1 t_0))))))
double code(double x1, double x2) {
	double t_0 = x1 + ((x1 + (6.0 + (x2 * -4.0))) - (3.0 * (x1 - (3.0 * (x1 * x1)))));
	double t_1 = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0));
	double tmp;
	if (x1 <= -4.6e+108) {
		tmp = t_0;
	} else if (x1 <= -6.6e-239) {
		tmp = t_1;
	} else if (x1 <= 6e-177) {
		tmp = x1 + ((3.0 * (x2 * -2.0)) - ((4.0 * (x2 * (x1 * (3.0 - (2.0 * x2))))) - x1));
	} else if (x1 <= 4.5e+153) {
		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 + ((x1 + (6.0d0 + (x2 * (-4.0d0)))) - (3.0d0 * (x1 - (3.0d0 * (x1 * x1)))))
    t_1 = x1 + ((x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) - 2.0d0)) + (x2 * (-6.0d0)))
    if (x1 <= (-4.6d+108)) then
        tmp = t_0
    else if (x1 <= (-6.6d-239)) then
        tmp = t_1
    else if (x1 <= 6d-177) then
        tmp = x1 + ((3.0d0 * (x2 * (-2.0d0))) - ((4.0d0 * (x2 * (x1 * (3.0d0 - (2.0d0 * x2))))) - x1))
    else if (x1 <= 4.5d+153) 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 + ((x1 + (6.0 + (x2 * -4.0))) - (3.0 * (x1 - (3.0 * (x1 * x1)))));
	double t_1 = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0));
	double tmp;
	if (x1 <= -4.6e+108) {
		tmp = t_0;
	} else if (x1 <= -6.6e-239) {
		tmp = t_1;
	} else if (x1 <= 6e-177) {
		tmp = x1 + ((3.0 * (x2 * -2.0)) - ((4.0 * (x2 * (x1 * (3.0 - (2.0 * x2))))) - x1));
	} else if (x1 <= 4.5e+153) {
		tmp = t_1;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x1, x2):
	t_0 = x1 + ((x1 + (6.0 + (x2 * -4.0))) - (3.0 * (x1 - (3.0 * (x1 * x1)))))
	t_1 = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0))
	tmp = 0
	if x1 <= -4.6e+108:
		tmp = t_0
	elif x1 <= -6.6e-239:
		tmp = t_1
	elif x1 <= 6e-177:
		tmp = x1 + ((3.0 * (x2 * -2.0)) - ((4.0 * (x2 * (x1 * (3.0 - (2.0 * x2))))) - x1))
	elif x1 <= 4.5e+153:
		tmp = t_1
	else:
		tmp = t_0
	return tmp
function code(x1, x2)
	t_0 = Float64(x1 + Float64(Float64(x1 + Float64(6.0 + Float64(x2 * -4.0))) - Float64(3.0 * Float64(x1 - Float64(3.0 * Float64(x1 * x1))))))
	t_1 = Float64(x1 + Float64(Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 2.0)) + Float64(x2 * -6.0)))
	tmp = 0.0
	if (x1 <= -4.6e+108)
		tmp = t_0;
	elseif (x1 <= -6.6e-239)
		tmp = t_1;
	elseif (x1 <= 6e-177)
		tmp = Float64(x1 + Float64(Float64(3.0 * Float64(x2 * -2.0)) - Float64(Float64(4.0 * Float64(x2 * Float64(x1 * Float64(3.0 - Float64(2.0 * x2))))) - x1)));
	elseif (x1 <= 4.5e+153)
		tmp = t_1;
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	t_0 = x1 + ((x1 + (6.0 + (x2 * -4.0))) - (3.0 * (x1 - (3.0 * (x1 * x1)))));
	t_1 = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0));
	tmp = 0.0;
	if (x1 <= -4.6e+108)
		tmp = t_0;
	elseif (x1 <= -6.6e-239)
		tmp = t_1;
	elseif (x1 <= 6e-177)
		tmp = x1 + ((3.0 * (x2 * -2.0)) - ((4.0 * (x2 * (x1 * (3.0 - (2.0 * x2))))) - x1));
	elseif (x1 <= 4.5e+153)
		tmp = t_1;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(N[(x1 + N[(6.0 + N[(x2 * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(3.0 * N[(x1 - N[(3.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -4.6e+108], t$95$0, If[LessEqual[x1, -6.6e-239], t$95$1, If[LessEqual[x1, 6e-177], N[(x1 + N[(N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision] - N[(N[(4.0 * N[(x2 * N[(x1 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.5e+153], t$95$1, t$95$0]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x1 \leq -6.6 \cdot 10^{-239}:\\
\;\;\;\;t_1\\

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

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

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


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

    1. Initial program 0.0%

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

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

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

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

        \[\leadsto x1 + \left(\left(-2 \cdot \left(2 \cdot x2 + \color{blue}{-3}\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. distribute-lft-in0.1%

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

        \[\leadsto x1 + \left(\left(\left(-2 \cdot \color{blue}{\left(x2 \cdot 2\right)} + -2 \cdot -3\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. associate-*l*0.1%

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

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

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

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

        \[\leadsto x1 + \left(\left(2 \cdot \color{blue}{\left(3 + -2 \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) \]
      10. distribute-lft-in0.1%

        \[\leadsto x1 + \left(\left(\color{blue}{\left(2 \cdot 3 + 2 \cdot \left(-2 \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) \]
      11. metadata-eval0.1%

        \[\leadsto x1 + \left(\left(\left(\color{blue}{6} + 2 \cdot \left(-2 \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) \]
      12. associate-*r*0.1%

        \[\leadsto x1 + \left(\left(\left(6 + \color{blue}{\left(2 \cdot -2\right) \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) \]
      13. metadata-eval0.1%

        \[\leadsto x1 + \left(\left(\left(6 + \color{blue}{-4} \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. Simplified0.1%

      \[\leadsto x1 + \left(\left(\color{blue}{\left(6 + -4 \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. Taylor expanded in x1 around 0 61.9%

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

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

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

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

        \[\leadsto x1 + \left(\left(\left(6 + -4 \cdot x2\right) + x1\right) + 3 \cdot \left(\left(3 - -2 \cdot x2\right) \cdot {x1}^{2} + \left(\color{blue}{\left(-2\right)} \cdot x2 + -1 \cdot x1\right)\right)\right) \]
      5. distribute-lft-neg-in61.9%

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

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

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

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

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

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

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

        \[\leadsto x1 + \left(\left(\left(6 + -4 \cdot x2\right) + x1\right) + 3 \cdot \left(\color{blue}{x1 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right)} - \mathsf{fma}\left(2, x2, x1\right)\right)\right) \]
      13. cancel-sign-sub-inv61.9%

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

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

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

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

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

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

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

        \[\leadsto x1 + \left(\left(\left(6 + -4 \cdot x2\right) + x1\right) + 3 \cdot \left(\color{blue}{\left(x1 \cdot x1\right)} \cdot 3 - x1\right)\right) \]
    11. Simplified86.9%

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

    if -4.5999999999999998e108 < x1 < -6.5999999999999999e-239 or 6.00000000000000015e-177 < x1 < 4.5000000000000001e153

    1. Initial program 98.6%

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

      \[\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 -6.5999999999999999e-239 < x1 < 6.00000000000000015e-177

    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(\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 97.8%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -4.6 \cdot 10^{+108}:\\ \;\;\;\;x1 + \left(\left(x1 + \left(6 + x2 \cdot -4\right)\right) - 3 \cdot \left(x1 - 3 \cdot \left(x1 \cdot x1\right)\right)\right)\\ \mathbf{elif}\;x1 \leq -6.6 \cdot 10^{-239}:\\ \;\;\;\;x1 + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right) + x2 \cdot -6\right)\\ \mathbf{elif}\;x1 \leq 6 \cdot 10^{-177}:\\ \;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2\right) - \left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(3 - 2 \cdot x2\right)\right)\right) - x1\right)\right)\\ \mathbf{elif}\;x1 \leq 4.5 \cdot 10^{+153}:\\ \;\;\;\;x1 + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right) + x2 \cdot -6\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(\left(x1 + \left(6 + x2 \cdot -4\right)\right) - 3 \cdot \left(x1 - 3 \cdot \left(x1 \cdot x1\right)\right)\right)\\ \end{array} \]

Alternative 15: 79.6% accurate, 4.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -1.15 \cdot 10^{+108} \lor \neg \left(x1 \leq 4.5 \cdot 10^{+153}\right):\\
\;\;\;\;x1 + \left(\left(x1 + \left(6 + x2 \cdot -4\right)\right) - 3 \cdot \left(x1 - 3 \cdot \left(x1 \cdot x1\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) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right)\\


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

    1. Initial program 0.0%

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

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

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

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

        \[\leadsto x1 + \left(\left(-2 \cdot \left(2 \cdot x2 + \color{blue}{-3}\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. distribute-lft-in0.1%

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

        \[\leadsto x1 + \left(\left(\left(-2 \cdot \color{blue}{\left(x2 \cdot 2\right)} + -2 \cdot -3\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. associate-*l*0.1%

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

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

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

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

        \[\leadsto x1 + \left(\left(2 \cdot \color{blue}{\left(3 + -2 \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) \]
      10. distribute-lft-in0.1%

        \[\leadsto x1 + \left(\left(\color{blue}{\left(2 \cdot 3 + 2 \cdot \left(-2 \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) \]
      11. metadata-eval0.1%

        \[\leadsto x1 + \left(\left(\left(\color{blue}{6} + 2 \cdot \left(-2 \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) \]
      12. associate-*r*0.1%

        \[\leadsto x1 + \left(\left(\left(6 + \color{blue}{\left(2 \cdot -2\right) \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) \]
      13. metadata-eval0.1%

        \[\leadsto x1 + \left(\left(\left(6 + \color{blue}{-4} \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. Simplified0.1%

      \[\leadsto x1 + \left(\left(\color{blue}{\left(6 + -4 \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. Taylor expanded in x1 around 0 61.9%

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

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

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

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

        \[\leadsto x1 + \left(\left(\left(6 + -4 \cdot x2\right) + x1\right) + 3 \cdot \left(\left(3 - -2 \cdot x2\right) \cdot {x1}^{2} + \left(\color{blue}{\left(-2\right)} \cdot x2 + -1 \cdot x1\right)\right)\right) \]
      5. distribute-lft-neg-in61.9%

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

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

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

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

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

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

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

        \[\leadsto x1 + \left(\left(\left(6 + -4 \cdot x2\right) + x1\right) + 3 \cdot \left(\color{blue}{x1 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right)} - \mathsf{fma}\left(2, x2, x1\right)\right)\right) \]
      13. cancel-sign-sub-inv61.9%

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

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

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

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

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

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

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

        \[\leadsto x1 + \left(\left(\left(6 + -4 \cdot x2\right) + x1\right) + 3 \cdot \left(\color{blue}{\left(x1 \cdot x1\right)} \cdot 3 - x1\right)\right) \]
    11. Simplified86.9%

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

    if -1.1499999999999999e108 < x1 < 4.5000000000000001e153

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -1.15 \cdot 10^{+108} \lor \neg \left(x1 \leq 4.5 \cdot 10^{+153}\right):\\ \;\;\;\;x1 + \left(\left(x1 + \left(6 + x2 \cdot -4\right)\right) - 3 \cdot \left(x1 - 3 \cdot \left(x1 \cdot x1\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) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right)\\ \end{array} \]

Alternative 16: 60.9% accurate, 6.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x1 \leq -2.05 \cdot 10^{+77}:\\ \;\;\;\;x1 - x2 \cdot \left(\left(x1 \cdot x1\right) \cdot -6 + 10\right)\\ \mathbf{elif}\;x1 \leq 1.85 \cdot 10^{-9}:\\ \;\;\;\;x2 \cdot -6 - x1\\ \mathbf{elif}\;x1 \leq 1.4 \cdot 10^{+154}:\\ \;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x1 \cdot x1}{x1 - x2 \cdot -6}\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (if (<= x1 -2.05e+77)
   (- x1 (* x2 (+ (* (* x1 x1) -6.0) 10.0)))
   (if (<= x1 1.85e-9)
     (- (* x2 -6.0) x1)
     (if (<= x1 1.4e+154)
       (+ x1 (* x1 (+ 1.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0))))))
       (/ (* x1 x1) (- x1 (* x2 -6.0)))))))
double code(double x1, double x2) {
	double tmp;
	if (x1 <= -2.05e+77) {
		tmp = x1 - (x2 * (((x1 * x1) * -6.0) + 10.0));
	} else if (x1 <= 1.85e-9) {
		tmp = (x2 * -6.0) - x1;
	} else if (x1 <= 1.4e+154) {
		tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
	} else {
		tmp = (x1 * x1) / (x1 - (x2 * -6.0));
	}
	return tmp;
}
real(8) function code(x1, x2)
    real(8), intent (in) :: x1
    real(8), intent (in) :: x2
    real(8) :: tmp
    if (x1 <= (-2.05d+77)) then
        tmp = x1 - (x2 * (((x1 * x1) * (-6.0d0)) + 10.0d0))
    else if (x1 <= 1.85d-9) then
        tmp = (x2 * (-6.0d0)) - x1
    else if (x1 <= 1.4d+154) then
        tmp = x1 + (x1 * (1.0d0 + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0)))))
    else
        tmp = (x1 * x1) / (x1 - (x2 * (-6.0d0)))
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double tmp;
	if (x1 <= -2.05e+77) {
		tmp = x1 - (x2 * (((x1 * x1) * -6.0) + 10.0));
	} else if (x1 <= 1.85e-9) {
		tmp = (x2 * -6.0) - x1;
	} else if (x1 <= 1.4e+154) {
		tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
	} else {
		tmp = (x1 * x1) / (x1 - (x2 * -6.0));
	}
	return tmp;
}
def code(x1, x2):
	tmp = 0
	if x1 <= -2.05e+77:
		tmp = x1 - (x2 * (((x1 * x1) * -6.0) + 10.0))
	elif x1 <= 1.85e-9:
		tmp = (x2 * -6.0) - x1
	elif x1 <= 1.4e+154:
		tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))))
	else:
		tmp = (x1 * x1) / (x1 - (x2 * -6.0))
	return tmp
function code(x1, x2)
	tmp = 0.0
	if (x1 <= -2.05e+77)
		tmp = Float64(x1 - Float64(x2 * Float64(Float64(Float64(x1 * x1) * -6.0) + 10.0)));
	elseif (x1 <= 1.85e-9)
		tmp = Float64(Float64(x2 * -6.0) - x1);
	elseif (x1 <= 1.4e+154)
		tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))))));
	else
		tmp = Float64(Float64(x1 * x1) / Float64(x1 - Float64(x2 * -6.0)));
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	tmp = 0.0;
	if (x1 <= -2.05e+77)
		tmp = x1 - (x2 * (((x1 * x1) * -6.0) + 10.0));
	elseif (x1 <= 1.85e-9)
		tmp = (x2 * -6.0) - x1;
	elseif (x1 <= 1.4e+154)
		tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
	else
		tmp = (x1 * x1) / (x1 - (x2 * -6.0));
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := If[LessEqual[x1, -2.05e+77], N[(x1 - N[(x2 * N[(N[(N[(x1 * x1), $MachinePrecision] * -6.0), $MachinePrecision] + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.85e-9], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision], If[LessEqual[x1, 1.4e+154], N[(x1 + N[(x1 * N[(1.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x1 * x1), $MachinePrecision] / N[(x1 - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

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

\mathbf{elif}\;x1 \leq 1.85 \cdot 10^{-9}:\\
\;\;\;\;x2 \cdot -6 - x1\\

\mathbf{elif}\;x1 \leq 1.4 \cdot 10^{+154}:\\
\;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\

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


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

    1. Initial program 14.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 inf 14.8%

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

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

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

        \[\leadsto x1 + \left(\left(-2 \cdot \left(2 \cdot x2 + \color{blue}{-3}\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. distribute-lft-in0.3%

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

        \[\leadsto x1 + \left(\left(\left(-2 \cdot \color{blue}{\left(x2 \cdot 2\right)} + -2 \cdot -3\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. associate-*l*0.3%

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

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

        \[\leadsto x1 + \left(\left(\left(\left(-2 \cdot x2\right) \cdot 2 + \color{blue}{3 \cdot 2}\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. distribute-rgt-in0.3%

        \[\leadsto x1 + \left(\left(\color{blue}{2 \cdot \left(-2 \cdot x2 + 3\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. +-commutative0.3%

        \[\leadsto x1 + \left(\left(2 \cdot \color{blue}{\left(3 + -2 \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) \]
      10. distribute-lft-in0.3%

        \[\leadsto x1 + \left(\left(\color{blue}{\left(2 \cdot 3 + 2 \cdot \left(-2 \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) \]
      11. metadata-eval0.3%

        \[\leadsto x1 + \left(\left(\left(\color{blue}{6} + 2 \cdot \left(-2 \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) \]
      12. associate-*r*0.3%

        \[\leadsto x1 + \left(\left(\left(6 + \color{blue}{\left(2 \cdot -2\right) \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) \]
      13. metadata-eval0.3%

        \[\leadsto x1 + \left(\left(\left(6 + \color{blue}{-4} \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. Simplified0.3%

      \[\leadsto x1 + \left(\left(\color{blue}{\left(6 + -4 \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. Taylor expanded in x1 around 0 51.4%

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

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

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

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

        \[\leadsto x1 + \left(\left(\left(6 + -4 \cdot x2\right) + x1\right) + 3 \cdot \left(\left(3 - -2 \cdot x2\right) \cdot {x1}^{2} + \left(\color{blue}{\left(-2\right)} \cdot x2 + -1 \cdot x1\right)\right)\right) \]
      5. distribute-lft-neg-in51.4%

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

        \[\leadsto x1 + \left(\left(\left(6 + -4 \cdot x2\right) + x1\right) + 3 \cdot \left(\left(3 - -2 \cdot x2\right) \cdot {x1}^{2} + \left(\left(-2 \cdot x2\right) + \color{blue}{\left(-x1\right)}\right)\right)\right) \]
      7. distribute-neg-in51.4%

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

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

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

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

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

        \[\leadsto x1 + \left(\left(\left(6 + -4 \cdot x2\right) + x1\right) + 3 \cdot \left(\color{blue}{x1 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right)} - \mathsf{fma}\left(2, x2, x1\right)\right)\right) \]
      13. cancel-sign-sub-inv51.4%

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

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

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

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

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

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

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

        \[\leadsto x1 + \left(-\color{blue}{\left(3 \cdot \left(-2 \cdot {x1}^{2} + 2\right) + 4\right) \cdot x2}\right) \]
      3. distribute-rgt-neg-in37.5%

        \[\leadsto x1 + \color{blue}{\left(3 \cdot \left(-2 \cdot {x1}^{2} + 2\right) + 4\right) \cdot \left(-x2\right)} \]
      4. distribute-rgt-in37.5%

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

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

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

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

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

        \[\leadsto x1 + \left({x1}^{2} \cdot \color{blue}{-6} + \left(6 + 4\right)\right) \cdot \left(-x2\right) \]
      10. unpow237.5%

        \[\leadsto x1 + \left(\color{blue}{\left(x1 \cdot x1\right)} \cdot -6 + \left(6 + 4\right)\right) \cdot \left(-x2\right) \]
      11. metadata-eval37.5%

        \[\leadsto x1 + \left(\left(x1 \cdot x1\right) \cdot -6 + \color{blue}{10}\right) \cdot \left(-x2\right) \]
    11. Simplified37.5%

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

    if -2.05e77 < x1 < 1.85e-9

    1. Initial program 98.7%

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

      \[\leadsto x1 + \left(\left(\color{blue}{8 \cdot \frac{{x2}^{2} \cdot x1}{1 + {x1}^{2}}} + 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-/l*79.9%

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

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

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

        \[\leadsto x1 + \left(\left(8 \cdot \frac{x2 \cdot x2}{\frac{\color{blue}{x1 \cdot x1} + 1}{x1}} + 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-udef79.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-6 \cdot x2 + \left(x1 + -2 \cdot x1\right)} \]
      4. distribute-rgt1-in68.1%

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

        \[\leadsto -6 \cdot x2 + \color{blue}{-1} \cdot x1 \]
      6. mul-1-neg68.1%

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

        \[\leadsto \color{blue}{-6 \cdot x2 - x1} \]
      8. *-commutative68.1%

        \[\leadsto \color{blue}{x2 \cdot -6} - x1 \]
    10. Simplified68.1%

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

    if 1.85e-9 < x1 < 1.4e154

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

      \[\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 inf 30.5%

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

    if 1.4e154 < 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 6.1%

      \[\leadsto x1 + \color{blue}{-6 \cdot x2} \]
    4. Step-by-step derivation
      1. *-commutative6.1%

        \[\leadsto x1 + \color{blue}{x2 \cdot -6} \]
    5. Simplified6.1%

      \[\leadsto x1 + \color{blue}{x2 \cdot -6} \]
    6. Step-by-step derivation
      1. flip-+77.4%

        \[\leadsto \color{blue}{\frac{x1 \cdot x1 - \left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6}} \]
    7. Applied egg-rr77.4%

      \[\leadsto \color{blue}{\frac{x1 \cdot x1 - \left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6}} \]
    8. Step-by-step derivation
      1. swap-sqr77.4%

        \[\leadsto \frac{x1 \cdot x1 - \color{blue}{\left(x2 \cdot x2\right) \cdot \left(-6 \cdot -6\right)}}{x1 - x2 \cdot -6} \]
      2. metadata-eval77.4%

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

      \[\leadsto \color{blue}{\frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}} \]
    10. Taylor expanded in x1 around inf 93.5%

      \[\leadsto \frac{\color{blue}{{x1}^{2}}}{x1 - x2 \cdot -6} \]
    11. Step-by-step derivation
      1. unpow293.5%

        \[\leadsto \frac{\color{blue}{x1 \cdot x1}}{x1 - x2 \cdot -6} \]
    12. Simplified93.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -2.05 \cdot 10^{+77}:\\ \;\;\;\;x1 - x2 \cdot \left(\left(x1 \cdot x1\right) \cdot -6 + 10\right)\\ \mathbf{elif}\;x1 \leq 1.85 \cdot 10^{-9}:\\ \;\;\;\;x2 \cdot -6 - x1\\ \mathbf{elif}\;x1 \leq 1.4 \cdot 10^{+154}:\\ \;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x1 \cdot x1}{x1 - x2 \cdot -6}\\ \end{array} \]

Alternative 17: 57.4% accurate, 7.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 + \left(x1 \cdot \left(x2 \cdot x2\right)\right) \cdot 8\\ t_1 := x1 - x2 \cdot -6\\ \mathbf{if}\;x1 \leq -2.15 \cdot 10^{+106}:\\ \;\;\;\;\frac{\left(x2 \cdot x2\right) \cdot -36}{t_1}\\ \mathbf{elif}\;x1 \leq -8.5 \cdot 10^{-17}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x1 \leq 1.02 \cdot 10^{-8}:\\ \;\;\;\;x2 \cdot -6 - x1\\ \mathbf{elif}\;x1 \leq 1.4 \cdot 10^{+154}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{x1 \cdot x1}{t_1}\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (+ x1 (* (* x1 (* x2 x2)) 8.0))) (t_1 (- x1 (* x2 -6.0))))
   (if (<= x1 -2.15e+106)
     (/ (* (* x2 x2) -36.0) t_1)
     (if (<= x1 -8.5e-17)
       t_0
       (if (<= x1 1.02e-8)
         (- (* x2 -6.0) x1)
         (if (<= x1 1.4e+154) t_0 (/ (* x1 x1) t_1)))))))
double code(double x1, double x2) {
	double t_0 = x1 + ((x1 * (x2 * x2)) * 8.0);
	double t_1 = x1 - (x2 * -6.0);
	double tmp;
	if (x1 <= -2.15e+106) {
		tmp = ((x2 * x2) * -36.0) / t_1;
	} else if (x1 <= -8.5e-17) {
		tmp = t_0;
	} else if (x1 <= 1.02e-8) {
		tmp = (x2 * -6.0) - x1;
	} else if (x1 <= 1.4e+154) {
		tmp = t_0;
	} else {
		tmp = (x1 * x1) / 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 + ((x1 * (x2 * x2)) * 8.0d0)
    t_1 = x1 - (x2 * (-6.0d0))
    if (x1 <= (-2.15d+106)) then
        tmp = ((x2 * x2) * (-36.0d0)) / t_1
    else if (x1 <= (-8.5d-17)) then
        tmp = t_0
    else if (x1 <= 1.02d-8) then
        tmp = (x2 * (-6.0d0)) - x1
    else if (x1 <= 1.4d+154) then
        tmp = t_0
    else
        tmp = (x1 * x1) / t_1
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double t_0 = x1 + ((x1 * (x2 * x2)) * 8.0);
	double t_1 = x1 - (x2 * -6.0);
	double tmp;
	if (x1 <= -2.15e+106) {
		tmp = ((x2 * x2) * -36.0) / t_1;
	} else if (x1 <= -8.5e-17) {
		tmp = t_0;
	} else if (x1 <= 1.02e-8) {
		tmp = (x2 * -6.0) - x1;
	} else if (x1 <= 1.4e+154) {
		tmp = t_0;
	} else {
		tmp = (x1 * x1) / t_1;
	}
	return tmp;
}
def code(x1, x2):
	t_0 = x1 + ((x1 * (x2 * x2)) * 8.0)
	t_1 = x1 - (x2 * -6.0)
	tmp = 0
	if x1 <= -2.15e+106:
		tmp = ((x2 * x2) * -36.0) / t_1
	elif x1 <= -8.5e-17:
		tmp = t_0
	elif x1 <= 1.02e-8:
		tmp = (x2 * -6.0) - x1
	elif x1 <= 1.4e+154:
		tmp = t_0
	else:
		tmp = (x1 * x1) / t_1
	return tmp
function code(x1, x2)
	t_0 = Float64(x1 + Float64(Float64(x1 * Float64(x2 * x2)) * 8.0))
	t_1 = Float64(x1 - Float64(x2 * -6.0))
	tmp = 0.0
	if (x1 <= -2.15e+106)
		tmp = Float64(Float64(Float64(x2 * x2) * -36.0) / t_1);
	elseif (x1 <= -8.5e-17)
		tmp = t_0;
	elseif (x1 <= 1.02e-8)
		tmp = Float64(Float64(x2 * -6.0) - x1);
	elseif (x1 <= 1.4e+154)
		tmp = t_0;
	else
		tmp = Float64(Float64(x1 * x1) / t_1);
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	t_0 = x1 + ((x1 * (x2 * x2)) * 8.0);
	t_1 = x1 - (x2 * -6.0);
	tmp = 0.0;
	if (x1 <= -2.15e+106)
		tmp = ((x2 * x2) * -36.0) / t_1;
	elseif (x1 <= -8.5e-17)
		tmp = t_0;
	elseif (x1 <= 1.02e-8)
		tmp = (x2 * -6.0) - x1;
	elseif (x1 <= 1.4e+154)
		tmp = t_0;
	else
		tmp = (x1 * x1) / t_1;
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(N[(x1 * N[(x2 * x2), $MachinePrecision]), $MachinePrecision] * 8.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -2.15e+106], N[(N[(N[(x2 * x2), $MachinePrecision] * -36.0), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[x1, -8.5e-17], t$95$0, If[LessEqual[x1, 1.02e-8], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision], If[LessEqual[x1, 1.4e+154], t$95$0, N[(N[(x1 * x1), $MachinePrecision] / t$95$1), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x1 + \left(x1 \cdot \left(x2 \cdot x2\right)\right) \cdot 8\\
t_1 := x1 - x2 \cdot -6\\
\mathbf{if}\;x1 \leq -2.15 \cdot 10^{+106}:\\
\;\;\;\;\frac{\left(x2 \cdot x2\right) \cdot -36}{t_1}\\

\mathbf{elif}\;x1 \leq -8.5 \cdot 10^{-17}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;x1 \leq 1.02 \cdot 10^{-8}:\\
\;\;\;\;x2 \cdot -6 - x1\\

\mathbf{elif}\;x1 \leq 1.4 \cdot 10^{+154}:\\
\;\;\;\;t_0\\

\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1}{t_1}\\


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

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

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

      \[\leadsto x1 + \color{blue}{-6 \cdot x2} \]
    4. Step-by-step derivation
      1. *-commutative0.7%

        \[\leadsto x1 + \color{blue}{x2 \cdot -6} \]
    5. Simplified0.7%

      \[\leadsto x1 + \color{blue}{x2 \cdot -6} \]
    6. Step-by-step derivation
      1. flip-+2.2%

        \[\leadsto \color{blue}{\frac{x1 \cdot x1 - \left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6}} \]
    7. Applied egg-rr2.2%

      \[\leadsto \color{blue}{\frac{x1 \cdot x1 - \left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6}} \]
    8. Step-by-step derivation
      1. swap-sqr2.2%

        \[\leadsto \frac{x1 \cdot x1 - \color{blue}{\left(x2 \cdot x2\right) \cdot \left(-6 \cdot -6\right)}}{x1 - x2 \cdot -6} \]
      2. metadata-eval2.2%

        \[\leadsto \frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot \color{blue}{36}}{x1 - x2 \cdot -6} \]
    9. Simplified2.2%

      \[\leadsto \color{blue}{\frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}} \]
    10. Taylor expanded in x1 around 0 23.2%

      \[\leadsto \frac{\color{blue}{-36 \cdot {x2}^{2}}}{x1 - x2 \cdot -6} \]
    11. Step-by-step derivation
      1. unpow223.2%

        \[\leadsto \frac{-36 \cdot \color{blue}{\left(x2 \cdot x2\right)}}{x1 - x2 \cdot -6} \]
    12. Simplified23.2%

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

    if -2.15e106 < x1 < -8.5e-17 or 1.02000000000000003e-8 < x1 < 1.4e154

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

      \[\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 x2 around inf 31.5%

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

        \[\leadsto x1 + \color{blue}{\left({x2}^{2} \cdot x1\right) \cdot 8} \]
      2. *-commutative31.5%

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

        \[\leadsto x1 + \left(x1 \cdot \color{blue}{\left(x2 \cdot x2\right)}\right) \cdot 8 \]
    5. Simplified31.5%

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

    if -8.5e-17 < x1 < 1.02000000000000003e-8

    1. Initial program 98.7%

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

      \[\leadsto x1 + \left(\left(\color{blue}{8 \cdot \frac{{x2}^{2} \cdot x1}{1 + {x1}^{2}}} + 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-/l*85.5%

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

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

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

        \[\leadsto x1 + \left(\left(8 \cdot \frac{x2 \cdot x2}{\frac{\color{blue}{x1 \cdot x1} + 1}{x1}} + 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-udef85.5%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-6 \cdot x2 + \left(x1 + -2 \cdot x1\right)} \]
      4. distribute-rgt1-in75.0%

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

        \[\leadsto -6 \cdot x2 + \color{blue}{-1} \cdot x1 \]
      6. mul-1-neg75.0%

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

        \[\leadsto \color{blue}{-6 \cdot x2 - x1} \]
      8. *-commutative75.0%

        \[\leadsto \color{blue}{x2 \cdot -6} - x1 \]
    10. Simplified75.0%

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

    if 1.4e154 < 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 6.1%

      \[\leadsto x1 + \color{blue}{-6 \cdot x2} \]
    4. Step-by-step derivation
      1. *-commutative6.1%

        \[\leadsto x1 + \color{blue}{x2 \cdot -6} \]
    5. Simplified6.1%

      \[\leadsto x1 + \color{blue}{x2 \cdot -6} \]
    6. Step-by-step derivation
      1. flip-+77.4%

        \[\leadsto \color{blue}{\frac{x1 \cdot x1 - \left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6}} \]
    7. Applied egg-rr77.4%

      \[\leadsto \color{blue}{\frac{x1 \cdot x1 - \left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6}} \]
    8. Step-by-step derivation
      1. swap-sqr77.4%

        \[\leadsto \frac{x1 \cdot x1 - \color{blue}{\left(x2 \cdot x2\right) \cdot \left(-6 \cdot -6\right)}}{x1 - x2 \cdot -6} \]
      2. metadata-eval77.4%

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

      \[\leadsto \color{blue}{\frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}} \]
    10. Taylor expanded in x1 around inf 93.5%

      \[\leadsto \frac{\color{blue}{{x1}^{2}}}{x1 - x2 \cdot -6} \]
    11. Step-by-step derivation
      1. unpow293.5%

        \[\leadsto \frac{\color{blue}{x1 \cdot x1}}{x1 - x2 \cdot -6} \]
    12. Simplified93.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -2.15 \cdot 10^{+106}:\\ \;\;\;\;\frac{\left(x2 \cdot x2\right) \cdot -36}{x1 - x2 \cdot -6}\\ \mathbf{elif}\;x1 \leq -8.5 \cdot 10^{-17}:\\ \;\;\;\;x1 + \left(x1 \cdot \left(x2 \cdot x2\right)\right) \cdot 8\\ \mathbf{elif}\;x1 \leq 1.02 \cdot 10^{-8}:\\ \;\;\;\;x2 \cdot -6 - x1\\ \mathbf{elif}\;x1 \leq 1.4 \cdot 10^{+154}:\\ \;\;\;\;x1 + \left(x1 \cdot \left(x2 \cdot x2\right)\right) \cdot 8\\ \mathbf{else}:\\ \;\;\;\;\frac{x1 \cdot x1}{x1 - x2 \cdot -6}\\ \end{array} \]

Alternative 18: 60.9% accurate, 8.4× speedup?

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

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

\mathbf{elif}\;x1 \leq 1.15 \cdot 10^{-9}:\\
\;\;\;\;x2 \cdot -6 - x1\\

\mathbf{elif}\;x1 \leq 1.4 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(x1 \cdot \left(x2 \cdot x2\right)\right) \cdot 8\\

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


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

    1. Initial program 14.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 inf 14.8%

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

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

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

        \[\leadsto x1 + \left(\left(-2 \cdot \left(2 \cdot x2 + \color{blue}{-3}\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. distribute-lft-in0.3%

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

        \[\leadsto x1 + \left(\left(\left(-2 \cdot \color{blue}{\left(x2 \cdot 2\right)} + -2 \cdot -3\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. associate-*l*0.3%

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

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

        \[\leadsto x1 + \left(\left(\left(\left(-2 \cdot x2\right) \cdot 2 + \color{blue}{3 \cdot 2}\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. distribute-rgt-in0.3%

        \[\leadsto x1 + \left(\left(\color{blue}{2 \cdot \left(-2 \cdot x2 + 3\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. +-commutative0.3%

        \[\leadsto x1 + \left(\left(2 \cdot \color{blue}{\left(3 + -2 \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) \]
      10. distribute-lft-in0.3%

        \[\leadsto x1 + \left(\left(\color{blue}{\left(2 \cdot 3 + 2 \cdot \left(-2 \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) \]
      11. metadata-eval0.3%

        \[\leadsto x1 + \left(\left(\left(\color{blue}{6} + 2 \cdot \left(-2 \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) \]
      12. associate-*r*0.3%

        \[\leadsto x1 + \left(\left(\left(6 + \color{blue}{\left(2 \cdot -2\right) \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) \]
      13. metadata-eval0.3%

        \[\leadsto x1 + \left(\left(\left(6 + \color{blue}{-4} \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. Simplified0.3%

      \[\leadsto x1 + \left(\left(\color{blue}{\left(6 + -4 \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. Taylor expanded in x1 around 0 51.4%

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

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

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

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

        \[\leadsto x1 + \left(\left(\left(6 + -4 \cdot x2\right) + x1\right) + 3 \cdot \left(\left(3 - -2 \cdot x2\right) \cdot {x1}^{2} + \left(\color{blue}{\left(-2\right)} \cdot x2 + -1 \cdot x1\right)\right)\right) \]
      5. distribute-lft-neg-in51.4%

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

        \[\leadsto x1 + \left(\left(\left(6 + -4 \cdot x2\right) + x1\right) + 3 \cdot \left(\left(3 - -2 \cdot x2\right) \cdot {x1}^{2} + \left(\left(-2 \cdot x2\right) + \color{blue}{\left(-x1\right)}\right)\right)\right) \]
      7. distribute-neg-in51.4%

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

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

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

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

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

        \[\leadsto x1 + \left(\left(\left(6 + -4 \cdot x2\right) + x1\right) + 3 \cdot \left(\color{blue}{x1 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right)} - \mathsf{fma}\left(2, x2, x1\right)\right)\right) \]
      13. cancel-sign-sub-inv51.4%

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

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

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

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

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

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

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

        \[\leadsto x1 + \left(-\color{blue}{\left(3 \cdot \left(-2 \cdot {x1}^{2} + 2\right) + 4\right) \cdot x2}\right) \]
      3. distribute-rgt-neg-in37.5%

        \[\leadsto x1 + \color{blue}{\left(3 \cdot \left(-2 \cdot {x1}^{2} + 2\right) + 4\right) \cdot \left(-x2\right)} \]
      4. distribute-rgt-in37.5%

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

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

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

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

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

        \[\leadsto x1 + \left({x1}^{2} \cdot \color{blue}{-6} + \left(6 + 4\right)\right) \cdot \left(-x2\right) \]
      10. unpow237.5%

        \[\leadsto x1 + \left(\color{blue}{\left(x1 \cdot x1\right)} \cdot -6 + \left(6 + 4\right)\right) \cdot \left(-x2\right) \]
      11. metadata-eval37.5%

        \[\leadsto x1 + \left(\left(x1 \cdot x1\right) \cdot -6 + \color{blue}{10}\right) \cdot \left(-x2\right) \]
    11. Simplified37.5%

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

    if -2.05e77 < x1 < 1.15e-9

    1. Initial program 98.7%

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

      \[\leadsto x1 + \left(\left(\color{blue}{8 \cdot \frac{{x2}^{2} \cdot x1}{1 + {x1}^{2}}} + 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-/l*79.9%

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

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

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

        \[\leadsto x1 + \left(\left(8 \cdot \frac{x2 \cdot x2}{\frac{\color{blue}{x1 \cdot x1} + 1}{x1}} + 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-udef79.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-6 \cdot x2 + \left(x1 + -2 \cdot x1\right)} \]
      4. distribute-rgt1-in68.1%

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

        \[\leadsto -6 \cdot x2 + \color{blue}{-1} \cdot x1 \]
      6. mul-1-neg68.1%

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

        \[\leadsto \color{blue}{-6 \cdot x2 - x1} \]
      8. *-commutative68.1%

        \[\leadsto \color{blue}{x2 \cdot -6} - x1 \]
    10. Simplified68.1%

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

    if 1.15e-9 < x1 < 1.4e154

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

      \[\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 x2 around inf 30.5%

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

        \[\leadsto x1 + \color{blue}{\left({x2}^{2} \cdot x1\right) \cdot 8} \]
      2. *-commutative30.5%

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

        \[\leadsto x1 + \left(x1 \cdot \color{blue}{\left(x2 \cdot x2\right)}\right) \cdot 8 \]
    5. Simplified30.5%

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

    if 1.4e154 < 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 6.1%

      \[\leadsto x1 + \color{blue}{-6 \cdot x2} \]
    4. Step-by-step derivation
      1. *-commutative6.1%

        \[\leadsto x1 + \color{blue}{x2 \cdot -6} \]
    5. Simplified6.1%

      \[\leadsto x1 + \color{blue}{x2 \cdot -6} \]
    6. Step-by-step derivation
      1. flip-+77.4%

        \[\leadsto \color{blue}{\frac{x1 \cdot x1 - \left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6}} \]
    7. Applied egg-rr77.4%

      \[\leadsto \color{blue}{\frac{x1 \cdot x1 - \left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6}} \]
    8. Step-by-step derivation
      1. swap-sqr77.4%

        \[\leadsto \frac{x1 \cdot x1 - \color{blue}{\left(x2 \cdot x2\right) \cdot \left(-6 \cdot -6\right)}}{x1 - x2 \cdot -6} \]
      2. metadata-eval77.4%

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

      \[\leadsto \color{blue}{\frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}} \]
    10. Taylor expanded in x1 around inf 93.5%

      \[\leadsto \frac{\color{blue}{{x1}^{2}}}{x1 - x2 \cdot -6} \]
    11. Step-by-step derivation
      1. unpow293.5%

        \[\leadsto \frac{\color{blue}{x1 \cdot x1}}{x1 - x2 \cdot -6} \]
    12. Simplified93.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -2.05 \cdot 10^{+77}:\\ \;\;\;\;x1 - x2 \cdot \left(\left(x1 \cdot x1\right) \cdot -6 + 10\right)\\ \mathbf{elif}\;x1 \leq 1.15 \cdot 10^{-9}:\\ \;\;\;\;x2 \cdot -6 - x1\\ \mathbf{elif}\;x1 \leq 1.4 \cdot 10^{+154}:\\ \;\;\;\;x1 + \left(x1 \cdot \left(x2 \cdot x2\right)\right) \cdot 8\\ \mathbf{else}:\\ \;\;\;\;\frac{x1 \cdot x1}{x1 - x2 \cdot -6}\\ \end{array} \]

Alternative 19: 48.9% accurate, 9.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -4.8 \cdot 10^{+126} \lor \neg \left(x2 \leq 4.2 \cdot 10^{+41}\right):\\
\;\;\;\;x1 + \left(x1 \cdot \left(x2 \cdot x2\right)\right) \cdot 8\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x2 < -4.80000000000000024e126 or 4.1999999999999999e41 < x2

    1. Initial program 68.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 64.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 x2 around inf 52.5%

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

        \[\leadsto x1 + \color{blue}{\left({x2}^{2} \cdot x1\right) \cdot 8} \]
      2. *-commutative52.5%

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

        \[\leadsto x1 + \left(x1 \cdot \color{blue}{\left(x2 \cdot x2\right)}\right) \cdot 8 \]
    5. Simplified52.5%

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

    if -4.80000000000000024e126 < x2 < 4.1999999999999999e41

    1. Initial program 69.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 x2 around inf 51.6%

      \[\leadsto x1 + \left(\left(\color{blue}{8 \cdot \frac{{x2}^{2} \cdot x1}{1 + {x1}^{2}}} + 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-/l*51.6%

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

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

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

        \[\leadsto x1 + \left(\left(8 \cdot \frac{x2 \cdot x2}{\frac{\color{blue}{x1 \cdot x1} + 1}{x1}} + 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-udef51.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -6 \cdot x2 + \color{blue}{-1} \cdot x1 \]
      6. mul-1-neg51.3%

        \[\leadsto -6 \cdot x2 + \color{blue}{\left(-x1\right)} \]
      7. sub-neg51.3%

        \[\leadsto \color{blue}{-6 \cdot x2 - x1} \]
      8. *-commutative51.3%

        \[\leadsto \color{blue}{x2 \cdot -6} - x1 \]
    10. Simplified51.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x2 \leq -4.8 \cdot 10^{+126} \lor \neg \left(x2 \leq 4.2 \cdot 10^{+41}\right):\\ \;\;\;\;x1 + \left(x1 \cdot \left(x2 \cdot x2\right)\right) \cdot 8\\ \mathbf{else}:\\ \;\;\;\;x2 \cdot -6 - x1\\ \end{array} \]

Alternative 20: 54.0% accurate, 9.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq 4.8 \cdot 10^{-10}:\\
\;\;\;\;x2 \cdot -6 - x1\\

\mathbf{elif}\;x1 \leq 1.4 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(x1 \cdot \left(x2 \cdot x2\right)\right) \cdot 8\\

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


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

    1. Initial program 75.7%

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

      \[\leadsto x1 + \left(\left(\color{blue}{8 \cdot \frac{{x2}^{2} \cdot x1}{1 + {x1}^{2}}} + 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-/l*60.1%

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

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

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

        \[\leadsto x1 + \left(\left(8 \cdot \frac{x2 \cdot x2}{\frac{\color{blue}{x1 \cdot x1} + 1}{x1}} + 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-udef60.1%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-6 \cdot x2 + \left(x1 + -2 \cdot x1\right)} \]
      4. distribute-rgt1-in51.0%

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

        \[\leadsto -6 \cdot x2 + \color{blue}{-1} \cdot x1 \]
      6. mul-1-neg51.0%

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

        \[\leadsto \color{blue}{-6 \cdot x2 - x1} \]
      8. *-commutative51.0%

        \[\leadsto \color{blue}{x2 \cdot -6} - x1 \]
    10. Simplified51.0%

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

    if 4.8e-10 < x1 < 1.4e154

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

      \[\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 x2 around inf 30.5%

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

        \[\leadsto x1 + \color{blue}{\left({x2}^{2} \cdot x1\right) \cdot 8} \]
      2. *-commutative30.5%

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

        \[\leadsto x1 + \left(x1 \cdot \color{blue}{\left(x2 \cdot x2\right)}\right) \cdot 8 \]
    5. Simplified30.5%

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

    if 1.4e154 < 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 6.1%

      \[\leadsto x1 + \color{blue}{-6 \cdot x2} \]
    4. Step-by-step derivation
      1. *-commutative6.1%

        \[\leadsto x1 + \color{blue}{x2 \cdot -6} \]
    5. Simplified6.1%

      \[\leadsto x1 + \color{blue}{x2 \cdot -6} \]
    6. Step-by-step derivation
      1. flip-+77.4%

        \[\leadsto \color{blue}{\frac{x1 \cdot x1 - \left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6}} \]
    7. Applied egg-rr77.4%

      \[\leadsto \color{blue}{\frac{x1 \cdot x1 - \left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)}{x1 - x2 \cdot -6}} \]
    8. Step-by-step derivation
      1. swap-sqr77.4%

        \[\leadsto \frac{x1 \cdot x1 - \color{blue}{\left(x2 \cdot x2\right) \cdot \left(-6 \cdot -6\right)}}{x1 - x2 \cdot -6} \]
      2. metadata-eval77.4%

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

      \[\leadsto \color{blue}{\frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}} \]
    10. Taylor expanded in x1 around inf 93.5%

      \[\leadsto \frac{\color{blue}{{x1}^{2}}}{x1 - x2 \cdot -6} \]
    11. Step-by-step derivation
      1. unpow293.5%

        \[\leadsto \frac{\color{blue}{x1 \cdot x1}}{x1 - x2 \cdot -6} \]
    12. Simplified93.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq 4.8 \cdot 10^{-10}:\\ \;\;\;\;x2 \cdot -6 - x1\\ \mathbf{elif}\;x1 \leq 1.4 \cdot 10^{+154}:\\ \;\;\;\;x1 + \left(x1 \cdot \left(x2 \cdot x2\right)\right) \cdot 8\\ \mathbf{else}:\\ \;\;\;\;\frac{x1 \cdot x1}{x1 - x2 \cdot -6}\\ \end{array} \]

Alternative 21: 30.8% accurate, 13.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -1.05 \cdot 10^{-254}:\\
\;\;\;\;x2 \cdot -6\\

\mathbf{elif}\;x2 \leq 1.45 \cdot 10^{-173}:\\
\;\;\;\;-x1\\

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


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

    1. Initial program 70.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 55.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 27.4%

      \[\leadsto x1 + \color{blue}{-6 \cdot x2} \]
    4. Step-by-step derivation
      1. *-commutative27.4%

        \[\leadsto x1 + \color{blue}{x2 \cdot -6} \]
    5. Simplified27.4%

      \[\leadsto x1 + \color{blue}{x2 \cdot -6} \]
    6. Taylor expanded in x1 around 0 27.9%

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

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

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

    if -1.04999999999999998e-254 < x2 < 1.4499999999999999e-173

    1. Initial program 61.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 x2 around inf 48.7%

      \[\leadsto x1 + \left(\left(\color{blue}{8 \cdot \frac{{x2}^{2} \cdot x1}{1 + {x1}^{2}}} + 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-/l*48.7%

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

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

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

        \[\leadsto x1 + \left(\left(8 \cdot \frac{x2 \cdot x2}{\frac{\color{blue}{x1 \cdot x1} + 1}{x1}} + 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-udef48.7%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x1 + -2 \cdot x1} \]
    9. Step-by-step derivation
      1. distribute-rgt1-in49.6%

        \[\leadsto \color{blue}{\left(-2 + 1\right) \cdot x1} \]
      2. metadata-eval49.6%

        \[\leadsto \color{blue}{-1} \cdot x1 \]
      3. mul-1-neg49.6%

        \[\leadsto \color{blue}{-x1} \]
    10. Simplified49.6%

      \[\leadsto \color{blue}{-x1} \]

    if 1.4499999999999999e-173 < x2

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

      \[\leadsto x1 + \color{blue}{-6 \cdot x2} \]
    4. Step-by-step derivation
      1. *-commutative34.6%

        \[\leadsto x1 + \color{blue}{x2 \cdot -6} \]
    5. Simplified34.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x2 \leq -1.05 \cdot 10^{-254}:\\ \;\;\;\;x2 \cdot -6\\ \mathbf{elif}\;x2 \leq 1.45 \cdot 10^{-173}:\\ \;\;\;\;-x1\\ \mathbf{else}:\\ \;\;\;\;x1 + x2 \cdot -6\\ \end{array} \]

Alternative 22: 30.6% accurate, 17.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -1.05 \cdot 10^{-254}:\\
\;\;\;\;x2 \cdot -6\\

\mathbf{elif}\;x2 \leq 4 \cdot 10^{-172}:\\
\;\;\;\;-x1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x2 < -1.04999999999999998e-254 or 4.0000000000000002e-172 < x2

    1. Initial program 70.3%

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

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

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

        \[\leadsto x1 + \color{blue}{x2 \cdot -6} \]
    5. Simplified30.4%

      \[\leadsto x1 + \color{blue}{x2 \cdot -6} \]
    6. Taylor expanded in x1 around 0 30.4%

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

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

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

    if -1.04999999999999998e-254 < x2 < 4.0000000000000002e-172

    1. Initial program 61.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 x2 around inf 48.7%

      \[\leadsto x1 + \left(\left(\color{blue}{8 \cdot \frac{{x2}^{2} \cdot x1}{1 + {x1}^{2}}} + 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-/l*48.7%

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

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

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

        \[\leadsto x1 + \left(\left(8 \cdot \frac{x2 \cdot x2}{\frac{\color{blue}{x1 \cdot x1} + 1}{x1}} + 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-udef48.7%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x1 + -2 \cdot x1} \]
    9. Step-by-step derivation
      1. distribute-rgt1-in49.6%

        \[\leadsto \color{blue}{\left(-2 + 1\right) \cdot x1} \]
      2. metadata-eval49.6%

        \[\leadsto \color{blue}{-1} \cdot x1 \]
      3. mul-1-neg49.6%

        \[\leadsto \color{blue}{-x1} \]
    10. Simplified49.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x2 \leq -1.05 \cdot 10^{-254}:\\ \;\;\;\;x2 \cdot -6\\ \mathbf{elif}\;x2 \leq 4 \cdot 10^{-172}:\\ \;\;\;\;-x1\\ \mathbf{else}:\\ \;\;\;\;x2 \cdot -6\\ \end{array} \]

Alternative 23: 38.9% accurate, 25.4× speedup?

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

\\
x2 \cdot -6 - x1
\end{array}
Derivation
  1. Initial program 69.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 x2 around inf 49.8%

    \[\leadsto x1 + \left(\left(\color{blue}{8 \cdot \frac{{x2}^{2} \cdot x1}{1 + {x1}^{2}}} + 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-/l*49.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-6 \cdot x2 + \left(x1 + -2 \cdot x1\right)} \]
    4. distribute-rgt1-in39.5%

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

      \[\leadsto -6 \cdot x2 + \color{blue}{-1} \cdot x1 \]
    6. mul-1-neg39.5%

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

      \[\leadsto \color{blue}{-6 \cdot x2 - x1} \]
    8. *-commutative39.5%

      \[\leadsto \color{blue}{x2 \cdot -6} - x1 \]
  10. Simplified39.5%

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

    \[\leadsto x2 \cdot -6 - x1 \]

Alternative 24: 14.5% accurate, 63.5× speedup?

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

\\
-x1
\end{array}
Derivation
  1. Initial program 69.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 x2 around inf 49.8%

    \[\leadsto x1 + \left(\left(\color{blue}{8 \cdot \frac{{x2}^{2} \cdot x1}{1 + {x1}^{2}}} + 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-/l*49.4%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{x1 + -2 \cdot x1} \]
  9. Step-by-step derivation
    1. distribute-rgt1-in13.7%

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

      \[\leadsto \color{blue}{-1} \cdot x1 \]
    3. mul-1-neg13.7%

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

    \[\leadsto \color{blue}{-x1} \]
  11. Final simplification13.7%

    \[\leadsto -x1 \]

Alternative 25: 3.2% accurate, 127.0× speedup?

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

\\
x1
\end{array}
Derivation
  1. Initial program 69.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 56.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 26.7%

    \[\leadsto x1 + \color{blue}{-6 \cdot x2} \]
  4. Step-by-step derivation
    1. *-commutative26.7%

      \[\leadsto x1 + \color{blue}{x2 \cdot -6} \]
  5. Simplified26.7%

    \[\leadsto x1 + \color{blue}{x2 \cdot -6} \]
  6. Taylor expanded in x1 around inf 3.2%

    \[\leadsto \color{blue}{x1} \]
  7. Final simplification3.2%

    \[\leadsto x1 \]

Reproduce

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