Rosa's FloatVsDoubleBenchmark

Percentage Accurate: 69.9% → 99.5%
Time: 48.5s
Alternatives: 22
Speedup: 1.5×

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 22 alternatives:

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

Initial Program: 69.9% accurate, 1.0× speedup?

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

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

Alternative 1: 99.5% accurate, 0.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 99.4% accurate, 0.5× speedup?

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

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

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

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

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

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

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

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

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

Alternative 4: 96.7% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;x1 \leq 2.95 \cdot 10^{-8}:\\
\;\;\;\;x1 - \left(3 \cdot \frac{x1 + \left(2 \cdot x2 - t_1\right)}{t_3} - \left(x1 - \left(\left(t_1 \cdot t_4 + t_3 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t_4\right) + \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2 - x1\right)\right) \cdot \left(3 + t_4\right)\right)\right) - t_6\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 4 \cdot 10^{+96}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(\left(t_3 \cdot \left(\left(t_5 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t_5 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_5 \cdot 4 - 6\right)\right) + t_1 \cdot t_5\right) + t_6\right)\right) + 3 \cdot \left(3 + \frac{-1}{x1}\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x1 < -1.59999999999999992e62 or 4.0000000000000002e96 < x1

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

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

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

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

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

    if -1.59999999999999992e62 < x1 < 2.9499999999999999e-8

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

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

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

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

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

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

    if 2.9499999999999999e-8 < x1 < 4.0000000000000002e96

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

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

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

Alternative 5: 96.7% accurate, 1.1× speedup?

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

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

\mathbf{elif}\;x1 \leq 2.95 \cdot 10^{-8}:\\
\;\;\;\;x1 - \left(3 \cdot \frac{x1 + \left(2 \cdot x2 - t_1\right)}{t_3} - \left(x1 - \left(\left(t_1 \cdot t_4 + t_3 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t_4\right) + \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2 - x1\right)\right) \cdot \left(3 + t_4\right)\right)\right) - t_6\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 7 \cdot 10^{+96}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(\left(t_3 \cdot \left(\left(t_5 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t_5 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_5 \cdot 4 - 6\right)\right) + t_1 \cdot t_5\right) + t_6\right)\right) + 9\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x1 < -4.8e62 or 6.9999999999999998e96 < x1

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

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

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

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

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

    if -4.8e62 < x1 < 2.9499999999999999e-8

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

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

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

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

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

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

    if 2.9499999999999999e-8 < x1 < 6.9999999999999998e96

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

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

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

Alternative 6: 95.9% accurate, 1.1× speedup?

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

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

\mathbf{elif}\;x1 \leq 2.95 \cdot 10^{-8}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_3 - 2 \cdot x2\right) - x1}{t_1} + \left(x1 + \left(t_0 + \left(t_6 + t_1 \cdot \left(t_7 + \left(\left(x1 \cdot 2\right) \cdot \frac{x1 - t_4}{t_1}\right) \cdot \left(3 - 2 \cdot x2\right)\right)\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 5 \cdot 10^{+96}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(\left(t_1 \cdot \left(\left(t_5 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t_5 - 3\right) + t_7\right) + t_6\right) + t_0\right)\right) + 9\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x1 < -4.9e13 or 5.0000000000000004e96 < x1

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

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

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

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

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

    if -4.9e13 < x1 < 2.9499999999999999e-8

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

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

    if 2.9499999999999999e-8 < x1 < 5.0000000000000004e96

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

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

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

Alternative 7: 95.7% accurate, 1.1× speedup?

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

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

\mathbf{elif}\;x1 \leq 2.95 \cdot 10^{-8}:\\
\;\;\;\;x1 - \left(3 \cdot \frac{x1 + \left(2 \cdot x2 - t_1\right)}{t_3} + \left(\left(\left(t_1 \cdot t_4 + t_3 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t_4\right) + \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2 - x1\right)\right) \cdot \left(3 - 2 \cdot x2\right)\right)\right) - t_6\right) - x1\right)\right)\\

\mathbf{elif}\;x1 \leq 7 \cdot 10^{+96}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(\left(t_3 \cdot \left(\left(t_5 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t_5 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_5 \cdot 4 - 6\right)\right) + t_1 \cdot t_5\right) + t_6\right)\right) + 9\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x1 < -1.55e11 or 6.9999999999999998e96 < x1

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

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

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

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

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

    if -1.55e11 < x1 < 2.9499999999999999e-8

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

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

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

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

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

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

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

    if 2.9499999999999999e-8 < x1 < 6.9999999999999998e96

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

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

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

Alternative 8: 94.8% accurate, 1.1× speedup?

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

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

\mathbf{elif}\;x1 \leq 2.95 \cdot 10^{-8}:\\
\;\;\;\;x1 - \left(3 \cdot \frac{x1 + \left(2 \cdot x2 - t_1\right)}{t_3} + \left(\left(\left(t_1 \cdot t_4 + t_3 \cdot \left(t_5 + \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2 - x1\right)\right) \cdot \left(3 - 2 \cdot x2\right)\right)\right) - t_6\right) - x1\right)\right)\\

\mathbf{elif}\;x1 \leq 4 \cdot 10^{+96}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(t_6 - \left(t_3 \cdot \left(t_5 + \left(\frac{t_2 - x1}{t_3} \cdot \left(x1 \cdot 2\right)\right) \cdot \left(3 + t_4\right)\right) - t_1 \cdot \left(2 \cdot x2\right)\right)\right)\right) + 3 \cdot \frac{1}{\frac{-0.5}{x2}}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x1 < -1.45e11 or 4.0000000000000002e96 < x1

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

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

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

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

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

    if -1.45e11 < x1 < 2.9499999999999999e-8

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

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

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

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

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

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

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

    if 2.9499999999999999e-8 < x1 < 4.0000000000000002e96

    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. Step-by-step derivation
      1. fma-def99.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 76.4% accurate, 1.2× 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}\\ t_4 := \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t_3\right)\\ t_5 := x1 \cdot \left(x1 \cdot x1\right)\\ t_6 := x1 + \left(\left(x1 + \left(t_5 - \left(t_2 \cdot \left(t_4 + \left(\frac{t_1 - x1}{t_2} \cdot \left(x1 \cdot 2\right)\right) \cdot \left(3 + t_3\right)\right) - t_0 \cdot \left(2 \cdot x2\right)\right)\right)\right) + 3 \cdot \frac{1}{\frac{-0.5}{x2}}\right)\\ t_7 := 3 - 2 \cdot x2\\ \mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\ \;\;\;\;x2 \cdot \left(x1 \cdot -12 - 6\right) - x1\\ \mathbf{elif}\;x1 \leq -0.064:\\ \;\;\;\;t_6\\ \mathbf{elif}\;x1 \leq 2.95 \cdot 10^{-8}:\\ \;\;\;\;x1 - \left(3 \cdot \frac{x1 + \left(2 \cdot x2 - t_0\right)}{t_2} + \left(\left(\left(t_0 \cdot t_3 + t_2 \cdot \left(t_4 + \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2 - x1\right)\right) \cdot t_7\right)\right) - t_5\right) - x1\right)\right)\\ \mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;t_6\\ \mathbf{else}:\\ \;\;\;\;x1 + x1 \cdot \left(1 - 4 \cdot \left(x2 \cdot t_7\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))
        (t_4 (* (* x1 x1) (+ 6.0 (* 4.0 t_3))))
        (t_5 (* x1 (* x1 x1)))
        (t_6
         (+
          x1
          (+
           (+
            x1
            (-
             t_5
             (-
              (* t_2 (+ t_4 (* (* (/ (- t_1 x1) t_2) (* x1 2.0)) (+ 3.0 t_3))))
              (* t_0 (* 2.0 x2)))))
           (* 3.0 (/ 1.0 (/ -0.5 x2))))))
        (t_7 (- 3.0 (* 2.0 x2))))
   (if (<= x1 -5.6e+102)
     (- (* x2 (- (* x1 -12.0) 6.0)) x1)
     (if (<= x1 -0.064)
       t_6
       (if (<= x1 2.95e-8)
         (-
          x1
          (+
           (* 3.0 (/ (+ x1 (- (* 2.0 x2) t_0)) t_2))
           (-
            (-
             (+
              (* t_0 t_3)
              (* t_2 (+ t_4 (* (* (* x1 2.0) (- (* 2.0 x2) x1)) t_7))))
             t_5)
            x1)))
         (if (<= x1 1.35e+154)
           t_6
           (+ x1 (* x1 (- 1.0 (* 4.0 (* x2 t_7)))))))))))
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 t_4 = (x1 * x1) * (6.0 + (4.0 * t_3));
	double t_5 = x1 * (x1 * x1);
	double t_6 = x1 + ((x1 + (t_5 - ((t_2 * (t_4 + ((((t_1 - x1) / t_2) * (x1 * 2.0)) * (3.0 + t_3)))) - (t_0 * (2.0 * x2))))) + (3.0 * (1.0 / (-0.5 / x2))));
	double t_7 = 3.0 - (2.0 * x2);
	double tmp;
	if (x1 <= -5.6e+102) {
		tmp = (x2 * ((x1 * -12.0) - 6.0)) - x1;
	} else if (x1 <= -0.064) {
		tmp = t_6;
	} else if (x1 <= 2.95e-8) {
		tmp = x1 - ((3.0 * ((x1 + ((2.0 * x2) - t_0)) / t_2)) + ((((t_0 * t_3) + (t_2 * (t_4 + (((x1 * 2.0) * ((2.0 * x2) - x1)) * t_7)))) - t_5) - x1));
	} else if (x1 <= 1.35e+154) {
		tmp = t_6;
	} else {
		tmp = x1 + (x1 * (1.0 - (4.0 * (x2 * t_7))));
	}
	return tmp;
}
real(8) function code(x1, x2)
    real(8), intent (in) :: x1
    real(8), intent (in) :: x2
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: t_4
    real(8) :: t_5
    real(8) :: t_6
    real(8) :: t_7
    real(8) :: tmp
    t_0 = x1 * (x1 * 3.0d0)
    t_1 = t_0 + (2.0d0 * x2)
    t_2 = (x1 * x1) + 1.0d0
    t_3 = (x1 - t_1) / t_2
    t_4 = (x1 * x1) * (6.0d0 + (4.0d0 * t_3))
    t_5 = x1 * (x1 * x1)
    t_6 = x1 + ((x1 + (t_5 - ((t_2 * (t_4 + ((((t_1 - x1) / t_2) * (x1 * 2.0d0)) * (3.0d0 + t_3)))) - (t_0 * (2.0d0 * x2))))) + (3.0d0 * (1.0d0 / ((-0.5d0) / x2))))
    t_7 = 3.0d0 - (2.0d0 * x2)
    if (x1 <= (-5.6d+102)) then
        tmp = (x2 * ((x1 * (-12.0d0)) - 6.0d0)) - x1
    else if (x1 <= (-0.064d0)) then
        tmp = t_6
    else if (x1 <= 2.95d-8) then
        tmp = x1 - ((3.0d0 * ((x1 + ((2.0d0 * x2) - t_0)) / t_2)) + ((((t_0 * t_3) + (t_2 * (t_4 + (((x1 * 2.0d0) * ((2.0d0 * x2) - x1)) * t_7)))) - t_5) - x1))
    else if (x1 <= 1.35d+154) then
        tmp = t_6
    else
        tmp = x1 + (x1 * (1.0d0 - (4.0d0 * (x2 * t_7))))
    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 t_4 = (x1 * x1) * (6.0 + (4.0 * t_3));
	double t_5 = x1 * (x1 * x1);
	double t_6 = x1 + ((x1 + (t_5 - ((t_2 * (t_4 + ((((t_1 - x1) / t_2) * (x1 * 2.0)) * (3.0 + t_3)))) - (t_0 * (2.0 * x2))))) + (3.0 * (1.0 / (-0.5 / x2))));
	double t_7 = 3.0 - (2.0 * x2);
	double tmp;
	if (x1 <= -5.6e+102) {
		tmp = (x2 * ((x1 * -12.0) - 6.0)) - x1;
	} else if (x1 <= -0.064) {
		tmp = t_6;
	} else if (x1 <= 2.95e-8) {
		tmp = x1 - ((3.0 * ((x1 + ((2.0 * x2) - t_0)) / t_2)) + ((((t_0 * t_3) + (t_2 * (t_4 + (((x1 * 2.0) * ((2.0 * x2) - x1)) * t_7)))) - t_5) - x1));
	} else if (x1 <= 1.35e+154) {
		tmp = t_6;
	} else {
		tmp = x1 + (x1 * (1.0 - (4.0 * (x2 * t_7))));
	}
	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
	t_4 = (x1 * x1) * (6.0 + (4.0 * t_3))
	t_5 = x1 * (x1 * x1)
	t_6 = x1 + ((x1 + (t_5 - ((t_2 * (t_4 + ((((t_1 - x1) / t_2) * (x1 * 2.0)) * (3.0 + t_3)))) - (t_0 * (2.0 * x2))))) + (3.0 * (1.0 / (-0.5 / x2))))
	t_7 = 3.0 - (2.0 * x2)
	tmp = 0
	if x1 <= -5.6e+102:
		tmp = (x2 * ((x1 * -12.0) - 6.0)) - x1
	elif x1 <= -0.064:
		tmp = t_6
	elif x1 <= 2.95e-8:
		tmp = x1 - ((3.0 * ((x1 + ((2.0 * x2) - t_0)) / t_2)) + ((((t_0 * t_3) + (t_2 * (t_4 + (((x1 * 2.0) * ((2.0 * x2) - x1)) * t_7)))) - t_5) - x1))
	elif x1 <= 1.35e+154:
		tmp = t_6
	else:
		tmp = x1 + (x1 * (1.0 - (4.0 * (x2 * t_7))))
	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)
	t_4 = Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_3)))
	t_5 = Float64(x1 * Float64(x1 * x1))
	t_6 = Float64(x1 + Float64(Float64(x1 + Float64(t_5 - Float64(Float64(t_2 * Float64(t_4 + Float64(Float64(Float64(Float64(t_1 - x1) / t_2) * Float64(x1 * 2.0)) * Float64(3.0 + t_3)))) - Float64(t_0 * Float64(2.0 * x2))))) + Float64(3.0 * Float64(1.0 / Float64(-0.5 / x2)))))
	t_7 = Float64(3.0 - Float64(2.0 * x2))
	tmp = 0.0
	if (x1 <= -5.6e+102)
		tmp = Float64(Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0)) - x1);
	elseif (x1 <= -0.064)
		tmp = t_6;
	elseif (x1 <= 2.95e-8)
		tmp = Float64(x1 - Float64(Float64(3.0 * Float64(Float64(x1 + Float64(Float64(2.0 * x2) - t_0)) / t_2)) + Float64(Float64(Float64(Float64(t_0 * t_3) + Float64(t_2 * Float64(t_4 + Float64(Float64(Float64(x1 * 2.0) * Float64(Float64(2.0 * x2) - x1)) * t_7)))) - t_5) - x1)));
	elseif (x1 <= 1.35e+154)
		tmp = t_6;
	else
		tmp = Float64(x1 + Float64(x1 * Float64(1.0 - Float64(4.0 * Float64(x2 * t_7)))));
	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;
	t_4 = (x1 * x1) * (6.0 + (4.0 * t_3));
	t_5 = x1 * (x1 * x1);
	t_6 = x1 + ((x1 + (t_5 - ((t_2 * (t_4 + ((((t_1 - x1) / t_2) * (x1 * 2.0)) * (3.0 + t_3)))) - (t_0 * (2.0 * x2))))) + (3.0 * (1.0 / (-0.5 / x2))));
	t_7 = 3.0 - (2.0 * x2);
	tmp = 0.0;
	if (x1 <= -5.6e+102)
		tmp = (x2 * ((x1 * -12.0) - 6.0)) - x1;
	elseif (x1 <= -0.064)
		tmp = t_6;
	elseif (x1 <= 2.95e-8)
		tmp = x1 - ((3.0 * ((x1 + ((2.0 * x2) - t_0)) / t_2)) + ((((t_0 * t_3) + (t_2 * (t_4 + (((x1 * 2.0) * ((2.0 * x2) - x1)) * t_7)))) - t_5) - x1));
	elseif (x1 <= 1.35e+154)
		tmp = t_6;
	else
		tmp = x1 + (x1 * (1.0 - (4.0 * (x2 * t_7))));
	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]}, Block[{t$95$4 = N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(x1 + N[(N[(x1 + N[(t$95$5 - N[(N[(t$95$2 * N[(t$95$4 + N[(N[(N[(N[(t$95$1 - x1), $MachinePrecision] / t$95$2), $MachinePrecision] * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision] * N[(3.0 + t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(t$95$0 * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(1.0 / N[(-0.5 / x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision], If[LessEqual[x1, -0.064], t$95$6, If[LessEqual[x1, 2.95e-8], N[(x1 - N[(N[(3.0 * N[(N[(x1 + N[(N[(2.0 * x2), $MachinePrecision] - t$95$0), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[(t$95$0 * t$95$3), $MachinePrecision] + N[(t$95$2 * N[(t$95$4 + N[(N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision] * t$95$7), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$5), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], t$95$6, N[(x1 + N[(x1 * N[(1.0 - N[(4.0 * N[(x2 * t$95$7), $MachinePrecision]), $MachinePrecision]), $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}\\
t_4 := \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t_3\right)\\
t_5 := x1 \cdot \left(x1 \cdot x1\right)\\
t_6 := x1 + \left(\left(x1 + \left(t_5 - \left(t_2 \cdot \left(t_4 + \left(\frac{t_1 - x1}{t_2} \cdot \left(x1 \cdot 2\right)\right) \cdot \left(3 + t_3\right)\right) - t_0 \cdot \left(2 \cdot x2\right)\right)\right)\right) + 3 \cdot \frac{1}{\frac{-0.5}{x2}}\right)\\
t_7 := 3 - 2 \cdot x2\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x2 \cdot \left(x1 \cdot -12 - 6\right) - x1\\

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

\mathbf{elif}\;x1 \leq 2.95 \cdot 10^{-8}:\\
\;\;\;\;x1 - \left(3 \cdot \frac{x1 + \left(2 \cdot x2 - t_0\right)}{t_2} + \left(\left(\left(t_0 \cdot t_3 + t_2 \cdot \left(t_4 + \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2 - x1\right)\right) \cdot t_7\right)\right) - t_5\right) - x1\right)\right)\\

\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;t_6\\

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


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

    1. Initial program 0.0%

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

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x1 \cdot \left(x2 \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 3.5%

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

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

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

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

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

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

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

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

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

    if -5.60000000000000037e102 < x1 < -0.064000000000000001 or 2.9499999999999999e-8 < x1 < 1.35000000000000003e154

    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. Step-by-step derivation
      1. fma-def99.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.064000000000000001 < x1 < 2.9499999999999999e-8

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

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

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

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

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

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

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

    if 1.35000000000000003e154 < 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(x1 \cdot \left(x2 \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 58.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\ \;\;\;\;x2 \cdot \left(x1 \cdot -12 - 6\right) - x1\\ \mathbf{elif}\;x1 \leq -0.064:\\ \;\;\;\;x1 + \left(\left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) - \left(\left(x1 \cdot x1 + 1\right) \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot \frac{x1 - \left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right)}{x1 \cdot x1 + 1}\right) + \left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} \cdot \left(x1 \cdot 2\right)\right) \cdot \left(3 + \frac{x1 - \left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right)}{x1 \cdot x1 + 1}\right)\right) - \left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \left(2 \cdot x2\right)\right)\right)\right) + 3 \cdot \frac{1}{\frac{-0.5}{x2}}\right)\\ \mathbf{elif}\;x1 \leq 2.95 \cdot 10^{-8}:\\ \;\;\;\;x1 - \left(3 \cdot \frac{x1 + \left(2 \cdot x2 - x1 \cdot \left(x1 \cdot 3\right)\right)}{x1 \cdot x1 + 1} + \left(\left(\left(\left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{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(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) + \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2 - x1\right)\right) \cdot \left(3 - 2 \cdot x2\right)\right)\right) - x1 \cdot \left(x1 \cdot x1\right)\right) - x1\right)\right)\\ \mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;x1 + \left(\left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) - \left(\left(x1 \cdot x1 + 1\right) \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot \frac{x1 - \left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right)}{x1 \cdot x1 + 1}\right) + \left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} \cdot \left(x1 \cdot 2\right)\right) \cdot \left(3 + \frac{x1 - \left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right)}{x1 \cdot x1 + 1}\right)\right) - \left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \left(2 \cdot x2\right)\right)\right)\right) + 3 \cdot \frac{1}{\frac{-0.5}{x2}}\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + x1 \cdot \left(1 - 4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right)\\ \end{array} \]

Alternative 10: 75.9% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;x1 \leq -3900:\\
\;\;\;\;x1 + \left(3 \cdot \frac{1}{\frac{-0.5}{x2}} + \left(x1 + \left(t_0 - \left(t_7 - \left(\left(\frac{t_5 - x1}{t_1} \cdot \left(x1 \cdot 2\right)\right) \cdot \frac{1}{x1} + t_8\right) \cdot \left(-1 - x1 \cdot x1\right)\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 2.95 \cdot 10^{-8}:\\
\;\;\;\;x1 - \left(3 \cdot \frac{x1 + \left(2 \cdot x2 - t_4\right)}{t_1} + \left(\left(\left(t_7 + t_1 \cdot \left(t_8 + \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2 - x1\right)\right) \cdot t_2\right)\right) - t_0\right) - x1\right)\right)\\

\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_4 - 2 \cdot x2\right) - x1}{t_1} - \left(\left(\left(t_7 + t_1 \cdot \left(4 \cdot \left(x1 \cdot t_3\right) + t_8\right)\right) - t_0\right) - x1\right)\right)\\

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


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

    1. Initial program 0.0%

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

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x1 \cdot \left(x2 \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 3.5%

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

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

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

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

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

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

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

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

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

    if -5.60000000000000037e102 < x1 < -3900

    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. Step-by-step derivation
      1. fma-def99.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3900 < x1 < 2.9499999999999999e-8

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

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

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

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

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

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

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

    if 2.9499999999999999e-8 < x1 < 1.35000000000000003e154

    1. Initial program 99.4%

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

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

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

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

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

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

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

    if 1.35000000000000003e154 < 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(x1 \cdot \left(x2 \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 58.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\ \;\;\;\;x2 \cdot \left(x1 \cdot -12 - 6\right) - x1\\ \mathbf{elif}\;x1 \leq -3900:\\ \;\;\;\;x1 + \left(3 \cdot \frac{1}{\frac{-0.5}{x2}} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) - \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(\left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} \cdot \left(x1 \cdot 2\right)\right) \cdot \frac{1}{x1} + \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) \cdot \left(-1 - x1 \cdot x1\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 2.95 \cdot 10^{-8}:\\ \;\;\;\;x1 - \left(3 \cdot \frac{x1 + \left(2 \cdot x2 - x1 \cdot \left(x1 \cdot 3\right)\right)}{x1 \cdot x1 + 1} + \left(\left(\left(\left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{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(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) + \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2 - x1\right)\right) \cdot \left(3 - 2 \cdot x2\right)\right)\right) - x1 \cdot \left(x1 \cdot x1\right)\right) - x1\right)\right)\\ \mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;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(4 \cdot \left(x1 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right) + \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot \frac{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 + x1 \cdot \left(1 - 4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right)\\ \end{array} \]

Alternative 11: 70.4% accurate, 1.2× 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 := x2 \cdot \left(x1 \cdot -12 - 6\right) - x1\\ t_3 := x2 \cdot \left(3 - 2 \cdot x2\right)\\ t_4 := x1 \cdot x1 + 1\\ t_5 := \frac{x1 - \left(t_0 + 2 \cdot x2\right)}{t_4}\\ t_6 := t_4 \cdot \left(4 \cdot \left(x1 \cdot t_3\right) + \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t_5\right)\right)\\ \mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x1 \leq -1 \cdot 10^{-177}:\\ \;\;\;\;x1 - \left(3 \cdot \frac{x1 + \left(2 \cdot x2 - t_0\right)}{t_4} - \left(x1 - \left(\left(t_6 - t_0 \cdot \left(2 \cdot x2\right)\right) - t_1\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 4.1 \cdot 10^{-199}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_4} - \left(\left(\left(t_0 \cdot t_5 + t_6\right) - t_1\right) - x1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + x1 \cdot \left(1 - 4 \cdot t_3\right)\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (* x1 (* x1 3.0)))
        (t_1 (* x1 (* x1 x1)))
        (t_2 (- (* x2 (- (* x1 -12.0) 6.0)) x1))
        (t_3 (* x2 (- 3.0 (* 2.0 x2))))
        (t_4 (+ (* x1 x1) 1.0))
        (t_5 (/ (- x1 (+ t_0 (* 2.0 x2))) t_4))
        (t_6 (* t_4 (+ (* 4.0 (* x1 t_3)) (* (* x1 x1) (+ 6.0 (* 4.0 t_5)))))))
   (if (<= x1 -5.6e+102)
     t_2
     (if (<= x1 -1e-177)
       (-
        x1
        (-
         (* 3.0 (/ (+ x1 (- (* 2.0 x2) t_0)) t_4))
         (- x1 (- (- t_6 (* t_0 (* 2.0 x2))) t_1))))
       (if (<= x1 4.1e-199)
         t_2
         (if (<= x1 1.35e+154)
           (+
            x1
            (-
             (* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_4))
             (- (- (+ (* t_0 t_5) t_6) t_1) x1)))
           (+ x1 (* x1 (- 1.0 (* 4.0 t_3))))))))))
double code(double x1, double x2) {
	double t_0 = x1 * (x1 * 3.0);
	double t_1 = x1 * (x1 * x1);
	double t_2 = (x2 * ((x1 * -12.0) - 6.0)) - x1;
	double t_3 = x2 * (3.0 - (2.0 * x2));
	double t_4 = (x1 * x1) + 1.0;
	double t_5 = (x1 - (t_0 + (2.0 * x2))) / t_4;
	double t_6 = t_4 * ((4.0 * (x1 * t_3)) + ((x1 * x1) * (6.0 + (4.0 * t_5))));
	double tmp;
	if (x1 <= -5.6e+102) {
		tmp = t_2;
	} else if (x1 <= -1e-177) {
		tmp = x1 - ((3.0 * ((x1 + ((2.0 * x2) - t_0)) / t_4)) - (x1 - ((t_6 - (t_0 * (2.0 * x2))) - t_1)));
	} else if (x1 <= 4.1e-199) {
		tmp = t_2;
	} else if (x1 <= 1.35e+154) {
		tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_4)) - ((((t_0 * t_5) + t_6) - t_1) - x1));
	} else {
		tmp = x1 + (x1 * (1.0 - (4.0 * t_3)));
	}
	return tmp;
}
real(8) function code(x1, x2)
    real(8), intent (in) :: x1
    real(8), intent (in) :: x2
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: t_4
    real(8) :: t_5
    real(8) :: t_6
    real(8) :: tmp
    t_0 = x1 * (x1 * 3.0d0)
    t_1 = x1 * (x1 * x1)
    t_2 = (x2 * ((x1 * (-12.0d0)) - 6.0d0)) - x1
    t_3 = x2 * (3.0d0 - (2.0d0 * x2))
    t_4 = (x1 * x1) + 1.0d0
    t_5 = (x1 - (t_0 + (2.0d0 * x2))) / t_4
    t_6 = t_4 * ((4.0d0 * (x1 * t_3)) + ((x1 * x1) * (6.0d0 + (4.0d0 * t_5))))
    if (x1 <= (-5.6d+102)) then
        tmp = t_2
    else if (x1 <= (-1d-177)) then
        tmp = x1 - ((3.0d0 * ((x1 + ((2.0d0 * x2) - t_0)) / t_4)) - (x1 - ((t_6 - (t_0 * (2.0d0 * x2))) - t_1)))
    else if (x1 <= 4.1d-199) then
        tmp = t_2
    else if (x1 <= 1.35d+154) then
        tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_4)) - ((((t_0 * t_5) + t_6) - t_1) - x1))
    else
        tmp = x1 + (x1 * (1.0d0 - (4.0d0 * t_3)))
    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 = (x2 * ((x1 * -12.0) - 6.0)) - x1;
	double t_3 = x2 * (3.0 - (2.0 * x2));
	double t_4 = (x1 * x1) + 1.0;
	double t_5 = (x1 - (t_0 + (2.0 * x2))) / t_4;
	double t_6 = t_4 * ((4.0 * (x1 * t_3)) + ((x1 * x1) * (6.0 + (4.0 * t_5))));
	double tmp;
	if (x1 <= -5.6e+102) {
		tmp = t_2;
	} else if (x1 <= -1e-177) {
		tmp = x1 - ((3.0 * ((x1 + ((2.0 * x2) - t_0)) / t_4)) - (x1 - ((t_6 - (t_0 * (2.0 * x2))) - t_1)));
	} else if (x1 <= 4.1e-199) {
		tmp = t_2;
	} else if (x1 <= 1.35e+154) {
		tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_4)) - ((((t_0 * t_5) + t_6) - t_1) - x1));
	} else {
		tmp = x1 + (x1 * (1.0 - (4.0 * t_3)));
	}
	return tmp;
}
def code(x1, x2):
	t_0 = x1 * (x1 * 3.0)
	t_1 = x1 * (x1 * x1)
	t_2 = (x2 * ((x1 * -12.0) - 6.0)) - x1
	t_3 = x2 * (3.0 - (2.0 * x2))
	t_4 = (x1 * x1) + 1.0
	t_5 = (x1 - (t_0 + (2.0 * x2))) / t_4
	t_6 = t_4 * ((4.0 * (x1 * t_3)) + ((x1 * x1) * (6.0 + (4.0 * t_5))))
	tmp = 0
	if x1 <= -5.6e+102:
		tmp = t_2
	elif x1 <= -1e-177:
		tmp = x1 - ((3.0 * ((x1 + ((2.0 * x2) - t_0)) / t_4)) - (x1 - ((t_6 - (t_0 * (2.0 * x2))) - t_1)))
	elif x1 <= 4.1e-199:
		tmp = t_2
	elif x1 <= 1.35e+154:
		tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_4)) - ((((t_0 * t_5) + t_6) - t_1) - x1))
	else:
		tmp = x1 + (x1 * (1.0 - (4.0 * t_3)))
	return tmp
function code(x1, x2)
	t_0 = Float64(x1 * Float64(x1 * 3.0))
	t_1 = Float64(x1 * Float64(x1 * x1))
	t_2 = Float64(Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0)) - x1)
	t_3 = Float64(x2 * Float64(3.0 - Float64(2.0 * x2)))
	t_4 = Float64(Float64(x1 * x1) + 1.0)
	t_5 = Float64(Float64(x1 - Float64(t_0 + Float64(2.0 * x2))) / t_4)
	t_6 = Float64(t_4 * Float64(Float64(4.0 * Float64(x1 * t_3)) + Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_5)))))
	tmp = 0.0
	if (x1 <= -5.6e+102)
		tmp = t_2;
	elseif (x1 <= -1e-177)
		tmp = Float64(x1 - Float64(Float64(3.0 * Float64(Float64(x1 + Float64(Float64(2.0 * x2) - t_0)) / t_4)) - Float64(x1 - Float64(Float64(t_6 - Float64(t_0 * Float64(2.0 * x2))) - t_1))));
	elseif (x1 <= 4.1e-199)
		tmp = t_2;
	elseif (x1 <= 1.35e+154)
		tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_4)) - Float64(Float64(Float64(Float64(t_0 * t_5) + t_6) - t_1) - x1)));
	else
		tmp = Float64(x1 + Float64(x1 * Float64(1.0 - Float64(4.0 * t_3))));
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	t_0 = x1 * (x1 * 3.0);
	t_1 = x1 * (x1 * x1);
	t_2 = (x2 * ((x1 * -12.0) - 6.0)) - x1;
	t_3 = x2 * (3.0 - (2.0 * x2));
	t_4 = (x1 * x1) + 1.0;
	t_5 = (x1 - (t_0 + (2.0 * x2))) / t_4;
	t_6 = t_4 * ((4.0 * (x1 * t_3)) + ((x1 * x1) * (6.0 + (4.0 * t_5))));
	tmp = 0.0;
	if (x1 <= -5.6e+102)
		tmp = t_2;
	elseif (x1 <= -1e-177)
		tmp = x1 - ((3.0 * ((x1 + ((2.0 * x2) - t_0)) / t_4)) - (x1 - ((t_6 - (t_0 * (2.0 * x2))) - t_1)));
	elseif (x1 <= 4.1e-199)
		tmp = t_2;
	elseif (x1 <= 1.35e+154)
		tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_4)) - ((((t_0 * t_5) + t_6) - t_1) - x1));
	else
		tmp = x1 + (x1 * (1.0 - (4.0 * t_3)));
	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[(N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$3 = N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$5 = N[(N[(x1 - N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$4), $MachinePrecision]}, Block[{t$95$6 = N[(t$95$4 * N[(N[(4.0 * N[(x1 * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], t$95$2, If[LessEqual[x1, -1e-177], N[(x1 - N[(N[(3.0 * N[(N[(x1 + N[(N[(2.0 * x2), $MachinePrecision] - t$95$0), $MachinePrecision]), $MachinePrecision] / t$95$4), $MachinePrecision]), $MachinePrecision] - N[(x1 - N[(N[(t$95$6 - N[(t$95$0 * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.1e-199], t$95$2, If[LessEqual[x1, 1.35e+154], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$4), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(N[(t$95$0 * t$95$5), $MachinePrecision] + t$95$6), $MachinePrecision] - t$95$1), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 * N[(1.0 - N[(4.0 * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x1 \leq -1 \cdot 10^{-177}:\\
\;\;\;\;x1 - \left(3 \cdot \frac{x1 + \left(2 \cdot x2 - t_0\right)}{t_4} - \left(x1 - \left(\left(t_6 - t_0 \cdot \left(2 \cdot x2\right)\right) - t_1\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 4.1 \cdot 10^{-199}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_4} - \left(\left(\left(t_0 \cdot t_5 + t_6\right) - t_1\right) - x1\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x1 < -5.60000000000000037e102 or -9.99999999999999952e-178 < x1 < 4.10000000000000022e-199

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

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x1 \cdot \left(x2 \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 41.2%

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

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

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

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

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

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

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

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

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

    if -5.60000000000000037e102 < x1 < -9.99999999999999952e-178

    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 0 96.6%

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

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

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

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

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

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

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

    if 4.10000000000000022e-199 < x1 < 1.35000000000000003e154

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

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

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

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

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

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

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

    if 1.35000000000000003e154 < 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(x1 \cdot \left(x2 \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 58.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\ \;\;\;\;x2 \cdot \left(x1 \cdot -12 - 6\right) - x1\\ \mathbf{elif}\;x1 \leq -1 \cdot 10^{-177}:\\ \;\;\;\;x1 - \left(3 \cdot \frac{x1 + \left(2 \cdot x2 - x1 \cdot \left(x1 \cdot 3\right)\right)}{x1 \cdot x1 + 1} - \left(x1 - \left(\left(\left(x1 \cdot x1 + 1\right) \cdot \left(4 \cdot \left(x1 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right) + \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot \frac{x1 - \left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right)}{x1 \cdot x1 + 1}\right)\right) - \left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \left(2 \cdot x2\right)\right) - x1 \cdot \left(x1 \cdot x1\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 4.1 \cdot 10^{-199}:\\ \;\;\;\;x2 \cdot \left(x1 \cdot -12 - 6\right) - x1\\ \mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;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(4 \cdot \left(x1 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right) + \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot \frac{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 + x1 \cdot \left(1 - 4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right)\\ \end{array} \]

Alternative 12: 71.7% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;x1 \leq -4000:\\
\;\;\;\;x1 + \left(9 + \left(x1 + \left(t_2 + \left(t_6 \cdot \frac{t_7 - x1}{t_0} - t_0 \cdot \left(t_9 - x1 \cdot 2\right)\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq -8 \cdot 10^{-178}:\\
\;\;\;\;x2 \cdot -6 - x1 \cdot \left(t_4 - -1\right)\\

\mathbf{elif}\;x1 \leq 10^{-198}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(9 - \left(\left(\left(t_6 \cdot t_8 + t_0 \cdot \left(t_5 + t_9\right)\right) - t_2\right) - x1\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if x1 < -5.60000000000000037e102 or -7.9999999999999996e-178 < x1 < 9.9999999999999991e-199

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

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x1 \cdot \left(x2 \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 41.2%

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

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

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

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

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

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

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

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

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

    if -5.60000000000000037e102 < x1 < -4e3

    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 0 91.7%

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

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

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

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

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

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

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

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

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

    if -4e3 < x1 < -7.9999999999999996e-178

    1. Initial program 99.1%

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

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x1 \cdot \left(x2 \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 91.0%

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

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

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

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

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

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

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

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

    if 9.9999999999999991e-199 < x1 < 170

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

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x1 \cdot \left(x2 \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 170 < x1 < 1.35000000000000003e154

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

    if 1.35000000000000003e154 < 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(x1 \cdot \left(x2 \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 58.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\ \;\;\;\;x2 \cdot \left(x1 \cdot -12 - 6\right) - x1\\ \mathbf{elif}\;x1 \leq -4000:\\ \;\;\;\;x1 + \left(9 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(\left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - \left(x1 \cdot x1 + 1\right) \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot \frac{x1 - \left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right)}{x1 \cdot x1 + 1}\right) - x1 \cdot 2\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq -8 \cdot 10^{-178}:\\ \;\;\;\;x2 \cdot -6 - x1 \cdot \left(4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right) - -1\right)\\ \mathbf{elif}\;x1 \leq 10^{-198}:\\ \;\;\;\;x2 \cdot \left(x1 \cdot -12 - 6\right) - x1\\ \mathbf{elif}\;x1 \leq 170:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 - 4 \cdot \left(x1 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;x1 + \left(9 - \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(4 \cdot \left(x1 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right) + \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot \frac{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 + x1 \cdot \left(1 - 4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right)\\ \end{array} \]

Alternative 13: 69.2% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 \cdot \left(x1 \cdot 3\right)\\ t_1 := x1 \cdot x1 + 1\\ t_2 := x2 \cdot \left(x1 \cdot -12 - 6\right) - x1\\ t_3 := x2 \cdot \left(3 - 2 \cdot x2\right)\\ t_4 := x1 - \left(3 \cdot \frac{x1 + \left(2 \cdot x2 - t_0\right)}{t_1} - \left(x1 - \left(\left(t_1 \cdot \left(4 \cdot \left(x1 \cdot t_3\right) + \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot \frac{x1 - \left(t_0 + 2 \cdot x2\right)}{t_1}\right)\right) - t_0 \cdot \left(2 \cdot x2\right)\right) - x1 \cdot \left(x1 \cdot x1\right)\right)\right)\right)\\ \mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x1 \leq -6.5 \cdot 10^{-179}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;x1 \leq 9 \cdot 10^{-199}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;t_4\\ \mathbf{else}:\\ \;\;\;\;x1 + x1 \cdot \left(1 - 4 \cdot t_3\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 (- (* x2 (- (* x1 -12.0) 6.0)) x1))
        (t_3 (* x2 (- 3.0 (* 2.0 x2))))
        (t_4
         (-
          x1
          (-
           (* 3.0 (/ (+ x1 (- (* 2.0 x2) t_0)) t_1))
           (-
            x1
            (-
             (-
              (*
               t_1
               (+
                (* 4.0 (* x1 t_3))
                (*
                 (* x1 x1)
                 (+ 6.0 (* 4.0 (/ (- x1 (+ t_0 (* 2.0 x2))) t_1))))))
              (* t_0 (* 2.0 x2)))
             (* x1 (* x1 x1))))))))
   (if (<= x1 -5.6e+102)
     t_2
     (if (<= x1 -6.5e-179)
       t_4
       (if (<= x1 9e-199)
         t_2
         (if (<= x1 1.35e+154) t_4 (+ x1 (* x1 (- 1.0 (* 4.0 t_3))))))))))
double code(double x1, double x2) {
	double t_0 = x1 * (x1 * 3.0);
	double t_1 = (x1 * x1) + 1.0;
	double t_2 = (x2 * ((x1 * -12.0) - 6.0)) - x1;
	double t_3 = x2 * (3.0 - (2.0 * x2));
	double t_4 = x1 - ((3.0 * ((x1 + ((2.0 * x2) - t_0)) / t_1)) - (x1 - (((t_1 * ((4.0 * (x1 * t_3)) + ((x1 * x1) * (6.0 + (4.0 * ((x1 - (t_0 + (2.0 * x2))) / t_1)))))) - (t_0 * (2.0 * x2))) - (x1 * (x1 * x1)))));
	double tmp;
	if (x1 <= -5.6e+102) {
		tmp = t_2;
	} else if (x1 <= -6.5e-179) {
		tmp = t_4;
	} else if (x1 <= 9e-199) {
		tmp = t_2;
	} else if (x1 <= 1.35e+154) {
		tmp = t_4;
	} else {
		tmp = x1 + (x1 * (1.0 - (4.0 * t_3)));
	}
	return tmp;
}
real(8) function code(x1, x2)
    real(8), intent (in) :: x1
    real(8), intent (in) :: x2
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: t_4
    real(8) :: tmp
    t_0 = x1 * (x1 * 3.0d0)
    t_1 = (x1 * x1) + 1.0d0
    t_2 = (x2 * ((x1 * (-12.0d0)) - 6.0d0)) - x1
    t_3 = x2 * (3.0d0 - (2.0d0 * x2))
    t_4 = x1 - ((3.0d0 * ((x1 + ((2.0d0 * x2) - t_0)) / t_1)) - (x1 - (((t_1 * ((4.0d0 * (x1 * t_3)) + ((x1 * x1) * (6.0d0 + (4.0d0 * ((x1 - (t_0 + (2.0d0 * x2))) / t_1)))))) - (t_0 * (2.0d0 * x2))) - (x1 * (x1 * x1)))))
    if (x1 <= (-5.6d+102)) then
        tmp = t_2
    else if (x1 <= (-6.5d-179)) then
        tmp = t_4
    else if (x1 <= 9d-199) then
        tmp = t_2
    else if (x1 <= 1.35d+154) then
        tmp = t_4
    else
        tmp = x1 + (x1 * (1.0d0 - (4.0d0 * t_3)))
    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 = (x2 * ((x1 * -12.0) - 6.0)) - x1;
	double t_3 = x2 * (3.0 - (2.0 * x2));
	double t_4 = x1 - ((3.0 * ((x1 + ((2.0 * x2) - t_0)) / t_1)) - (x1 - (((t_1 * ((4.0 * (x1 * t_3)) + ((x1 * x1) * (6.0 + (4.0 * ((x1 - (t_0 + (2.0 * x2))) / t_1)))))) - (t_0 * (2.0 * x2))) - (x1 * (x1 * x1)))));
	double tmp;
	if (x1 <= -5.6e+102) {
		tmp = t_2;
	} else if (x1 <= -6.5e-179) {
		tmp = t_4;
	} else if (x1 <= 9e-199) {
		tmp = t_2;
	} else if (x1 <= 1.35e+154) {
		tmp = t_4;
	} else {
		tmp = x1 + (x1 * (1.0 - (4.0 * t_3)));
	}
	return tmp;
}
def code(x1, x2):
	t_0 = x1 * (x1 * 3.0)
	t_1 = (x1 * x1) + 1.0
	t_2 = (x2 * ((x1 * -12.0) - 6.0)) - x1
	t_3 = x2 * (3.0 - (2.0 * x2))
	t_4 = x1 - ((3.0 * ((x1 + ((2.0 * x2) - t_0)) / t_1)) - (x1 - (((t_1 * ((4.0 * (x1 * t_3)) + ((x1 * x1) * (6.0 + (4.0 * ((x1 - (t_0 + (2.0 * x2))) / t_1)))))) - (t_0 * (2.0 * x2))) - (x1 * (x1 * x1)))))
	tmp = 0
	if x1 <= -5.6e+102:
		tmp = t_2
	elif x1 <= -6.5e-179:
		tmp = t_4
	elif x1 <= 9e-199:
		tmp = t_2
	elif x1 <= 1.35e+154:
		tmp = t_4
	else:
		tmp = x1 + (x1 * (1.0 - (4.0 * t_3)))
	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(x2 * Float64(Float64(x1 * -12.0) - 6.0)) - x1)
	t_3 = Float64(x2 * Float64(3.0 - Float64(2.0 * x2)))
	t_4 = Float64(x1 - Float64(Float64(3.0 * Float64(Float64(x1 + Float64(Float64(2.0 * x2) - t_0)) / t_1)) - Float64(x1 - Float64(Float64(Float64(t_1 * Float64(Float64(4.0 * Float64(x1 * t_3)) + Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * Float64(Float64(x1 - Float64(t_0 + Float64(2.0 * x2))) / t_1)))))) - Float64(t_0 * Float64(2.0 * x2))) - Float64(x1 * Float64(x1 * x1))))))
	tmp = 0.0
	if (x1 <= -5.6e+102)
		tmp = t_2;
	elseif (x1 <= -6.5e-179)
		tmp = t_4;
	elseif (x1 <= 9e-199)
		tmp = t_2;
	elseif (x1 <= 1.35e+154)
		tmp = t_4;
	else
		tmp = Float64(x1 + Float64(x1 * Float64(1.0 - Float64(4.0 * t_3))));
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	t_0 = x1 * (x1 * 3.0);
	t_1 = (x1 * x1) + 1.0;
	t_2 = (x2 * ((x1 * -12.0) - 6.0)) - x1;
	t_3 = x2 * (3.0 - (2.0 * x2));
	t_4 = x1 - ((3.0 * ((x1 + ((2.0 * x2) - t_0)) / t_1)) - (x1 - (((t_1 * ((4.0 * (x1 * t_3)) + ((x1 * x1) * (6.0 + (4.0 * ((x1 - (t_0 + (2.0 * x2))) / t_1)))))) - (t_0 * (2.0 * x2))) - (x1 * (x1 * x1)))));
	tmp = 0.0;
	if (x1 <= -5.6e+102)
		tmp = t_2;
	elseif (x1 <= -6.5e-179)
		tmp = t_4;
	elseif (x1 <= 9e-199)
		tmp = t_2;
	elseif (x1 <= 1.35e+154)
		tmp = t_4;
	else
		tmp = x1 + (x1 * (1.0 - (4.0 * t_3)));
	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[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$3 = N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(x1 - N[(N[(3.0 * N[(N[(x1 + N[(N[(2.0 * x2), $MachinePrecision] - t$95$0), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] - N[(x1 - N[(N[(N[(t$95$1 * N[(N[(4.0 * N[(x1 * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * N[(N[(x1 - N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(t$95$0 * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], t$95$2, If[LessEqual[x1, -6.5e-179], t$95$4, If[LessEqual[x1, 9e-199], t$95$2, If[LessEqual[x1, 1.35e+154], t$95$4, N[(x1 + N[(x1 * N[(1.0 - N[(4.0 * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x1 \leq -6.5 \cdot 10^{-179}:\\
\;\;\;\;t_4\\

\mathbf{elif}\;x1 \leq 9 \cdot 10^{-199}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;t_4\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x1 < -5.60000000000000037e102 or -6.49999999999999996e-179 < x1 < 8.99999999999999995e-199

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

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x1 \cdot \left(x2 \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 41.2%

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

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

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

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

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

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

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

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

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

    if -5.60000000000000037e102 < x1 < -6.49999999999999996e-179 or 8.99999999999999995e-199 < x1 < 1.35000000000000003e154

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

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

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

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

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

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

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

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

    if 1.35000000000000003e154 < 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(x1 \cdot \left(x2 \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 58.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\ \;\;\;\;x2 \cdot \left(x1 \cdot -12 - 6\right) - x1\\ \mathbf{elif}\;x1 \leq -6.5 \cdot 10^{-179}:\\ \;\;\;\;x1 - \left(3 \cdot \frac{x1 + \left(2 \cdot x2 - x1 \cdot \left(x1 \cdot 3\right)\right)}{x1 \cdot x1 + 1} - \left(x1 - \left(\left(\left(x1 \cdot x1 + 1\right) \cdot \left(4 \cdot \left(x1 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right) + \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot \frac{x1 - \left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right)}{x1 \cdot x1 + 1}\right)\right) - \left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \left(2 \cdot x2\right)\right) - x1 \cdot \left(x1 \cdot x1\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 9 \cdot 10^{-199}:\\ \;\;\;\;x2 \cdot \left(x1 \cdot -12 - 6\right) - x1\\ \mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;x1 - \left(3 \cdot \frac{x1 + \left(2 \cdot x2 - x1 \cdot \left(x1 \cdot 3\right)\right)}{x1 \cdot x1 + 1} - \left(x1 - \left(\left(\left(x1 \cdot x1 + 1\right) \cdot \left(4 \cdot \left(x1 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right) + \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot \frac{x1 - \left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right)}{x1 \cdot x1 + 1}\right)\right) - \left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \left(2 \cdot x2\right)\right) - x1 \cdot \left(x1 \cdot x1\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + x1 \cdot \left(1 - 4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right)\\ \end{array} \]

Alternative 14: 70.5% accurate, 1.5× speedup?

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

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

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

\mathbf{elif}\;x1 \leq -1.8 \cdot 10^{-175}:\\
\;\;\;\;x2 \cdot -6 - x1 \cdot \left(t_2 - -1\right)\\

\mathbf{elif}\;x1 \leq 7 \cdot 10^{-199}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;x1 \leq 3.8 \cdot 10^{+47}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_4 - 2 \cdot x2\right) - x1}{t_0} + \left(x1 - 4 \cdot \left(x1 \cdot t_1\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;t_6\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if x1 < -5.60000000000000037e102 or -1.8e-175 < x1 < 6.9999999999999998e-199

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

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x1 \cdot \left(x2 \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 41.2%

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

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

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

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

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

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

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

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

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

    if -5.60000000000000037e102 < x1 < -4e3 or 3.8000000000000003e47 < x1 < 1.35000000000000003e154

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

    if -4e3 < x1 < -1.8e-175

    1. Initial program 99.1%

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

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x1 \cdot \left(x2 \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 91.0%

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

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

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

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

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

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

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

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

    if 6.9999999999999998e-199 < x1 < 3.8000000000000003e47

    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 0 71.0%

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x1 \cdot \left(x2 \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 1.35000000000000003e154 < 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(x1 \cdot \left(x2 \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 58.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\ \;\;\;\;x2 \cdot \left(x1 \cdot -12 - 6\right) - x1\\ \mathbf{elif}\;x1 \leq -4000:\\ \;\;\;\;x1 + \left(9 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(\left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - \left(x1 \cdot x1 + 1\right) \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot \frac{x1 - \left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right)}{x1 \cdot x1 + 1}\right) - x1 \cdot 2\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq -1.8 \cdot 10^{-175}:\\ \;\;\;\;x2 \cdot -6 - x1 \cdot \left(4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right) - -1\right)\\ \mathbf{elif}\;x1 \leq 7 \cdot 10^{-199}:\\ \;\;\;\;x2 \cdot \left(x1 \cdot -12 - 6\right) - x1\\ \mathbf{elif}\;x1 \leq 3.8 \cdot 10^{+47}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 - 4 \cdot \left(x1 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;x1 + \left(9 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(\left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - \left(x1 \cdot x1 + 1\right) \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot \frac{x1 - \left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right)}{x1 \cdot x1 + 1}\right) - x1 \cdot 2\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + x1 \cdot \left(1 - 4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right)\\ \end{array} \]

Alternative 15: 59.6% accurate, 5.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -6.3 \cdot 10^{+84} \lor \neg \left(x1 \leq -6.2 \cdot 10^{-178}\right) \land x1 \leq 1.15 \cdot 10^{-199}:\\
\;\;\;\;x2 \cdot \left(x1 \cdot -12 - 6\right) - x1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x1 < -6.30000000000000013e84 or -6.1999999999999999e-178 < x1 < 1.1500000000000001e-199

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

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x1 \cdot \left(x2 \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 40.3%

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

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

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

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

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

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

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

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

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

    if -6.30000000000000013e84 < x1 < -6.1999999999999999e-178 or 1.1500000000000001e-199 < x1

    1. Initial program 83.2%

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

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x1 \cdot \left(x2 \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 59.5%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -6.3 \cdot 10^{+84} \lor \neg \left(x1 \leq -6.2 \cdot 10^{-178}\right) \land x1 \leq 1.15 \cdot 10^{-199}:\\ \;\;\;\;x2 \cdot \left(x1 \cdot -12 - 6\right) - x1\\ \mathbf{else}:\\ \;\;\;\;x2 \cdot -6 - x1 \cdot \left(4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right) - -1\right)\\ \end{array} \]

Alternative 16: 54.8% accurate, 6.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -2.8 \cdot 10^{+87} \lor \neg \left(x1 \leq -1.45 \cdot 10^{-99}\right) \land x1 \leq 1.02 \cdot 10^{-123}:\\
\;\;\;\;x2 \cdot \left(x1 \cdot -12 - 6\right) - x1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x1 < -2.80000000000000015e87 or -1.44999999999999993e-99 < x1 < 1.02e-123

    1. Initial program 66.9%

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

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

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

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

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

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

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

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

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

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

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

    if -2.80000000000000015e87 < x1 < -1.44999999999999993e-99 or 1.02e-123 < x1

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

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x1 \cdot \left(x2 \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 51.3%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -2.8 \cdot 10^{+87} \lor \neg \left(x1 \leq -1.45 \cdot 10^{-99}\right) \land x1 \leq 1.02 \cdot 10^{-123}:\\ \;\;\;\;x2 \cdot \left(x1 \cdot -12 - 6\right) - x1\\ \mathbf{else}:\\ \;\;\;\;x1 \cdot \left(-1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\ \end{array} \]

Alternative 17: 32.4% accurate, 13.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x2 \leq -1.65 \cdot 10^{-169}:\\ \;\;\;\;x2 \cdot -6\\ \mathbf{elif}\;x2 \leq 5.8 \cdot 10^{-144}:\\ \;\;\;\;-x1\\ \mathbf{else}:\\ \;\;\;\;x1 + x2 \cdot -6\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (if (<= x2 -1.65e-169)
   (* x2 -6.0)
   (if (<= x2 5.8e-144) (- x1) (+ x1 (* x2 -6.0)))))
double code(double x1, double x2) {
	double tmp;
	if (x2 <= -1.65e-169) {
		tmp = x2 * -6.0;
	} else if (x2 <= 5.8e-144) {
		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.65d-169)) then
        tmp = x2 * (-6.0d0)
    else if (x2 <= 5.8d-144) 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.65e-169) {
		tmp = x2 * -6.0;
	} else if (x2 <= 5.8e-144) {
		tmp = -x1;
	} else {
		tmp = x1 + (x2 * -6.0);
	}
	return tmp;
}
def code(x1, x2):
	tmp = 0
	if x2 <= -1.65e-169:
		tmp = x2 * -6.0
	elif x2 <= 5.8e-144:
		tmp = -x1
	else:
		tmp = x1 + (x2 * -6.0)
	return tmp
function code(x1, x2)
	tmp = 0.0
	if (x2 <= -1.65e-169)
		tmp = Float64(x2 * -6.0);
	elseif (x2 <= 5.8e-144)
		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.65e-169)
		tmp = x2 * -6.0;
	elseif (x2 <= 5.8e-144)
		tmp = -x1;
	else
		tmp = x1 + (x2 * -6.0);
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := If[LessEqual[x2, -1.65e-169], N[(x2 * -6.0), $MachinePrecision], If[LessEqual[x2, 5.8e-144], (-x1), N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -1.65 \cdot 10^{-169}:\\
\;\;\;\;x2 \cdot -6\\

\mathbf{elif}\;x2 \leq 5.8 \cdot 10^{-144}:\\
\;\;\;\;-x1\\

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


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

    1. Initial program 76.0%

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

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x1 \cdot \left(x2 \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 35.8%

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

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

      \[\leadsto x1 + \color{blue}{x2 \cdot -6} \]
    6. Taylor expanded in x1 around 0 36.0%

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

    if -1.65000000000000013e-169 < x2 < 5.8000000000000004e-144

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

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x1 \cdot \left(x2 \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 51.8%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x1 + -2 \cdot x1} \]
    7. Step-by-step derivation
      1. distribute-rgt1-in47.6%

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

        \[\leadsto \color{blue}{-1} \cdot x1 \]
      3. neg-mul-147.6%

        \[\leadsto \color{blue}{-x1} \]
    8. Simplified47.6%

      \[\leadsto \color{blue}{-x1} \]

    if 5.8000000000000004e-144 < x2

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x2 \leq -1.65 \cdot 10^{-169}:\\ \;\;\;\;x2 \cdot -6\\ \mathbf{elif}\;x2 \leq 5.8 \cdot 10^{-144}:\\ \;\;\;\;-x1\\ \mathbf{else}:\\ \;\;\;\;x1 + x2 \cdot -6\\ \end{array} \]

Alternative 18: 45.0% accurate, 14.1× speedup?

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

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

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

    \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x1 \cdot \left(x2 \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 52.9%

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

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

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

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

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

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

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

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

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

    \[\leadsto x2 \cdot \left(x1 \cdot -12 - 6\right) - x1 \]

Alternative 19: 32.0% accurate, 17.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -4 \cdot 10^{-168} \lor \neg \left(x2 \leq 4.3 \cdot 10^{-131}\right):\\
\;\;\;\;x2 \cdot -6\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x2 < -4.0000000000000002e-168 or 4.30000000000000019e-131 < x2

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

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

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

    if -4.0000000000000002e-168 < x2 < 4.30000000000000019e-131

    1. Initial program 75.5%

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

      \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x1 \cdot \left(x2 \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 49.5%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x1 + -2 \cdot x1} \]
    7. Step-by-step derivation
      1. distribute-rgt1-in45.5%

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

        \[\leadsto \color{blue}{-1} \cdot x1 \]
      3. neg-mul-145.5%

        \[\leadsto \color{blue}{-x1} \]
    8. Simplified45.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x2 \leq -4 \cdot 10^{-168} \lor \neg \left(x2 \leq 4.3 \cdot 10^{-131}\right):\\ \;\;\;\;x2 \cdot -6\\ \mathbf{else}:\\ \;\;\;\;-x1\\ \end{array} \]

Alternative 20: 38.6% 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 73.0%

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

    \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x1 \cdot \left(x2 \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 52.9%

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

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

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

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

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

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

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

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

    \[\leadsto -6 \cdot x2 + \color{blue}{-1 \cdot x1} \]
  8. Step-by-step derivation
    1. mul-1-neg39.7%

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

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

    \[\leadsto x2 \cdot -6 - x1 \]

Alternative 21: 13.4% 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 73.0%

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

    \[\leadsto x1 + \left(\left(\color{blue}{4 \cdot \left(x1 \cdot \left(x2 \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 52.9%

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{x1 + -2 \cdot x1} \]
  7. Step-by-step derivation
    1. distribute-rgt1-in14.4%

      \[\leadsto \color{blue}{\left(-2 + 1\right) \cdot x1} \]
    2. metadata-eval14.4%

      \[\leadsto \color{blue}{-1} \cdot x1 \]
    3. neg-mul-114.4%

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

    \[\leadsto \color{blue}{-x1} \]
  9. Final simplification14.4%

    \[\leadsto -x1 \]

Alternative 22: 3.3% accurate, 127.0× speedup?

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

\\
x1
\end{array}
Derivation
  1. Initial program 73.0%

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

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

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

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

    \[\leadsto x1 + \color{blue}{x2 \cdot -6} \]
  6. Taylor expanded in x1 around inf 3.3%

    \[\leadsto \color{blue}{x1} \]
  7. Final simplification3.3%

    \[\leadsto x1 \]

Reproduce

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