Rosa's FloatVsDoubleBenchmark

Percentage Accurate: 69.7% → 98.0%
Time: 1.1min
Alternatives: 26
Speedup: 1.5×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 26 alternatives:

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

Initial Program: 69.7% accurate, 1.0× speedup?

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

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

Alternative 1: 98.0% accurate, 0.1× speedup?

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

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

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

\mathbf{elif}\;x1 \leq 2.8 \cdot 10^{+140}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(\left(t_4 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_5\right) \cdot \left(\mathsf{fma}\left(3, {x1}^{2}, t_1\right) \cdot \frac{1}{\mathsf{fma}\left(x1, x1, 1\right)} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t_5 - 6\right)\right) + t_0 \cdot t_5\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t_0 - x2 \cdot 2\right) - x1}{t_4}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x1 < -7.59999999999999933e153 or 2.79999999999999983e140 < x1

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

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

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

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

      \[\leadsto x1 + \color{blue}{x2 \cdot -6} \]
    6. Step-by-step derivation
      1. add-sqr-sqrt3.3%

        \[\leadsto \color{blue}{\sqrt{x1 + x2 \cdot -6} \cdot \sqrt{x1 + x2 \cdot -6}} \]
      2. sqrt-unprod100.0%

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

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

        \[\leadsto \sqrt{{\left(x1 + x2 \cdot -6\right)}^{1} \cdot \color{blue}{{\left(x1 + x2 \cdot -6\right)}^{1}}} \]
      5. pow-sqr100.0%

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

        \[\leadsto \sqrt{{\left(x1 + x2 \cdot -6\right)}^{\color{blue}{2}}} \]
    7. Applied egg-rr100.0%

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

    if -7.59999999999999933e153 < x1 < -5.39999999999999976e-148

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

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

    if -5.39999999999999976e-148 < x1 < 2.79999999999999983e140

    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. Step-by-step derivation
      1. associate--l+98.7%

        \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\color{blue}{\left(3 \cdot x1\right) \cdot x1 + \left(2 \cdot x2 - x1\right)}}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
      2. associate-*r*98.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{\color{blue}{3 \cdot \left(x1 \cdot x1\right)} + \left(2 \cdot x2 - x1\right)}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
      3. fma-udef98.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{\color{blue}{\mathsf{fma}\left(3, x1 \cdot x1, 2 \cdot x2 - x1\right)}}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
      4. fma-def98.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{\mathsf{fma}\left(3, x1 \cdot x1, 2 \cdot x2 - x1\right)}{\color{blue}{\mathsf{fma}\left(x1, x1, 1\right)}} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
      5. div-inv98.8%

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

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

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

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

Alternative 2: 98.5% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(t_3 + \left(x1 + 6 \cdot {x1}^{4}\right)\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x1 < -1.35000000000000003e154 or 2.79999999999999983e140 < x1

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

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

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

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

      \[\leadsto x1 + \color{blue}{x2 \cdot -6} \]
    6. Step-by-step derivation
      1. add-sqr-sqrt3.3%

        \[\leadsto \color{blue}{\sqrt{x1 + x2 \cdot -6} \cdot \sqrt{x1 + x2 \cdot -6}} \]
      2. sqrt-unprod100.0%

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

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

        \[\leadsto \sqrt{{\left(x1 + x2 \cdot -6\right)}^{1} \cdot \color{blue}{{\left(x1 + x2 \cdot -6\right)}^{1}}} \]
      5. pow-sqr100.0%

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

        \[\leadsto \sqrt{{\left(x1 + x2 \cdot -6\right)}^{\color{blue}{2}}} \]
    7. Applied egg-rr100.0%

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

    if -1.35000000000000003e154 < 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 100.0%

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

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

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

    if -5.60000000000000037e102 < x1 < 2.79999999999999983e140

    1. Initial program 98.9%

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

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

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

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

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

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

Alternative 3: 87.4% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 99.4%

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

Alternative 4: 98.5% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(t_3 + \left(x1 + 6 \cdot {x1}^{4}\right)\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x1 < -1.35000000000000003e154 or 2.79999999999999983e140 < x1

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

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

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

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

      \[\leadsto x1 + \color{blue}{x2 \cdot -6} \]
    6. Step-by-step derivation
      1. add-sqr-sqrt3.3%

        \[\leadsto \color{blue}{\sqrt{x1 + x2 \cdot -6} \cdot \sqrt{x1 + x2 \cdot -6}} \]
      2. sqrt-unprod100.0%

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

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

        \[\leadsto \sqrt{{\left(x1 + x2 \cdot -6\right)}^{1} \cdot \color{blue}{{\left(x1 + x2 \cdot -6\right)}^{1}}} \]
      5. pow-sqr100.0%

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

        \[\leadsto \sqrt{{\left(x1 + x2 \cdot -6\right)}^{\color{blue}{2}}} \]
    7. Applied egg-rr100.0%

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

    if -1.35000000000000003e154 < 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 100.0%

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

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

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

    if -5.60000000000000037e102 < x1 < 2.79999999999999983e140

    1. Initial program 98.9%

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

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

Alternative 5: 93.9% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 \cdot \left(x1 \cdot 3\right)\\ t_1 := x1 \cdot x1 + 1\\ t_2 := \frac{\left(x2 \cdot 2 + t_0\right) - x1}{t_1}\\ t_3 := 3 \cdot \frac{\left(t_0 - x2 \cdot 2\right) - x1}{t_1}\\ \mathbf{if}\;x1 \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + \left(3 \cdot \left({x1}^{2} \cdot \left(3 - x2 \cdot -2\right)\right) + x1 \cdot \left(x2 \cdot -12 - 2\right)\right)\right)\\ \mathbf{elif}\;x1 \leq -3 \cdot 10^{+101}:\\ \;\;\;\;x1 + \left(t_3 + \left(x1 + 6 \cdot {x1}^{4}\right)\right)\\ \mathbf{elif}\;x1 \leq 1.8 \cdot 10^{+83}:\\ \;\;\;\;x1 + \left(t_3 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_0 \cdot t_2 + t_1 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(4 \cdot t_2 - 6\right) + \left(\left(x1 \cdot 2\right) \cdot t_2\right) \cdot \left(t_2 - 3\right)\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(x1 + x2 \cdot -6\right)\right)\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (* x1 (* x1 3.0)))
        (t_1 (+ (* x1 x1) 1.0))
        (t_2 (/ (- (+ (* x2 2.0) t_0) x1) t_1))
        (t_3 (* 3.0 (/ (- (- t_0 (* x2 2.0)) x1) t_1))))
   (if (<= x1 -1.35e+154)
     (+
      x1
      (+
       (* x2 -6.0)
       (+
        (* 3.0 (* (pow x1 2.0) (- 3.0 (* x2 -2.0))))
        (* x1 (- (* x2 -12.0) 2.0)))))
     (if (<= x1 -3e+101)
       (+ x1 (+ t_3 (+ x1 (* 6.0 (pow x1 4.0)))))
       (if (<= x1 1.8e+83)
         (+
          x1
          (+
           t_3
           (+
            x1
            (+
             (* x1 (* x1 x1))
             (+
              (* t_0 t_2)
              (*
               t_1
               (+
                (* (* x1 x1) (- (* 4.0 t_2) 6.0))
                (* (* (* x1 2.0) t_2) (- t_2 3.0)))))))))
         (log1p (expm1 (+ x1 (* x2 -6.0)))))))))
double code(double x1, double x2) {
	double t_0 = x1 * (x1 * 3.0);
	double t_1 = (x1 * x1) + 1.0;
	double t_2 = (((x2 * 2.0) + t_0) - x1) / t_1;
	double t_3 = 3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_1);
	double tmp;
	if (x1 <= -1.35e+154) {
		tmp = x1 + ((x2 * -6.0) + ((3.0 * (pow(x1, 2.0) * (3.0 - (x2 * -2.0)))) + (x1 * ((x2 * -12.0) - 2.0))));
	} else if (x1 <= -3e+101) {
		tmp = x1 + (t_3 + (x1 + (6.0 * pow(x1, 4.0))));
	} else if (x1 <= 1.8e+83) {
		tmp = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((x1 * x1) * ((4.0 * t_2) - 6.0)) + (((x1 * 2.0) * t_2) * (t_2 - 3.0))))))));
	} else {
		tmp = log1p(expm1((x1 + (x2 * -6.0))));
	}
	return tmp;
}
public static double code(double x1, double x2) {
	double t_0 = x1 * (x1 * 3.0);
	double t_1 = (x1 * x1) + 1.0;
	double t_2 = (((x2 * 2.0) + t_0) - x1) / t_1;
	double t_3 = 3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_1);
	double tmp;
	if (x1 <= -1.35e+154) {
		tmp = x1 + ((x2 * -6.0) + ((3.0 * (Math.pow(x1, 2.0) * (3.0 - (x2 * -2.0)))) + (x1 * ((x2 * -12.0) - 2.0))));
	} else if (x1 <= -3e+101) {
		tmp = x1 + (t_3 + (x1 + (6.0 * Math.pow(x1, 4.0))));
	} else if (x1 <= 1.8e+83) {
		tmp = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((x1 * x1) * ((4.0 * t_2) - 6.0)) + (((x1 * 2.0) * t_2) * (t_2 - 3.0))))))));
	} else {
		tmp = Math.log1p(Math.expm1((x1 + (x2 * -6.0))));
	}
	return tmp;
}
def code(x1, x2):
	t_0 = x1 * (x1 * 3.0)
	t_1 = (x1 * x1) + 1.0
	t_2 = (((x2 * 2.0) + t_0) - x1) / t_1
	t_3 = 3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_1)
	tmp = 0
	if x1 <= -1.35e+154:
		tmp = x1 + ((x2 * -6.0) + ((3.0 * (math.pow(x1, 2.0) * (3.0 - (x2 * -2.0)))) + (x1 * ((x2 * -12.0) - 2.0))))
	elif x1 <= -3e+101:
		tmp = x1 + (t_3 + (x1 + (6.0 * math.pow(x1, 4.0))))
	elif x1 <= 1.8e+83:
		tmp = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((x1 * x1) * ((4.0 * t_2) - 6.0)) + (((x1 * 2.0) * t_2) * (t_2 - 3.0))))))))
	else:
		tmp = math.log1p(math.expm1((x1 + (x2 * -6.0))))
	return tmp
function code(x1, x2)
	t_0 = Float64(x1 * Float64(x1 * 3.0))
	t_1 = Float64(Float64(x1 * x1) + 1.0)
	t_2 = Float64(Float64(Float64(Float64(x2 * 2.0) + t_0) - x1) / t_1)
	t_3 = Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(x2 * 2.0)) - x1) / t_1))
	tmp = 0.0
	if (x1 <= -1.35e+154)
		tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(Float64(3.0 * Float64((x1 ^ 2.0) * Float64(3.0 - Float64(x2 * -2.0)))) + Float64(x1 * Float64(Float64(x2 * -12.0) - 2.0)))));
	elseif (x1 <= -3e+101)
		tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(6.0 * (x1 ^ 4.0)))));
	elseif (x1 <= 1.8e+83)
		tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_0 * t_2) + Float64(t_1 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0)) + Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)))))))));
	else
		tmp = log1p(expm1(Float64(x1 + Float64(x2 * -6.0))));
	end
	return tmp
end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(x2 * 2.0), $MachinePrecision] + t$95$0), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(3.0 * N[(N[(N[(t$95$0 - N[(x2 * 2.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.35e+154], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(N[(3.0 * N[(N[Power[x1, 2.0], $MachinePrecision] * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(N[(x2 * -12.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -3e+101], N[(x1 + N[(t$95$3 + N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.8e+83], N[(x1 + N[(t$95$3 + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$0 * t$95$2), $MachinePrecision] + N[(t$95$1 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Log[1 + N[(Exp[N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]]]]]]]]
\begin{array}{l}

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

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

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

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


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

    1. Initial program 0.0%

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

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

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

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

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

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

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

    if -1.35000000000000003e154 < x1 < -2.99999999999999993e101

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

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

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

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

    if -2.99999999999999993e101 < x1 < 1.7999999999999999e83

    1. Initial program 98.8%

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

    if 1.7999999999999999e83 < x1

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(x1 + x2 \cdot -6\right)\right)} \]
    7. Applied egg-rr92.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + \left(3 \cdot \left({x1}^{2} \cdot \left(3 - x2 \cdot -2\right)\right) + x1 \cdot \left(x2 \cdot -12 - 2\right)\right)\right)\\ \mathbf{elif}\;x1 \leq -3 \cdot 10^{+101}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - x2 \cdot 2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + 6 \cdot {x1}^{4}\right)\right)\\ \mathbf{elif}\;x1 \leq 1.8 \cdot 10^{+83}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - x2 \cdot 2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(\left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{\left(x2 \cdot 2 + x1 \cdot \left(x1 \cdot 3\right)\right) - x1}{x1 \cdot x1 + 1} + \left(x1 \cdot x1 + 1\right) \cdot \left(\left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(x2 \cdot 2 + x1 \cdot \left(x1 \cdot 3\right)\right) - x1}{x1 \cdot x1 + 1} - 6\right) + \left(\left(x1 \cdot 2\right) \cdot \frac{\left(x2 \cdot 2 + x1 \cdot \left(x1 \cdot 3\right)\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(x2 \cdot 2 + x1 \cdot \left(x1 \cdot 3\right)\right) - x1}{x1 \cdot x1 + 1} - 3\right)\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(x1 + x2 \cdot -6\right)\right)\\ \end{array} \]

Alternative 6: 92.6% accurate, 0.9× speedup?

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

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

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

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

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


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

    1. Initial program 0.0%

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

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

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

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

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

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

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

    if -1.35000000000000003e154 < x1 < -5e102

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

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

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

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

    if -5e102 < x1 < 1.35000000000000003e154

    1. Initial program 98.9%

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

    if 1.35000000000000003e154 < x1

    1. Initial program 0.0%

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

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

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

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

Alternative 7: 88.7% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;x1 \leq -5 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(t_3 + \left(x1 + 6 \cdot {x1}^{4}\right)\right)\\

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

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


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

    1. Initial program 0.0%

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

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

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

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

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

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

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

    if -1.35000000000000003e154 < x1 < -5e102

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

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

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

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

    if -5e102 < x1 < 2.3000000000000002e132

    1. Initial program 98.9%

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

    if 2.3000000000000002e132 < x1

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

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

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

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

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

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

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

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

Alternative 8: 85.5% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;x1 \leq 2.3 \cdot 10^{+132}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_1 - x2 \cdot 2\right) - x1}{t_0} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_0 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(4 \cdot t_2 - 6\right) + \left(\left(x1 \cdot 2\right) \cdot t_2\right) \cdot \left(t_2 - 3\right)\right) + 3 \cdot t_1\right)\right)\right)\right)\\

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


\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 0 0.0%

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

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

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

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

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

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

    if -5.60000000000000037e102 < x1 < 2.3000000000000002e132

    1. Initial program 98.9%

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

    if 2.3000000000000002e132 < x1

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

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

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

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

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

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

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

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

Alternative 9: 78.2% accurate, 1.1× speedup?

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

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

\mathbf{elif}\;x1 \leq 2.3 \cdot 10^{+132}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_1 - x2 \cdot 2\right) - x1}{t_0} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_0 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(4 \cdot t_2 - 6\right) + \left(\left(x1 \cdot 2\right) \cdot t_2\right) \cdot \left(t_2 - 3\right)\right) + 3 \cdot t_1\right)\right)\right)\right)\\

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


\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 0 0.0%

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

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

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

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

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

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

    if -5.60000000000000037e102 < x1 < 2.3000000000000002e132

    1. Initial program 98.9%

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

    if 2.3000000000000002e132 < x1

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

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

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

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

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

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

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

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

Alternative 10: 75.6% accurate, 1.1× speedup?

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

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

\mathbf{elif}\;x1 \leq 2.3 \cdot 10^{+132}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_0 - x2 \cdot 2\right) - x1}{t_1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot 6\right) + \left(x2 \cdot 2\right) \cdot t_0\right)\right)\right)\right)\\

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


\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 0 0.0%

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

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

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

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

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

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

    if -5.60000000000000037e102 < x1 < 2.3000000000000002e132

    1. Initial program 98.9%

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

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

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

    if 2.3000000000000002e132 < x1

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

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

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

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

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

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

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

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

Alternative 11: 76.7% accurate, 1.1× speedup?

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

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

\mathbf{elif}\;x1 \leq 2.3 \cdot 10^{+132}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_0 - x2 \cdot 2\right) - x1}{t_1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_0 \cdot t_2 + t_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\

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


\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 0 0.0%

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

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

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

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

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

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

    if -5.60000000000000037e102 < x1 < 2.3000000000000002e132

    1. Initial program 98.9%

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

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

    if 2.3000000000000002e132 < x1

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

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

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

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

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

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

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

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

Alternative 12: 75.6% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;x1 \leq 2.3 \cdot 10^{+132}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_0 - x2 \cdot 2\right) - x1}{t_1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot 6\right) + \left(x2 \cdot 2\right) \cdot t_0\right)\right)\right)\right)\\

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


\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 0 0.0%

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

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

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

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

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

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

    if -5.60000000000000037e102 < x1 < 2.3000000000000002e132

    1. Initial program 98.9%

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

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

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

    if 2.3000000000000002e132 < x1

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

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

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

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

Alternative 13: 74.7% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;x1 \leq 9 \cdot 10^{+30}:\\
\;\;\;\;x1 + \left(t_3 + \left(x1 + \left(t_0 + \left(\left(x2 \cdot 2\right) \cdot t_1 + t_2 \cdot \left(\left(x1 \cdot x1\right) \cdot 6 + \left(t_4 - 3\right) \cdot \left(\left(x2 \cdot 2 - x1\right) \cdot \left(x1 \cdot 2\right)\right)\right)\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 2.3 \cdot 10^{+132}:\\
\;\;\;\;x1 + \left(t_3 + \left(x1 + \left(t_0 + \left(3 \cdot t_1 + t_2 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(4 \cdot t_4 - 6\right) + 12 \cdot \frac{x2}{x1}\right)\right)\right)\right)\right)\\

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


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

    1. Initial program 0.0%

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

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

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

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

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

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

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

    if -5.60000000000000037e102 < x1 < 8.9999999999999999e30

    1. Initial program 98.8%

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

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

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

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

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

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

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

    if 8.9999999999999999e30 < x1 < 2.3000000000000002e132

    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 x2 around inf 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 \color{blue}{\left(2 \cdot \frac{x2}{1 + {x1}^{2}}\right)} + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    3. Step-by-step derivation
      1. associate-*r/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 \color{blue}{\frac{2 \cdot x2}{1 + {x1}^{2}}} + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
      2. associate-/l*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 \color{blue}{\frac{2}{\frac{1 + {x1}^{2}}{x2}}} + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
      3. +-commutative99.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 \frac{2}{\frac{\color{blue}{{x1}^{2} + 1}}{x2}} + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
      4. unpow299.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 \frac{2}{\frac{\color{blue}{x1 \cdot x1} + 1}{x2}} + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
      5. fma-udef99.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 \frac{2}{\frac{\color{blue}{\mathsf{fma}\left(x1, x1, 1\right)}}{x2}} + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    4. 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 \color{blue}{\frac{2}{\frac{\mathsf{fma}\left(x1, x1, 1\right)}{x2}}} + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    5. Taylor expanded in x1 around inf 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 \frac{2}{\frac{\mathsf{fma}\left(x1, x1, 1\right)}{x2}} + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \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) \]
    6. Taylor expanded in x1 around inf 90.8%

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

    if 2.3000000000000002e132 < x1

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

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

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

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

Alternative 14: 75.1% accurate, 1.5× speedup?

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

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

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

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

\mathbf{elif}\;x1 \leq 2.3 \cdot 10^{+132}:\\
\;\;\;\;t_3\\

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


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

    1. Initial program 0.0%

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

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

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

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

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

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

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

    if -5.60000000000000037e102 < x1 < -0.299999999999999989 or 3e4 < x1 < 2.3000000000000002e132

    1. Initial program 99.3%

      \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    2. Taylor expanded in x2 around inf 96.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 \color{blue}{\left(2 \cdot \frac{x2}{1 + {x1}^{2}}\right)} + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    3. Step-by-step derivation
      1. associate-*r/96.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 \color{blue}{\frac{2 \cdot x2}{1 + {x1}^{2}}} + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
      2. associate-/l*96.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 \color{blue}{\frac{2}{\frac{1 + {x1}^{2}}{x2}}} + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
      3. +-commutative96.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 \frac{2}{\frac{\color{blue}{{x1}^{2} + 1}}{x2}} + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
      4. unpow296.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 \frac{2}{\frac{\color{blue}{x1 \cdot x1} + 1}{x2}} + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
      5. fma-udef96.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 \frac{2}{\frac{\color{blue}{\mathsf{fma}\left(x1, x1, 1\right)}}{x2}} + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    4. Simplified96.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 \color{blue}{\frac{2}{\frac{\mathsf{fma}\left(x1, x1, 1\right)}{x2}}} + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
    5. Taylor expanded in x1 around inf 96.3%

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

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

    if -0.299999999999999989 < x1 < 3e4

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

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

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

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

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

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

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

    if 2.3000000000000002e132 < x1

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

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

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

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

Alternative 15: 64.7% accurate, 2.9× speedup?

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

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

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

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


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

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

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

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

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

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

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

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

    if -1.60000000000000015e57 < x1 < 2.00000000000000008e36

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

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

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

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

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

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

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

    if 2.00000000000000008e36 < x1

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

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

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

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

Alternative 16: 59.6% accurate, 5.5× speedup?

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

\mathbf{elif}\;x1 \leq -6.5 \cdot 10^{-160} \lor \neg \left(x1 \leq 5 \cdot 10^{-286}\right):\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(x2 \cdot 2 - 3\right)\right) + -1\right)\\

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


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

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

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

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

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

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

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

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

    if -3.19999999999999989e91 < x1 < -6.4999999999999996e-160 or 5.00000000000000037e-286 < x1

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

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

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

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

    if -6.4999999999999996e-160 < x1 < 5.00000000000000037e-286

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -3.2 \cdot 10^{+91}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x2 \cdot -12 - 2\right)\right)\\ \mathbf{elif}\;x1 \leq -6.5 \cdot 10^{-160} \lor \neg \left(x1 \leq 5 \cdot 10^{-286}\right):\\ \;\;\;\;x2 \cdot -6 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(x2 \cdot 2 - 3\right)\right) + -1\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\ \end{array} \]

Alternative 17: 50.7% accurate, 6.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x2 < -4.00000000000000019e223 or 1.39999999999999992e181 < x2

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

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

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

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

    if -4.00000000000000019e223 < x2 < 1.39999999999999992e181

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

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

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

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

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

Alternative 18: 48.6% accurate, 7.4× speedup?

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

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

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

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

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

    if -7.9999999999999993e212 < x2 < 4.8000000000000001e172

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

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

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

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

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

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

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

Alternative 19: 50.8% accurate, 7.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -7.5 \cdot 10^{+219} \lor \neg \left(x2 \leq 6.8 \cdot 10^{+177}\right):\\
\;\;\;\;x1 \cdot \left(4 \cdot \left(x2 \cdot \left(x2 \cdot 2 - 3\right)\right) + -1\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x2 < -7.5000000000000006e219 or 6.7999999999999996e177 < x2

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

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

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

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

    if -7.5000000000000006e219 < x2 < 6.7999999999999996e177

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x2 \leq -7.5 \cdot 10^{+219} \lor \neg \left(x2 \leq 6.8 \cdot 10^{+177}\right):\\ \;\;\;\;x1 \cdot \left(4 \cdot \left(x2 \cdot \left(x2 \cdot 2 - 3\right)\right) + -1\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x2 \cdot -12 - 2\right)\right)\\ \end{array} \]

Alternative 20: 42.2% accurate, 9.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x1 \leq 1.36:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(9 + x1 \cdot \left(1 + x2 \cdot -12\right)\right)\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (if (<= x1 1.36)
   (+ x1 (+ (* x2 -6.0) (* x1 -2.0)))
   (+ x1 (+ 9.0 (* x1 (+ 1.0 (* x2 -12.0)))))))
double code(double x1, double x2) {
	double tmp;
	if (x1 <= 1.36) {
		tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
	} else {
		tmp = x1 + (9.0 + (x1 * (1.0 + (x2 * -12.0))));
	}
	return tmp;
}
real(8) function code(x1, x2)
    real(8), intent (in) :: x1
    real(8), intent (in) :: x2
    real(8) :: tmp
    if (x1 <= 1.36d0) then
        tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (-2.0d0)))
    else
        tmp = x1 + (9.0d0 + (x1 * (1.0d0 + (x2 * (-12.0d0)))))
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double tmp;
	if (x1 <= 1.36) {
		tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
	} else {
		tmp = x1 + (9.0 + (x1 * (1.0 + (x2 * -12.0))));
	}
	return tmp;
}
def code(x1, x2):
	tmp = 0
	if x1 <= 1.36:
		tmp = x1 + ((x2 * -6.0) + (x1 * -2.0))
	else:
		tmp = x1 + (9.0 + (x1 * (1.0 + (x2 * -12.0))))
	return tmp
function code(x1, x2)
	tmp = 0.0
	if (x1 <= 1.36)
		tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * -2.0)));
	else
		tmp = Float64(x1 + Float64(9.0 + Float64(x1 * Float64(1.0 + Float64(x2 * -12.0)))));
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	tmp = 0.0;
	if (x1 <= 1.36)
		tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
	else
		tmp = x1 + (9.0 + (x1 * (1.0 + (x2 * -12.0))));
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := If[LessEqual[x1, 1.36], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(9.0 + N[(x1 * N[(1.0 + N[(x2 * -12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq 1.36:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\

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


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

    1. Initial program 73.5%

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

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

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

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

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

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

    if 1.3600000000000001 < x1

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

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

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

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

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

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

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

        \[\leadsto x1 + \left(9 + x1 \cdot \left(1 + \color{blue}{x2 \cdot -12}\right)\right) \]
    8. Simplified17.5%

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

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

Alternative 21: 32.9% accurate, 11.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -1.7 \cdot 10^{+240}:\\
\;\;\;\;x1 + x1 \cdot \left(1 + x2 \cdot -12\right)\\

\mathbf{elif}\;x2 \leq -6.3 \cdot 10^{-83}:\\
\;\;\;\;x2 \cdot -6\\

\mathbf{elif}\;x2 \leq 9.5 \cdot 10^{-164}:\\
\;\;\;\;-x1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x2 < -1.70000000000000004e240

    1. Initial program 61.1%

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

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

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

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

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

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

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

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

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

    if -1.70000000000000004e240 < x2 < -6.29999999999999967e-83

    1. Initial program 70.5%

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

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

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

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

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

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

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

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

    if -6.29999999999999967e-83 < x2 < 9.5000000000000001e-164

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

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

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

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

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

        \[\leadsto \color{blue}{-1} \cdot x1 \]
      3. *-commutative32.1%

        \[\leadsto \color{blue}{x1 \cdot -1} \]
    6. Simplified32.1%

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

    if 9.5000000000000001e-164 < x2

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x2 \leq -1.7 \cdot 10^{+240}:\\ \;\;\;\;x1 + x1 \cdot \left(1 + x2 \cdot -12\right)\\ \mathbf{elif}\;x2 \leq -6.3 \cdot 10^{-83}:\\ \;\;\;\;x2 \cdot -6\\ \mathbf{elif}\;x2 \leq 9.5 \cdot 10^{-164}:\\ \;\;\;\;-x1\\ \mathbf{else}:\\ \;\;\;\;x1 + x2 \cdot -6\\ \end{array} \]

Alternative 22: 42.2% accurate, 11.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x1 \leq 1.36:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + x1 \cdot \left(1 + x2 \cdot -12\right)\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (if (<= x1 1.36)
   (+ x1 (+ (* x2 -6.0) (* x1 -2.0)))
   (+ x1 (* x1 (+ 1.0 (* x2 -12.0))))))
double code(double x1, double x2) {
	double tmp;
	if (x1 <= 1.36) {
		tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
	} else {
		tmp = x1 + (x1 * (1.0 + (x2 * -12.0)));
	}
	return tmp;
}
real(8) function code(x1, x2)
    real(8), intent (in) :: x1
    real(8), intent (in) :: x2
    real(8) :: tmp
    if (x1 <= 1.36d0) then
        tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (-2.0d0)))
    else
        tmp = x1 + (x1 * (1.0d0 + (x2 * (-12.0d0))))
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double tmp;
	if (x1 <= 1.36) {
		tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
	} else {
		tmp = x1 + (x1 * (1.0 + (x2 * -12.0)));
	}
	return tmp;
}
def code(x1, x2):
	tmp = 0
	if x1 <= 1.36:
		tmp = x1 + ((x2 * -6.0) + (x1 * -2.0))
	else:
		tmp = x1 + (x1 * (1.0 + (x2 * -12.0)))
	return tmp
function code(x1, x2)
	tmp = 0.0
	if (x1 <= 1.36)
		tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * -2.0)));
	else
		tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(x2 * -12.0))));
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	tmp = 0.0;
	if (x1 <= 1.36)
		tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
	else
		tmp = x1 + (x1 * (1.0 + (x2 * -12.0)));
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := If[LessEqual[x1, 1.36], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 * N[(1.0 + N[(x2 * -12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq 1.36:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\

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


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

    1. Initial program 73.5%

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

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

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

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

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

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

    if 1.3600000000000001 < x1

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

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

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

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

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

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

      \[\leadsto x1 + \color{blue}{x1 \cdot \left(1 + -12 \cdot x2\right)} \]
    7. Step-by-step derivation
      1. *-commutative17.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq 1.36:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + x1 \cdot \left(1 + x2 \cdot -12\right)\\ \end{array} \]

Alternative 23: 31.8% accurate, 13.9× speedup?

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

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

\mathbf{elif}\;x2 \leq 2.9 \cdot 10^{-162}:\\
\;\;\;\;-x1\\

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


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

    1. Initial program 68.5%

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

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

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

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

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

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

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

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

    if -6.29999999999999967e-83 < x2 < 2.9000000000000001e-162

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

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

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

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

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

        \[\leadsto \color{blue}{-1} \cdot x1 \]
      3. *-commutative32.1%

        \[\leadsto \color{blue}{x1 \cdot -1} \]
    6. Simplified32.1%

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

    if 2.9000000000000001e-162 < x2

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x2 \leq -6.3 \cdot 10^{-83}:\\ \;\;\;\;x2 \cdot -6\\ \mathbf{elif}\;x2 \leq 2.9 \cdot 10^{-162}:\\ \;\;\;\;-x1\\ \mathbf{else}:\\ \;\;\;\;x1 + x2 \cdot -6\\ \end{array} \]

Alternative 24: 31.5% accurate, 17.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -1.05 \cdot 10^{-82} \lor \neg \left(x2 \leq 3.5 \cdot 10^{-164}\right):\\
\;\;\;\;x2 \cdot -6\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x2 < -1.05e-82 or 3.5e-164 < x2

    1. Initial program 71.1%

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

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

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

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

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

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

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

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

    if -1.05e-82 < x2 < 3.5e-164

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

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

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

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

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

        \[\leadsto \color{blue}{-1} \cdot x1 \]
      3. *-commutative32.1%

        \[\leadsto \color{blue}{x1 \cdot -1} \]
    6. Simplified32.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x2 \leq -1.05 \cdot 10^{-82} \lor \neg \left(x2 \leq 3.5 \cdot 10^{-164}\right):\\ \;\;\;\;x2 \cdot -6\\ \mathbf{else}:\\ \;\;\;\;-x1\\ \end{array} \]

Alternative 25: 14.4% accurate, 63.5× speedup?

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

\\
-x1
\end{array}
Derivation
  1. Initial program 68.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 44.0%

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

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

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

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

      \[\leadsto \color{blue}{-1} \cdot x1 \]
    3. *-commutative13.6%

      \[\leadsto \color{blue}{x1 \cdot -1} \]
  6. Simplified13.6%

    \[\leadsto \color{blue}{x1 \cdot -1} \]
  7. Final simplification13.6%

    \[\leadsto -x1 \]

Alternative 26: 3.3% accurate, 127.0× speedup?

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

\\
x1
\end{array}
Derivation
  1. Initial program 68.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 44.0%

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

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

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

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

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

    \[\leadsto x1 \]

Reproduce

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