Rosa's FloatVsDoubleBenchmark

Percentage Accurate: 69.5% → 93.0%
Time: 51.5s
Alternatives: 26
Speedup: 1.6×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 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.5% 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: 93.0% accurate, 0.1× speedup?

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

\\
\begin{array}{l}
t_0 := 3 + x2 \cdot 2\\
t_1 := \mathsf{fma}\left(x1, x1 \cdot 3, \mathsf{fma}\left(2, x2, -x1\right)\right)\\
\mathbf{if}\;x1 \leq -5.4 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(-3 \cdot \left(x1 \cdot x2\right)\right)\right) + 3 \cdot \left(\mathsf{fma}\left(x1 \cdot x1, t_0, x2 \cdot -2\right) - x1\right)\right)\\

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

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


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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.4000000000000001e153 < x1 < 5.4000000000000001e153

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

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

    if 5.4000000000000001e153 < x1

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 91.5% accurate, 0.3× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;x1 + \mathsf{fma}\left(x1, \mathsf{fma}\left(4, x2 \cdot \mathsf{fma}\left(2, x2, -3\right), -2\right), \mathsf{fma}\left(3, x1 \cdot \left(x1 \cdot \left(3 + x2 \cdot 2\right)\right), x2 \cdot -6\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.1%

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

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

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

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

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

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

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

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

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

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

    if -5.60000000000000037e102 < x1 < 1.35000000000000003e154

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

    if 1.35000000000000003e154 < x1

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 91.5% accurate, 0.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.60000000000000037e102 < x1 < 1.35000000000000003e154

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

    if 1.35000000000000003e154 < x1

    1. Initial program 0.0%

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

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

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

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

Alternative 4: 92.4% 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}\\ \mathbf{if}\;x1 \leq -1.32 \cdot 10^{+154}:\\ \;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(-3 \cdot \left(x1 \cdot x2\right)\right)\right) + 3 \cdot \left(\mathsf{fma}\left(x1 \cdot x1, 3 + x2 \cdot 2, x2 \cdot -2\right) - x1\right)\right)\\ \mathbf{elif}\;x1 \leq -5.5 \cdot 10^{+102}:\\ \;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 3 \cdot \frac{\left(t_0 - x2 \cdot 2\right) - x1}{t_1}\right)\\ \mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2 - x1\right) + \left(x1 + \left(\left(t_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t_2 - 6\right)\right) + 3 \cdot t_0\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot \left(x2 \cdot 2 - 3\right)\right) - 2\right) + \left(x2 \cdot -6 + 3 \cdot \left({x1}^{2} \cdot \left(3 - x2 \cdot -2\right)\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 -1.32e+154)
     (+
      x1
      (+
       (+ x1 (* 4.0 (* -3.0 (* x1 x2))))
       (* 3.0 (- (fma (* x1 x1) (+ 3.0 (* x2 2.0)) (* x2 -2.0)) x1))))
     (if (<= x1 -5.5e+102)
       (+
        x1
        (+
         (+ x1 (* 6.0 (pow x1 4.0)))
         (* 3.0 (/ (- (- t_0 (* x2 2.0)) x1) t_1))))
       (if (<= x1 1.35e+154)
         (+
          x1
          (+
           (* 3.0 (- (* x2 -2.0) x1))
           (+
            x1
            (+
             (+
              (*
               t_1
               (+
                (* (* (* x1 2.0) t_2) (- t_2 3.0))
                (* (* x1 x1) (- (* 4.0 t_2) 6.0))))
              (* 3.0 t_0))
             (* x1 (* x1 x1))))))
         (+
          x1
          (+
           (* x1 (- (* 4.0 (* x2 (- (* x2 2.0) 3.0))) 2.0))
           (+ (* x2 -6.0) (* 3.0 (* (pow x1 2.0) (- 3.0 (* x2 -2.0))))))))))))
double code(double x1, double x2) {
	double t_0 = x1 * (x1 * 3.0);
	double t_1 = (x1 * x1) + 1.0;
	double t_2 = (((x2 * 2.0) + t_0) - x1) / t_1;
	double tmp;
	if (x1 <= -1.32e+154) {
		tmp = x1 + ((x1 + (4.0 * (-3.0 * (x1 * x2)))) + (3.0 * (fma((x1 * x1), (3.0 + (x2 * 2.0)), (x2 * -2.0)) - x1)));
	} else if (x1 <= -5.5e+102) {
		tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + (3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_1)));
	} else if (x1 <= 1.35e+154) {
		tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0)))) + (3.0 * t_0)) + (x1 * (x1 * x1)))));
	} else {
		tmp = x1 + ((x1 * ((4.0 * (x2 * ((x2 * 2.0) - 3.0))) - 2.0)) + ((x2 * -6.0) + (3.0 * (pow(x1, 2.0) * (3.0 - (x2 * -2.0))))));
	}
	return tmp;
}
function code(x1, x2)
	t_0 = Float64(x1 * Float64(x1 * 3.0))
	t_1 = Float64(Float64(x1 * x1) + 1.0)
	t_2 = Float64(Float64(Float64(Float64(x2 * 2.0) + t_0) - x1) / t_1)
	tmp = 0.0
	if (x1 <= -1.32e+154)
		tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(-3.0 * Float64(x1 * x2)))) + Float64(3.0 * Float64(fma(Float64(x1 * x1), Float64(3.0 + Float64(x2 * 2.0)), Float64(x2 * -2.0)) - x1))));
	elseif (x1 <= -5.5e+102)
		tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(x2 * 2.0)) - x1) / t_1))));
	elseif (x1 <= 1.35e+154)
		tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)) + Float64(x1 + Float64(Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0)))) + Float64(3.0 * t_0)) + Float64(x1 * Float64(x1 * x1))))));
	else
		tmp = Float64(x1 + Float64(Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(x2 * 2.0) - 3.0))) - 2.0)) + Float64(Float64(x2 * -6.0) + Float64(3.0 * Float64((x1 ^ 2.0) * Float64(3.0 - Float64(x2 * -2.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]}, If[LessEqual[x1, -1.32e+154], N[(x1 + N[(N[(x1 + N[(4.0 * N[(-3.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(3.0 + N[(x2 * 2.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -5.5e+102], N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(x2 * 2.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 + N[(N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * t$95$0), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(x2 * 2.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x2 * -6.0), $MachinePrecision] + N[(3.0 * N[(N[Power[x1, 2.0], $MachinePrecision] * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $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 -1.32 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(-3 \cdot \left(x1 \cdot x2\right)\right)\right) + 3 \cdot \left(\mathsf{fma}\left(x1 \cdot x1, 3 + x2 \cdot 2, x2 \cdot -2\right) - x1\right)\right)\\

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

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

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


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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.31999999999999998e154 < x1 < -5.49999999999999981e102

    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.49999999999999981e102 < x1 < 1.35000000000000003e154

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

    if 1.35000000000000003e154 < x1

    1. Initial program 0.0%

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

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

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

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

Alternative 5: 88.6% 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}\\ \mathbf{if}\;x1 \leq -1.32 \cdot 10^{+154}:\\ \;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(-3 \cdot \left(x1 \cdot x2\right)\right)\right) + 3 \cdot \left(\mathsf{fma}\left(x1 \cdot x1, 3 + x2 \cdot 2, x2 \cdot -2\right) - x1\right)\right)\\ \mathbf{elif}\;x1 \leq -1 \cdot 10^{+105}:\\ \;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 3 \cdot \frac{\left(t_0 - x2 \cdot 2\right) - x1}{t_1}\right)\\ \mathbf{elif}\;x1 \leq 1.8 \cdot 10^{+149}:\\ \;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2 - x1\right) + \left(x1 + \left(\left(t_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t_2 - 6\right)\right) + 3 \cdot t_0\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(x2 \cdot 2 - 3\right)\right)\right)\right) + 3 \cdot \left(x2 \cdot -2\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 -1.32e+154)
     (+
      x1
      (+
       (+ x1 (* 4.0 (* -3.0 (* x1 x2))))
       (* 3.0 (- (fma (* x1 x1) (+ 3.0 (* x2 2.0)) (* x2 -2.0)) x1))))
     (if (<= x1 -1e+105)
       (+
        x1
        (+
         (+ x1 (* 6.0 (pow x1 4.0)))
         (* 3.0 (/ (- (- t_0 (* x2 2.0)) x1) t_1))))
       (if (<= x1 1.8e+149)
         (+
          x1
          (+
           (* 3.0 (- (* x2 -2.0) x1))
           (+
            x1
            (+
             (+
              (*
               t_1
               (+
                (* (* (* x1 2.0) t_2) (- t_2 3.0))
                (* (* x1 x1) (- (* 4.0 t_2) 6.0))))
              (* 3.0 t_0))
             (* x1 (* x1 x1))))))
         (+
          x1
          (+
           (+ x1 (* 4.0 (* x2 (* x1 (- (* x2 2.0) 3.0)))))
           (* 3.0 (* x2 -2.0)))))))))
double code(double x1, double x2) {
	double t_0 = x1 * (x1 * 3.0);
	double t_1 = (x1 * x1) + 1.0;
	double t_2 = (((x2 * 2.0) + t_0) - x1) / t_1;
	double tmp;
	if (x1 <= -1.32e+154) {
		tmp = x1 + ((x1 + (4.0 * (-3.0 * (x1 * x2)))) + (3.0 * (fma((x1 * x1), (3.0 + (x2 * 2.0)), (x2 * -2.0)) - x1)));
	} else if (x1 <= -1e+105) {
		tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + (3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_1)));
	} else if (x1 <= 1.8e+149) {
		tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0)))) + (3.0 * t_0)) + (x1 * (x1 * x1)))));
	} else {
		tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * ((x2 * 2.0) - 3.0))))) + (3.0 * (x2 * -2.0)));
	}
	return tmp;
}
function code(x1, x2)
	t_0 = Float64(x1 * Float64(x1 * 3.0))
	t_1 = Float64(Float64(x1 * x1) + 1.0)
	t_2 = Float64(Float64(Float64(Float64(x2 * 2.0) + t_0) - x1) / t_1)
	tmp = 0.0
	if (x1 <= -1.32e+154)
		tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(-3.0 * Float64(x1 * x2)))) + Float64(3.0 * Float64(fma(Float64(x1 * x1), Float64(3.0 + Float64(x2 * 2.0)), Float64(x2 * -2.0)) - x1))));
	elseif (x1 <= -1e+105)
		tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(x2 * 2.0)) - x1) / t_1))));
	elseif (x1 <= 1.8e+149)
		tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)) + Float64(x1 + Float64(Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0)))) + Float64(3.0 * t_0)) + Float64(x1 * Float64(x1 * x1))))));
	else
		tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * Float64(Float64(x2 * 2.0) - 3.0))))) + Float64(3.0 * Float64(x2 * -2.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]}, If[LessEqual[x1, -1.32e+154], N[(x1 + N[(N[(x1 + N[(4.0 * N[(-3.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(3.0 + N[(x2 * 2.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -1e+105], N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(x2 * 2.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.8e+149], N[(x1 + N[(N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * t$95$0), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x2 * N[(x1 * N[(N[(x2 * 2.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x2 * -2.0), $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 -1.32 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(-3 \cdot \left(x1 \cdot x2\right)\right)\right) + 3 \cdot \left(\mathsf{fma}\left(x1 \cdot x1, 3 + x2 \cdot 2, x2 \cdot -2\right) - x1\right)\right)\\

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

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

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


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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.31999999999999998e154 < x1 < -9.9999999999999994e104

    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 -9.9999999999999994e104 < x1 < 1.79999999999999997e149

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

    if 1.79999999999999997e149 < x1

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

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

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

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

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

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

Alternative 6: 86.3% 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(\left(x1 + 4 \cdot \left(-3 \cdot \left(x1 \cdot x2\right)\right)\right) + 3 \cdot \left(\mathsf{fma}\left(x1 \cdot x1, 3 + x2 \cdot 2, x2 \cdot -2\right) - x1\right)\right)\\ \mathbf{elif}\;x1 \leq 1.8 \cdot 10^{+149}:\\ \;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2 - x1\right) + \left(x1 + \left(\left(t_0 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t_2 - 6\right)\right) + 3 \cdot t_1\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(x2 \cdot 2 - 3\right)\right)\right)\right) + 3 \cdot \left(x2 \cdot -2\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)))
   (if (<= x1 -5.6e+102)
     (+
      x1
      (+
       (+ x1 (* 4.0 (* -3.0 (* x1 x2))))
       (* 3.0 (- (fma (* x1 x1) (+ 3.0 (* x2 2.0)) (* x2 -2.0)) x1))))
     (if (<= x1 1.8e+149)
       (+
        x1
        (+
         (* 3.0 (- (* x2 -2.0) x1))
         (+
          x1
          (+
           (+
            (*
             t_0
             (+
              (* (* (* x1 2.0) t_2) (- t_2 3.0))
              (* (* x1 x1) (- (* 4.0 t_2) 6.0))))
            (* 3.0 t_1))
           (* x1 (* x1 x1))))))
       (+
        x1
        (+
         (+ x1 (* 4.0 (* x2 (* x1 (- (* x2 2.0) 3.0)))))
         (* 3.0 (* x2 -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 tmp;
	if (x1 <= -5.6e+102) {
		tmp = x1 + ((x1 + (4.0 * (-3.0 * (x1 * x2)))) + (3.0 * (fma((x1 * x1), (3.0 + (x2 * 2.0)), (x2 * -2.0)) - x1)));
	} else if (x1 <= 1.8e+149) {
		tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + (((t_0 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0)))) + (3.0 * t_1)) + (x1 * (x1 * x1)))));
	} else {
		tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * ((x2 * 2.0) - 3.0))))) + (3.0 * (x2 * -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)
	tmp = 0.0
	if (x1 <= -5.6e+102)
		tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(-3.0 * Float64(x1 * x2)))) + Float64(3.0 * Float64(fma(Float64(x1 * x1), Float64(3.0 + Float64(x2 * 2.0)), Float64(x2 * -2.0)) - x1))));
	elseif (x1 <= 1.8e+149)
		tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)) + Float64(x1 + Float64(Float64(Float64(t_0 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0)))) + Float64(3.0 * t_1)) + Float64(x1 * Float64(x1 * x1))))));
	else
		tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * Float64(Float64(x2 * 2.0) - 3.0))))) + Float64(3.0 * Float64(x2 * -2.0))));
	end
	return 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[(x1 + N[(4.0 * N[(-3.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(3.0 + N[(x2 * 2.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.8e+149], N[(x1 + N[(N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(N[(t$95$0 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * t$95$1), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x2 * N[(x1 * N[(N[(x2 * 2.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.60000000000000037e102 < x1 < 1.79999999999999997e149

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

    if 1.79999999999999997e149 < x1

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

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

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

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

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

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

Alternative 7: 86.3% 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 1.8 \cdot 10^{+149}:\\ \;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2 - x1\right) + \left(x1 + \left(\left(t_0 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t_2 - 6\right)\right) + 3 \cdot t_1\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(x2 \cdot 2 - 3\right)\right)\right)\right) + 3 \cdot \left(x2 \cdot -2\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)))
   (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 1.8e+149)
       (+
        x1
        (+
         (* 3.0 (- (* x2 -2.0) x1))
         (+
          x1
          (+
           (+
            (*
             t_0
             (+
              (* (* (* x1 2.0) t_2) (- t_2 3.0))
              (* (* x1 x1) (- (* 4.0 t_2) 6.0))))
            (* 3.0 t_1))
           (* x1 (* x1 x1))))))
       (+
        x1
        (+
         (+ x1 (* 4.0 (* x2 (* x1 (- (* x2 2.0) 3.0)))))
         (* 3.0 (* x2 -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 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 <= 1.8e+149) {
		tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + (((t_0 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0)))) + (3.0 * t_1)) + (x1 * (x1 * x1)))));
	} else {
		tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * ((x2 * 2.0) - 3.0))))) + (3.0 * (x2 * -2.0)));
	}
	return tmp;
}
real(8) function code(x1, x2)
    real(8), intent (in) :: x1
    real(8), intent (in) :: x2
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_0 = (x1 * x1) + 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 <= 1.8d+149) then
        tmp = x1 + ((3.0d0 * ((x2 * (-2.0d0)) - x1)) + (x1 + (((t_0 * ((((x1 * 2.0d0) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_2) - 6.0d0)))) + (3.0d0 * t_1)) + (x1 * (x1 * x1)))))
    else
        tmp = x1 + ((x1 + (4.0d0 * (x2 * (x1 * ((x2 * 2.0d0) - 3.0d0))))) + (3.0d0 * (x2 * (-2.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 <= 1.8e+149) {
		tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + (((t_0 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0)))) + (3.0 * t_1)) + (x1 * (x1 * x1)))));
	} else {
		tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * ((x2 * 2.0) - 3.0))))) + (3.0 * (x2 * -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
	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 <= 1.8e+149:
		tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + (((t_0 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0)))) + (3.0 * t_1)) + (x1 * (x1 * x1)))))
	else:
		tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * ((x2 * 2.0) - 3.0))))) + (3.0 * (x2 * -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)
	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 <= 1.8e+149)
		tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)) + Float64(x1 + Float64(Float64(Float64(t_0 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0)))) + Float64(3.0 * t_1)) + Float64(x1 * Float64(x1 * x1))))));
	else
		tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * Float64(Float64(x2 * 2.0) - 3.0))))) + Float64(3.0 * Float64(x2 * -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;
	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 <= 1.8e+149)
		tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + (((t_0 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0)))) + (3.0 * t_1)) + (x1 * (x1 * x1)))));
	else
		tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * ((x2 * 2.0) - 3.0))))) + (3.0 * (x2 * -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]}, 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, 1.8e+149], N[(x1 + N[(N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(N[(t$95$0 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * t$95$1), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x2 * N[(x1 * N[(N[(x2 * 2.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := \frac{\left(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 1.8 \cdot 10^{+149}:\\
\;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2 - x1\right) + \left(x1 + \left(\left(t_0 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t_2 - 6\right)\right) + 3 \cdot t_1\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right)\right)\\

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

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

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

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

    if -5.60000000000000037e102 < x1 < 1.79999999999999997e149

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

    if 1.79999999999999997e149 < x1

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

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

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

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

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

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

Alternative 8: 79.1% accurate, 1.2× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.60000000000000037e102 < x1 < 1.79999999999999997e149

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

    if 1.79999999999999997e149 < x1

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

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

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

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

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

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

Alternative 9: 77.0% 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 \cdot \left(x2 \cdot -12 + -1\right)\\ \mathbf{elif}\;x1 \leq 1.8 \cdot 10^{+149}:\\ \;\;\;\;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(3 \cdot t_0 + t_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(x2 \cdot 2 - 3\right)\right)\right)\right) + 3 \cdot \left(x2 \cdot -2\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 -12.0) -1.0))
     (if (<= x1 1.8e+149)
       (+
        x1
        (+
         (* 3.0 (/ (- (- t_0 (* x2 2.0)) x1) t_1))
         (+
          x1
          (+
           (* x1 (* x1 x1))
           (+
            (* 3.0 t_0)
            (*
             t_1
             (+ (* (* (* x1 2.0) t_2) (- t_2 3.0)) (* (* x1 x1) 6.0))))))))
       (+
        x1
        (+
         (+ x1 (* 4.0 (* x2 (* x1 (- (* x2 2.0) 3.0)))))
         (* 3.0 (* x2 -2.0))))))))
double code(double x1, double x2) {
	double t_0 = x1 * (x1 * 3.0);
	double t_1 = (x1 * x1) + 1.0;
	double t_2 = (((x2 * 2.0) + t_0) - x1) / t_1;
	double tmp;
	if (x1 <= -5.6e+102) {
		tmp = x1 * ((x2 * -12.0) + -1.0);
	} else if (x1 <= 1.8e+149) {
		tmp = x1 + ((3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0)))))));
	} else {
		tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * ((x2 * 2.0) - 3.0))))) + (3.0 * (x2 * -2.0)));
	}
	return tmp;
}
real(8) function code(x1, x2)
    real(8), intent (in) :: x1
    real(8), intent (in) :: x2
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_0 = x1 * (x1 * 3.0d0)
    t_1 = (x1 * x1) + 1.0d0
    t_2 = (((x2 * 2.0d0) + t_0) - x1) / t_1
    if (x1 <= (-5.6d+102)) then
        tmp = x1 * ((x2 * (-12.0d0)) + (-1.0d0))
    else if (x1 <= 1.8d+149) then
        tmp = x1 + ((3.0d0 * (((t_0 - (x2 * 2.0d0)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0d0 * t_0) + (t_1 * ((((x1 * 2.0d0) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * 6.0d0)))))))
    else
        tmp = x1 + ((x1 + (4.0d0 * (x2 * (x1 * ((x2 * 2.0d0) - 3.0d0))))) + (3.0d0 * (x2 * (-2.0d0))))
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double t_0 = x1 * (x1 * 3.0);
	double t_1 = (x1 * x1) + 1.0;
	double t_2 = (((x2 * 2.0) + t_0) - x1) / t_1;
	double tmp;
	if (x1 <= -5.6e+102) {
		tmp = x1 * ((x2 * -12.0) + -1.0);
	} else if (x1 <= 1.8e+149) {
		tmp = x1 + ((3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0)))))));
	} else {
		tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * ((x2 * 2.0) - 3.0))))) + (3.0 * (x2 * -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
	tmp = 0
	if x1 <= -5.6e+102:
		tmp = x1 * ((x2 * -12.0) + -1.0)
	elif x1 <= 1.8e+149:
		tmp = x1 + ((3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0)))))))
	else:
		tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * ((x2 * 2.0) - 3.0))))) + (3.0 * (x2 * -2.0)))
	return tmp
function code(x1, x2)
	t_0 = Float64(x1 * Float64(x1 * 3.0))
	t_1 = Float64(Float64(x1 * x1) + 1.0)
	t_2 = Float64(Float64(Float64(Float64(x2 * 2.0) + t_0) - x1) / t_1)
	tmp = 0.0
	if (x1 <= -5.6e+102)
		tmp = Float64(x1 * Float64(Float64(x2 * -12.0) + -1.0));
	elseif (x1 <= 1.8e+149)
		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(3.0 * t_0) + Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * 6.0))))))));
	else
		tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * Float64(Float64(x2 * 2.0) - 3.0))))) + Float64(3.0 * Float64(x2 * -2.0))));
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	t_0 = x1 * (x1 * 3.0);
	t_1 = (x1 * x1) + 1.0;
	t_2 = (((x2 * 2.0) + t_0) - x1) / t_1;
	tmp = 0.0;
	if (x1 <= -5.6e+102)
		tmp = x1 * ((x2 * -12.0) + -1.0);
	elseif (x1 <= 1.8e+149)
		tmp = x1 + ((3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0)))))));
	else
		tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * ((x2 * 2.0) - 3.0))))) + (3.0 * (x2 * -2.0)));
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(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 * -12.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.8e+149], 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[(3.0 * t$95$0), $MachinePrecision] + N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x2 * N[(x1 * N[(N[(x2 * 2.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x2 * -2.0), $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 \cdot \left(x2 \cdot -12 + -1\right)\\

\mathbf{elif}\;x1 \leq 1.8 \cdot 10^{+149}:\\
\;\;\;\;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(3 \cdot t_0 + t_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\

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

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

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

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

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

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

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

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

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

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

    if -5.60000000000000037e102 < x1 < 1.79999999999999997e149

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

Alternative 10: 75.5% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;x1 \leq -2.3 \cdot 10^{+33}:\\
\;\;\;\;x1 + \left(t_5 + \left(x1 + \left(t_4 + \left(t_6 + t_2 \cdot \left(x1 \cdot 2 + t_3\right)\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 1.8 \cdot 10^{+149}:\\
\;\;\;\;x1 + \left(t_5 + \left(x1 + \left(t_4 + \left(t_6 + t_2 \cdot \left(t_3 + t_1\right)\right)\right)\right)\right)\\

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

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

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

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

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

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

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

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

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

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

    if -5.60000000000000037e102 < x1 < -2.30000000000000011e33

    1. Initial program 99.2%

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

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

      \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \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 \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) \]
    4. Taylor expanded in x1 around inf 84.6%

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

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

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

    1. Initial program 99.3%

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

      \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \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 \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) \]
    4. Taylor expanded in x1 around 0 93.8%

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

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

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

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

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

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

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

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

\mathbf{elif}\;x1 \leq 2.05 \cdot 10^{+142}:\\
\;\;\;\;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(3 \cdot t_0 + t_1 \cdot \left(\left(x1 \cdot x1\right) \cdot 6 + \left(\frac{\left(x2 \cdot 2 + t_0\right) - x1}{t_1} - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(x2 \cdot 2 - x1\right)\right)\right)\right)\right)\right)\right)\\

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

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

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

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

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

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

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

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

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

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

    if -5.60000000000000037e102 < x1 < 2.04999999999999991e142

    1. Initial program 99.3%

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

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

      \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \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 \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) \]
    4. Taylor expanded in x1 around inf 92.8%

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

    if 2.04999999999999991e142 < x1

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

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

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

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

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

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

Alternative 12: 74.9% accurate, 1.6× speedup?

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

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

\mathbf{elif}\;x1 \leq 530000000:\\
\;\;\;\;x1 + \left(t_2 + \left(x1 + 8 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 1.8 \cdot 10^{+149}:\\
\;\;\;\;t_3\\

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

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

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

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

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

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

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

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

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

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

    if -5.60000000000000037e102 < x1 < -6.70000000000000018 or 5.3e8 < x1 < 1.79999999999999997e149

    1. Initial program 99.4%

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

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

      \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \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 \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) \]
    4. Taylor expanded in x1 around inf 81.1%

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

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

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

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x1 + \left(\left(8 \cdot \color{blue}{\left(x2 \cdot \left(x2 \cdot x1\right)\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.79999999999999997e149 < x1

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

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

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

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

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

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

Alternative 13: 65.8% accurate, 3.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x1 \leq -7.5 \cdot 10^{+77}:\\ \;\;\;\;x1 \cdot \left(x2 \cdot -12 + -1\right)\\ \mathbf{elif}\;x1 \leq 1.8 \cdot 10^{+149}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - x2 \cdot 2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + 8 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 4.4 \cdot 10^{+193}:\\ \;\;\;\;\frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}\\ \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 -7.5e+77)
   (* x1 (+ (* x2 -12.0) -1.0))
   (if (<= x1 1.8e+149)
     (+
      x1
      (+
       (* 3.0 (/ (- (- (* x1 (* x1 3.0)) (* x2 2.0)) x1) (+ (* x1 x1) 1.0)))
       (+ x1 (* 8.0 (* x2 (* x1 x2))))))
     (if (<= x1 4.4e+193)
       (/ (- (* x1 x1) (* (* x2 x2) 36.0)) (- x1 (* x2 -6.0)))
       (+ x1 (* x1 (+ 1.0 (* 4.0 (* x2 (- (* x2 2.0) 3.0))))))))))
double code(double x1, double x2) {
	double tmp;
	if (x1 <= -7.5e+77) {
		tmp = x1 * ((x2 * -12.0) + -1.0);
	} else if (x1 <= 1.8e+149) {
		tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (x2 * 2.0)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (8.0 * (x2 * (x1 * x2)))));
	} else if (x1 <= 4.4e+193) {
		tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.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) :: tmp
    if (x1 <= (-7.5d+77)) then
        tmp = x1 * ((x2 * (-12.0d0)) + (-1.0d0))
    else if (x1 <= 1.8d+149) then
        tmp = x1 + ((3.0d0 * ((((x1 * (x1 * 3.0d0)) - (x2 * 2.0d0)) - x1) / ((x1 * x1) + 1.0d0))) + (x1 + (8.0d0 * (x2 * (x1 * x2)))))
    else if (x1 <= 4.4d+193) then
        tmp = ((x1 * x1) - ((x2 * x2) * 36.0d0)) / (x1 - (x2 * (-6.0d0)))
    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 <= -7.5e+77) {
		tmp = x1 * ((x2 * -12.0) + -1.0);
	} else if (x1 <= 1.8e+149) {
		tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (x2 * 2.0)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (8.0 * (x2 * (x1 * x2)))));
	} else if (x1 <= 4.4e+193) {
		tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
	} else {
		tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((x2 * 2.0) - 3.0)))));
	}
	return tmp;
}
def code(x1, x2):
	tmp = 0
	if x1 <= -7.5e+77:
		tmp = x1 * ((x2 * -12.0) + -1.0)
	elif x1 <= 1.8e+149:
		tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (x2 * 2.0)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (8.0 * (x2 * (x1 * x2)))))
	elif x1 <= 4.4e+193:
		tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0))
	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 <= -7.5e+77)
		tmp = Float64(x1 * Float64(Float64(x2 * -12.0) + -1.0));
	elseif (x1 <= 1.8e+149)
		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(8.0 * Float64(x2 * Float64(x1 * x2))))));
	elseif (x1 <= 4.4e+193)
		tmp = Float64(Float64(Float64(x1 * x1) - Float64(Float64(x2 * x2) * 36.0)) / Float64(x1 - Float64(x2 * -6.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)
	tmp = 0.0;
	if (x1 <= -7.5e+77)
		tmp = x1 * ((x2 * -12.0) + -1.0);
	elseif (x1 <= 1.8e+149)
		tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (x2 * 2.0)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (8.0 * (x2 * (x1 * x2)))));
	elseif (x1 <= 4.4e+193)
		tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
	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, -7.5e+77], N[(x1 * N[(N[(x2 * -12.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.8e+149], 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[(8.0 * N[(x2 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.4e+193], N[(N[(N[(x1 * x1), $MachinePrecision] - N[(N[(x2 * x2), $MachinePrecision] * 36.0), $MachinePrecision]), $MachinePrecision] / N[(x1 - N[(x2 * -6.0), $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 -7.5 \cdot 10^{+77}:\\
\;\;\;\;x1 \cdot \left(x2 \cdot -12 + -1\right)\\

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

\mathbf{elif}\;x1 \leq 4.4 \cdot 10^{+193}:\\
\;\;\;\;\frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}\\

\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 < -7.49999999999999955e77

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

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

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

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

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

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

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

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

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

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

    if -7.49999999999999955e77 < x1 < 1.79999999999999997e149

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x1 + \left(\left(8 \cdot \color{blue}{\left(x2 \cdot \left(x2 \cdot x1\right)\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.79999999999999997e149 < x1 < 4.39999999999999972e193

    1. Initial program 18.2%

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

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

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

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

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

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

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

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

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

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

    if 4.39999999999999972e193 < x1

    1. Initial program 0.0%

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

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

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

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

Alternative 14: 60.1% accurate, 5.0× speedup?

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

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

\mathbf{elif}\;x1 \leq -1 \cdot 10^{-246} \lor \neg \left(x1 \leq 1.65 \cdot 10^{-230}\right):\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(x2 \cdot 2 - 3\right)\right) - 2\right)\right)\\

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


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

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

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

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

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

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

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

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

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

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

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

    if -1.19999999999999998e85 < x1 < -9.99999999999999956e-247 or 1.64999999999999997e-230 < x1

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

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

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

    if -9.99999999999999956e-247 < x1 < 1.64999999999999997e-230

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -1.2 \cdot 10^{+85}:\\ \;\;\;\;x1 \cdot \left(x2 \cdot -12 + -1\right)\\ \mathbf{elif}\;x1 \leq -1 \cdot 10^{-246} \lor \neg \left(x1 \leq 1.65 \cdot 10^{-230}\right):\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(x2 \cdot 2 - 3\right)\right) - 2\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x2 \cdot -6 + x1 \cdot \left(x2 \cdot -12 + -1\right)\\ \end{array} \]

Alternative 15: 61.3% accurate, 5.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -1.08 \cdot 10^{+21} \lor \neg \left(x2 \leq 2.6 \cdot 10^{+24}\right):\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(x2 \cdot 2 - 3\right)\right)\right)\right) + 3 \cdot \left(x2 \cdot -2\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x2 < -1.08e21 or 2.5999999999999998e24 < x2

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

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

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

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

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

    if -1.08e21 < x2 < 2.5999999999999998e24

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

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

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

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

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

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

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

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

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

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

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

Alternative 16: 64.3% accurate, 5.1× speedup?

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

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

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


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

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

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

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

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

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

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

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

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

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

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

    if -1.9e84 < x1

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

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

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

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

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

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

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

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

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

Alternative 17: 52.3% accurate, 6.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -1.78 \cdot 10^{+75} \lor \neg \left(x2 \leq 7.2 \cdot 10^{+202}\right):\\
\;\;\;\;x1 + x2 \cdot \left(x2 \cdot \left(x1 \cdot 8\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x2 < -1.78e75 or 7.20000000000000016e202 < x2

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

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

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

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

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

        \[\leadsto x1 + \left(8 \cdot x1\right) \cdot \color{blue}{\left(x2 \cdot x2\right)} \]
      4. associate-*r*73.9%

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

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

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

    if -1.78e75 < x2 < 7.20000000000000016e202

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x2 \leq -1.78 \cdot 10^{+75} \lor \neg \left(x2 \leq 7.2 \cdot 10^{+202}\right):\\ \;\;\;\;x1 + x2 \cdot \left(x2 \cdot \left(x1 \cdot 8\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x2 \cdot \left(x1 \cdot -12 - 6\right) + \left(x1 + x1 \cdot -3\right)\right)\\ \end{array} \]

Alternative 18: 44.0% accurate, 7.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 + 8 \cdot \left(x1 \cdot \left(x2 \cdot x2\right)\right)\\ \mathbf{if}\;x2 \leq -4.8 \cdot 10^{+74}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x2 \leq -5.8 \cdot 10^{-134}:\\ \;\;\;\;x2 \cdot -6\\ \mathbf{elif}\;x2 \leq 4.2 \cdot 10^{-172}:\\ \;\;\;\;x1 \cdot \left(x2 \cdot -12 + -1\right)\\ \mathbf{elif}\;x2 \leq 3 \cdot 10^{+199}:\\ \;\;\;\;x1 + x2 \cdot \left(x1 \cdot -12 - 6\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (+ x1 (* 8.0 (* x1 (* x2 x2))))))
   (if (<= x2 -4.8e+74)
     t_0
     (if (<= x2 -5.8e-134)
       (* x2 -6.0)
       (if (<= x2 4.2e-172)
         (* x1 (+ (* x2 -12.0) -1.0))
         (if (<= x2 3e+199) (+ x1 (* x2 (- (* x1 -12.0) 6.0))) t_0))))))
double code(double x1, double x2) {
	double t_0 = x1 + (8.0 * (x1 * (x2 * x2)));
	double tmp;
	if (x2 <= -4.8e+74) {
		tmp = t_0;
	} else if (x2 <= -5.8e-134) {
		tmp = x2 * -6.0;
	} else if (x2 <= 4.2e-172) {
		tmp = x1 * ((x2 * -12.0) + -1.0);
	} else if (x2 <= 3e+199) {
		tmp = x1 + (x2 * ((x1 * -12.0) - 6.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) :: tmp
    t_0 = x1 + (8.0d0 * (x1 * (x2 * x2)))
    if (x2 <= (-4.8d+74)) then
        tmp = t_0
    else if (x2 <= (-5.8d-134)) then
        tmp = x2 * (-6.0d0)
    else if (x2 <= 4.2d-172) then
        tmp = x1 * ((x2 * (-12.0d0)) + (-1.0d0))
    else if (x2 <= 3d+199) then
        tmp = x1 + (x2 * ((x1 * (-12.0d0)) - 6.0d0))
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double t_0 = x1 + (8.0 * (x1 * (x2 * x2)));
	double tmp;
	if (x2 <= -4.8e+74) {
		tmp = t_0;
	} else if (x2 <= -5.8e-134) {
		tmp = x2 * -6.0;
	} else if (x2 <= 4.2e-172) {
		tmp = x1 * ((x2 * -12.0) + -1.0);
	} else if (x2 <= 3e+199) {
		tmp = x1 + (x2 * ((x1 * -12.0) - 6.0));
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x1, x2):
	t_0 = x1 + (8.0 * (x1 * (x2 * x2)))
	tmp = 0
	if x2 <= -4.8e+74:
		tmp = t_0
	elif x2 <= -5.8e-134:
		tmp = x2 * -6.0
	elif x2 <= 4.2e-172:
		tmp = x1 * ((x2 * -12.0) + -1.0)
	elif x2 <= 3e+199:
		tmp = x1 + (x2 * ((x1 * -12.0) - 6.0))
	else:
		tmp = t_0
	return tmp
function code(x1, x2)
	t_0 = Float64(x1 + Float64(8.0 * Float64(x1 * Float64(x2 * x2))))
	tmp = 0.0
	if (x2 <= -4.8e+74)
		tmp = t_0;
	elseif (x2 <= -5.8e-134)
		tmp = Float64(x2 * -6.0);
	elseif (x2 <= 4.2e-172)
		tmp = Float64(x1 * Float64(Float64(x2 * -12.0) + -1.0));
	elseif (x2 <= 3e+199)
		tmp = Float64(x1 + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0)));
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	t_0 = x1 + (8.0 * (x1 * (x2 * x2)));
	tmp = 0.0;
	if (x2 <= -4.8e+74)
		tmp = t_0;
	elseif (x2 <= -5.8e-134)
		tmp = x2 * -6.0;
	elseif (x2 <= 4.2e-172)
		tmp = x1 * ((x2 * -12.0) + -1.0);
	elseif (x2 <= 3e+199)
		tmp = x1 + (x2 * ((x1 * -12.0) - 6.0));
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(8.0 * N[(x1 * N[(x2 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x2, -4.8e+74], t$95$0, If[LessEqual[x2, -5.8e-134], N[(x2 * -6.0), $MachinePrecision], If[LessEqual[x2, 4.2e-172], N[(x1 * N[(N[(x2 * -12.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x2, 3e+199], N[(x1 + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x1 + 8 \cdot \left(x1 \cdot \left(x2 \cdot x2\right)\right)\\
\mathbf{if}\;x2 \leq -4.8 \cdot 10^{+74}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;x2 \leq -5.8 \cdot 10^{-134}:\\
\;\;\;\;x2 \cdot -6\\

\mathbf{elif}\;x2 \leq 4.2 \cdot 10^{-172}:\\
\;\;\;\;x1 \cdot \left(x2 \cdot -12 + -1\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x2 < -4.80000000000000017e74 or 3.0000000000000001e199 < x2

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

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

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

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

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

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

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

    if -4.80000000000000017e74 < x2 < -5.79999999999999986e-134

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

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

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

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

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

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

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

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

    if -5.79999999999999986e-134 < x2 < 4.1999999999999999e-172

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

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

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

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

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

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

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

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

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

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

    if 4.1999999999999999e-172 < x2 < 3.0000000000000001e199

    1. Initial program 73.7%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x2 \leq -4.8 \cdot 10^{+74}:\\ \;\;\;\;x1 + 8 \cdot \left(x1 \cdot \left(x2 \cdot x2\right)\right)\\ \mathbf{elif}\;x2 \leq -5.8 \cdot 10^{-134}:\\ \;\;\;\;x2 \cdot -6\\ \mathbf{elif}\;x2 \leq 4.2 \cdot 10^{-172}:\\ \;\;\;\;x1 \cdot \left(x2 \cdot -12 + -1\right)\\ \mathbf{elif}\;x2 \leq 3 \cdot 10^{+199}:\\ \;\;\;\;x1 + x2 \cdot \left(x1 \cdot -12 - 6\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + 8 \cdot \left(x1 \cdot \left(x2 \cdot x2\right)\right)\\ \end{array} \]

Alternative 19: 45.7% accurate, 7.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 + x2 \cdot \left(x2 \cdot \left(x1 \cdot 8\right)\right)\\ \mathbf{if}\;x2 \leq -1.15 \cdot 10^{+70}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x2 \leq -5.3 \cdot 10^{-134}:\\ \;\;\;\;x2 \cdot -6\\ \mathbf{elif}\;x2 \leq 9.5 \cdot 10^{-172}:\\ \;\;\;\;x1 \cdot \left(x2 \cdot -12 + -1\right)\\ \mathbf{elif}\;x2 \leq 4 \cdot 10^{+198}:\\ \;\;\;\;x1 + x2 \cdot \left(x1 \cdot -12 - 6\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (+ x1 (* x2 (* x2 (* x1 8.0))))))
   (if (<= x2 -1.15e+70)
     t_0
     (if (<= x2 -5.3e-134)
       (* x2 -6.0)
       (if (<= x2 9.5e-172)
         (* x1 (+ (* x2 -12.0) -1.0))
         (if (<= x2 4e+198) (+ x1 (* x2 (- (* x1 -12.0) 6.0))) t_0))))))
double code(double x1, double x2) {
	double t_0 = x1 + (x2 * (x2 * (x1 * 8.0)));
	double tmp;
	if (x2 <= -1.15e+70) {
		tmp = t_0;
	} else if (x2 <= -5.3e-134) {
		tmp = x2 * -6.0;
	} else if (x2 <= 9.5e-172) {
		tmp = x1 * ((x2 * -12.0) + -1.0);
	} else if (x2 <= 4e+198) {
		tmp = x1 + (x2 * ((x1 * -12.0) - 6.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) :: tmp
    t_0 = x1 + (x2 * (x2 * (x1 * 8.0d0)))
    if (x2 <= (-1.15d+70)) then
        tmp = t_0
    else if (x2 <= (-5.3d-134)) then
        tmp = x2 * (-6.0d0)
    else if (x2 <= 9.5d-172) then
        tmp = x1 * ((x2 * (-12.0d0)) + (-1.0d0))
    else if (x2 <= 4d+198) then
        tmp = x1 + (x2 * ((x1 * (-12.0d0)) - 6.0d0))
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double t_0 = x1 + (x2 * (x2 * (x1 * 8.0)));
	double tmp;
	if (x2 <= -1.15e+70) {
		tmp = t_0;
	} else if (x2 <= -5.3e-134) {
		tmp = x2 * -6.0;
	} else if (x2 <= 9.5e-172) {
		tmp = x1 * ((x2 * -12.0) + -1.0);
	} else if (x2 <= 4e+198) {
		tmp = x1 + (x2 * ((x1 * -12.0) - 6.0));
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x1, x2):
	t_0 = x1 + (x2 * (x2 * (x1 * 8.0)))
	tmp = 0
	if x2 <= -1.15e+70:
		tmp = t_0
	elif x2 <= -5.3e-134:
		tmp = x2 * -6.0
	elif x2 <= 9.5e-172:
		tmp = x1 * ((x2 * -12.0) + -1.0)
	elif x2 <= 4e+198:
		tmp = x1 + (x2 * ((x1 * -12.0) - 6.0))
	else:
		tmp = t_0
	return tmp
function code(x1, x2)
	t_0 = Float64(x1 + Float64(x2 * Float64(x2 * Float64(x1 * 8.0))))
	tmp = 0.0
	if (x2 <= -1.15e+70)
		tmp = t_0;
	elseif (x2 <= -5.3e-134)
		tmp = Float64(x2 * -6.0);
	elseif (x2 <= 9.5e-172)
		tmp = Float64(x1 * Float64(Float64(x2 * -12.0) + -1.0));
	elseif (x2 <= 4e+198)
		tmp = Float64(x1 + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0)));
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	t_0 = x1 + (x2 * (x2 * (x1 * 8.0)));
	tmp = 0.0;
	if (x2 <= -1.15e+70)
		tmp = t_0;
	elseif (x2 <= -5.3e-134)
		tmp = x2 * -6.0;
	elseif (x2 <= 9.5e-172)
		tmp = x1 * ((x2 * -12.0) + -1.0);
	elseif (x2 <= 4e+198)
		tmp = x1 + (x2 * ((x1 * -12.0) - 6.0));
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(x2 * N[(x2 * N[(x1 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x2, -1.15e+70], t$95$0, If[LessEqual[x2, -5.3e-134], N[(x2 * -6.0), $MachinePrecision], If[LessEqual[x2, 9.5e-172], N[(x1 * N[(N[(x2 * -12.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x2, 4e+198], N[(x1 + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x1 + x2 \cdot \left(x2 \cdot \left(x1 \cdot 8\right)\right)\\
\mathbf{if}\;x2 \leq -1.15 \cdot 10^{+70}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;x2 \leq -5.3 \cdot 10^{-134}:\\
\;\;\;\;x2 \cdot -6\\

\mathbf{elif}\;x2 \leq 9.5 \cdot 10^{-172}:\\
\;\;\;\;x1 \cdot \left(x2 \cdot -12 + -1\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x2 < -1.14999999999999997e70 or 4.00000000000000007e198 < x2

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

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

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

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

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

        \[\leadsto x1 + \left(8 \cdot x1\right) \cdot \color{blue}{\left(x2 \cdot x2\right)} \]
      4. associate-*r*73.9%

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

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

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

    if -1.14999999999999997e70 < x2 < -5.30000000000000003e-134

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

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

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

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

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

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

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

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

    if -5.30000000000000003e-134 < x2 < 9.50000000000000053e-172

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

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

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

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

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

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

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

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

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

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

    if 9.50000000000000053e-172 < x2 < 4.00000000000000007e198

    1. Initial program 73.7%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x2 \leq -1.15 \cdot 10^{+70}:\\ \;\;\;\;x1 + x2 \cdot \left(x2 \cdot \left(x1 \cdot 8\right)\right)\\ \mathbf{elif}\;x2 \leq -5.3 \cdot 10^{-134}:\\ \;\;\;\;x2 \cdot -6\\ \mathbf{elif}\;x2 \leq 9.5 \cdot 10^{-172}:\\ \;\;\;\;x1 \cdot \left(x2 \cdot -12 + -1\right)\\ \mathbf{elif}\;x2 \leq 4 \cdot 10^{+198}:\\ \;\;\;\;x1 + x2 \cdot \left(x1 \cdot -12 - 6\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + x2 \cdot \left(x2 \cdot \left(x1 \cdot 8\right)\right)\\ \end{array} \]

Alternative 20: 52.4% accurate, 8.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -2 \cdot 10^{+75} \lor \neg \left(x2 \leq 5.4 \cdot 10^{+200}\right):\\
\;\;\;\;x1 + x2 \cdot \left(x2 \cdot \left(x1 \cdot 8\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x2 < -1.99999999999999985e75 or 5.40000000000000031e200 < x2

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

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

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

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

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

        \[\leadsto x1 + \left(8 \cdot x1\right) \cdot \color{blue}{\left(x2 \cdot x2\right)} \]
      4. associate-*r*73.9%

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

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

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

    if -1.99999999999999985e75 < x2 < 5.40000000000000031e200

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

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

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

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

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

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

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

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

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

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

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

Alternative 21: 38.2% accurate, 9.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -5.5 \cdot 10^{-134} \lor \neg \left(x2 \leq 3.8 \cdot 10^{-172}\right):\\
\;\;\;\;x1 + x2 \cdot \left(x1 \cdot -12 - 6\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x2 < -5.5000000000000002e-134 or 3.79999999999999987e-172 < x2

    1. Initial program 75.7%

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

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

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

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

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

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

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

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

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

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

    if -5.5000000000000002e-134 < x2 < 3.79999999999999987e-172

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x2 \leq -5.5 \cdot 10^{-134} \lor \neg \left(x2 \leq 3.8 \cdot 10^{-172}\right):\\ \;\;\;\;x1 + x2 \cdot \left(x1 \cdot -12 - 6\right)\\ \mathbf{else}:\\ \;\;\;\;x1 \cdot \left(x2 \cdot -12 + -1\right)\\ \end{array} \]

Alternative 22: 35.7% accurate, 11.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -2.55 \cdot 10^{-138} \lor \neg \left(x1 \leq 8.4 \cdot 10^{-70}\right):\\
\;\;\;\;x1 \cdot \left(x2 \cdot -12 + -1\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x1 < -2.5500000000000001e-138 or 8.4000000000000004e-70 < x1

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

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

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

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

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

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

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

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

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

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

    if -2.5500000000000001e-138 < x1 < 8.4000000000000004e-70

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -2.55 \cdot 10^{-138} \lor \neg \left(x1 \leq 8.4 \cdot 10^{-70}\right):\\ \;\;\;\;x1 \cdot \left(x2 \cdot -12 + -1\right)\\ \mathbf{else}:\\ \;\;\;\;x2 \cdot -6\\ \end{array} \]

Alternative 23: 32.2% accurate, 13.9× speedup?

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

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

\mathbf{elif}\;x2 \leq 2.5 \cdot 10^{-171}:\\
\;\;\;\;-x1\\

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


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

    1. Initial program 83.3%

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

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

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

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

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

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

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

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

    if -7.60000000000000006e-134 < x2 < 2.49999999999999996e-171

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-3 \cdot x1 + 2 \cdot x1} \]
    8. Step-by-step derivation
      1. distribute-rgt-out43.3%

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

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

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

        \[\leadsto \color{blue}{-x1} \]
    9. Simplified43.3%

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

    if 2.49999999999999996e-171 < x2

    1. Initial program 70.7%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x2 \leq -7.6 \cdot 10^{-134}:\\ \;\;\;\;x2 \cdot -6\\ \mathbf{elif}\;x2 \leq 2.5 \cdot 10^{-171}:\\ \;\;\;\;-x1\\ \mathbf{else}:\\ \;\;\;\;x1 + x2 \cdot -6\\ \end{array} \]

Alternative 24: 31.9% accurate, 17.8× speedup?

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

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

\mathbf{elif}\;x2 \leq 2.7 \cdot 10^{-171}:\\
\;\;\;\;-x1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x2 < -6.4999999999999998e-134 or 2.70000000000000014e-171 < x2

    1. Initial program 75.7%

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

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

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

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

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

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

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

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

    if -6.4999999999999998e-134 < x2 < 2.70000000000000014e-171

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-3 \cdot x1 + 2 \cdot x1} \]
    8. Step-by-step derivation
      1. distribute-rgt-out43.3%

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

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

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

        \[\leadsto \color{blue}{-x1} \]
    9. Simplified43.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x2 \leq -6.5 \cdot 10^{-134}:\\ \;\;\;\;x2 \cdot -6\\ \mathbf{elif}\;x2 \leq 2.7 \cdot 10^{-171}:\\ \;\;\;\;-x1\\ \mathbf{else}:\\ \;\;\;\;x2 \cdot -6\\ \end{array} \]

Alternative 25: 13.8% accurate, 63.5× speedup?

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{-3 \cdot x1 + 2 \cdot x1} \]
  8. Step-by-step derivation
    1. distribute-rgt-out16.0%

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

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

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

      \[\leadsto \color{blue}{-x1} \]
  9. Simplified16.0%

    \[\leadsto \color{blue}{-x1} \]
  10. Final simplification16.0%

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

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

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

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

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

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

    \[\leadsto x1 \]

Reproduce

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