Rosa's FloatVsDoubleBenchmark

Percentage Accurate: 70.2% → 99.5%
Time: 40.4s
Alternatives: 21
Speedup: 1.8×

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 21 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.2% accurate, 1.0× speedup?

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

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

Alternative 1: 99.5% accurate, 0.1× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;x1 + 6 \cdot {x1}^{4}\\


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

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

Alternative 2: 99.3% accurate, 0.1× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;x1 + 6 \cdot {x1}^{4}\\


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

    1. Initial program 99.4%

      \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    2. Step-by-step derivation
      1. associate-+l+99.4%

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

      \[\leadsto x1 + \color{blue}{6 \cdot {x1}^{4}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification98.8%

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

Alternative 3: 99.3% accurate, 0.5× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;x1 + 6 \cdot {x1}^{4}\\


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

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x1 + \color{blue}{6 \cdot {x1}^{4}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification98.8%

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

Alternative 4: 82.5% accurate, 1.2× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}\\


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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

    if -2.20000000000000007e105 < x1 < 1.35000000000000003e154

    1. Initial program 98.3%

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

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

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

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

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

    if 1.35000000000000003e154 < x1

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 80.3% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;x1 \leq -0.75:\\
\;\;\;\;t_4\\

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

\mathbf{elif}\;x1 \leq 9 \cdot 10^{+153}:\\
\;\;\;\;t_4\\

\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}\\


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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

    if -1.0500000000000001e103 < x1 < -0.75 or 1 < x1 < 9.0000000000000002e153

    1. Initial program 97.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 inf 95.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 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 3\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \color{blue}{\left(-1 \cdot x1 + -2 \cdot x2\right)}\right) \]
    4. Step-by-step derivation
      1. +-commutative34.0%

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

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

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

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

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

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

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

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

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

    1. Initial program 98.7%

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

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

    if 9.0000000000000002e153 < x1

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 80.3% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 - \left(\left(\left(\left(\left(x1 \cdot \left(x1 \cdot 6\right) - \left(\frac{t_2 - x1}{t_3} - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \frac{x1 - t_2}{t_3}\right)\right) \cdot \left(-1 - x1 \cdot x1\right) - 3 \cdot t_1\right) - x1 \cdot \left(x1 \cdot x1\right)\right) - x1\right) + 3 \cdot \left(x1 - x2 \cdot -2\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}\\


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

    1. Initial program 0.0%

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

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

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

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

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

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

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

    if -5.60000000000000037e102 < x1 < 1.35000000000000003e154

    1. Initial program 98.3%

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

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

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

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

        \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right) + x1\right) + 3 \cdot \left(\color{blue}{x2 \cdot -2} - x1\right)\right) \]
    5. Simplified98.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 inf 94.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) + \color{blue}{6 \cdot {x1}^{2}}\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) \]
    7. Step-by-step derivation
      1. *-commutative94.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) + \color{blue}{{x1}^{2} \cdot 6}\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) \]
      2. unpow294.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) + \color{blue}{\left(x1 \cdot x1\right)} \cdot 6\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot 3\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right) \]
      3. associate-*l*94.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) + \color{blue}{x1 \cdot \left(x1 \cdot 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) \]
    8. Simplified94.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) + \color{blue}{x1 \cdot \left(x1 \cdot 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.35000000000000003e154 < x1

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 78.6% accurate, 1.6× speedup?

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

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

\mathbf{elif}\;x1 \leq -1.02 \cdot 10^{+15}:\\
\;\;\;\;t_4\\

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

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

\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}\\


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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

    if -4.5999999999999996e105 < x1 < -1.02e15 or 320 < x1 < 1.35000000000000003e154

    1. Initial program 96.9%

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

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

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

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

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

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

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

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

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

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

    if -1.02e15 < x1 < 320

    1. Initial program 98.7%

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

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

    if 1.35000000000000003e154 < x1

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -4.6 \cdot 10^{+105}:\\ \;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2 - x1\right) + \left(x1 + \left(-2 \cdot \left(2 \cdot x2 - 3\right) - 2 \cdot \left(x1 \cdot \left(-1 - 3 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq -1.02 \cdot 10^{+15}:\\ \;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2 - x1\right) - \left(\left(\left(\left(x1 \cdot x1 + 1\right) \cdot \left(\frac{1}{x1} \cdot \left(\left(x1 \cdot 2\right) \cdot \left(3 - \frac{1}{x1}\right)\right) + \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot \frac{x1 - \left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right)}{x1 \cdot x1 + 1}\right)\right) - 3 \cdot \left(x1 \cdot \left(x1 \cdot 3\right)\right)\right) - x1 \cdot \left(x1 \cdot x1\right)\right) - x1\right)\right)\\ \mathbf{elif}\;x1 \leq 320:\\ \;\;\;\;x1 - \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(3 - 2 \cdot x2\right)\right)\right) - x1\right) + 3 \cdot \frac{x1 + \left(2 \cdot x2 - x1 \cdot \left(x1 \cdot 3\right)\right)}{x1 \cdot x1 + 1}\right)\\ \mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2 - x1\right) - \left(\left(\left(\left(x1 \cdot x1 + 1\right) \cdot \left(\frac{1}{x1} \cdot \left(\left(x1 \cdot 2\right) \cdot \left(3 - \frac{1}{x1}\right)\right) + \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot \frac{x1 - \left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right)}{x1 \cdot x1 + 1}\right)\right) - 3 \cdot \left(x1 \cdot \left(x1 \cdot 3\right)\right)\right) - x1 \cdot \left(x1 \cdot x1\right)\right) - x1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}\\ \end{array} \]

Alternative 8: 77.2% accurate, 1.8× speedup?

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

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

\mathbf{elif}\;x1 \leq -1.15 \cdot 10^{+15}:\\
\;\;\;\;t_4\\

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

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

\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}\\


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

    1. Initial program 0.0%

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

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

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

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

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

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

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

    if -5.60000000000000037e102 < x1 < -1.15e15 or 10500 < x1 < 1.35000000000000003e154

    1. Initial program 96.9%

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

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

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

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

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

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

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

      \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot 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 85.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) + \color{blue}{6 \cdot {x1}^{2}}\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) \]
    7. Step-by-step derivation
      1. *-commutative85.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) + \color{blue}{{x1}^{2} \cdot 6}\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) \]
      2. unpow285.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) + \color{blue}{\left(x1 \cdot x1\right)} \cdot 6\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot 3\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right) \]
      3. associate-*l*85.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) + \color{blue}{x1 \cdot \left(x1 \cdot 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) \]
    8. Simplified85.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) + \color{blue}{x1 \cdot \left(x1 \cdot 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) \]
    9. Taylor expanded in x1 around inf 72.6%

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

    1. Initial program 98.7%

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

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

    if 1.35000000000000003e154 < x1

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 66.5% accurate, 3.6× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}\\


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

    1. Initial program 9.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 inf 9.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 9.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 3\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \color{blue}{\left(-1 \cdot x1 + -2 \cdot x2\right)}\right) \]
    4. Step-by-step derivation
      1. +-commutative3.0%

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

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

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

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

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

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

    if -3.8000000000000002e79 < x1 < 2.4000000000000001e156

    1. Initial program 97.8%

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

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

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

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

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

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

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

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

    if 2.4000000000000001e156 < x1

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 56.3% accurate, 5.1× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}\\


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

    1. Initial program 61.6%

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

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

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

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

    if -2.2499999999999999e-241 < x1 < 3.2999999999999999e156

    1. Initial program 96.9%

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

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

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

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

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

    if 3.2999999999999999e156 < x1

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 64.2% accurate, 5.1× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}\\


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

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

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

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

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

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

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

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

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

    if 2.4000000000000001e156 < x1

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 54.3% accurate, 5.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(x1 + x1 \cdot -2\right) - x2 \cdot \left(6 - x1 \cdot -12\right)\\ \mathbf{if}\;x1 \leq -3.8 \cdot 10^{+79}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x1 \leq -9.8 \cdot 10^{-23}:\\ \;\;\;\;9 + x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 1.22 \cdot 10^{-217}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x1 \leq 2.4 \cdot 10^{+156}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(\left(x2 \cdot x2\right) \cdot 8\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (- (+ x1 (* x1 -2.0)) (* x2 (- 6.0 (* x1 -12.0))))))
   (if (<= x1 -3.8e+79)
     t_0
     (if (<= x1 -9.8e-23)
       (+ 9.0 (* x1 (+ 2.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0))))))
       (if (<= x1 1.22e-217)
         t_0
         (if (<= x1 2.4e+156)
           (+ x1 (+ (* x2 -6.0) (* x1 (* (* x2 x2) 8.0))))
           (/ (- (* x1 x1) (* (* x2 x2) 36.0)) (- x1 (* x2 -6.0)))))))))
double code(double x1, double x2) {
	double t_0 = (x1 + (x1 * -2.0)) - (x2 * (6.0 - (x1 * -12.0)));
	double tmp;
	if (x1 <= -3.8e+79) {
		tmp = t_0;
	} else if (x1 <= -9.8e-23) {
		tmp = 9.0 + (x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
	} else if (x1 <= 1.22e-217) {
		tmp = t_0;
	} else if (x1 <= 2.4e+156) {
		tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * x2) * 8.0)));
	} else {
		tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
	}
	return tmp;
}
real(8) function code(x1, x2)
    real(8), intent (in) :: x1
    real(8), intent (in) :: x2
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (x1 + (x1 * (-2.0d0))) - (x2 * (6.0d0 - (x1 * (-12.0d0))))
    if (x1 <= (-3.8d+79)) then
        tmp = t_0
    else if (x1 <= (-9.8d-23)) then
        tmp = 9.0d0 + (x1 * (2.0d0 + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0)))))
    else if (x1 <= 1.22d-217) then
        tmp = t_0
    else if (x1 <= 2.4d+156) then
        tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((x2 * x2) * 8.0d0)))
    else
        tmp = ((x1 * x1) - ((x2 * x2) * 36.0d0)) / (x1 - (x2 * (-6.0d0)))
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double t_0 = (x1 + (x1 * -2.0)) - (x2 * (6.0 - (x1 * -12.0)));
	double tmp;
	if (x1 <= -3.8e+79) {
		tmp = t_0;
	} else if (x1 <= -9.8e-23) {
		tmp = 9.0 + (x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
	} else if (x1 <= 1.22e-217) {
		tmp = t_0;
	} else if (x1 <= 2.4e+156) {
		tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * x2) * 8.0)));
	} else {
		tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
	}
	return tmp;
}
def code(x1, x2):
	t_0 = (x1 + (x1 * -2.0)) - (x2 * (6.0 - (x1 * -12.0)))
	tmp = 0
	if x1 <= -3.8e+79:
		tmp = t_0
	elif x1 <= -9.8e-23:
		tmp = 9.0 + (x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))))
	elif x1 <= 1.22e-217:
		tmp = t_0
	elif x1 <= 2.4e+156:
		tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * x2) * 8.0)))
	else:
		tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0))
	return tmp
function code(x1, x2)
	t_0 = Float64(Float64(x1 + Float64(x1 * -2.0)) - Float64(x2 * Float64(6.0 - Float64(x1 * -12.0))))
	tmp = 0.0
	if (x1 <= -3.8e+79)
		tmp = t_0;
	elseif (x1 <= -9.8e-23)
		tmp = Float64(9.0 + Float64(x1 * Float64(2.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))))));
	elseif (x1 <= 1.22e-217)
		tmp = t_0;
	elseif (x1 <= 2.4e+156)
		tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x2 * x2) * 8.0))));
	else
		tmp = Float64(Float64(Float64(x1 * x1) - Float64(Float64(x2 * x2) * 36.0)) / Float64(x1 - Float64(x2 * -6.0)));
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	t_0 = (x1 + (x1 * -2.0)) - (x2 * (6.0 - (x1 * -12.0)));
	tmp = 0.0;
	if (x1 <= -3.8e+79)
		tmp = t_0;
	elseif (x1 <= -9.8e-23)
		tmp = 9.0 + (x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
	elseif (x1 <= 1.22e-217)
		tmp = t_0;
	elseif (x1 <= 2.4e+156)
		tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * x2) * 8.0)));
	else
		tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision] - N[(x2 * N[(6.0 - N[(x1 * -12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -3.8e+79], t$95$0, If[LessEqual[x1, -9.8e-23], N[(9.0 + N[(x1 * N[(2.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.22e-217], t$95$0, If[LessEqual[x1, 2.4e+156], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x2 * x2), $MachinePrecision] * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x1 * x1), $MachinePrecision] - N[(N[(x2 * x2), $MachinePrecision] * 36.0), $MachinePrecision]), $MachinePrecision] / N[(x1 - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left(x1 + x1 \cdot -2\right) - x2 \cdot \left(6 - x1 \cdot -12\right)\\
\mathbf{if}\;x1 \leq -3.8 \cdot 10^{+79}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;x1 \leq 1.22 \cdot 10^{-217}:\\
\;\;\;\;t_0\\

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

\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x1 < -3.8000000000000002e79 or -9.7999999999999996e-23 < x1 < 1.2200000000000001e-217

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

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

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

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

    if -3.8000000000000002e79 < x1 < -9.7999999999999996e-23

    1. Initial program 99.2%

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

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

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

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

    if 1.2200000000000001e-217 < x1 < 2.4000000000000001e156

    1. Initial program 96.9%

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

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

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

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

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

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

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

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

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

    if 2.4000000000000001e156 < x1

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -3.8 \cdot 10^{+79}:\\ \;\;\;\;\left(x1 + x1 \cdot -2\right) - x2 \cdot \left(6 - x1 \cdot -12\right)\\ \mathbf{elif}\;x1 \leq -9.8 \cdot 10^{-23}:\\ \;\;\;\;9 + x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 1.22 \cdot 10^{-217}:\\ \;\;\;\;\left(x1 + x1 \cdot -2\right) - x2 \cdot \left(6 - x1 \cdot -12\right)\\ \mathbf{elif}\;x1 \leq 2.4 \cdot 10^{+156}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(\left(x2 \cdot x2\right) \cdot 8\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}\\ \end{array} \]

Alternative 13: 60.2% accurate, 5.5× speedup?

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

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

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

\mathbf{elif}\;x1 \leq 2.4 \cdot 10^{+156}:\\
\;\;\;\;t_0\\

\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x1 < -2.19999999999999998e-211 or 1.8500000000000001e-244 < x1 < 2.4000000000000001e156

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

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

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

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

    if -2.19999999999999998e-211 < x1 < 1.8500000000000001e-244

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

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

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

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

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

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

    if 2.4000000000000001e156 < x1

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -2.2 \cdot 10^{-211}:\\ \;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 1.85 \cdot 10^{-244}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\ \mathbf{elif}\;x1 \leq 2.4 \cdot 10^{+156}:\\ \;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}\\ \end{array} \]

Alternative 14: 54.3% accurate, 7.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -3.8 \cdot 10^{-14} \lor \neg \left(x2 \leq 5.2 \cdot 10^{-57}\right):\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(\left(x2 \cdot x2\right) \cdot 8\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x2 < -3.8000000000000002e-14 or 5.19999999999999971e-57 < x2

    1. Initial program 72.1%

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

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

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

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

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

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

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

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

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

    if -3.8000000000000002e-14 < x2 < 5.19999999999999971e-57

    1. Initial program 68.0%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x2 \leq -3.8 \cdot 10^{-14} \lor \neg \left(x2 \leq 5.2 \cdot 10^{-57}\right):\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(\left(x2 \cdot x2\right) \cdot 8\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\ \end{array} \]

Alternative 15: 54.3% accurate, 7.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -2 \cdot 10^{-17} \lor \neg \left(x2 \leq 5.2 \cdot 10^{-57}\right):\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(\left(x2 \cdot x2\right) \cdot 8\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x2 < -2.00000000000000014e-17 or 5.19999999999999971e-57 < x2

    1. Initial program 72.1%

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

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

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

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

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

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

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

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

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

    if -2.00000000000000014e-17 < x2 < 5.19999999999999971e-57

    1. Initial program 68.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x2 \leq -2 \cdot 10^{-17} \lor \neg \left(x2 \leq 5.2 \cdot 10^{-57}\right):\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(\left(x2 \cdot x2\right) \cdot 8\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x1 + x1 \cdot -2\right) - x2 \cdot \left(6 - x1 \cdot -12\right)\\ \end{array} \]

Alternative 16: 49.2% accurate, 9.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -3.4 \cdot 10^{+112} \lor \neg \left(x2 \leq 1.08 \cdot 10^{+108}\right):\\
\;\;\;\;x1 + x1 \cdot \left(\left(x2 \cdot x2\right) \cdot 8\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x2 < -3.39999999999999993e112 or 1.0800000000000001e108 < x2

    1. Initial program 72.2%

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

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

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

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

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

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

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

    if -3.39999999999999993e112 < x2 < 1.0800000000000001e108

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x2 \leq -3.4 \cdot 10^{+112} \lor \neg \left(x2 \leq 1.08 \cdot 10^{+108}\right):\\ \;\;\;\;x1 + x1 \cdot \left(\left(x2 \cdot x2\right) \cdot 8\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\ \end{array} \]

Alternative 17: 38.6% accurate, 9.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x1 \leq -5.2 \cdot 10^{-128}:\\ \;\;\;\;-x1\\ \mathbf{elif}\;x1 \leq 4.9 \cdot 10^{-57}:\\ \;\;\;\;x2 \cdot -6\\ \mathbf{else}:\\ \;\;\;\;x1 + x1 \cdot \left(\left(x2 \cdot x2\right) \cdot 8\right)\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (if (<= x1 -5.2e-128)
   (- x1)
   (if (<= x1 4.9e-57) (* x2 -6.0) (+ x1 (* x1 (* (* x2 x2) 8.0))))))
double code(double x1, double x2) {
	double tmp;
	if (x1 <= -5.2e-128) {
		tmp = -x1;
	} else if (x1 <= 4.9e-57) {
		tmp = x2 * -6.0;
	} else {
		tmp = x1 + (x1 * ((x2 * x2) * 8.0));
	}
	return tmp;
}
real(8) function code(x1, x2)
    real(8), intent (in) :: x1
    real(8), intent (in) :: x2
    real(8) :: tmp
    if (x1 <= (-5.2d-128)) then
        tmp = -x1
    else if (x1 <= 4.9d-57) then
        tmp = x2 * (-6.0d0)
    else
        tmp = x1 + (x1 * ((x2 * x2) * 8.0d0))
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double tmp;
	if (x1 <= -5.2e-128) {
		tmp = -x1;
	} else if (x1 <= 4.9e-57) {
		tmp = x2 * -6.0;
	} else {
		tmp = x1 + (x1 * ((x2 * x2) * 8.0));
	}
	return tmp;
}
def code(x1, x2):
	tmp = 0
	if x1 <= -5.2e-128:
		tmp = -x1
	elif x1 <= 4.9e-57:
		tmp = x2 * -6.0
	else:
		tmp = x1 + (x1 * ((x2 * x2) * 8.0))
	return tmp
function code(x1, x2)
	tmp = 0.0
	if (x1 <= -5.2e-128)
		tmp = Float64(-x1);
	elseif (x1 <= 4.9e-57)
		tmp = Float64(x2 * -6.0);
	else
		tmp = Float64(x1 + Float64(x1 * Float64(Float64(x2 * x2) * 8.0)));
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	tmp = 0.0;
	if (x1 <= -5.2e-128)
		tmp = -x1;
	elseif (x1 <= 4.9e-57)
		tmp = x2 * -6.0;
	else
		tmp = x1 + (x1 * ((x2 * x2) * 8.0));
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := If[LessEqual[x1, -5.2e-128], (-x1), If[LessEqual[x1, 4.9e-57], N[(x2 * -6.0), $MachinePrecision], N[(x1 + N[(x1 * N[(N[(x2 * x2), $MachinePrecision] * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -5.2 \cdot 10^{-128}:\\
\;\;\;\;-x1\\

\mathbf{elif}\;x1 \leq 4.9 \cdot 10^{-57}:\\
\;\;\;\;x2 \cdot -6\\

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


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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-x1} \]
    6. Simplified19.5%

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

    if -5.19999999999999961e-128 < x1 < 4.89999999999999988e-57

    1. Initial program 98.6%

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

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

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

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

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

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

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

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

    if 4.89999999999999988e-57 < x1

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -5.2 \cdot 10^{-128}:\\ \;\;\;\;-x1\\ \mathbf{elif}\;x1 \leq 4.9 \cdot 10^{-57}:\\ \;\;\;\;x2 \cdot -6\\ \mathbf{else}:\\ \;\;\;\;x1 + x1 \cdot \left(\left(x2 \cdot x2\right) \cdot 8\right)\\ \end{array} \]

Alternative 18: 28.9% accurate, 18.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x1 \leq -3.3 \cdot 10^{-128}:\\ \;\;\;\;-x1\\ \mathbf{else}:\\ \;\;\;\;x1 + x2 \cdot -6\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (if (<= x1 -3.3e-128) (- x1) (+ x1 (* x2 -6.0))))
double code(double x1, double x2) {
	double tmp;
	if (x1 <= -3.3e-128) {
		tmp = -x1;
	} else {
		tmp = x1 + (x2 * -6.0);
	}
	return tmp;
}
real(8) function code(x1, x2)
    real(8), intent (in) :: x1
    real(8), intent (in) :: x2
    real(8) :: tmp
    if (x1 <= (-3.3d-128)) then
        tmp = -x1
    else
        tmp = x1 + (x2 * (-6.0d0))
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double tmp;
	if (x1 <= -3.3e-128) {
		tmp = -x1;
	} else {
		tmp = x1 + (x2 * -6.0);
	}
	return tmp;
}
def code(x1, x2):
	tmp = 0
	if x1 <= -3.3e-128:
		tmp = -x1
	else:
		tmp = x1 + (x2 * -6.0)
	return tmp
function code(x1, x2)
	tmp = 0.0
	if (x1 <= -3.3e-128)
		tmp = Float64(-x1);
	else
		tmp = Float64(x1 + Float64(x2 * -6.0));
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	tmp = 0.0;
	if (x1 <= -3.3e-128)
		tmp = -x1;
	else
		tmp = x1 + (x2 * -6.0);
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := If[LessEqual[x1, -3.3e-128], (-x1), N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -3.3 \cdot 10^{-128}:\\
\;\;\;\;-x1\\

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


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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-x1} \]
    6. Simplified19.5%

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

    if -3.3e-128 < x1

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -3.3 \cdot 10^{-128}:\\ \;\;\;\;-x1\\ \mathbf{else}:\\ \;\;\;\;x1 + x2 \cdot -6\\ \end{array} \]

Alternative 19: 28.4% accurate, 25.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x1 \leq -6.2 \cdot 10^{-128}:\\ \;\;\;\;-x1\\ \mathbf{else}:\\ \;\;\;\;x2 \cdot -6\\ \end{array} \end{array} \]
(FPCore (x1 x2) :precision binary64 (if (<= x1 -6.2e-128) (- x1) (* x2 -6.0)))
double code(double x1, double x2) {
	double tmp;
	if (x1 <= -6.2e-128) {
		tmp = -x1;
	} else {
		tmp = x2 * -6.0;
	}
	return tmp;
}
real(8) function code(x1, x2)
    real(8), intent (in) :: x1
    real(8), intent (in) :: x2
    real(8) :: tmp
    if (x1 <= (-6.2d-128)) then
        tmp = -x1
    else
        tmp = x2 * (-6.0d0)
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double tmp;
	if (x1 <= -6.2e-128) {
		tmp = -x1;
	} else {
		tmp = x2 * -6.0;
	}
	return tmp;
}
def code(x1, x2):
	tmp = 0
	if x1 <= -6.2e-128:
		tmp = -x1
	else:
		tmp = x2 * -6.0
	return tmp
function code(x1, x2)
	tmp = 0.0
	if (x1 <= -6.2e-128)
		tmp = Float64(-x1);
	else
		tmp = Float64(x2 * -6.0);
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	tmp = 0.0;
	if (x1 <= -6.2e-128)
		tmp = -x1;
	else
		tmp = x2 * -6.0;
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := If[LessEqual[x1, -6.2e-128], (-x1), N[(x2 * -6.0), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -6.2 \cdot 10^{-128}:\\
\;\;\;\;-x1\\

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


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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-x1} \]
    6. Simplified19.5%

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

    if -6.20000000000000005e-128 < x1

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -6.2 \cdot 10^{-128}:\\ \;\;\;\;-x1\\ \mathbf{else}:\\ \;\;\;\;x2 \cdot -6\\ \end{array} \]

Alternative 20: 13.9% accurate, 63.5× speedup?

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-x1} \]
  6. Simplified10.9%

    \[\leadsto \color{blue}{-x1} \]
  7. Final simplification10.9%

    \[\leadsto -x1 \]

Alternative 21: 3.2% accurate, 127.0× speedup?

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

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

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

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

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

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

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

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

    \[\leadsto x1 \]

Reproduce

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