Rosa's FloatVsDoubleBenchmark

Percentage Accurate: 70.8% → 99.5%
Time: 55.0s
Alternatives: 19
Speedup: 1.6×

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

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

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

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

\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\right)\\


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

    1. Initial program 99.5%

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

      \[\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. *-commutative6.8%

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

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

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

Alternative 2: 99.4% accurate, 0.2× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\right)\\


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

    1. Initial program 99.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. Step-by-step derivation
      1. div-sub99.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(\color{blue}{\left(\frac{\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2}{x1 \cdot x1 + 1} - \frac{x1}{x1 \cdot x1 + 1}\right)} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
      2. *-commutative99.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(\left(\frac{\color{blue}{x1 \cdot \left(3 \cdot x1\right)} + 2 \cdot x2}{x1 \cdot x1 + 1} - \frac{x1}{x1 \cdot x1 + 1}\right) - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
      3. fma-def99.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(\left(\frac{\color{blue}{\mathsf{fma}\left(x1, 3 \cdot x1, 2 \cdot x2\right)}}{x1 \cdot x1 + 1} - \frac{x1}{x1 \cdot x1 + 1}\right) - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
      4. *-commutative99.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(\left(\frac{\mathsf{fma}\left(x1, \color{blue}{x1 \cdot 3}, 2 \cdot x2\right)}{x1 \cdot x1 + 1} - \frac{x1}{x1 \cdot x1 + 1}\right) - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
      5. fma-udef99.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(\left(\frac{\color{blue}{x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2}}{x1 \cdot x1 + 1} - \frac{x1}{x1 \cdot x1 + 1}\right) - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
      6. *-commutative99.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(\left(\frac{x1 \cdot \color{blue}{\left(3 \cdot x1\right)} + 2 \cdot x2}{x1 \cdot x1 + 1} - \frac{x1}{x1 \cdot x1 + 1}\right) - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
      7. *-commutative99.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(\left(\frac{\color{blue}{\left(3 \cdot x1\right) \cdot x1} + 2 \cdot x2}{x1 \cdot x1 + 1} - \frac{x1}{x1 \cdot x1 + 1}\right) - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
      8. associate-*r*99.5%

        \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\left(\frac{\color{blue}{3 \cdot \left(x1 \cdot x1\right)} + 2 \cdot x2}{x1 \cdot x1 + 1} - \frac{x1}{x1 \cdot x1 + 1}\right) - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
      9. fma-def99.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(\left(\frac{\color{blue}{\mathsf{fma}\left(3, x1 \cdot x1, 2 \cdot x2\right)}}{x1 \cdot x1 + 1} - \frac{x1}{x1 \cdot x1 + 1}\right) - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
      10. pow299.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(\left(\frac{\mathsf{fma}\left(3, \color{blue}{{x1}^{2}}, 2 \cdot x2\right)}{x1 \cdot x1 + 1} - \frac{x1}{x1 \cdot x1 + 1}\right) - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
      11. fma-def99.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(\left(\frac{\mathsf{fma}\left(3, {x1}^{2}, 2 \cdot x2\right)}{\color{blue}{\mathsf{fma}\left(x1, x1, 1\right)}} - \frac{x1}{x1 \cdot x1 + 1}\right) - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
      12. fma-def99.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(\left(\frac{\mathsf{fma}\left(3, {x1}^{2}, 2 \cdot x2\right)}{\mathsf{fma}\left(x1, x1, 1\right)} - \frac{x1}{\color{blue}{\mathsf{fma}\left(x1, x1, 1\right)}}\right) - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    3. Applied egg-rr99.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(\color{blue}{\left(\frac{\mathsf{fma}\left(3, {x1}^{2}, 2 \cdot x2\right)}{\mathsf{fma}\left(x1, x1, 1\right)} - \frac{x1}{\mathsf{fma}\left(x1, x1, 1\right)}\right)} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]

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

      \[\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. *-commutative6.8%

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

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

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

Alternative 3: 99.4% accurate, 0.2× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\right)\\


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

    1. Initial program 99.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. Step-by-step derivation
      1. div-sub99.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(\frac{\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2}{x1 \cdot x1 + 1} - \frac{x1}{x1 \cdot x1 + 1}\right)}\right) \]
      2. cancel-sign-sub-inv99.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 \left(\frac{\color{blue}{\left(3 \cdot x1\right) \cdot x1 + \left(-2\right) \cdot x2}}{x1 \cdot x1 + 1} - \frac{x1}{x1 \cdot x1 + 1}\right)\right) \]
      3. associate-*r*99.5%

        \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \left(\frac{\color{blue}{3 \cdot \left(x1 \cdot x1\right)} + \left(-2\right) \cdot x2}{x1 \cdot x1 + 1} - \frac{x1}{x1 \cdot x1 + 1}\right)\right) \]
      4. fma-def99.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 \left(\frac{\color{blue}{\mathsf{fma}\left(3, x1 \cdot x1, \left(-2\right) \cdot x2\right)}}{x1 \cdot x1 + 1} - \frac{x1}{x1 \cdot x1 + 1}\right)\right) \]
      5. pow299.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 \left(\frac{\mathsf{fma}\left(3, \color{blue}{{x1}^{2}}, \left(-2\right) \cdot x2\right)}{x1 \cdot x1 + 1} - \frac{x1}{x1 \cdot x1 + 1}\right)\right) \]
      6. metadata-eval99.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 \left(\frac{\mathsf{fma}\left(3, {x1}^{2}, \color{blue}{-2} \cdot x2\right)}{x1 \cdot x1 + 1} - \frac{x1}{x1 \cdot x1 + 1}\right)\right) \]
      7. fma-def99.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 \left(\frac{\mathsf{fma}\left(3, {x1}^{2}, -2 \cdot x2\right)}{\color{blue}{\mathsf{fma}\left(x1, x1, 1\right)}} - \frac{x1}{x1 \cdot x1 + 1}\right)\right) \]
      8. fma-def99.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 \left(\frac{\mathsf{fma}\left(3, {x1}^{2}, -2 \cdot x2\right)}{\mathsf{fma}\left(x1, x1, 1\right)} - \frac{x1}{\color{blue}{\mathsf{fma}\left(x1, x1, 1\right)}}\right)\right) \]
    3. Applied egg-rr99.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(\frac{\mathsf{fma}\left(3, {x1}^{2}, -2 \cdot x2\right)}{\mathsf{fma}\left(x1, x1, 1\right)} - \frac{x1}{\mathsf{fma}\left(x1, x1, 1\right)}\right)}\right) \]
    4. Step-by-step derivation
      1. *-commutative99.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 \left(\frac{\mathsf{fma}\left(3, {x1}^{2}, \color{blue}{x2 \cdot -2}\right)}{\mathsf{fma}\left(x1, x1, 1\right)} - \frac{x1}{\mathsf{fma}\left(x1, x1, 1\right)}\right)\right) \]
    5. Simplified99.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(\frac{\mathsf{fma}\left(3, {x1}^{2}, x2 \cdot -2\right)}{\mathsf{fma}\left(x1, x1, 1\right)} - \frac{x1}{\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 6.8%

      \[\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. *-commutative6.8%

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

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

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

Alternative 4: 99.4% accurate, 0.5× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\right)\\


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

    1. Initial program 99.5%

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

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

    1. Initial program 0.0%

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

      \[\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. *-commutative6.8%

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

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

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

Alternative 5: 99.1% accurate, 1.1× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x1 < -9.99999999999999977e101 or 5.0000000000000001e93 < x1

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

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

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

      \[\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 + \left(\left({x1}^{4} \cdot 6 + x1\right) + \color{blue}{9}\right) \]

    if -9.99999999999999977e101 < x1 < 5.0000000000000001e93

    1. Initial program 99.4%

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

      \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \color{blue}{3}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    3. Taylor expanded in x1 around 0 98.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 3\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \color{blue}{\left(-2 \cdot x2 + -1 \cdot x1\right)}\right) \]
    4. Step-by-step derivation
      1. mul-1-neg98.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 3\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \left(-2 \cdot x2 + \color{blue}{\left(-x1\right)}\right)\right) \]
      2. unsub-neg98.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 3\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \color{blue}{\left(-2 \cdot x2 - x1\right)}\right) \]
      3. *-commutative98.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 3\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \left(\color{blue}{x2 \cdot -2} - x1\right)\right) \]
    5. Simplified98.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 3\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \color{blue}{\left(x2 \cdot -2 - x1\right)}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification99.1%

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

Alternative 6: 76.5% accurate, 1.2× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 \cdot 8\right) \cdot {x2}^{2}\\


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

    1. Initial program 81.8%

      \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    2. Taylor expanded in x1 around inf 80.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 \color{blue}{3}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    3. Taylor expanded in x1 around 0 81.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 3\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \color{blue}{\left(-2 \cdot x2 + -1 \cdot x1\right)}\right) \]
    4. Step-by-step derivation
      1. mul-1-neg81.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 3\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \left(-2 \cdot x2 + \color{blue}{\left(-x1\right)}\right)\right) \]
      2. unsub-neg81.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 3\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \color{blue}{\left(-2 \cdot x2 - x1\right)}\right) \]
      3. *-commutative81.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 3\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \left(\color{blue}{x2 \cdot -2} - x1\right)\right) \]
    5. Simplified81.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 3\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \color{blue}{\left(x2 \cdot -2 - x1\right)}\right) \]

    if 1.7999999999999999e146 < x1

    1. Initial program 5.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 5.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 x2 around inf 51.4%

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

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

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

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

Alternative 7: 74.0% accurate, 1.3× speedup?

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

\mathbf{elif}\;x1 \leq 1.8 \cdot 10^{+146}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(t_0 + \left(t_3 \cdot \left(t_5 \cdot \left(t_4 - 3\right) + t_6\right) + t_2\right)\right)\right) + 3 \cdot \left(x2 \cdot -2\right)\right)\\

\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 3 regimes
  2. if x1 < 0.0045999999999999999

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

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

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

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

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

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

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

    if 0.0045999999999999999 < x1 < 1.7999999999999999e146

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

      \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \color{blue}{\left(-2 \cdot x2\right)}\right) \]
    3. Step-by-step derivation
      1. *-commutative97.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(x2 \cdot -2\right)}\right) \]
    4. Simplified97.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(x2 \cdot -2\right)}\right) \]
    5. Taylor expanded in x1 around inf 96.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 \color{blue}{3}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \left(x2 \cdot -2\right)\right) \]

    if 1.7999999999999999e146 < x1

    1. Initial program 5.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 5.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 inf 51.4%

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

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

Alternative 8: 76.5% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 \cdot \left(x1 \cdot 3\right)\\ t_1 := x1 \cdot x1 + 1\\ t_2 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\ \mathbf{if}\;x1 \leq 1.8 \cdot 10^{+146}:\\ \;\;\;\;x1 + \left(\left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_2 \cdot 4 - 6\right)\right) + 3 \cdot t_0\right)\right)\right) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + 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
 (let* ((t_0 (* x1 (* x1 3.0)))
        (t_1 (+ (* x1 x1) 1.0))
        (t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
   (if (<= x1 1.8e+146)
     (+
      x1
      (+
       (+
        x1
        (+
         (* x1 (* x1 x1))
         (+
          (*
           t_1
           (+
            (* (* (* x1 2.0) t_2) (- t_2 3.0))
            (* (* x1 x1) (- (* t_2 4.0) 6.0))))
          (* 3.0 t_0))))
       (* 3.0 (- (* x2 -2.0) x1))))
     (+ x1 (* x1 (+ 1.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0)))))))))
double code(double x1, double x2) {
	double t_0 = x1 * (x1 * 3.0);
	double t_1 = (x1 * x1) + 1.0;
	double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
	double tmp;
	if (x1 <= 1.8e+146) {
		tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_0)))) + (3.0 * ((x2 * -2.0) - x1)));
	} else {
		tmp = x1 + (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) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_0 = x1 * (x1 * 3.0d0)
    t_1 = (x1 * x1) + 1.0d0
    t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
    if (x1 <= 1.8d+146) then
        tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0d0) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((t_2 * 4.0d0) - 6.0d0)))) + (3.0d0 * t_0)))) + (3.0d0 * ((x2 * (-2.0d0)) - x1)))
    else
        tmp = x1 + (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 t_0 = x1 * (x1 * 3.0);
	double t_1 = (x1 * x1) + 1.0;
	double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
	double tmp;
	if (x1 <= 1.8e+146) {
		tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_0)))) + (3.0 * ((x2 * -2.0) - x1)));
	} else {
		tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
	}
	return tmp;
}
def code(x1, x2):
	t_0 = x1 * (x1 * 3.0)
	t_1 = (x1 * x1) + 1.0
	t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1
	tmp = 0
	if x1 <= 1.8e+146:
		tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_0)))) + (3.0 * ((x2 * -2.0) - x1)))
	else:
		tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))))
	return tmp
function code(x1, x2)
	t_0 = Float64(x1 * Float64(x1 * 3.0))
	t_1 = Float64(Float64(x1 * x1) + 1.0)
	t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1)
	tmp = 0.0
	if (x1 <= 1.8e+146)
		tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(3.0 * t_0)))) + Float64(3.0 * Float64(Float64(x2 * -2.0) - x1))));
	else
		tmp = Float64(x1 + 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)
	t_0 = x1 * (x1 * 3.0);
	t_1 = (x1 * x1) + 1.0;
	t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
	tmp = 0.0;
	if (x1 <= 1.8e+146)
		tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_0)))) + (3.0 * ((x2 * -2.0) - x1)));
	else
		tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[x1, 1.8e+146], N[(x1 + N[(N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 * N[(1.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;x1 + 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 < 1.7999999999999999e146

    1. Initial program 81.8%

      \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    2. Taylor expanded in x1 around inf 80.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 \color{blue}{3}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    3. Taylor expanded in x1 around 0 81.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 3\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \color{blue}{\left(-2 \cdot x2 + -1 \cdot x1\right)}\right) \]
    4. Step-by-step derivation
      1. mul-1-neg81.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 3\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \left(-2 \cdot x2 + \color{blue}{\left(-x1\right)}\right)\right) \]
      2. unsub-neg81.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 3\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \color{blue}{\left(-2 \cdot x2 - x1\right)}\right) \]
      3. *-commutative81.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 3\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \left(\color{blue}{x2 \cdot -2} - x1\right)\right) \]
    5. Simplified81.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 3\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \color{blue}{\left(x2 \cdot -2 - x1\right)}\right) \]

    if 1.7999999999999999e146 < x1

    1. Initial program 5.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 5.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 inf 51.4%

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

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

Alternative 9: 70.6% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;x1 \leq -5.2 \cdot 10^{-191}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;x1 \leq 4.8 \cdot 10^{-197}:\\
\;\;\;\;t_5\\

\mathbf{elif}\;x1 \leq 3.6 \cdot 10^{-6}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;x1 \leq 1.8 \cdot 10^{+146}:\\
\;\;\;\;t_5\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x1 < -0.156 or -5.19999999999999972e-191 < x1 < 4.8000000000000002e-197 or 3.59999999999999984e-6 < x1 < 1.7999999999999999e146

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

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

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

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

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

    if -0.156 < x1 < -5.19999999999999972e-191 or 4.8000000000000002e-197 < x1 < 3.59999999999999984e-6

    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 89.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) \]

    if 1.7999999999999999e146 < x1

    1. Initial program 5.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 5.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 inf 51.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -0.156:\\ \;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2\right) + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot \left(x1 \cdot \left(x1 \cdot 3\right)\right) + \left(x1 \cdot x1 + 1\right) \cdot \left(\left(\left(x1 \cdot 2\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq -5.2 \cdot 10^{-191}:\\ \;\;\;\;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(2 \cdot x2 - 3\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 4.8 \cdot 10^{-197}:\\ \;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2\right) + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot \left(x1 \cdot \left(x1 \cdot 3\right)\right) + \left(x1 \cdot x1 + 1\right) \cdot \left(\left(\left(x1 \cdot 2\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 3.6 \cdot 10^{-6}:\\ \;\;\;\;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(2 \cdot x2 - 3\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 1.8 \cdot 10^{+146}:\\ \;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2\right) + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot \left(x1 \cdot \left(x1 \cdot 3\right)\right) + \left(x1 \cdot x1 + 1\right) \cdot \left(\left(\left(x1 \cdot 2\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\ \end{array} \]

Alternative 10: 74.2% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 \cdot \left(x1 \cdot 3\right)\\ t_1 := x1 \cdot x1 + 1\\ t_2 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\ \mathbf{if}\;x1 \leq 1.8 \cdot 10^{+146}:\\ \;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2 - x1\right) + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot t_0 + t_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + 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
 (let* ((t_0 (* x1 (* x1 3.0)))
        (t_1 (+ (* x1 x1) 1.0))
        (t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
   (if (<= x1 1.8e+146)
     (+
      x1
      (+
       (* 3.0 (- (* x2 -2.0) x1))
       (+
        x1
        (+
         (* x1 (* x1 x1))
         (+
          (* 3.0 t_0)
          (* t_1 (+ (* (* (* x1 2.0) t_2) (- t_2 3.0)) (* (* x1 x1) 6.0))))))))
     (+ x1 (* x1 (+ 1.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0)))))))))
double code(double x1, double x2) {
	double t_0 = x1 * (x1 * 3.0);
	double t_1 = (x1 * x1) + 1.0;
	double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
	double tmp;
	if (x1 <= 1.8e+146) {
		tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0)))))));
	} else {
		tmp = x1 + (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) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_0 = x1 * (x1 * 3.0d0)
    t_1 = (x1 * x1) + 1.0d0
    t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
    if (x1 <= 1.8d+146) then
        tmp = x1 + ((3.0d0 * ((x2 * (-2.0d0)) - x1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0d0 * t_0) + (t_1 * ((((x1 * 2.0d0) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * 6.0d0)))))))
    else
        tmp = x1 + (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 t_0 = x1 * (x1 * 3.0);
	double t_1 = (x1 * x1) + 1.0;
	double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
	double tmp;
	if (x1 <= 1.8e+146) {
		tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0)))))));
	} else {
		tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
	}
	return tmp;
}
def code(x1, x2):
	t_0 = x1 * (x1 * 3.0)
	t_1 = (x1 * x1) + 1.0
	t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1
	tmp = 0
	if x1 <= 1.8e+146:
		tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0)))))))
	else:
		tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))))
	return tmp
function code(x1, x2)
	t_0 = Float64(x1 * Float64(x1 * 3.0))
	t_1 = Float64(Float64(x1 * x1) + 1.0)
	t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1)
	tmp = 0.0
	if (x1 <= 1.8e+146)
		tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(3.0 * t_0) + Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * 6.0))))))));
	else
		tmp = Float64(x1 + 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)
	t_0 = x1 * (x1 * 3.0);
	t_1 = (x1 * x1) + 1.0;
	t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
	tmp = 0.0;
	if (x1 <= 1.8e+146)
		tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0)))))));
	else
		tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[x1, 1.8e+146], N[(x1 + N[(N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 * t$95$0), $MachinePrecision] + N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 * N[(1.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;x1 + 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 < 1.7999999999999999e146

    1. Initial program 81.8%

      \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    2. Taylor expanded in x1 around inf 80.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 \color{blue}{3}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    3. Taylor expanded in x1 around 0 81.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 3\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \color{blue}{\left(-2 \cdot x2 + -1 \cdot x1\right)}\right) \]
    4. Step-by-step derivation
      1. mul-1-neg81.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 3\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \left(-2 \cdot x2 + \color{blue}{\left(-x1\right)}\right)\right) \]
      2. unsub-neg81.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 3\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \color{blue}{\left(-2 \cdot x2 - x1\right)}\right) \]
      3. *-commutative81.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 3\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \left(\color{blue}{x2 \cdot -2} - x1\right)\right) \]
    5. Simplified81.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 3\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \color{blue}{\left(x2 \cdot -2 - x1\right)}\right) \]
    6. Taylor expanded in x1 around inf 77.4%

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

    if 1.7999999999999999e146 < x1

    1. Initial program 5.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 5.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 inf 51.4%

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

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

Alternative 11: 68.7% accurate, 1.9× speedup?

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

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

\mathbf{elif}\;x1 \leq -5.6 \cdot 10^{-212}:\\
\;\;\;\;t_4\\

\mathbf{elif}\;x1 \leq 6.4 \cdot 10^{-208}:\\
\;\;\;\;x1 + \left(t_3 + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot -3\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 480000000:\\
\;\;\;\;t_4\\

\mathbf{elif}\;x1 \leq 1.8 \cdot 10^{+146}:\\
\;\;\;\;t_5\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x1 < -162 or 4.8e8 < x1 < 1.7999999999999999e146

    1. Initial program 49.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 49.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 \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \color{blue}{\left(-2 \cdot x2\right)}\right) \]
    3. Step-by-step derivation
      1. *-commutative49.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 \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \color{blue}{\left(x2 \cdot -2\right)}\right) \]
    4. Simplified49.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 \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \color{blue}{\left(x2 \cdot -2\right)}\right) \]
    5. Taylor expanded in x1 around inf 49.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}{3}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \left(x2 \cdot -2\right)\right) \]
    6. Taylor expanded in x1 around inf 43.6%

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

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

    if -162 < x1 < -5.60000000000000027e-212 or 6.4000000000000003e-208 < x1 < 4.8e8

    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 84.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) \]

    if -5.60000000000000027e-212 < x1 < 6.4000000000000003e-208

    1. Initial program 99.7%

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

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

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

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

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

    if 1.7999999999999999e146 < x1

    1. Initial program 5.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 5.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 inf 51.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -162:\\ \;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2\right) + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot \left(x1 \cdot \left(x1 \cdot 3\right)\right) + \left(x1 \cdot x1 + 1\right) \cdot \left(\left(x1 \cdot x1\right) \cdot \left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} \cdot 4 - 6\right) + -6\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq -5.6 \cdot 10^{-212}:\\ \;\;\;\;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(2 \cdot x2 - 3\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 6.4 \cdot 10^{-208}:\\ \;\;\;\;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(x2 \cdot \left(x1 \cdot -3\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 480000000:\\ \;\;\;\;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(2 \cdot x2 - 3\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 1.8 \cdot 10^{+146}:\\ \;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2\right) + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot \left(x1 \cdot \left(x1 \cdot 3\right)\right) + \left(x1 \cdot x1 + 1\right) \cdot \left(\left(x1 \cdot x1\right) \cdot \left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} \cdot 4 - 6\right) + -6\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\ \end{array} \]

Alternative 12: 57.9% accurate, 3.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -1.05 \cdot 10^{-211} \lor \neg \left(x1 \leq 4.5 \cdot 10^{-207}\right):\\
\;\;\;\;x1 + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right) + x2 \cdot -6\right)\\

\mathbf{else}:\\
\;\;\;\;x1 + \left(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(x2 \cdot \left(x1 \cdot -3\right)\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x1 < -1.05000000000000004e-211 or 4.49999999999999992e-207 < x1

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

      \[\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 50.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)} \]

    if -1.05000000000000004e-211 < x1 < 4.49999999999999992e-207

    1. Initial program 99.7%

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

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

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

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

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

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

Alternative 13: 57.1% accurate, 5.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -9.5 \cdot 10^{-233} \lor \neg \left(x1 \leq 2.35 \cdot 10^{-272}\right):\\
\;\;\;\;x1 + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right) + x2 \cdot -6\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x1 < -9.5000000000000003e-233 or 2.3499999999999999e-272 < x1

    1. Initial program 68.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 47.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 54.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)} \]

    if -9.5000000000000003e-233 < x1 < 2.3499999999999999e-272

    1. Initial program 99.8%

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

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

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

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

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

        \[\leadsto \color{blue}{x2 \cdot -6} \]
    8. Simplified99.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -9.5 \cdot 10^{-233} \lor \neg \left(x1 \leq 2.35 \cdot 10^{-272}\right):\\ \;\;\;\;x1 + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right) + x2 \cdot -6\right)\\ \mathbf{else}:\\ \;\;\;\;x2 \cdot -6\\ \end{array} \]

Alternative 14: 41.0% accurate, 6.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -2.05 \cdot 10^{-128} \lor \neg \left(x1 \leq 6.4 \cdot 10^{-104}\right):\\
\;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x1 < -2.05e-128 or 6.39999999999999978e-104 < x1

    1. Initial program 55.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 31.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 inf 25.5%

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

    if -2.05e-128 < x1 < 6.39999999999999978e-104

    1. Initial program 99.7%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -2.05 \cdot 10^{-128} \lor \neg \left(x1 \leq 6.4 \cdot 10^{-104}\right):\\ \;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x2 \cdot -6\\ \end{array} \]

Alternative 15: 41.2% accurate, 6.6× speedup?

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

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

\mathbf{elif}\;x1 \leq 1.5 \cdot 10^{-105}:\\
\;\;\;\;x2 \cdot -6\\

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


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

    1. Initial program 49.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 35.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 inf 17.5%

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

    if -1.3999999999999999e-128 < x1 < 1.5e-105

    1. Initial program 99.7%

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

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

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

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

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

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

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

    if 1.5e-105 < x1

    1. Initial program 61.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 28.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 inf 33.3%

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

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

Alternative 16: 27.1% accurate, 18.1× speedup?

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

\\
x1 + \left(x1 + x2 \cdot -6\right)
\end{array}
Derivation
  1. Initial program 71.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 58.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 17: 27.1% accurate, 25.4× speedup?

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

\\
x1 + x2 \cdot -6
\end{array}
Derivation
  1. Initial program 71.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 49.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 30.1%

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

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

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

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

Alternative 18: 26.9% accurate, 42.3× speedup?

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

\\
x2 \cdot -6
\end{array}
Derivation
  1. Initial program 71.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 49.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 30.1%

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

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

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

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

      \[\leadsto \color{blue}{x2 \cdot -6} \]
  8. Simplified29.7%

    \[\leadsto \color{blue}{x2 \cdot -6} \]
  9. Final simplification29.7%

    \[\leadsto x2 \cdot -6 \]

Alternative 19: 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 71.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 49.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 30.1%

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

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

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

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

    \[\leadsto x1 \]

Reproduce

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