Rosa's FloatVsDoubleBenchmark

Percentage Accurate: 70.8% → 99.6%
Time: 57.4s
Alternatives: 29
Speedup: 1.8×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 29 alternatives:

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

Initial Program: 70.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.6% accurate, 0.1× speedup?

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

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

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


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

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

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

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

    1. Initial program 0.0%

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

      \[\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)} \]
    3. Taylor expanded in x1 around inf 7.2%

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

        \[\leadsto 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(\color{blue}{x1 \cdot -4} + 6 \cdot {x1}^{2}\right)\right)\right)\right) \]
      2. fma-def7.2%

        \[\leadsto 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 + \color{blue}{\mathsf{fma}\left(x1, -4, 6 \cdot {x1}^{2}\right)}\right)\right)\right) \]
      3. *-commutative7.2%

        \[\leadsto 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 + \mathsf{fma}\left(x1, -4, \color{blue}{{x1}^{2} \cdot 6}\right)\right)\right)\right) \]
      4. unpow27.2%

        \[\leadsto 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 + \mathsf{fma}\left(x1, -4, \color{blue}{\left(x1 \cdot x1\right)} \cdot 6\right)\right)\right)\right) \]
    5. Simplified7.2%

      \[\leadsto 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 + \color{blue}{\mathsf{fma}\left(x1, -4, \left(x1 \cdot x1\right) \cdot 6\right)}\right)\right)\right) \]
    6. Taylor expanded in x1 around inf 8.7%

      \[\leadsto 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, \color{blue}{9 \cdot x1}, \mathsf{fma}\left(x1, x1, 1\right) \cdot \left(x1 + \mathsf{fma}\left(x1, -4, \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right) \]
    7. Step-by-step derivation
      1. *-commutative8.7%

        \[\leadsto 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, \color{blue}{x1 \cdot 9}, \mathsf{fma}\left(x1, x1, 1\right) \cdot \left(x1 + \mathsf{fma}\left(x1, -4, \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right) \]
    8. Simplified8.7%

      \[\leadsto 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, \color{blue}{x1 \cdot 9}, \mathsf{fma}\left(x1, x1, 1\right) \cdot \left(x1 + \mathsf{fma}\left(x1, -4, \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right) \]
    9. Taylor expanded in x1 around 0 100.0%

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

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

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

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

Alternative 2: 99.4% accurate, 0.1× speedup?

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

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

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


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

    1. Initial program 99.2%

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

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

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

        \[\leadsto x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\mathsf{fma}\left(x1 \cdot 3, x1, 2 \cdot x2\right) - x1}{\color{blue}{\mathsf{fma}\left(x1, x1, 1\right)}}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
      4. add-cube-cbrt99.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}{\left(\left(\sqrt[3]{\frac{\mathsf{fma}\left(x1 \cdot 3, x1, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}} \cdot \sqrt[3]{\frac{\mathsf{fma}\left(x1 \cdot 3, x1, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}}\right) \cdot \sqrt[3]{\frac{\mathsf{fma}\left(x1 \cdot 3, x1, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}}\right)}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
      5. *-commutative99.3%

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

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

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

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

    1. Initial program 0.0%

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

      \[\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)} \]
    3. Taylor expanded in x1 around inf 7.2%

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

        \[\leadsto 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(\color{blue}{x1 \cdot -4} + 6 \cdot {x1}^{2}\right)\right)\right)\right) \]
      2. fma-def7.2%

        \[\leadsto 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 + \color{blue}{\mathsf{fma}\left(x1, -4, 6 \cdot {x1}^{2}\right)}\right)\right)\right) \]
      3. *-commutative7.2%

        \[\leadsto 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 + \mathsf{fma}\left(x1, -4, \color{blue}{{x1}^{2} \cdot 6}\right)\right)\right)\right) \]
      4. unpow27.2%

        \[\leadsto 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 + \mathsf{fma}\left(x1, -4, \color{blue}{\left(x1 \cdot x1\right)} \cdot 6\right)\right)\right)\right) \]
    5. Simplified7.2%

      \[\leadsto 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 + \color{blue}{\mathsf{fma}\left(x1, -4, \left(x1 \cdot x1\right) \cdot 6\right)}\right)\right)\right) \]
    6. Taylor expanded in x1 around inf 8.7%

      \[\leadsto 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, \color{blue}{9 \cdot x1}, \mathsf{fma}\left(x1, x1, 1\right) \cdot \left(x1 + \mathsf{fma}\left(x1, -4, \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right) \]
    7. Step-by-step derivation
      1. *-commutative8.7%

        \[\leadsto 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, \color{blue}{x1 \cdot 9}, \mathsf{fma}\left(x1, x1, 1\right) \cdot \left(x1 + \mathsf{fma}\left(x1, -4, \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right) \]
    8. Simplified8.7%

      \[\leadsto 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, \color{blue}{x1 \cdot 9}, \mathsf{fma}\left(x1, x1, 1\right) \cdot \left(x1 + \mathsf{fma}\left(x1, -4, \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right) \]
    9. Taylor expanded in x1 around 0 100.0%

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

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

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

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

Alternative 3: 99.4% accurate, 0.2× speedup?

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

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


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

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 0.0%

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

      \[\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)} \]
    3. Taylor expanded in x1 around inf 7.2%

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

        \[\leadsto 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(\color{blue}{x1 \cdot -4} + 6 \cdot {x1}^{2}\right)\right)\right)\right) \]
      2. fma-def7.2%

        \[\leadsto 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 + \color{blue}{\mathsf{fma}\left(x1, -4, 6 \cdot {x1}^{2}\right)}\right)\right)\right) \]
      3. *-commutative7.2%

        \[\leadsto 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 + \mathsf{fma}\left(x1, -4, \color{blue}{{x1}^{2} \cdot 6}\right)\right)\right)\right) \]
      4. unpow27.2%

        \[\leadsto 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 + \mathsf{fma}\left(x1, -4, \color{blue}{\left(x1 \cdot x1\right)} \cdot 6\right)\right)\right)\right) \]
    5. Simplified7.2%

      \[\leadsto 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 + \color{blue}{\mathsf{fma}\left(x1, -4, \left(x1 \cdot x1\right) \cdot 6\right)}\right)\right)\right) \]
    6. Taylor expanded in x1 around inf 8.7%

      \[\leadsto 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, \color{blue}{9 \cdot x1}, \mathsf{fma}\left(x1, x1, 1\right) \cdot \left(x1 + \mathsf{fma}\left(x1, -4, \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right) \]
    7. Step-by-step derivation
      1. *-commutative8.7%

        \[\leadsto 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, \color{blue}{x1 \cdot 9}, \mathsf{fma}\left(x1, x1, 1\right) \cdot \left(x1 + \mathsf{fma}\left(x1, -4, \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right) \]
    8. Simplified8.7%

      \[\leadsto 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, \color{blue}{x1 \cdot 9}, \mathsf{fma}\left(x1, x1, 1\right) \cdot \left(x1 + \mathsf{fma}\left(x1, -4, \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right) \]
    9. Taylor expanded in x1 around 0 100.0%

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

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

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

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

Alternative 4: 99.4% accurate, 0.2× speedup?

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

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

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


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

    1. Initial program 99.2%

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

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

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

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

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

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

    1. Initial program 0.0%

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

      \[\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)} \]
    3. Taylor expanded in x1 around inf 7.2%

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

        \[\leadsto 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(\color{blue}{x1 \cdot -4} + 6 \cdot {x1}^{2}\right)\right)\right)\right) \]
      2. fma-def7.2%

        \[\leadsto 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 + \color{blue}{\mathsf{fma}\left(x1, -4, 6 \cdot {x1}^{2}\right)}\right)\right)\right) \]
      3. *-commutative7.2%

        \[\leadsto 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 + \mathsf{fma}\left(x1, -4, \color{blue}{{x1}^{2} \cdot 6}\right)\right)\right)\right) \]
      4. unpow27.2%

        \[\leadsto 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 + \mathsf{fma}\left(x1, -4, \color{blue}{\left(x1 \cdot x1\right)} \cdot 6\right)\right)\right)\right) \]
    5. Simplified7.2%

      \[\leadsto 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 + \color{blue}{\mathsf{fma}\left(x1, -4, \left(x1 \cdot x1\right) \cdot 6\right)}\right)\right)\right) \]
    6. Taylor expanded in x1 around inf 8.7%

      \[\leadsto 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, \color{blue}{9 \cdot x1}, \mathsf{fma}\left(x1, x1, 1\right) \cdot \left(x1 + \mathsf{fma}\left(x1, -4, \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right) \]
    7. Step-by-step derivation
      1. *-commutative8.7%

        \[\leadsto 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, \color{blue}{x1 \cdot 9}, \mathsf{fma}\left(x1, x1, 1\right) \cdot \left(x1 + \mathsf{fma}\left(x1, -4, \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right) \]
    8. Simplified8.7%

      \[\leadsto 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, \color{blue}{x1 \cdot 9}, \mathsf{fma}\left(x1, x1, 1\right) \cdot \left(x1 + \mathsf{fma}\left(x1, -4, \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right) \]
    9. Taylor expanded in x1 around 0 100.0%

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

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

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

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

Alternative 5: 92.4% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 \cdot \left(x1 \cdot 3\right)\\ t_1 := x1 \cdot x1 + 1\\ t_2 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\ t_3 := 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1}\\ t_4 := x1 + x2 \cdot 6\\ \mathbf{if}\;x1 \leq -1.5 \cdot 10^{+247}:\\ \;\;\;\;\frac{\mathsf{fma}\left(x1, x1, \mathsf{log1p}\left(\mathsf{expm1}\left(x2 \cdot \left(x2 \cdot -36\right)\right)\right)\right)}{t_4}\\ \mathbf{elif}\;x1 \leq -3.5 \cdot 10^{+157}:\\ \;\;\;\;x1 + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right) + \left(x2 \cdot -6 + 3 \cdot \left({x1}^{2} \cdot \left(3 - x2 \cdot -2\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq -5.8 \cdot 10^{+102}:\\ \;\;\;\;x1 + \left(t_3 + \left(x1 + 6 \cdot {x1}^{4}\right)\right)\\ \mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;x1 + \left(t_3 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_2 \cdot 4 - 6\right)\right) + t_0 \cdot \left(\left(\mathsf{fma}\left(x1 \cdot 3, x1, 2 \cdot x2\right) - x1\right) \cdot \frac{1}{\mathsf{fma}\left(x1, x1, 1\right)}\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x1 \cdot x1}{t_4}\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (* x1 (* x1 3.0)))
        (t_1 (+ (* x1 x1) 1.0))
        (t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1))
        (t_3 (* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1)))
        (t_4 (+ x1 (* x2 6.0))))
   (if (<= x1 -1.5e+247)
     (/ (fma x1 x1 (log1p (expm1 (* x2 (* x2 -36.0))))) t_4)
     (if (<= x1 -3.5e+157)
       (+
        x1
        (+
         (* x1 (- (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) 2.0))
         (+ (* x2 -6.0) (* 3.0 (* (pow x1 2.0) (- 3.0 (* x2 -2.0)))))))
       (if (<= x1 -5.8e+102)
         (+ x1 (+ t_3 (+ x1 (* 6.0 (pow x1 4.0)))))
         (if (<= x1 1.35e+154)
           (+
            x1
            (+
             t_3
             (+
              x1
              (+
               (* x1 (* x1 x1))
               (+
                (*
                 t_1
                 (+
                  (* (* (* x1 2.0) t_2) (- t_2 3.0))
                  (* (* x1 x1) (- (* t_2 4.0) 6.0))))
                (*
                 t_0
                 (*
                  (- (fma (* x1 3.0) x1 (* 2.0 x2)) x1)
                  (/ 1.0 (fma x1 x1 1.0)))))))))
           (/ (* x1 x1) t_4)))))))
double code(double x1, double x2) {
	double t_0 = x1 * (x1 * 3.0);
	double t_1 = (x1 * x1) + 1.0;
	double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
	double t_3 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1);
	double t_4 = x1 + (x2 * 6.0);
	double tmp;
	if (x1 <= -1.5e+247) {
		tmp = fma(x1, x1, log1p(expm1((x2 * (x2 * -36.0))))) / t_4;
	} else if (x1 <= -3.5e+157) {
		tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + ((x2 * -6.0) + (3.0 * (pow(x1, 2.0) * (3.0 - (x2 * -2.0))))));
	} else if (x1 <= -5.8e+102) {
		tmp = x1 + (t_3 + (x1 + (6.0 * pow(x1, 4.0))));
	} else if (x1 <= 1.35e+154) {
		tmp = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * ((fma((x1 * 3.0), x1, (2.0 * x2)) - x1) * (1.0 / fma(x1, x1, 1.0))))))));
	} else {
		tmp = (x1 * x1) / t_4;
	}
	return tmp;
}
function code(x1, x2)
	t_0 = Float64(x1 * Float64(x1 * 3.0))
	t_1 = Float64(Float64(x1 * x1) + 1.0)
	t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1)
	t_3 = Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1))
	t_4 = Float64(x1 + Float64(x2 * 6.0))
	tmp = 0.0
	if (x1 <= -1.5e+247)
		tmp = Float64(fma(x1, x1, log1p(expm1(Float64(x2 * Float64(x2 * -36.0))))) / t_4);
	elseif (x1 <= -3.5e+157)
		tmp = Float64(x1 + Float64(Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 2.0)) + Float64(Float64(x2 * -6.0) + Float64(3.0 * Float64((x1 ^ 2.0) * Float64(3.0 - Float64(x2 * -2.0)))))));
	elseif (x1 <= -5.8e+102)
		tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(6.0 * (x1 ^ 4.0)))));
	elseif (x1 <= 1.35e+154)
		tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(t_0 * Float64(Float64(fma(Float64(x1 * 3.0), x1, Float64(2.0 * x2)) - x1) * Float64(1.0 / fma(x1, x1, 1.0)))))))));
	else
		tmp = Float64(Float64(x1 * x1) / t_4);
	end
	return tmp
end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(x2 * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.5e+247], N[(N[(x1 * x1 + N[Log[1 + N[(Exp[N[(x2 * N[(x2 * -36.0), $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t$95$4), $MachinePrecision], If[LessEqual[x1, -3.5e+157], N[(x1 + N[(N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] + N[(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], If[LessEqual[x1, -5.8e+102], N[(x1 + N[(t$95$3 + N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 + N[(t$95$3 + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(N[(N[(N[(x1 * 3.0), $MachinePrecision] * x1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] * N[(1.0 / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x1 * x1), $MachinePrecision] / t$95$4), $MachinePrecision]]]]]]]]]]
\begin{array}{l}

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

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

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

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

\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1}{t_4}\\


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

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

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

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

        \[\leadsto \frac{x1 \cdot x1 - \color{blue}{\left(x2 \cdot -6\right)} \cdot \left(-6 \cdot x2\right)}{x1 - -6 \cdot x2} \]
      3. *-commutative0.0%

        \[\leadsto \frac{x1 \cdot x1 - \left(x2 \cdot -6\right) \cdot \color{blue}{\left(x2 \cdot -6\right)}}{x1 - -6 \cdot x2} \]
      4. *-commutative0.0%

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{\left(x2 \cdot x2\right) \cdot \left(-6 \cdot -6\right)}\right)}{x1 - x2 \cdot -6} \]
      3. unpow213.3%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{{x2}^{2}} \cdot \left(-6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      4. distribute-rgt-neg-in13.3%

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

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

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \left(-\color{blue}{36}\right)\right)}{x1 - x2 \cdot -6} \]
      7. metadata-eval13.3%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \color{blue}{-36}\right)}{x1 - x2 \cdot -6} \]
      8. sub-neg13.3%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{\color{blue}{x1 + \left(-x2 \cdot -6\right)}} \]
      9. distribute-rgt-neg-in13.3%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + \color{blue}{x2 \cdot \left(--6\right)}} \]
      10. metadata-eval13.3%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot \color{blue}{6}} \]
    7. Simplified13.3%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot 6}} \]
    8. Step-by-step derivation
      1. log1p-expm1-u66.7%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\left(x2 \cdot x2\right) \cdot -36\right)\right)}\right)}{x1 + x2 \cdot 6} \]
      2. associate-*l*66.7%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \mathsf{log1p}\left(\mathsf{expm1}\left(\color{blue}{x2 \cdot \left(x2 \cdot -36\right)}\right)\right)\right)}{x1 + x2 \cdot 6} \]
    9. Applied egg-rr66.7%

      \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(x2 \cdot \left(x2 \cdot -36\right)\right)\right)}\right)}{x1 + x2 \cdot 6} \]

    if -1.5e247 < x1 < -3.50000000000000002e157

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

    if -3.50000000000000002e157 < x1 < -5.8000000000000005e102

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

      \[\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. *-commutative83.3%

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

      \[\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.8000000000000005e102 < x1 < 1.35000000000000003e154

    1. Initial program 98.7%

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

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

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

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

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

    if 1.35000000000000003e154 < x1

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x1, x1, -\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)\right)}}{x1 - x2 \cdot -6} \]
      2. swap-sqr90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{\left(x2 \cdot x2\right) \cdot \left(-6 \cdot -6\right)}\right)}{x1 - x2 \cdot -6} \]
      3. unpow290.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{{x2}^{2}} \cdot \left(-6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      4. distribute-rgt-neg-in90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \color{blue}{{x2}^{2} \cdot \left(--6 \cdot -6\right)}\right)}{x1 - x2 \cdot -6} \]
      5. unpow290.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \color{blue}{\left(x2 \cdot x2\right)} \cdot \left(--6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      6. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \left(-\color{blue}{36}\right)\right)}{x1 - x2 \cdot -6} \]
      7. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \color{blue}{-36}\right)}{x1 - x2 \cdot -6} \]
      8. sub-neg90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{\color{blue}{x1 + \left(-x2 \cdot -6\right)}} \]
      9. distribute-rgt-neg-in90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + \color{blue}{x2 \cdot \left(--6\right)}} \]
      10. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot \color{blue}{6}} \]
    7. Simplified90.0%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot 6}} \]
    8. Taylor expanded in x1 around inf 93.3%

      \[\leadsto \frac{\color{blue}{{x1}^{2}}}{x1 + x2 \cdot 6} \]
    9. Step-by-step derivation
      1. unpow293.3%

        \[\leadsto \frac{\color{blue}{x1 \cdot x1}}{x1 + x2 \cdot 6} \]
    10. Simplified93.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -1.5 \cdot 10^{+247}:\\ \;\;\;\;\frac{\mathsf{fma}\left(x1, x1, \mathsf{log1p}\left(\mathsf{expm1}\left(x2 \cdot \left(x2 \cdot -36\right)\right)\right)\right)}{x1 + x2 \cdot 6}\\ \mathbf{elif}\;x1 \leq -3.5 \cdot 10^{+157}:\\ \;\;\;\;x1 + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right) + \left(x2 \cdot -6 + 3 \cdot \left({x1}^{2} \cdot \left(3 - x2 \cdot -2\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq -5.8 \cdot 10^{+102}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + 6 \cdot {x1}^{4}\right)\right)\\ \mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(\left(x1 \cdot x1 + 1\right) \cdot \left(\left(\left(x1 \cdot 2\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} \cdot 4 - 6\right)\right) + \left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \left(\left(\mathsf{fma}\left(x1 \cdot 3, x1, 2 \cdot x2\right) - x1\right) \cdot \frac{1}{\mathsf{fma}\left(x1, x1, 1\right)}\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x1 \cdot x1}{x1 + x2 \cdot 6}\\ \end{array} \]

Alternative 6: 92.4% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 \cdot \left(x1 \cdot 3\right)\\ t_1 := x1 \cdot x1 + 1\\ t_2 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\ t_3 := 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1}\\ t_4 := x1 + x2 \cdot 6\\ \mathbf{if}\;x1 \leq -7.2 \cdot 10^{+252}:\\ \;\;\;\;\frac{\mathsf{fma}\left(x1, x1, \mathsf{log1p}\left(\mathsf{expm1}\left(x2 \cdot \left(x2 \cdot -36\right)\right)\right)\right)}{t_4}\\ \mathbf{elif}\;x1 \leq -3.5 \cdot 10^{+157}:\\ \;\;\;\;x1 + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right) + \left(x2 \cdot -6 + 3 \cdot \left({x1}^{2} \cdot \left(3 - x2 \cdot -2\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq -1 \cdot 10^{+103}:\\ \;\;\;\;x1 + \left(t_3 + \left(x1 + 6 \cdot {x1}^{4}\right)\right)\\ \mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;x1 + \left(\left(x1 + \left(\left(t_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_2 \cdot 4 - 6\right)\right) + t_0 \cdot t_2\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + t_3\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x1 \cdot x1}{t_4}\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (* x1 (* x1 3.0)))
        (t_1 (+ (* x1 x1) 1.0))
        (t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1))
        (t_3 (* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1)))
        (t_4 (+ x1 (* x2 6.0))))
   (if (<= x1 -7.2e+252)
     (/ (fma x1 x1 (log1p (expm1 (* x2 (* x2 -36.0))))) t_4)
     (if (<= x1 -3.5e+157)
       (+
        x1
        (+
         (* x1 (- (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) 2.0))
         (+ (* x2 -6.0) (* 3.0 (* (pow x1 2.0) (- 3.0 (* x2 -2.0)))))))
       (if (<= x1 -1e+103)
         (+ x1 (+ t_3 (+ x1 (* 6.0 (pow x1 4.0)))))
         (if (<= x1 1.35e+154)
           (+
            x1
            (+
             (+
              x1
              (+
               (+
                (*
                 t_1
                 (+
                  (* (* (* x1 2.0) t_2) (- t_2 3.0))
                  (* (* x1 x1) (- (* t_2 4.0) 6.0))))
                (* t_0 t_2))
               (* x1 (* x1 x1))))
             t_3))
           (/ (* x1 x1) t_4)))))))
double code(double x1, double x2) {
	double t_0 = x1 * (x1 * 3.0);
	double t_1 = (x1 * x1) + 1.0;
	double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
	double t_3 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1);
	double t_4 = x1 + (x2 * 6.0);
	double tmp;
	if (x1 <= -7.2e+252) {
		tmp = fma(x1, x1, log1p(expm1((x2 * (x2 * -36.0))))) / t_4;
	} else if (x1 <= -3.5e+157) {
		tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + ((x2 * -6.0) + (3.0 * (pow(x1, 2.0) * (3.0 - (x2 * -2.0))))));
	} else if (x1 <= -1e+103) {
		tmp = x1 + (t_3 + (x1 + (6.0 * pow(x1, 4.0))));
	} else if (x1 <= 1.35e+154) {
		tmp = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + t_3);
	} else {
		tmp = (x1 * x1) / t_4;
	}
	return tmp;
}
function code(x1, x2)
	t_0 = Float64(x1 * Float64(x1 * 3.0))
	t_1 = Float64(Float64(x1 * x1) + 1.0)
	t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1)
	t_3 = Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1))
	t_4 = Float64(x1 + Float64(x2 * 6.0))
	tmp = 0.0
	if (x1 <= -7.2e+252)
		tmp = Float64(fma(x1, x1, log1p(expm1(Float64(x2 * Float64(x2 * -36.0))))) / t_4);
	elseif (x1 <= -3.5e+157)
		tmp = Float64(x1 + Float64(Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 2.0)) + Float64(Float64(x2 * -6.0) + Float64(3.0 * Float64((x1 ^ 2.0) * Float64(3.0 - Float64(x2 * -2.0)))))));
	elseif (x1 <= -1e+103)
		tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(6.0 * (x1 ^ 4.0)))));
	elseif (x1 <= 1.35e+154)
		tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(t_0 * t_2)) + Float64(x1 * Float64(x1 * x1)))) + t_3));
	else
		tmp = Float64(Float64(x1 * x1) / t_4);
	end
	return tmp
end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(x2 * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -7.2e+252], N[(N[(x1 * x1 + N[Log[1 + N[(Exp[N[(x2 * N[(x2 * -36.0), $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t$95$4), $MachinePrecision], If[LessEqual[x1, -3.5e+157], N[(x1 + N[(N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] + N[(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], If[LessEqual[x1, -1e+103], N[(x1 + N[(t$95$3 + N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision], N[(N[(x1 * x1), $MachinePrecision] / t$95$4), $MachinePrecision]]]]]]]]]]
\begin{array}{l}

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

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

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

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

\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1}{t_4}\\


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

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

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

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

        \[\leadsto \frac{x1 \cdot x1 - \color{blue}{\left(x2 \cdot -6\right)} \cdot \left(-6 \cdot x2\right)}{x1 - -6 \cdot x2} \]
      3. *-commutative0.0%

        \[\leadsto \frac{x1 \cdot x1 - \left(x2 \cdot -6\right) \cdot \color{blue}{\left(x2 \cdot -6\right)}}{x1 - -6 \cdot x2} \]
      4. *-commutative0.0%

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{\left(x2 \cdot x2\right) \cdot \left(-6 \cdot -6\right)}\right)}{x1 - x2 \cdot -6} \]
      3. unpow213.3%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{{x2}^{2}} \cdot \left(-6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      4. distribute-rgt-neg-in13.3%

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

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

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \left(-\color{blue}{36}\right)\right)}{x1 - x2 \cdot -6} \]
      7. metadata-eval13.3%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \color{blue}{-36}\right)}{x1 - x2 \cdot -6} \]
      8. sub-neg13.3%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{\color{blue}{x1 + \left(-x2 \cdot -6\right)}} \]
      9. distribute-rgt-neg-in13.3%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + \color{blue}{x2 \cdot \left(--6\right)}} \]
      10. metadata-eval13.3%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot \color{blue}{6}} \]
    7. Simplified13.3%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot 6}} \]
    8. Step-by-step derivation
      1. log1p-expm1-u66.7%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\left(x2 \cdot x2\right) \cdot -36\right)\right)}\right)}{x1 + x2 \cdot 6} \]
      2. associate-*l*66.7%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \mathsf{log1p}\left(\mathsf{expm1}\left(\color{blue}{x2 \cdot \left(x2 \cdot -36\right)}\right)\right)\right)}{x1 + x2 \cdot 6} \]
    9. Applied egg-rr66.7%

      \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(x2 \cdot \left(x2 \cdot -36\right)\right)\right)}\right)}{x1 + x2 \cdot 6} \]

    if -7.1999999999999997e252 < x1 < -3.50000000000000002e157

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

    if -3.50000000000000002e157 < x1 < -1e103

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

      \[\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. *-commutative83.3%

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

      \[\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 -1e103 < x1 < 1.35000000000000003e154

    1. Initial program 98.7%

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

    if 1.35000000000000003e154 < x1

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x1, x1, -\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)\right)}}{x1 - x2 \cdot -6} \]
      2. swap-sqr90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{\left(x2 \cdot x2\right) \cdot \left(-6 \cdot -6\right)}\right)}{x1 - x2 \cdot -6} \]
      3. unpow290.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{{x2}^{2}} \cdot \left(-6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      4. distribute-rgt-neg-in90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \color{blue}{{x2}^{2} \cdot \left(--6 \cdot -6\right)}\right)}{x1 - x2 \cdot -6} \]
      5. unpow290.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \color{blue}{\left(x2 \cdot x2\right)} \cdot \left(--6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      6. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \left(-\color{blue}{36}\right)\right)}{x1 - x2 \cdot -6} \]
      7. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \color{blue}{-36}\right)}{x1 - x2 \cdot -6} \]
      8. sub-neg90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{\color{blue}{x1 + \left(-x2 \cdot -6\right)}} \]
      9. distribute-rgt-neg-in90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + \color{blue}{x2 \cdot \left(--6\right)}} \]
      10. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot \color{blue}{6}} \]
    7. Simplified90.0%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot 6}} \]
    8. Taylor expanded in x1 around inf 93.3%

      \[\leadsto \frac{\color{blue}{{x1}^{2}}}{x1 + x2 \cdot 6} \]
    9. Step-by-step derivation
      1. unpow293.3%

        \[\leadsto \frac{\color{blue}{x1 \cdot x1}}{x1 + x2 \cdot 6} \]
    10. Simplified93.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -7.2 \cdot 10^{+252}:\\ \;\;\;\;\frac{\mathsf{fma}\left(x1, x1, \mathsf{log1p}\left(\mathsf{expm1}\left(x2 \cdot \left(x2 \cdot -36\right)\right)\right)\right)}{x1 + x2 \cdot 6}\\ \mathbf{elif}\;x1 \leq -3.5 \cdot 10^{+157}:\\ \;\;\;\;x1 + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right) + \left(x2 \cdot -6 + 3 \cdot \left({x1}^{2} \cdot \left(3 - x2 \cdot -2\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq -1 \cdot 10^{+103}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + 6 \cdot {x1}^{4}\right)\right)\\ \mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;x1 + \left(\left(x1 + \left(\left(\left(x1 \cdot x1 + 1\right) \cdot \left(\left(\left(x1 \cdot 2\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} \cdot 4 - 6\right)\right) + \left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x1 \cdot x1}{x1 + x2 \cdot 6}\\ \end{array} \]

Alternative 7: 92.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 := 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1}\\ t_3 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\ \mathbf{if}\;x1 \leq -3.5 \cdot 10^{+157}:\\ \;\;\;\;x1 + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right) + \left(x2 \cdot -6 + 3 \cdot \left({x1}^{2} \cdot \left(3 - x2 \cdot -2\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq -5.5 \cdot 10^{+102}:\\ \;\;\;\;x1 + \left(t_2 + \left(x1 + 6 \cdot {x1}^{4}\right)\right)\\ \mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;x1 + \left(\left(x1 + \left(\left(t_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_3\right) \cdot \left(t_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_3 \cdot 4 - 6\right)\right) + t_0 \cdot t_3\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + t_2\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x1 \cdot x1}{x1 + x2 \cdot 6}\\ \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 (* 2.0 x2)) x1) t_1)))
        (t_3 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
   (if (<= x1 -3.5e+157)
     (+
      x1
      (+
       (* x1 (- (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) 2.0))
       (+ (* x2 -6.0) (* 3.0 (* (pow x1 2.0) (- 3.0 (* x2 -2.0)))))))
     (if (<= x1 -5.5e+102)
       (+ x1 (+ t_2 (+ x1 (* 6.0 (pow x1 4.0)))))
       (if (<= x1 1.35e+154)
         (+
          x1
          (+
           (+
            x1
            (+
             (+
              (*
               t_1
               (+
                (* (* (* x1 2.0) t_3) (- t_3 3.0))
                (* (* x1 x1) (- (* t_3 4.0) 6.0))))
              (* t_0 t_3))
             (* x1 (* x1 x1))))
           t_2))
         (/ (* x1 x1) (+ x1 (* x2 6.0))))))))
double code(double x1, double x2) {
	double t_0 = x1 * (x1 * 3.0);
	double t_1 = (x1 * x1) + 1.0;
	double t_2 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1);
	double t_3 = ((t_0 + (2.0 * x2)) - x1) / t_1;
	double tmp;
	if (x1 <= -3.5e+157) {
		tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + ((x2 * -6.0) + (3.0 * (pow(x1, 2.0) * (3.0 - (x2 * -2.0))))));
	} else if (x1 <= -5.5e+102) {
		tmp = x1 + (t_2 + (x1 + (6.0 * pow(x1, 4.0))));
	} else if (x1 <= 1.35e+154) {
		tmp = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_0 * t_3)) + (x1 * (x1 * x1)))) + t_2);
	} else {
		tmp = (x1 * x1) / (x1 + (x2 * 6.0));
	}
	return tmp;
}
real(8) function code(x1, x2)
    real(8), intent (in) :: x1
    real(8), intent (in) :: x2
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_0 = x1 * (x1 * 3.0d0)
    t_1 = (x1 * x1) + 1.0d0
    t_2 = 3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)
    t_3 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
    if (x1 <= (-3.5d+157)) then
        tmp = x1 + ((x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) - 2.0d0)) + ((x2 * (-6.0d0)) + (3.0d0 * ((x1 ** 2.0d0) * (3.0d0 - (x2 * (-2.0d0)))))))
    else if (x1 <= (-5.5d+102)) then
        tmp = x1 + (t_2 + (x1 + (6.0d0 * (x1 ** 4.0d0))))
    else if (x1 <= 1.35d+154) then
        tmp = x1 + ((x1 + (((t_1 * ((((x1 * 2.0d0) * t_3) * (t_3 - 3.0d0)) + ((x1 * x1) * ((t_3 * 4.0d0) - 6.0d0)))) + (t_0 * t_3)) + (x1 * (x1 * x1)))) + t_2)
    else
        tmp = (x1 * x1) / (x1 + (x2 * 6.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 - (2.0 * x2)) - x1) / t_1);
	double t_3 = ((t_0 + (2.0 * x2)) - x1) / t_1;
	double tmp;
	if (x1 <= -3.5e+157) {
		tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + ((x2 * -6.0) + (3.0 * (Math.pow(x1, 2.0) * (3.0 - (x2 * -2.0))))));
	} else if (x1 <= -5.5e+102) {
		tmp = x1 + (t_2 + (x1 + (6.0 * Math.pow(x1, 4.0))));
	} else if (x1 <= 1.35e+154) {
		tmp = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_0 * t_3)) + (x1 * (x1 * x1)))) + t_2);
	} else {
		tmp = (x1 * x1) / (x1 + (x2 * 6.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 - (2.0 * x2)) - x1) / t_1)
	t_3 = ((t_0 + (2.0 * x2)) - x1) / t_1
	tmp = 0
	if x1 <= -3.5e+157:
		tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + ((x2 * -6.0) + (3.0 * (math.pow(x1, 2.0) * (3.0 - (x2 * -2.0))))))
	elif x1 <= -5.5e+102:
		tmp = x1 + (t_2 + (x1 + (6.0 * math.pow(x1, 4.0))))
	elif x1 <= 1.35e+154:
		tmp = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_0 * t_3)) + (x1 * (x1 * x1)))) + t_2)
	else:
		tmp = (x1 * x1) / (x1 + (x2 * 6.0))
	return tmp
function code(x1, x2)
	t_0 = Float64(x1 * Float64(x1 * 3.0))
	t_1 = Float64(Float64(x1 * x1) + 1.0)
	t_2 = Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1))
	t_3 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1)
	tmp = 0.0
	if (x1 <= -3.5e+157)
		tmp = Float64(x1 + Float64(Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 2.0)) + Float64(Float64(x2 * -6.0) + Float64(3.0 * Float64((x1 ^ 2.0) * Float64(3.0 - Float64(x2 * -2.0)))))));
	elseif (x1 <= -5.5e+102)
		tmp = Float64(x1 + Float64(t_2 + Float64(x1 + Float64(6.0 * (x1 ^ 4.0)))));
	elseif (x1 <= 1.35e+154)
		tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)))) + Float64(t_0 * t_3)) + Float64(x1 * Float64(x1 * x1)))) + t_2));
	else
		tmp = Float64(Float64(x1 * x1) / Float64(x1 + Float64(x2 * 6.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 - (2.0 * x2)) - x1) / t_1);
	t_3 = ((t_0 + (2.0 * x2)) - x1) / t_1;
	tmp = 0.0;
	if (x1 <= -3.5e+157)
		tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + ((x2 * -6.0) + (3.0 * ((x1 ^ 2.0) * (3.0 - (x2 * -2.0))))));
	elseif (x1 <= -5.5e+102)
		tmp = x1 + (t_2 + (x1 + (6.0 * (x1 ^ 4.0))));
	elseif (x1 <= 1.35e+154)
		tmp = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_0 * t_3)) + (x1 * (x1 * x1)))) + t_2);
	else
		tmp = (x1 * x1) / (x1 + (x2 * 6.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[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[x1, -3.5e+157], N[(x1 + N[(N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] + N[(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], If[LessEqual[x1, -5.5e+102], N[(x1 + N[(t$95$2 + N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision], N[(N[(x1 * x1), $MachinePrecision] / N[(x1 + N[(x2 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

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

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

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


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

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

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

    if -3.50000000000000002e157 < 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 83.3%

      \[\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. *-commutative83.3%

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

      \[\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 98.7%

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

    if 1.35000000000000003e154 < x1

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x1, x1, -\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)\right)}}{x1 - x2 \cdot -6} \]
      2. swap-sqr90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{\left(x2 \cdot x2\right) \cdot \left(-6 \cdot -6\right)}\right)}{x1 - x2 \cdot -6} \]
      3. unpow290.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{{x2}^{2}} \cdot \left(-6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      4. distribute-rgt-neg-in90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \color{blue}{{x2}^{2} \cdot \left(--6 \cdot -6\right)}\right)}{x1 - x2 \cdot -6} \]
      5. unpow290.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \color{blue}{\left(x2 \cdot x2\right)} \cdot \left(--6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      6. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \left(-\color{blue}{36}\right)\right)}{x1 - x2 \cdot -6} \]
      7. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \color{blue}{-36}\right)}{x1 - x2 \cdot -6} \]
      8. sub-neg90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{\color{blue}{x1 + \left(-x2 \cdot -6\right)}} \]
      9. distribute-rgt-neg-in90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + \color{blue}{x2 \cdot \left(--6\right)}} \]
      10. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot \color{blue}{6}} \]
    7. Simplified90.0%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot 6}} \]
    8. Taylor expanded in x1 around inf 93.3%

      \[\leadsto \frac{\color{blue}{{x1}^{2}}}{x1 + x2 \cdot 6} \]
    9. Step-by-step derivation
      1. unpow293.3%

        \[\leadsto \frac{\color{blue}{x1 \cdot x1}}{x1 + x2 \cdot 6} \]
    10. Simplified93.3%

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

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

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

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

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

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


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

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

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

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

        \[\leadsto \frac{x1 \cdot x1 - \color{blue}{\left(x2 \cdot -6\right)} \cdot \left(-6 \cdot x2\right)}{x1 - -6 \cdot x2} \]
      3. *-commutative0.0%

        \[\leadsto \frac{x1 \cdot x1 - \left(x2 \cdot -6\right) \cdot \color{blue}{\left(x2 \cdot -6\right)}}{x1 - -6 \cdot x2} \]
      4. *-commutative0.0%

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x1, x1, -\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)\right)}}{x1 - x2 \cdot -6} \]
      2. swap-sqr13.2%

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

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{{x2}^{2}} \cdot \left(-6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      4. distribute-rgt-neg-in13.2%

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

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

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \left(-\color{blue}{36}\right)\right)}{x1 - x2 \cdot -6} \]
      7. metadata-eval13.2%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \color{blue}{-36}\right)}{x1 - x2 \cdot -6} \]
      8. sub-neg13.2%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{\color{blue}{x1 + \left(-x2 \cdot -6\right)}} \]
      9. distribute-rgt-neg-in13.2%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + \color{blue}{x2 \cdot \left(--6\right)}} \]
      10. metadata-eval13.2%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot \color{blue}{6}} \]
    7. Simplified13.2%

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

      \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{\color{blue}{6 \cdot x2}} \]
    9. Step-by-step derivation
      1. *-commutative42.1%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{\color{blue}{x2 \cdot 6}} \]
    10. Simplified42.1%

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

    if -6.19999999999999973e102 < x1 < 1.35000000000000003e154

    1. Initial program 98.7%

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

    if 1.35000000000000003e154 < x1

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x1, x1, -\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)\right)}}{x1 - x2 \cdot -6} \]
      2. swap-sqr90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{\left(x2 \cdot x2\right) \cdot \left(-6 \cdot -6\right)}\right)}{x1 - x2 \cdot -6} \]
      3. unpow290.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{{x2}^{2}} \cdot \left(-6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      4. distribute-rgt-neg-in90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \color{blue}{{x2}^{2} \cdot \left(--6 \cdot -6\right)}\right)}{x1 - x2 \cdot -6} \]
      5. unpow290.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \color{blue}{\left(x2 \cdot x2\right)} \cdot \left(--6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      6. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \left(-\color{blue}{36}\right)\right)}{x1 - x2 \cdot -6} \]
      7. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \color{blue}{-36}\right)}{x1 - x2 \cdot -6} \]
      8. sub-neg90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{\color{blue}{x1 + \left(-x2 \cdot -6\right)}} \]
      9. distribute-rgt-neg-in90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + \color{blue}{x2 \cdot \left(--6\right)}} \]
      10. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot \color{blue}{6}} \]
    7. Simplified90.0%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot 6}} \]
    8. Taylor expanded in x1 around inf 93.3%

      \[\leadsto \frac{\color{blue}{{x1}^{2}}}{x1 + x2 \cdot 6} \]
    9. Step-by-step derivation
      1. unpow293.3%

        \[\leadsto \frac{\color{blue}{x1 \cdot x1}}{x1 + x2 \cdot 6} \]
    10. Simplified93.3%

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

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

Alternative 9: 84.8% accurate, 1.1× speedup?

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

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

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

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

\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1}{t_1}\\


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

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

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

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

        \[\leadsto \frac{x1 \cdot x1 - \color{blue}{\left(x2 \cdot -6\right)} \cdot \left(-6 \cdot x2\right)}{x1 - -6 \cdot x2} \]
      3. *-commutative0.0%

        \[\leadsto \frac{x1 \cdot x1 - \left(x2 \cdot -6\right) \cdot \color{blue}{\left(x2 \cdot -6\right)}}{x1 - -6 \cdot x2} \]
      4. *-commutative0.0%

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x1, x1, -\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)\right)}}{x1 - x2 \cdot -6} \]
      2. swap-sqr13.2%

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

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{{x2}^{2}} \cdot \left(-6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      4. distribute-rgt-neg-in13.2%

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

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

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \left(-\color{blue}{36}\right)\right)}{x1 - x2 \cdot -6} \]
      7. metadata-eval13.2%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \color{blue}{-36}\right)}{x1 - x2 \cdot -6} \]
      8. sub-neg13.2%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{\color{blue}{x1 + \left(-x2 \cdot -6\right)}} \]
      9. distribute-rgt-neg-in13.2%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + \color{blue}{x2 \cdot \left(--6\right)}} \]
      10. metadata-eval13.2%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot \color{blue}{6}} \]
    7. Simplified13.2%

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

      \[\leadsto \frac{\color{blue}{-36 \cdot {x2}^{2}}}{x1 + x2 \cdot 6} \]
    9. Step-by-step derivation
      1. *-commutative14.8%

        \[\leadsto \frac{\color{blue}{{x2}^{2} \cdot -36}}{x1 + x2 \cdot 6} \]
      2. unpow214.8%

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

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

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

    if -3.80000000000000039e109 < x1 < 1.99999999999999986e-34

    1. Initial program 98.6%

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

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

    if 1.99999999999999986e-34 < x1 < 1.35000000000000003e154

    1. Initial program 99.1%

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

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

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

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

    if 1.35000000000000003e154 < x1

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x1, x1, -\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)\right)}}{x1 - x2 \cdot -6} \]
      2. swap-sqr90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{\left(x2 \cdot x2\right) \cdot \left(-6 \cdot -6\right)}\right)}{x1 - x2 \cdot -6} \]
      3. unpow290.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{{x2}^{2}} \cdot \left(-6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      4. distribute-rgt-neg-in90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \color{blue}{{x2}^{2} \cdot \left(--6 \cdot -6\right)}\right)}{x1 - x2 \cdot -6} \]
      5. unpow290.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \color{blue}{\left(x2 \cdot x2\right)} \cdot \left(--6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      6. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \left(-\color{blue}{36}\right)\right)}{x1 - x2 \cdot -6} \]
      7. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \color{blue}{-36}\right)}{x1 - x2 \cdot -6} \]
      8. sub-neg90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{\color{blue}{x1 + \left(-x2 \cdot -6\right)}} \]
      9. distribute-rgt-neg-in90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + \color{blue}{x2 \cdot \left(--6\right)}} \]
      10. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot \color{blue}{6}} \]
    7. Simplified90.0%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot 6}} \]
    8. Taylor expanded in x1 around inf 93.3%

      \[\leadsto \frac{\color{blue}{{x1}^{2}}}{x1 + x2 \cdot 6} \]
    9. Step-by-step derivation
      1. unpow293.3%

        \[\leadsto \frac{\color{blue}{x1 \cdot x1}}{x1 + x2 \cdot 6} \]
    10. Simplified93.3%

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

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

Alternative 10: 89.4% accurate, 1.1× speedup?

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

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

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

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

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


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

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

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

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

        \[\leadsto \frac{x1 \cdot x1 - \color{blue}{\left(x2 \cdot -6\right)} \cdot \left(-6 \cdot x2\right)}{x1 - -6 \cdot x2} \]
      3. *-commutative0.0%

        \[\leadsto \frac{x1 \cdot x1 - \left(x2 \cdot -6\right) \cdot \color{blue}{\left(x2 \cdot -6\right)}}{x1 - -6 \cdot x2} \]
      4. *-commutative0.0%

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x1, x1, -\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)\right)}}{x1 - x2 \cdot -6} \]
      2. swap-sqr13.2%

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

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{{x2}^{2}} \cdot \left(-6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      4. distribute-rgt-neg-in13.2%

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

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

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \left(-\color{blue}{36}\right)\right)}{x1 - x2 \cdot -6} \]
      7. metadata-eval13.2%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \color{blue}{-36}\right)}{x1 - x2 \cdot -6} \]
      8. sub-neg13.2%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{\color{blue}{x1 + \left(-x2 \cdot -6\right)}} \]
      9. distribute-rgt-neg-in13.2%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + \color{blue}{x2 \cdot \left(--6\right)}} \]
      10. metadata-eval13.2%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot \color{blue}{6}} \]
    7. Simplified13.2%

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

      \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{\color{blue}{6 \cdot x2}} \]
    9. Step-by-step derivation
      1. *-commutative42.1%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{\color{blue}{x2 \cdot 6}} \]
    10. Simplified42.1%

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

    if -5.8000000000000005e102 < x1 < 9.99999999999999928e-35

    1. Initial program 98.6%

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

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

    if 9.99999999999999928e-35 < x1 < 1.35000000000000003e154

    1. Initial program 99.1%

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

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

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

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

    if 1.35000000000000003e154 < x1

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x1, x1, -\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)\right)}}{x1 - x2 \cdot -6} \]
      2. swap-sqr90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{\left(x2 \cdot x2\right) \cdot \left(-6 \cdot -6\right)}\right)}{x1 - x2 \cdot -6} \]
      3. unpow290.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{{x2}^{2}} \cdot \left(-6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      4. distribute-rgt-neg-in90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \color{blue}{{x2}^{2} \cdot \left(--6 \cdot -6\right)}\right)}{x1 - x2 \cdot -6} \]
      5. unpow290.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \color{blue}{\left(x2 \cdot x2\right)} \cdot \left(--6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      6. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \left(-\color{blue}{36}\right)\right)}{x1 - x2 \cdot -6} \]
      7. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \color{blue}{-36}\right)}{x1 - x2 \cdot -6} \]
      8. sub-neg90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{\color{blue}{x1 + \left(-x2 \cdot -6\right)}} \]
      9. distribute-rgt-neg-in90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + \color{blue}{x2 \cdot \left(--6\right)}} \]
      10. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot \color{blue}{6}} \]
    7. Simplified90.0%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot 6}} \]
    8. Taylor expanded in x1 around inf 93.3%

      \[\leadsto \frac{\color{blue}{{x1}^{2}}}{x1 + x2 \cdot 6} \]
    9. Step-by-step derivation
      1. unpow293.3%

        \[\leadsto \frac{\color{blue}{x1 \cdot x1}}{x1 + x2 \cdot 6} \]
    10. Simplified93.3%

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

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

Alternative 11: 84.0% accurate, 1.1× speedup?

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

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

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

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

\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1}{t_2}\\


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

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

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

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

        \[\leadsto \frac{x1 \cdot x1 - \color{blue}{\left(x2 \cdot -6\right)} \cdot \left(-6 \cdot x2\right)}{x1 - -6 \cdot x2} \]
      3. *-commutative0.0%

        \[\leadsto \frac{x1 \cdot x1 - \left(x2 \cdot -6\right) \cdot \color{blue}{\left(x2 \cdot -6\right)}}{x1 - -6 \cdot x2} \]
      4. *-commutative0.0%

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x1, x1, -\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)\right)}}{x1 - x2 \cdot -6} \]
      2. swap-sqr13.2%

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

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{{x2}^{2}} \cdot \left(-6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      4. distribute-rgt-neg-in13.2%

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

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

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \left(-\color{blue}{36}\right)\right)}{x1 - x2 \cdot -6} \]
      7. metadata-eval13.2%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \color{blue}{-36}\right)}{x1 - x2 \cdot -6} \]
      8. sub-neg13.2%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{\color{blue}{x1 + \left(-x2 \cdot -6\right)}} \]
      9. distribute-rgt-neg-in13.2%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + \color{blue}{x2 \cdot \left(--6\right)}} \]
      10. metadata-eval13.2%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot \color{blue}{6}} \]
    7. Simplified13.2%

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

      \[\leadsto \frac{\color{blue}{-36 \cdot {x2}^{2}}}{x1 + x2 \cdot 6} \]
    9. Step-by-step derivation
      1. *-commutative14.8%

        \[\leadsto \frac{\color{blue}{{x2}^{2} \cdot -36}}{x1 + x2 \cdot 6} \]
      2. unpow214.8%

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

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

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

    if -5.79999999999999975e107 < x1 < 9.99999999999999928e-35

    1. Initial program 98.6%

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

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

    if 9.99999999999999928e-35 < x1 < 1.35000000000000003e154

    1. Initial program 99.1%

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

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

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

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

    if 1.35000000000000003e154 < x1

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x1, x1, -\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)\right)}}{x1 - x2 \cdot -6} \]
      2. swap-sqr90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{\left(x2 \cdot x2\right) \cdot \left(-6 \cdot -6\right)}\right)}{x1 - x2 \cdot -6} \]
      3. unpow290.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{{x2}^{2}} \cdot \left(-6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      4. distribute-rgt-neg-in90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \color{blue}{{x2}^{2} \cdot \left(--6 \cdot -6\right)}\right)}{x1 - x2 \cdot -6} \]
      5. unpow290.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \color{blue}{\left(x2 \cdot x2\right)} \cdot \left(--6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      6. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \left(-\color{blue}{36}\right)\right)}{x1 - x2 \cdot -6} \]
      7. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \color{blue}{-36}\right)}{x1 - x2 \cdot -6} \]
      8. sub-neg90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{\color{blue}{x1 + \left(-x2 \cdot -6\right)}} \]
      9. distribute-rgt-neg-in90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + \color{blue}{x2 \cdot \left(--6\right)}} \]
      10. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot \color{blue}{6}} \]
    7. Simplified90.0%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot 6}} \]
    8. Taylor expanded in x1 around inf 93.3%

      \[\leadsto \frac{\color{blue}{{x1}^{2}}}{x1 + x2 \cdot 6} \]
    9. Step-by-step derivation
      1. unpow293.3%

        \[\leadsto \frac{\color{blue}{x1 \cdot x1}}{x1 + x2 \cdot 6} \]
    10. Simplified93.3%

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

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

Alternative 12: 85.2% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;x1 \leq -3.15 \cdot 10^{-9}:\\
\;\;\;\;t_3\\

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

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

\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1}{t_4}\\


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

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

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

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

        \[\leadsto \frac{x1 \cdot x1 - \color{blue}{\left(x2 \cdot -6\right)} \cdot \left(-6 \cdot x2\right)}{x1 - -6 \cdot x2} \]
      3. *-commutative0.0%

        \[\leadsto \frac{x1 \cdot x1 - \left(x2 \cdot -6\right) \cdot \color{blue}{\left(x2 \cdot -6\right)}}{x1 - -6 \cdot x2} \]
      4. *-commutative0.0%

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x1, x1, -\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)\right)}}{x1 - x2 \cdot -6} \]
      2. swap-sqr13.2%

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

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{{x2}^{2}} \cdot \left(-6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      4. distribute-rgt-neg-in13.2%

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

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

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \left(-\color{blue}{36}\right)\right)}{x1 - x2 \cdot -6} \]
      7. metadata-eval13.2%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \color{blue}{-36}\right)}{x1 - x2 \cdot -6} \]
      8. sub-neg13.2%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{\color{blue}{x1 + \left(-x2 \cdot -6\right)}} \]
      9. distribute-rgt-neg-in13.2%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + \color{blue}{x2 \cdot \left(--6\right)}} \]
      10. metadata-eval13.2%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot \color{blue}{6}} \]
    7. Simplified13.2%

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

      \[\leadsto \frac{\color{blue}{-36 \cdot {x2}^{2}}}{x1 + x2 \cdot 6} \]
    9. Step-by-step derivation
      1. *-commutative14.8%

        \[\leadsto \frac{\color{blue}{{x2}^{2} \cdot -36}}{x1 + x2 \cdot 6} \]
      2. unpow214.8%

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

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

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

    if -5.2000000000000004e105 < x1 < -3.1500000000000001e-9 or 1.00000000000000004e-10 < x1 < 1.35000000000000003e154

    1. Initial program 99.2%

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

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

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

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

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

    if -3.1500000000000001e-9 < x1 < 1.00000000000000004e-10

    1. Initial program 98.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.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) \]

    if 1.35000000000000003e154 < x1

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x1, x1, -\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)\right)}}{x1 - x2 \cdot -6} \]
      2. swap-sqr90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{\left(x2 \cdot x2\right) \cdot \left(-6 \cdot -6\right)}\right)}{x1 - x2 \cdot -6} \]
      3. unpow290.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{{x2}^{2}} \cdot \left(-6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      4. distribute-rgt-neg-in90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \color{blue}{{x2}^{2} \cdot \left(--6 \cdot -6\right)}\right)}{x1 - x2 \cdot -6} \]
      5. unpow290.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \color{blue}{\left(x2 \cdot x2\right)} \cdot \left(--6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      6. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \left(-\color{blue}{36}\right)\right)}{x1 - x2 \cdot -6} \]
      7. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \color{blue}{-36}\right)}{x1 - x2 \cdot -6} \]
      8. sub-neg90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{\color{blue}{x1 + \left(-x2 \cdot -6\right)}} \]
      9. distribute-rgt-neg-in90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + \color{blue}{x2 \cdot \left(--6\right)}} \]
      10. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot \color{blue}{6}} \]
    7. Simplified90.0%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot 6}} \]
    8. Taylor expanded in x1 around inf 93.3%

      \[\leadsto \frac{\color{blue}{{x1}^{2}}}{x1 + x2 \cdot 6} \]
    9. Step-by-step derivation
      1. unpow293.3%

        \[\leadsto \frac{\color{blue}{x1 \cdot x1}}{x1 + x2 \cdot 6} \]
    10. Simplified93.3%

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

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

Alternative 13: 83.1% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;x1 \leq -7.3 \cdot 10^{-6}:\\
\;\;\;\;t_5\\

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

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

\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1}{t_1}\\


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

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

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

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

        \[\leadsto \frac{x1 \cdot x1 - \color{blue}{\left(x2 \cdot -6\right)} \cdot \left(-6 \cdot x2\right)}{x1 - -6 \cdot x2} \]
      3. *-commutative0.0%

        \[\leadsto \frac{x1 \cdot x1 - \left(x2 \cdot -6\right) \cdot \color{blue}{\left(x2 \cdot -6\right)}}{x1 - -6 \cdot x2} \]
      4. *-commutative0.0%

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x1, x1, -\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)\right)}}{x1 - x2 \cdot -6} \]
      2. swap-sqr13.2%

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

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{{x2}^{2}} \cdot \left(-6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      4. distribute-rgt-neg-in13.2%

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

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

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \left(-\color{blue}{36}\right)\right)}{x1 - x2 \cdot -6} \]
      7. metadata-eval13.2%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \color{blue}{-36}\right)}{x1 - x2 \cdot -6} \]
      8. sub-neg13.2%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{\color{blue}{x1 + \left(-x2 \cdot -6\right)}} \]
      9. distribute-rgt-neg-in13.2%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + \color{blue}{x2 \cdot \left(--6\right)}} \]
      10. metadata-eval13.2%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot \color{blue}{6}} \]
    7. Simplified13.2%

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

      \[\leadsto \frac{\color{blue}{-36 \cdot {x2}^{2}}}{x1 + x2 \cdot 6} \]
    9. Step-by-step derivation
      1. *-commutative14.8%

        \[\leadsto \frac{\color{blue}{{x2}^{2} \cdot -36}}{x1 + x2 \cdot 6} \]
      2. unpow214.8%

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

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

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

    if -4.00000000000000036e106 < x1 < -7.30000000000000041e-6 or 1.75 < x1 < 1.35000000000000003e154

    1. Initial program 99.4%

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

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

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

    if -7.30000000000000041e-6 < x1 < 1.75

    1. Initial program 98.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 96.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) \]

    if 1.35000000000000003e154 < x1

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x1, x1, -\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)\right)}}{x1 - x2 \cdot -6} \]
      2. swap-sqr90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{\left(x2 \cdot x2\right) \cdot \left(-6 \cdot -6\right)}\right)}{x1 - x2 \cdot -6} \]
      3. unpow290.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{{x2}^{2}} \cdot \left(-6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      4. distribute-rgt-neg-in90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \color{blue}{{x2}^{2} \cdot \left(--6 \cdot -6\right)}\right)}{x1 - x2 \cdot -6} \]
      5. unpow290.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \color{blue}{\left(x2 \cdot x2\right)} \cdot \left(--6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      6. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \left(-\color{blue}{36}\right)\right)}{x1 - x2 \cdot -6} \]
      7. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \color{blue}{-36}\right)}{x1 - x2 \cdot -6} \]
      8. sub-neg90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{\color{blue}{x1 + \left(-x2 \cdot -6\right)}} \]
      9. distribute-rgt-neg-in90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + \color{blue}{x2 \cdot \left(--6\right)}} \]
      10. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot \color{blue}{6}} \]
    7. Simplified90.0%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot 6}} \]
    8. Taylor expanded in x1 around inf 93.3%

      \[\leadsto \frac{\color{blue}{{x1}^{2}}}{x1 + x2 \cdot 6} \]
    9. Step-by-step derivation
      1. unpow293.3%

        \[\leadsto \frac{\color{blue}{x1 \cdot x1}}{x1 + x2 \cdot 6} \]
    10. Simplified93.3%

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

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

Alternative 14: 81.2% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;x1 \leq -52000000:\\
\;\;\;\;x1 + \left(t_5 + \left(x1 + \left(t_0 + \left(t_6 + t_4 \cdot \left(t_2 + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \left(3 + \left(2 \cdot \frac{x2}{x1 \cdot x1} + \left(\frac{-1}{x1} - \frac{3}{x1 \cdot x1}\right)\right)\right) - 6\right)\right)\right)\right)\right)\right)\\

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

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

\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1}{t_3}\\


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

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

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

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

        \[\leadsto \frac{x1 \cdot x1 - \color{blue}{\left(x2 \cdot -6\right)} \cdot \left(-6 \cdot x2\right)}{x1 - -6 \cdot x2} \]
      3. *-commutative0.0%

        \[\leadsto \frac{x1 \cdot x1 - \left(x2 \cdot -6\right) \cdot \color{blue}{\left(x2 \cdot -6\right)}}{x1 - -6 \cdot x2} \]
      4. *-commutative0.0%

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x1, x1, -\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)\right)}}{x1 - x2 \cdot -6} \]
      2. swap-sqr13.2%

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

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{{x2}^{2}} \cdot \left(-6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      4. distribute-rgt-neg-in13.2%

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

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

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \left(-\color{blue}{36}\right)\right)}{x1 - x2 \cdot -6} \]
      7. metadata-eval13.2%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \color{blue}{-36}\right)}{x1 - x2 \cdot -6} \]
      8. sub-neg13.2%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{\color{blue}{x1 + \left(-x2 \cdot -6\right)}} \]
      9. distribute-rgt-neg-in13.2%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + \color{blue}{x2 \cdot \left(--6\right)}} \]
      10. metadata-eval13.2%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot \color{blue}{6}} \]
    7. Simplified13.2%

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

      \[\leadsto \frac{\color{blue}{-36 \cdot {x2}^{2}}}{x1 + x2 \cdot 6} \]
    9. Step-by-step derivation
      1. *-commutative14.8%

        \[\leadsto \frac{\color{blue}{{x2}^{2} \cdot -36}}{x1 + x2 \cdot 6} \]
      2. unpow214.8%

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

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

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

    if -1.5500000000000001e103 < x1 < -5.2e7

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

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

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

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

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

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

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

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

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

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

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

    if -5.2e7 < x1 < 0.47999999999999998

    1. Initial program 98.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 96.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) \]

    if 0.47999999999999998 < x1 < 1.35000000000000003e154

    1. Initial program 99.2%

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

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

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

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

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

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

    if 1.35000000000000003e154 < x1

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x1, x1, -\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)\right)}}{x1 - x2 \cdot -6} \]
      2. swap-sqr90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{\left(x2 \cdot x2\right) \cdot \left(-6 \cdot -6\right)}\right)}{x1 - x2 \cdot -6} \]
      3. unpow290.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{{x2}^{2}} \cdot \left(-6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      4. distribute-rgt-neg-in90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \color{blue}{{x2}^{2} \cdot \left(--6 \cdot -6\right)}\right)}{x1 - x2 \cdot -6} \]
      5. unpow290.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \color{blue}{\left(x2 \cdot x2\right)} \cdot \left(--6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      6. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \left(-\color{blue}{36}\right)\right)}{x1 - x2 \cdot -6} \]
      7. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \color{blue}{-36}\right)}{x1 - x2 \cdot -6} \]
      8. sub-neg90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{\color{blue}{x1 + \left(-x2 \cdot -6\right)}} \]
      9. distribute-rgt-neg-in90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + \color{blue}{x2 \cdot \left(--6\right)}} \]
      10. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot \color{blue}{6}} \]
    7. Simplified90.0%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot 6}} \]
    8. Taylor expanded in x1 around inf 93.3%

      \[\leadsto \frac{\color{blue}{{x1}^{2}}}{x1 + x2 \cdot 6} \]
    9. Step-by-step derivation
      1. unpow293.3%

        \[\leadsto \frac{\color{blue}{x1 \cdot x1}}{x1 + x2 \cdot 6} \]
    10. Simplified93.3%

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

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

Alternative 15: 81.2% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 \cdot x1 + 1\\ t_1 := x1 + x2 \cdot 6\\ t_2 := x1 \cdot \left(x1 \cdot 3\right)\\ t_3 := x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_2 \cdot \left(3 + \frac{-1}{x1}\right) + t_0 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(\frac{\left(t_2 + 2 \cdot x2\right) - x1}{t_0} \cdot 4 - 6\right) + \left(\left(x1 \cdot 2\right) \cdot 3\right) \cdot \frac{-1}{x1}\right)\right)\right)\\ \mathbf{if}\;x1 \leq -2.7 \cdot 10^{+107}:\\ \;\;\;\;\frac{x2 \cdot \left(x2 \cdot -36\right)}{t_1}\\ \mathbf{elif}\;x1 \leq -52000000:\\ \;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2\right) + t_3\right)\\ \mathbf{elif}\;x1 \leq 0.48:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(t_2 - 2 \cdot x2\right) - x1}{t_0} + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;x1 + \left(t_3 + 3 \cdot \left(x2 \cdot -2 - x1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x1 \cdot x1}{t_1}\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (+ (* x1 x1) 1.0))
        (t_1 (+ x1 (* x2 6.0)))
        (t_2 (* x1 (* x1 3.0)))
        (t_3
         (+
          x1
          (+
           (* x1 (* x1 x1))
           (+
            (* t_2 (+ 3.0 (/ -1.0 x1)))
            (*
             t_0
             (+
              (* (* x1 x1) (- (* (/ (- (+ t_2 (* 2.0 x2)) x1) t_0) 4.0) 6.0))
              (* (* (* x1 2.0) 3.0) (/ -1.0 x1)))))))))
   (if (<= x1 -2.7e+107)
     (/ (* x2 (* x2 -36.0)) t_1)
     (if (<= x1 -52000000.0)
       (+ x1 (+ (* 3.0 (* x2 -2.0)) t_3))
       (if (<= x1 0.48)
         (+
          x1
          (+
           (* 3.0 (/ (- (- t_2 (* 2.0 x2)) x1) t_0))
           (+ x1 (* 4.0 (* x2 (* x1 (- (* 2.0 x2) 3.0)))))))
         (if (<= x1 1.35e+154)
           (+ x1 (+ t_3 (* 3.0 (- (* x2 -2.0) x1))))
           (/ (* x1 x1) t_1)))))))
double code(double x1, double x2) {
	double t_0 = (x1 * x1) + 1.0;
	double t_1 = x1 + (x2 * 6.0);
	double t_2 = x1 * (x1 * 3.0);
	double t_3 = x1 + ((x1 * (x1 * x1)) + ((t_2 * (3.0 + (-1.0 / x1))) + (t_0 * (((x1 * x1) * (((((t_2 + (2.0 * x2)) - x1) / t_0) * 4.0) - 6.0)) + (((x1 * 2.0) * 3.0) * (-1.0 / x1))))));
	double tmp;
	if (x1 <= -2.7e+107) {
		tmp = (x2 * (x2 * -36.0)) / t_1;
	} else if (x1 <= -52000000.0) {
		tmp = x1 + ((3.0 * (x2 * -2.0)) + t_3);
	} else if (x1 <= 0.48) {
		tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))));
	} else if (x1 <= 1.35e+154) {
		tmp = x1 + (t_3 + (3.0 * ((x2 * -2.0) - x1)));
	} else {
		tmp = (x1 * x1) / t_1;
	}
	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) + 1.0d0
    t_1 = x1 + (x2 * 6.0d0)
    t_2 = x1 * (x1 * 3.0d0)
    t_3 = x1 + ((x1 * (x1 * x1)) + ((t_2 * (3.0d0 + ((-1.0d0) / x1))) + (t_0 * (((x1 * x1) * (((((t_2 + (2.0d0 * x2)) - x1) / t_0) * 4.0d0) - 6.0d0)) + (((x1 * 2.0d0) * 3.0d0) * ((-1.0d0) / x1))))))
    if (x1 <= (-2.7d+107)) then
        tmp = (x2 * (x2 * (-36.0d0))) / t_1
    else if (x1 <= (-52000000.0d0)) then
        tmp = x1 + ((3.0d0 * (x2 * (-2.0d0))) + t_3)
    else if (x1 <= 0.48d0) then
        tmp = x1 + ((3.0d0 * (((t_2 - (2.0d0 * x2)) - x1) / t_0)) + (x1 + (4.0d0 * (x2 * (x1 * ((2.0d0 * x2) - 3.0d0))))))
    else if (x1 <= 1.35d+154) then
        tmp = x1 + (t_3 + (3.0d0 * ((x2 * (-2.0d0)) - x1)))
    else
        tmp = (x1 * x1) / t_1
    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 + (x2 * 6.0);
	double t_2 = x1 * (x1 * 3.0);
	double t_3 = x1 + ((x1 * (x1 * x1)) + ((t_2 * (3.0 + (-1.0 / x1))) + (t_0 * (((x1 * x1) * (((((t_2 + (2.0 * x2)) - x1) / t_0) * 4.0) - 6.0)) + (((x1 * 2.0) * 3.0) * (-1.0 / x1))))));
	double tmp;
	if (x1 <= -2.7e+107) {
		tmp = (x2 * (x2 * -36.0)) / t_1;
	} else if (x1 <= -52000000.0) {
		tmp = x1 + ((3.0 * (x2 * -2.0)) + t_3);
	} else if (x1 <= 0.48) {
		tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))));
	} else if (x1 <= 1.35e+154) {
		tmp = x1 + (t_3 + (3.0 * ((x2 * -2.0) - x1)));
	} else {
		tmp = (x1 * x1) / t_1;
	}
	return tmp;
}
def code(x1, x2):
	t_0 = (x1 * x1) + 1.0
	t_1 = x1 + (x2 * 6.0)
	t_2 = x1 * (x1 * 3.0)
	t_3 = x1 + ((x1 * (x1 * x1)) + ((t_2 * (3.0 + (-1.0 / x1))) + (t_0 * (((x1 * x1) * (((((t_2 + (2.0 * x2)) - x1) / t_0) * 4.0) - 6.0)) + (((x1 * 2.0) * 3.0) * (-1.0 / x1))))))
	tmp = 0
	if x1 <= -2.7e+107:
		tmp = (x2 * (x2 * -36.0)) / t_1
	elif x1 <= -52000000.0:
		tmp = x1 + ((3.0 * (x2 * -2.0)) + t_3)
	elif x1 <= 0.48:
		tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))))
	elif x1 <= 1.35e+154:
		tmp = x1 + (t_3 + (3.0 * ((x2 * -2.0) - x1)))
	else:
		tmp = (x1 * x1) / t_1
	return tmp
function code(x1, x2)
	t_0 = Float64(Float64(x1 * x1) + 1.0)
	t_1 = Float64(x1 + Float64(x2 * 6.0))
	t_2 = Float64(x1 * Float64(x1 * 3.0))
	t_3 = Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_2 * Float64(3.0 + Float64(-1.0 / x1))) + Float64(t_0 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(Float64(Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) / t_0) * 4.0) - 6.0)) + Float64(Float64(Float64(x1 * 2.0) * 3.0) * Float64(-1.0 / x1)))))))
	tmp = 0.0
	if (x1 <= -2.7e+107)
		tmp = Float64(Float64(x2 * Float64(x2 * -36.0)) / t_1);
	elseif (x1 <= -52000000.0)
		tmp = Float64(x1 + Float64(Float64(3.0 * Float64(x2 * -2.0)) + t_3));
	elseif (x1 <= 0.48)
		tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_2 - Float64(2.0 * x2)) - x1) / t_0)) + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * Float64(Float64(2.0 * x2) - 3.0)))))));
	elseif (x1 <= 1.35e+154)
		tmp = Float64(x1 + Float64(t_3 + Float64(3.0 * Float64(Float64(x2 * -2.0) - x1))));
	else
		tmp = Float64(Float64(x1 * x1) / t_1);
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	t_0 = (x1 * x1) + 1.0;
	t_1 = x1 + (x2 * 6.0);
	t_2 = x1 * (x1 * 3.0);
	t_3 = x1 + ((x1 * (x1 * x1)) + ((t_2 * (3.0 + (-1.0 / x1))) + (t_0 * (((x1 * x1) * (((((t_2 + (2.0 * x2)) - x1) / t_0) * 4.0) - 6.0)) + (((x1 * 2.0) * 3.0) * (-1.0 / x1))))));
	tmp = 0.0;
	if (x1 <= -2.7e+107)
		tmp = (x2 * (x2 * -36.0)) / t_1;
	elseif (x1 <= -52000000.0)
		tmp = x1 + ((3.0 * (x2 * -2.0)) + t_3);
	elseif (x1 <= 0.48)
		tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))));
	elseif (x1 <= 1.35e+154)
		tmp = x1 + (t_3 + (3.0 * ((x2 * -2.0) - x1)));
	else
		tmp = (x1 * x1) / t_1;
	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[(x2 * 6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 * N[(3.0 + N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(N[(N[(N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision] * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * 3.0), $MachinePrecision] * N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -2.7e+107], N[(N[(x2 * N[(x2 * -36.0), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[x1, -52000000.0], N[(x1 + N[(N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 0.48], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$2 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(x2 * N[(x1 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 + N[(t$95$3 + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x1 * x1), $MachinePrecision] / t$95$1), $MachinePrecision]]]]]]]]]
\begin{array}{l}

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

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

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

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

\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1}{t_1}\\


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

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

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

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

        \[\leadsto \frac{x1 \cdot x1 - \color{blue}{\left(x2 \cdot -6\right)} \cdot \left(-6 \cdot x2\right)}{x1 - -6 \cdot x2} \]
      3. *-commutative0.0%

        \[\leadsto \frac{x1 \cdot x1 - \left(x2 \cdot -6\right) \cdot \color{blue}{\left(x2 \cdot -6\right)}}{x1 - -6 \cdot x2} \]
      4. *-commutative0.0%

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x1, x1, -\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)\right)}}{x1 - x2 \cdot -6} \]
      2. swap-sqr13.2%

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

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{{x2}^{2}} \cdot \left(-6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      4. distribute-rgt-neg-in13.2%

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

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

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \left(-\color{blue}{36}\right)\right)}{x1 - x2 \cdot -6} \]
      7. metadata-eval13.2%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \color{blue}{-36}\right)}{x1 - x2 \cdot -6} \]
      8. sub-neg13.2%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{\color{blue}{x1 + \left(-x2 \cdot -6\right)}} \]
      9. distribute-rgt-neg-in13.2%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + \color{blue}{x2 \cdot \left(--6\right)}} \]
      10. metadata-eval13.2%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot \color{blue}{6}} \]
    7. Simplified13.2%

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

      \[\leadsto \frac{\color{blue}{-36 \cdot {x2}^{2}}}{x1 + x2 \cdot 6} \]
    9. Step-by-step derivation
      1. *-commutative14.8%

        \[\leadsto \frac{\color{blue}{{x2}^{2} \cdot -36}}{x1 + x2 \cdot 6} \]
      2. unpow214.8%

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

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

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

    if -2.7000000000000001e107 < x1 < -5.2e7

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

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

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

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

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

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

    if -5.2e7 < x1 < 0.47999999999999998

    1. Initial program 98.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 96.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) \]

    if 0.47999999999999998 < x1 < 1.35000000000000003e154

    1. Initial program 99.2%

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

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

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

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

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

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

    if 1.35000000000000003e154 < x1

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x1, x1, -\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)\right)}}{x1 - x2 \cdot -6} \]
      2. swap-sqr90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{\left(x2 \cdot x2\right) \cdot \left(-6 \cdot -6\right)}\right)}{x1 - x2 \cdot -6} \]
      3. unpow290.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{{x2}^{2}} \cdot \left(-6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      4. distribute-rgt-neg-in90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \color{blue}{{x2}^{2} \cdot \left(--6 \cdot -6\right)}\right)}{x1 - x2 \cdot -6} \]
      5. unpow290.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \color{blue}{\left(x2 \cdot x2\right)} \cdot \left(--6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      6. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \left(-\color{blue}{36}\right)\right)}{x1 - x2 \cdot -6} \]
      7. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \color{blue}{-36}\right)}{x1 - x2 \cdot -6} \]
      8. sub-neg90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{\color{blue}{x1 + \left(-x2 \cdot -6\right)}} \]
      9. distribute-rgt-neg-in90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + \color{blue}{x2 \cdot \left(--6\right)}} \]
      10. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot \color{blue}{6}} \]
    7. Simplified90.0%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot 6}} \]
    8. Taylor expanded in x1 around inf 93.3%

      \[\leadsto \frac{\color{blue}{{x1}^{2}}}{x1 + x2 \cdot 6} \]
    9. Step-by-step derivation
      1. unpow293.3%

        \[\leadsto \frac{\color{blue}{x1 \cdot x1}}{x1 + x2 \cdot 6} \]
    10. Simplified93.3%

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

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

Alternative 16: 81.2% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 \cdot x1 + 1\\ t_1 := x1 + x2 \cdot 6\\ t_2 := x1 \cdot \left(x1 \cdot 3\right)\\ t_3 := x1 + \left(3 \cdot \left(x2 \cdot -2\right) + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_2 \cdot \left(3 + \frac{-1}{x1}\right) + t_0 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(\frac{\left(t_2 + 2 \cdot x2\right) - x1}{t_0} \cdot 4 - 6\right) + \left(\left(x1 \cdot 2\right) \cdot 3\right) \cdot \frac{-1}{x1}\right)\right)\right)\right)\right)\\ \mathbf{if}\;x1 \leq -6.8 \cdot 10^{+108}:\\ \;\;\;\;\frac{x2 \cdot \left(x2 \cdot -36\right)}{t_1}\\ \mathbf{elif}\;x1 \leq -52000000:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x1 \leq 0.48:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(t_2 - 2 \cdot x2\right) - x1}{t_0} + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;\frac{x1 \cdot x1}{t_1}\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (+ (* x1 x1) 1.0))
        (t_1 (+ x1 (* x2 6.0)))
        (t_2 (* x1 (* x1 3.0)))
        (t_3
         (+
          x1
          (+
           (* 3.0 (* x2 -2.0))
           (+
            x1
            (+
             (* x1 (* x1 x1))
             (+
              (* t_2 (+ 3.0 (/ -1.0 x1)))
              (*
               t_0
               (+
                (* (* x1 x1) (- (* (/ (- (+ t_2 (* 2.0 x2)) x1) t_0) 4.0) 6.0))
                (* (* (* x1 2.0) 3.0) (/ -1.0 x1)))))))))))
   (if (<= x1 -6.8e+108)
     (/ (* x2 (* x2 -36.0)) t_1)
     (if (<= x1 -52000000.0)
       t_3
       (if (<= x1 0.48)
         (+
          x1
          (+
           (* 3.0 (/ (- (- t_2 (* 2.0 x2)) x1) t_0))
           (+ x1 (* 4.0 (* x2 (* x1 (- (* 2.0 x2) 3.0)))))))
         (if (<= x1 1.35e+154) t_3 (/ (* x1 x1) t_1)))))))
double code(double x1, double x2) {
	double t_0 = (x1 * x1) + 1.0;
	double t_1 = x1 + (x2 * 6.0);
	double t_2 = x1 * (x1 * 3.0);
	double t_3 = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * (3.0 + (-1.0 / x1))) + (t_0 * (((x1 * x1) * (((((t_2 + (2.0 * x2)) - x1) / t_0) * 4.0) - 6.0)) + (((x1 * 2.0) * 3.0) * (-1.0 / x1))))))));
	double tmp;
	if (x1 <= -6.8e+108) {
		tmp = (x2 * (x2 * -36.0)) / t_1;
	} else if (x1 <= -52000000.0) {
		tmp = t_3;
	} else if (x1 <= 0.48) {
		tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))));
	} else if (x1 <= 1.35e+154) {
		tmp = t_3;
	} else {
		tmp = (x1 * x1) / t_1;
	}
	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) + 1.0d0
    t_1 = x1 + (x2 * 6.0d0)
    t_2 = x1 * (x1 * 3.0d0)
    t_3 = x1 + ((3.0d0 * (x2 * (-2.0d0))) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * (3.0d0 + ((-1.0d0) / x1))) + (t_0 * (((x1 * x1) * (((((t_2 + (2.0d0 * x2)) - x1) / t_0) * 4.0d0) - 6.0d0)) + (((x1 * 2.0d0) * 3.0d0) * ((-1.0d0) / x1))))))))
    if (x1 <= (-6.8d+108)) then
        tmp = (x2 * (x2 * (-36.0d0))) / t_1
    else if (x1 <= (-52000000.0d0)) then
        tmp = t_3
    else if (x1 <= 0.48d0) then
        tmp = x1 + ((3.0d0 * (((t_2 - (2.0d0 * x2)) - x1) / t_0)) + (x1 + (4.0d0 * (x2 * (x1 * ((2.0d0 * x2) - 3.0d0))))))
    else if (x1 <= 1.35d+154) then
        tmp = t_3
    else
        tmp = (x1 * x1) / t_1
    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 + (x2 * 6.0);
	double t_2 = x1 * (x1 * 3.0);
	double t_3 = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * (3.0 + (-1.0 / x1))) + (t_0 * (((x1 * x1) * (((((t_2 + (2.0 * x2)) - x1) / t_0) * 4.0) - 6.0)) + (((x1 * 2.0) * 3.0) * (-1.0 / x1))))))));
	double tmp;
	if (x1 <= -6.8e+108) {
		tmp = (x2 * (x2 * -36.0)) / t_1;
	} else if (x1 <= -52000000.0) {
		tmp = t_3;
	} else if (x1 <= 0.48) {
		tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))));
	} else if (x1 <= 1.35e+154) {
		tmp = t_3;
	} else {
		tmp = (x1 * x1) / t_1;
	}
	return tmp;
}
def code(x1, x2):
	t_0 = (x1 * x1) + 1.0
	t_1 = x1 + (x2 * 6.0)
	t_2 = x1 * (x1 * 3.0)
	t_3 = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * (3.0 + (-1.0 / x1))) + (t_0 * (((x1 * x1) * (((((t_2 + (2.0 * x2)) - x1) / t_0) * 4.0) - 6.0)) + (((x1 * 2.0) * 3.0) * (-1.0 / x1))))))))
	tmp = 0
	if x1 <= -6.8e+108:
		tmp = (x2 * (x2 * -36.0)) / t_1
	elif x1 <= -52000000.0:
		tmp = t_3
	elif x1 <= 0.48:
		tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))))
	elif x1 <= 1.35e+154:
		tmp = t_3
	else:
		tmp = (x1 * x1) / t_1
	return tmp
function code(x1, x2)
	t_0 = Float64(Float64(x1 * x1) + 1.0)
	t_1 = Float64(x1 + Float64(x2 * 6.0))
	t_2 = Float64(x1 * Float64(x1 * 3.0))
	t_3 = Float64(x1 + Float64(Float64(3.0 * Float64(x2 * -2.0)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_2 * Float64(3.0 + Float64(-1.0 / x1))) + Float64(t_0 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(Float64(Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) / t_0) * 4.0) - 6.0)) + Float64(Float64(Float64(x1 * 2.0) * 3.0) * Float64(-1.0 / x1)))))))))
	tmp = 0.0
	if (x1 <= -6.8e+108)
		tmp = Float64(Float64(x2 * Float64(x2 * -36.0)) / t_1);
	elseif (x1 <= -52000000.0)
		tmp = t_3;
	elseif (x1 <= 0.48)
		tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_2 - Float64(2.0 * x2)) - x1) / t_0)) + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * Float64(Float64(2.0 * x2) - 3.0)))))));
	elseif (x1 <= 1.35e+154)
		tmp = t_3;
	else
		tmp = Float64(Float64(x1 * x1) / t_1);
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	t_0 = (x1 * x1) + 1.0;
	t_1 = x1 + (x2 * 6.0);
	t_2 = x1 * (x1 * 3.0);
	t_3 = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * (3.0 + (-1.0 / x1))) + (t_0 * (((x1 * x1) * (((((t_2 + (2.0 * x2)) - x1) / t_0) * 4.0) - 6.0)) + (((x1 * 2.0) * 3.0) * (-1.0 / x1))))))));
	tmp = 0.0;
	if (x1 <= -6.8e+108)
		tmp = (x2 * (x2 * -36.0)) / t_1;
	elseif (x1 <= -52000000.0)
		tmp = t_3;
	elseif (x1 <= 0.48)
		tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))));
	elseif (x1 <= 1.35e+154)
		tmp = t_3;
	else
		tmp = (x1 * x1) / t_1;
	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[(x2 * 6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x1 + N[(N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 * N[(3.0 + N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(N[(N[(N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision] * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * 3.0), $MachinePrecision] * N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -6.8e+108], N[(N[(x2 * N[(x2 * -36.0), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[x1, -52000000.0], t$95$3, If[LessEqual[x1, 0.48], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$2 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(x2 * N[(x1 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], t$95$3, N[(N[(x1 * x1), $MachinePrecision] / t$95$1), $MachinePrecision]]]]]]]]]
\begin{array}{l}

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

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

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

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

\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1}{t_1}\\


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

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

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

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

        \[\leadsto \frac{x1 \cdot x1 - \color{blue}{\left(x2 \cdot -6\right)} \cdot \left(-6 \cdot x2\right)}{x1 - -6 \cdot x2} \]
      3. *-commutative0.0%

        \[\leadsto \frac{x1 \cdot x1 - \left(x2 \cdot -6\right) \cdot \color{blue}{\left(x2 \cdot -6\right)}}{x1 - -6 \cdot x2} \]
      4. *-commutative0.0%

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x1, x1, -\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)\right)}}{x1 - x2 \cdot -6} \]
      2. swap-sqr13.2%

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

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{{x2}^{2}} \cdot \left(-6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      4. distribute-rgt-neg-in13.2%

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

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

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \left(-\color{blue}{36}\right)\right)}{x1 - x2 \cdot -6} \]
      7. metadata-eval13.2%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \color{blue}{-36}\right)}{x1 - x2 \cdot -6} \]
      8. sub-neg13.2%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{\color{blue}{x1 + \left(-x2 \cdot -6\right)}} \]
      9. distribute-rgt-neg-in13.2%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + \color{blue}{x2 \cdot \left(--6\right)}} \]
      10. metadata-eval13.2%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot \color{blue}{6}} \]
    7. Simplified13.2%

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

      \[\leadsto \frac{\color{blue}{-36 \cdot {x2}^{2}}}{x1 + x2 \cdot 6} \]
    9. Step-by-step derivation
      1. *-commutative14.8%

        \[\leadsto \frac{\color{blue}{{x2}^{2} \cdot -36}}{x1 + x2 \cdot 6} \]
      2. unpow214.8%

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

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

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

    if -6.79999999999999992e108 < x1 < -5.2e7 or 0.47999999999999998 < 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 95.1%

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

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

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

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

        \[\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) \]
    7. Simplified83.5%

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

    if -5.2e7 < x1 < 0.47999999999999998

    1. Initial program 98.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 96.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) \]

    if 1.35000000000000003e154 < x1

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x1, x1, -\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)\right)}}{x1 - x2 \cdot -6} \]
      2. swap-sqr90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{\left(x2 \cdot x2\right) \cdot \left(-6 \cdot -6\right)}\right)}{x1 - x2 \cdot -6} \]
      3. unpow290.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{{x2}^{2}} \cdot \left(-6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      4. distribute-rgt-neg-in90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \color{blue}{{x2}^{2} \cdot \left(--6 \cdot -6\right)}\right)}{x1 - x2 \cdot -6} \]
      5. unpow290.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \color{blue}{\left(x2 \cdot x2\right)} \cdot \left(--6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      6. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \left(-\color{blue}{36}\right)\right)}{x1 - x2 \cdot -6} \]
      7. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \color{blue}{-36}\right)}{x1 - x2 \cdot -6} \]
      8. sub-neg90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{\color{blue}{x1 + \left(-x2 \cdot -6\right)}} \]
      9. distribute-rgt-neg-in90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + \color{blue}{x2 \cdot \left(--6\right)}} \]
      10. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot \color{blue}{6}} \]
    7. Simplified90.0%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot 6}} \]
    8. Taylor expanded in x1 around inf 93.3%

      \[\leadsto \frac{\color{blue}{{x1}^{2}}}{x1 + x2 \cdot 6} \]
    9. Step-by-step derivation
      1. unpow293.3%

        \[\leadsto \frac{\color{blue}{x1 \cdot x1}}{x1 + x2 \cdot 6} \]
    10. Simplified93.3%

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

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

Alternative 17: 79.1% accurate, 1.8× speedup?

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

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

\mathbf{elif}\;x1 \leq -8.6 \cdot 10^{+16}:\\
\;\;\;\;t_4\\

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

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

\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1}{t_1}\\


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

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

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

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

        \[\leadsto \frac{x1 \cdot x1 - \color{blue}{\left(x2 \cdot -6\right)} \cdot \left(-6 \cdot x2\right)}{x1 - -6 \cdot x2} \]
      3. *-commutative0.0%

        \[\leadsto \frac{x1 \cdot x1 - \left(x2 \cdot -6\right) \cdot \color{blue}{\left(x2 \cdot -6\right)}}{x1 - -6 \cdot x2} \]
      4. *-commutative0.0%

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x1, x1, -\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)\right)}}{x1 - x2 \cdot -6} \]
      2. swap-sqr13.2%

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

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{{x2}^{2}} \cdot \left(-6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      4. distribute-rgt-neg-in13.2%

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

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

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \left(-\color{blue}{36}\right)\right)}{x1 - x2 \cdot -6} \]
      7. metadata-eval13.2%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \color{blue}{-36}\right)}{x1 - x2 \cdot -6} \]
      8. sub-neg13.2%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{\color{blue}{x1 + \left(-x2 \cdot -6\right)}} \]
      9. distribute-rgt-neg-in13.2%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + \color{blue}{x2 \cdot \left(--6\right)}} \]
      10. metadata-eval13.2%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot \color{blue}{6}} \]
    7. Simplified13.2%

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

      \[\leadsto \frac{\color{blue}{-36 \cdot {x2}^{2}}}{x1 + x2 \cdot 6} \]
    9. Step-by-step derivation
      1. *-commutative14.8%

        \[\leadsto \frac{\color{blue}{{x2}^{2} \cdot -36}}{x1 + x2 \cdot 6} \]
      2. unpow214.8%

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

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

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

    if -5.8000000000000005e102 < x1 < -8.6e16 or 0.46999999999999997 < 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 95.0%

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

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

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

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

    if -8.6e16 < x1 < 0.46999999999999997

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

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

    if 1.35000000000000003e154 < x1

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x1, x1, -\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)\right)}}{x1 - x2 \cdot -6} \]
      2. swap-sqr90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{\left(x2 \cdot x2\right) \cdot \left(-6 \cdot -6\right)}\right)}{x1 - x2 \cdot -6} \]
      3. unpow290.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{{x2}^{2}} \cdot \left(-6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      4. distribute-rgt-neg-in90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \color{blue}{{x2}^{2} \cdot \left(--6 \cdot -6\right)}\right)}{x1 - x2 \cdot -6} \]
      5. unpow290.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \color{blue}{\left(x2 \cdot x2\right)} \cdot \left(--6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      6. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \left(-\color{blue}{36}\right)\right)}{x1 - x2 \cdot -6} \]
      7. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \color{blue}{-36}\right)}{x1 - x2 \cdot -6} \]
      8. sub-neg90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{\color{blue}{x1 + \left(-x2 \cdot -6\right)}} \]
      9. distribute-rgt-neg-in90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + \color{blue}{x2 \cdot \left(--6\right)}} \]
      10. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot \color{blue}{6}} \]
    7. Simplified90.0%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot 6}} \]
    8. Taylor expanded in x1 around inf 93.3%

      \[\leadsto \frac{\color{blue}{{x1}^{2}}}{x1 + x2 \cdot 6} \]
    9. Step-by-step derivation
      1. unpow293.3%

        \[\leadsto \frac{\color{blue}{x1 \cdot x1}}{x1 + x2 \cdot 6} \]
    10. Simplified93.3%

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

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

Alternative 18: 68.6% accurate, 3.2× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1}{t_0}\\


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

    1. Initial program 32.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 2.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 1.0%

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

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

        \[\leadsto \frac{x1 \cdot x1 - \color{blue}{\left(x2 \cdot -6\right)} \cdot \left(-6 \cdot x2\right)}{x1 - -6 \cdot x2} \]
      3. *-commutative2.0%

        \[\leadsto \frac{x1 \cdot x1 - \left(x2 \cdot -6\right) \cdot \color{blue}{\left(x2 \cdot -6\right)}}{x1 - -6 \cdot x2} \]
      4. *-commutative2.0%

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x1, x1, -\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)\right)}}{x1 - x2 \cdot -6} \]
      2. swap-sqr11.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{\left(x2 \cdot x2\right) \cdot \left(-6 \cdot -6\right)}\right)}{x1 - x2 \cdot -6} \]
      3. unpow211.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{{x2}^{2}} \cdot \left(-6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      4. distribute-rgt-neg-in11.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \color{blue}{{x2}^{2} \cdot \left(--6 \cdot -6\right)}\right)}{x1 - x2 \cdot -6} \]
      5. unpow211.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \color{blue}{\left(x2 \cdot x2\right)} \cdot \left(--6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      6. metadata-eval11.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \left(-\color{blue}{36}\right)\right)}{x1 - x2 \cdot -6} \]
      7. metadata-eval11.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \color{blue}{-36}\right)}{x1 - x2 \cdot -6} \]
      8. sub-neg11.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{\color{blue}{x1 + \left(-x2 \cdot -6\right)}} \]
      9. distribute-rgt-neg-in11.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + \color{blue}{x2 \cdot \left(--6\right)}} \]
      10. metadata-eval11.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot \color{blue}{6}} \]
    7. Simplified11.0%

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

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

        \[\leadsto \frac{\color{blue}{{x2}^{2} \cdot -36}}{x1 + x2 \cdot 6} \]
      2. unpow212.4%

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

        \[\leadsto \frac{\color{blue}{x2 \cdot \left(x2 \cdot -36\right)}}{x1 + x2 \cdot 6} \]
    10. Simplified12.4%

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

    if -4.7999999999999999e30 < x1 < 1.35000000000000003e154

    1. Initial program 98.6%

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

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

    if 1.35000000000000003e154 < x1

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x1, x1, -\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)\right)}}{x1 - x2 \cdot -6} \]
      2. swap-sqr90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{\left(x2 \cdot x2\right) \cdot \left(-6 \cdot -6\right)}\right)}{x1 - x2 \cdot -6} \]
      3. unpow290.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{{x2}^{2}} \cdot \left(-6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      4. distribute-rgt-neg-in90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \color{blue}{{x2}^{2} \cdot \left(--6 \cdot -6\right)}\right)}{x1 - x2 \cdot -6} \]
      5. unpow290.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \color{blue}{\left(x2 \cdot x2\right)} \cdot \left(--6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      6. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \left(-\color{blue}{36}\right)\right)}{x1 - x2 \cdot -6} \]
      7. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \color{blue}{-36}\right)}{x1 - x2 \cdot -6} \]
      8. sub-neg90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{\color{blue}{x1 + \left(-x2 \cdot -6\right)}} \]
      9. distribute-rgt-neg-in90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + \color{blue}{x2 \cdot \left(--6\right)}} \]
      10. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot \color{blue}{6}} \]
    7. Simplified90.0%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot 6}} \]
    8. Taylor expanded in x1 around inf 93.3%

      \[\leadsto \frac{\color{blue}{{x1}^{2}}}{x1 + x2 \cdot 6} \]
    9. Step-by-step derivation
      1. unpow293.3%

        \[\leadsto \frac{\color{blue}{x1 \cdot x1}}{x1 + x2 \cdot 6} \]
    10. Simplified93.3%

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

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

Alternative 19: 63.7% accurate, 4.7× speedup?

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

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

\mathbf{elif}\;x1 \leq -1.42 \cdot 10^{-153}:\\
\;\;\;\;t_1\\

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

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

\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1}{t_2}\\


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

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

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

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

        \[\leadsto \frac{x1 \cdot x1 - \color{blue}{\left(x2 \cdot -6\right)} \cdot \left(-6 \cdot x2\right)}{x1 - -6 \cdot x2} \]
      3. *-commutative0.0%

        \[\leadsto \frac{x1 \cdot x1 - \left(x2 \cdot -6\right) \cdot \color{blue}{\left(x2 \cdot -6\right)}}{x1 - -6 \cdot x2} \]
      4. *-commutative0.0%

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x1, x1, -\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)\right)}}{x1 - x2 \cdot -6} \]
      2. swap-sqr15.2%

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

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{{x2}^{2}} \cdot \left(-6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      4. distribute-rgt-neg-in15.2%

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

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

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \left(-\color{blue}{36}\right)\right)}{x1 - x2 \cdot -6} \]
      7. metadata-eval15.2%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \color{blue}{-36}\right)}{x1 - x2 \cdot -6} \]
      8. sub-neg15.2%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{\color{blue}{x1 + \left(-x2 \cdot -6\right)}} \]
      9. distribute-rgt-neg-in15.2%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + \color{blue}{x2 \cdot \left(--6\right)}} \]
      10. metadata-eval15.2%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot \color{blue}{6}} \]
    7. Simplified15.2%

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

      \[\leadsto \frac{\color{blue}{-36 \cdot {x2}^{2}}}{x1 + x2 \cdot 6} \]
    9. Step-by-step derivation
      1. *-commutative16.8%

        \[\leadsto \frac{\color{blue}{{x2}^{2} \cdot -36}}{x1 + x2 \cdot 6} \]
      2. unpow216.8%

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

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

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

    if -1.02000000000000007e154 < x1 < -1.42000000000000007e-153 or 1.3e-271 < x1 < 1.35000000000000003e154

    1. Initial program 95.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 63.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 61.2%

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

    if -1.42000000000000007e-153 < x1 < 1.3e-271

    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 99.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 87.7%

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

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

      \[\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.35000000000000003e154 < x1

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x1, x1, -\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)\right)}}{x1 - x2 \cdot -6} \]
      2. swap-sqr90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{\left(x2 \cdot x2\right) \cdot \left(-6 \cdot -6\right)}\right)}{x1 - x2 \cdot -6} \]
      3. unpow290.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{{x2}^{2}} \cdot \left(-6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      4. distribute-rgt-neg-in90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \color{blue}{{x2}^{2} \cdot \left(--6 \cdot -6\right)}\right)}{x1 - x2 \cdot -6} \]
      5. unpow290.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \color{blue}{\left(x2 \cdot x2\right)} \cdot \left(--6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      6. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \left(-\color{blue}{36}\right)\right)}{x1 - x2 \cdot -6} \]
      7. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \color{blue}{-36}\right)}{x1 - x2 \cdot -6} \]
      8. sub-neg90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{\color{blue}{x1 + \left(-x2 \cdot -6\right)}} \]
      9. distribute-rgt-neg-in90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + \color{blue}{x2 \cdot \left(--6\right)}} \]
      10. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot \color{blue}{6}} \]
    7. Simplified90.0%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot 6}} \]
    8. Taylor expanded in x1 around inf 93.3%

      \[\leadsto \frac{\color{blue}{{x1}^{2}}}{x1 + x2 \cdot 6} \]
    9. Step-by-step derivation
      1. unpow293.3%

        \[\leadsto \frac{\color{blue}{x1 \cdot x1}}{x1 + x2 \cdot 6} \]
    10. Simplified93.3%

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

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

Alternative 20: 68.5% accurate, 4.7× speedup?

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

\\
\begin{array}{l}
t_0 := x1 + x2 \cdot 6\\
\mathbf{if}\;x1 \leq -7.5 \cdot 10^{+153}:\\
\;\;\;\;\frac{x2 \cdot \left(x2 \cdot -36\right)}{t_0}\\

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

\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1}{t_0}\\


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

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

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

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

        \[\leadsto \frac{x1 \cdot x1 - \color{blue}{\left(x2 \cdot -6\right)} \cdot \left(-6 \cdot x2\right)}{x1 - -6 \cdot x2} \]
      3. *-commutative0.0%

        \[\leadsto \frac{x1 \cdot x1 - \left(x2 \cdot -6\right) \cdot \color{blue}{\left(x2 \cdot -6\right)}}{x1 - -6 \cdot x2} \]
      4. *-commutative0.0%

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x1, x1, -\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)\right)}}{x1 - x2 \cdot -6} \]
      2. swap-sqr15.2%

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

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{{x2}^{2}} \cdot \left(-6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      4. distribute-rgt-neg-in15.2%

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

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

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \left(-\color{blue}{36}\right)\right)}{x1 - x2 \cdot -6} \]
      7. metadata-eval15.2%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \color{blue}{-36}\right)}{x1 - x2 \cdot -6} \]
      8. sub-neg15.2%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{\color{blue}{x1 + \left(-x2 \cdot -6\right)}} \]
      9. distribute-rgt-neg-in15.2%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + \color{blue}{x2 \cdot \left(--6\right)}} \]
      10. metadata-eval15.2%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot \color{blue}{6}} \]
    7. Simplified15.2%

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

      \[\leadsto \frac{\color{blue}{-36 \cdot {x2}^{2}}}{x1 + x2 \cdot 6} \]
    9. Step-by-step derivation
      1. *-commutative16.8%

        \[\leadsto \frac{\color{blue}{{x2}^{2} \cdot -36}}{x1 + x2 \cdot 6} \]
      2. unpow216.8%

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

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

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

    if -7.50000000000000065e153 < x1 < 1.35000000000000003e154

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

      \[\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. +-commutative70.6%

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

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

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

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

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

    if 1.35000000000000003e154 < x1

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x1, x1, -\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)\right)}}{x1 - x2 \cdot -6} \]
      2. swap-sqr90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{\left(x2 \cdot x2\right) \cdot \left(-6 \cdot -6\right)}\right)}{x1 - x2 \cdot -6} \]
      3. unpow290.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{{x2}^{2}} \cdot \left(-6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      4. distribute-rgt-neg-in90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \color{blue}{{x2}^{2} \cdot \left(--6 \cdot -6\right)}\right)}{x1 - x2 \cdot -6} \]
      5. unpow290.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \color{blue}{\left(x2 \cdot x2\right)} \cdot \left(--6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      6. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \left(-\color{blue}{36}\right)\right)}{x1 - x2 \cdot -6} \]
      7. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \color{blue}{-36}\right)}{x1 - x2 \cdot -6} \]
      8. sub-neg90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{\color{blue}{x1 + \left(-x2 \cdot -6\right)}} \]
      9. distribute-rgt-neg-in90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + \color{blue}{x2 \cdot \left(--6\right)}} \]
      10. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot \color{blue}{6}} \]
    7. Simplified90.0%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot 6}} \]
    8. Taylor expanded in x1 around inf 93.3%

      \[\leadsto \frac{\color{blue}{{x1}^{2}}}{x1 + x2 \cdot 6} \]
    9. Step-by-step derivation
      1. unpow293.3%

        \[\leadsto \frac{\color{blue}{x1 \cdot x1}}{x1 + x2 \cdot 6} \]
    10. Simplified93.3%

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

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

Alternative 21: 47.9% accurate, 5.0× speedup?

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

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

\mathbf{elif}\;x1 \leq -4 \cdot 10^{-105}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;x1 \leq 3.7 \cdot 10^{-122}:\\
\;\;\;\;x2 \cdot -6\\

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

\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1}{t_1}\\


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

    1. Initial program 32.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 2.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 1.0%

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

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

        \[\leadsto \frac{x1 \cdot x1 - \color{blue}{\left(x2 \cdot -6\right)} \cdot \left(-6 \cdot x2\right)}{x1 - -6 \cdot x2} \]
      3. *-commutative2.0%

        \[\leadsto \frac{x1 \cdot x1 - \left(x2 \cdot -6\right) \cdot \color{blue}{\left(x2 \cdot -6\right)}}{x1 - -6 \cdot x2} \]
      4. *-commutative2.0%

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x1, x1, -\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)\right)}}{x1 - x2 \cdot -6} \]
      2. swap-sqr11.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{\left(x2 \cdot x2\right) \cdot \left(-6 \cdot -6\right)}\right)}{x1 - x2 \cdot -6} \]
      3. unpow211.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{{x2}^{2}} \cdot \left(-6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      4. distribute-rgt-neg-in11.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \color{blue}{{x2}^{2} \cdot \left(--6 \cdot -6\right)}\right)}{x1 - x2 \cdot -6} \]
      5. unpow211.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \color{blue}{\left(x2 \cdot x2\right)} \cdot \left(--6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      6. metadata-eval11.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \left(-\color{blue}{36}\right)\right)}{x1 - x2 \cdot -6} \]
      7. metadata-eval11.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \color{blue}{-36}\right)}{x1 - x2 \cdot -6} \]
      8. sub-neg11.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{\color{blue}{x1 + \left(-x2 \cdot -6\right)}} \]
      9. distribute-rgt-neg-in11.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + \color{blue}{x2 \cdot \left(--6\right)}} \]
      10. metadata-eval11.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot \color{blue}{6}} \]
    7. Simplified11.0%

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

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

        \[\leadsto \frac{\color{blue}{{x2}^{2} \cdot -36}}{x1 + x2 \cdot 6} \]
      2. unpow212.4%

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

        \[\leadsto \frac{\color{blue}{x2 \cdot \left(x2 \cdot -36\right)}}{x1 + x2 \cdot 6} \]
    10. Simplified12.4%

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

    if -4.7999999999999999e30 < x1 < -3.99999999999999986e-105 or 3.6999999999999997e-122 < x1 < 1.35000000000000003e154

    1. Initial program 98.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 63.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 39.3%

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

    if -3.99999999999999986e-105 < x1 < 3.6999999999999997e-122

    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 99.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 59.4%

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

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

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

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

    if 1.35000000000000003e154 < x1

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x1, x1, -\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)\right)}}{x1 - x2 \cdot -6} \]
      2. swap-sqr90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{\left(x2 \cdot x2\right) \cdot \left(-6 \cdot -6\right)}\right)}{x1 - x2 \cdot -6} \]
      3. unpow290.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{{x2}^{2}} \cdot \left(-6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      4. distribute-rgt-neg-in90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \color{blue}{{x2}^{2} \cdot \left(--6 \cdot -6\right)}\right)}{x1 - x2 \cdot -6} \]
      5. unpow290.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \color{blue}{\left(x2 \cdot x2\right)} \cdot \left(--6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      6. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \left(-\color{blue}{36}\right)\right)}{x1 - x2 \cdot -6} \]
      7. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \color{blue}{-36}\right)}{x1 - x2 \cdot -6} \]
      8. sub-neg90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{\color{blue}{x1 + \left(-x2 \cdot -6\right)}} \]
      9. distribute-rgt-neg-in90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + \color{blue}{x2 \cdot \left(--6\right)}} \]
      10. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot \color{blue}{6}} \]
    7. Simplified90.0%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot 6}} \]
    8. Taylor expanded in x1 around inf 93.3%

      \[\leadsto \frac{\color{blue}{{x1}^{2}}}{x1 + x2 \cdot 6} \]
    9. Step-by-step derivation
      1. unpow293.3%

        \[\leadsto \frac{\color{blue}{x1 \cdot x1}}{x1 + x2 \cdot 6} \]
    10. Simplified93.3%

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

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

Alternative 22: 47.6% accurate, 5.5× speedup?

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

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

\mathbf{elif}\;x1 \leq -5.5 \cdot 10^{-106}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;x1 \leq 3.8 \cdot 10^{-122}:\\
\;\;\;\;x2 \cdot -6\\

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

\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1}{t_1}\\


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

    1. Initial program 32.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 2.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 1.0%

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

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

        \[\leadsto \frac{x1 \cdot x1 - \color{blue}{\left(x2 \cdot -6\right)} \cdot \left(-6 \cdot x2\right)}{x1 - -6 \cdot x2} \]
      3. *-commutative2.0%

        \[\leadsto \frac{x1 \cdot x1 - \left(x2 \cdot -6\right) \cdot \color{blue}{\left(x2 \cdot -6\right)}}{x1 - -6 \cdot x2} \]
      4. *-commutative2.0%

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x1, x1, -\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)\right)}}{x1 - x2 \cdot -6} \]
      2. swap-sqr11.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{\left(x2 \cdot x2\right) \cdot \left(-6 \cdot -6\right)}\right)}{x1 - x2 \cdot -6} \]
      3. unpow211.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{{x2}^{2}} \cdot \left(-6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      4. distribute-rgt-neg-in11.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \color{blue}{{x2}^{2} \cdot \left(--6 \cdot -6\right)}\right)}{x1 - x2 \cdot -6} \]
      5. unpow211.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \color{blue}{\left(x2 \cdot x2\right)} \cdot \left(--6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      6. metadata-eval11.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \left(-\color{blue}{36}\right)\right)}{x1 - x2 \cdot -6} \]
      7. metadata-eval11.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \color{blue}{-36}\right)}{x1 - x2 \cdot -6} \]
      8. sub-neg11.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{\color{blue}{x1 + \left(-x2 \cdot -6\right)}} \]
      9. distribute-rgt-neg-in11.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + \color{blue}{x2 \cdot \left(--6\right)}} \]
      10. metadata-eval11.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot \color{blue}{6}} \]
    7. Simplified11.0%

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

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

        \[\leadsto \frac{\color{blue}{{x2}^{2} \cdot -36}}{x1 + x2 \cdot 6} \]
      2. unpow212.4%

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

        \[\leadsto \frac{\color{blue}{x2 \cdot \left(x2 \cdot -36\right)}}{x1 + x2 \cdot 6} \]
    10. Simplified12.4%

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

    if -4.7999999999999999e30 < x1 < -5.5000000000000001e-106 or 3.8000000000000001e-122 < x1 < 1.35000000000000003e154

    1. Initial program 98.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 63.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 39.0%

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

    if -5.5000000000000001e-106 < x1 < 3.8000000000000001e-122

    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 99.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 59.4%

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

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

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

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

    if 1.35000000000000003e154 < x1

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x1, x1, -\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)\right)}}{x1 - x2 \cdot -6} \]
      2. swap-sqr90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{\left(x2 \cdot x2\right) \cdot \left(-6 \cdot -6\right)}\right)}{x1 - x2 \cdot -6} \]
      3. unpow290.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{{x2}^{2}} \cdot \left(-6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      4. distribute-rgt-neg-in90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \color{blue}{{x2}^{2} \cdot \left(--6 \cdot -6\right)}\right)}{x1 - x2 \cdot -6} \]
      5. unpow290.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \color{blue}{\left(x2 \cdot x2\right)} \cdot \left(--6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      6. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \left(-\color{blue}{36}\right)\right)}{x1 - x2 \cdot -6} \]
      7. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \color{blue}{-36}\right)}{x1 - x2 \cdot -6} \]
      8. sub-neg90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{\color{blue}{x1 + \left(-x2 \cdot -6\right)}} \]
      9. distribute-rgt-neg-in90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + \color{blue}{x2 \cdot \left(--6\right)}} \]
      10. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot \color{blue}{6}} \]
    7. Simplified90.0%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot 6}} \]
    8. Taylor expanded in x1 around inf 93.3%

      \[\leadsto \frac{\color{blue}{{x1}^{2}}}{x1 + x2 \cdot 6} \]
    9. Step-by-step derivation
      1. unpow293.3%

        \[\leadsto \frac{\color{blue}{x1 \cdot x1}}{x1 + x2 \cdot 6} \]
    10. Simplified93.3%

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

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

Alternative 23: 63.0% accurate, 5.5× speedup?

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

\\
\begin{array}{l}
t_0 := x1 + x2 \cdot 6\\
\mathbf{if}\;x1 \leq -4.5 \cdot 10^{+153}:\\
\;\;\;\;\frac{x2 \cdot \left(x2 \cdot -36\right)}{t_0}\\

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

\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1}{t_0}\\


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

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

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

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

        \[\leadsto \frac{x1 \cdot x1 - \color{blue}{\left(x2 \cdot -6\right)} \cdot \left(-6 \cdot x2\right)}{x1 - -6 \cdot x2} \]
      3. *-commutative0.0%

        \[\leadsto \frac{x1 \cdot x1 - \left(x2 \cdot -6\right) \cdot \color{blue}{\left(x2 \cdot -6\right)}}{x1 - -6 \cdot x2} \]
      4. *-commutative0.0%

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x1, x1, -\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)\right)}}{x1 - x2 \cdot -6} \]
      2. swap-sqr15.2%

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

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{{x2}^{2}} \cdot \left(-6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      4. distribute-rgt-neg-in15.2%

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

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

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \left(-\color{blue}{36}\right)\right)}{x1 - x2 \cdot -6} \]
      7. metadata-eval15.2%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \color{blue}{-36}\right)}{x1 - x2 \cdot -6} \]
      8. sub-neg15.2%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{\color{blue}{x1 + \left(-x2 \cdot -6\right)}} \]
      9. distribute-rgt-neg-in15.2%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + \color{blue}{x2 \cdot \left(--6\right)}} \]
      10. metadata-eval15.2%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot \color{blue}{6}} \]
    7. Simplified15.2%

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

      \[\leadsto \frac{\color{blue}{-36 \cdot {x2}^{2}}}{x1 + x2 \cdot 6} \]
    9. Step-by-step derivation
      1. *-commutative16.8%

        \[\leadsto \frac{\color{blue}{{x2}^{2} \cdot -36}}{x1 + x2 \cdot 6} \]
      2. unpow216.8%

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

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

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

    if -4.5000000000000001e153 < x1 < 1.35000000000000003e154

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

      \[\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 1.35000000000000003e154 < x1

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x1, x1, -\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)\right)}}{x1 - x2 \cdot -6} \]
      2. swap-sqr90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{\left(x2 \cdot x2\right) \cdot \left(-6 \cdot -6\right)}\right)}{x1 - x2 \cdot -6} \]
      3. unpow290.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{{x2}^{2}} \cdot \left(-6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      4. distribute-rgt-neg-in90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \color{blue}{{x2}^{2} \cdot \left(--6 \cdot -6\right)}\right)}{x1 - x2 \cdot -6} \]
      5. unpow290.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \color{blue}{\left(x2 \cdot x2\right)} \cdot \left(--6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      6. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \left(-\color{blue}{36}\right)\right)}{x1 - x2 \cdot -6} \]
      7. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \color{blue}{-36}\right)}{x1 - x2 \cdot -6} \]
      8. sub-neg90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{\color{blue}{x1 + \left(-x2 \cdot -6\right)}} \]
      9. distribute-rgt-neg-in90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + \color{blue}{x2 \cdot \left(--6\right)}} \]
      10. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot \color{blue}{6}} \]
    7. Simplified90.0%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot 6}} \]
    8. Taylor expanded in x1 around inf 93.3%

      \[\leadsto \frac{\color{blue}{{x1}^{2}}}{x1 + x2 \cdot 6} \]
    9. Step-by-step derivation
      1. unpow293.3%

        \[\leadsto \frac{\color{blue}{x1 \cdot x1}}{x1 + x2 \cdot 6} \]
    10. Simplified93.3%

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

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

Alternative 24: 47.6% accurate, 7.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 + x1 \cdot \left(\left(x2 \cdot x2\right) \cdot 8\right)\\ t_1 := x1 + x2 \cdot 6\\ \mathbf{if}\;x1 \leq -2.05 \cdot 10^{+30}:\\ \;\;\;\;\frac{x2 \cdot \left(x2 \cdot -36\right)}{t_1}\\ \mathbf{elif}\;x1 \leq -1.35 \cdot 10^{-104}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x1 \leq 3.8 \cdot 10^{-122}:\\ \;\;\;\;x2 \cdot -6\\ \mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{x1 \cdot x1}{t_1}\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (+ x1 (* x1 (* (* x2 x2) 8.0)))) (t_1 (+ x1 (* x2 6.0))))
   (if (<= x1 -2.05e+30)
     (/ (* x2 (* x2 -36.0)) t_1)
     (if (<= x1 -1.35e-104)
       t_0
       (if (<= x1 3.8e-122)
         (* x2 -6.0)
         (if (<= x1 1.35e+154) t_0 (/ (* x1 x1) t_1)))))))
double code(double x1, double x2) {
	double t_0 = x1 + (x1 * ((x2 * x2) * 8.0));
	double t_1 = x1 + (x2 * 6.0);
	double tmp;
	if (x1 <= -2.05e+30) {
		tmp = (x2 * (x2 * -36.0)) / t_1;
	} else if (x1 <= -1.35e-104) {
		tmp = t_0;
	} else if (x1 <= 3.8e-122) {
		tmp = x2 * -6.0;
	} else if (x1 <= 1.35e+154) {
		tmp = t_0;
	} else {
		tmp = (x1 * x1) / t_1;
	}
	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 * ((x2 * x2) * 8.0d0))
    t_1 = x1 + (x2 * 6.0d0)
    if (x1 <= (-2.05d+30)) then
        tmp = (x2 * (x2 * (-36.0d0))) / t_1
    else if (x1 <= (-1.35d-104)) then
        tmp = t_0
    else if (x1 <= 3.8d-122) then
        tmp = x2 * (-6.0d0)
    else if (x1 <= 1.35d+154) then
        tmp = t_0
    else
        tmp = (x1 * x1) / t_1
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double t_0 = x1 + (x1 * ((x2 * x2) * 8.0));
	double t_1 = x1 + (x2 * 6.0);
	double tmp;
	if (x1 <= -2.05e+30) {
		tmp = (x2 * (x2 * -36.0)) / t_1;
	} else if (x1 <= -1.35e-104) {
		tmp = t_0;
	} else if (x1 <= 3.8e-122) {
		tmp = x2 * -6.0;
	} else if (x1 <= 1.35e+154) {
		tmp = t_0;
	} else {
		tmp = (x1 * x1) / t_1;
	}
	return tmp;
}
def code(x1, x2):
	t_0 = x1 + (x1 * ((x2 * x2) * 8.0))
	t_1 = x1 + (x2 * 6.0)
	tmp = 0
	if x1 <= -2.05e+30:
		tmp = (x2 * (x2 * -36.0)) / t_1
	elif x1 <= -1.35e-104:
		tmp = t_0
	elif x1 <= 3.8e-122:
		tmp = x2 * -6.0
	elif x1 <= 1.35e+154:
		tmp = t_0
	else:
		tmp = (x1 * x1) / t_1
	return tmp
function code(x1, x2)
	t_0 = Float64(x1 + Float64(x1 * Float64(Float64(x2 * x2) * 8.0)))
	t_1 = Float64(x1 + Float64(x2 * 6.0))
	tmp = 0.0
	if (x1 <= -2.05e+30)
		tmp = Float64(Float64(x2 * Float64(x2 * -36.0)) / t_1);
	elseif (x1 <= -1.35e-104)
		tmp = t_0;
	elseif (x1 <= 3.8e-122)
		tmp = Float64(x2 * -6.0);
	elseif (x1 <= 1.35e+154)
		tmp = t_0;
	else
		tmp = Float64(Float64(x1 * x1) / t_1);
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	t_0 = x1 + (x1 * ((x2 * x2) * 8.0));
	t_1 = x1 + (x2 * 6.0);
	tmp = 0.0;
	if (x1 <= -2.05e+30)
		tmp = (x2 * (x2 * -36.0)) / t_1;
	elseif (x1 <= -1.35e-104)
		tmp = t_0;
	elseif (x1 <= 3.8e-122)
		tmp = x2 * -6.0;
	elseif (x1 <= 1.35e+154)
		tmp = t_0;
	else
		tmp = (x1 * x1) / t_1;
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(x1 * N[(N[(x2 * x2), $MachinePrecision] * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(x2 * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -2.05e+30], N[(N[(x2 * N[(x2 * -36.0), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[x1, -1.35e-104], t$95$0, If[LessEqual[x1, 3.8e-122], N[(x2 * -6.0), $MachinePrecision], If[LessEqual[x1, 1.35e+154], t$95$0, N[(N[(x1 * x1), $MachinePrecision] / t$95$1), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x1 + x1 \cdot \left(\left(x2 \cdot x2\right) \cdot 8\right)\\
t_1 := x1 + x2 \cdot 6\\
\mathbf{if}\;x1 \leq -2.05 \cdot 10^{+30}:\\
\;\;\;\;\frac{x2 \cdot \left(x2 \cdot -36\right)}{t_1}\\

\mathbf{elif}\;x1 \leq -1.35 \cdot 10^{-104}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;x1 \leq 3.8 \cdot 10^{-122}:\\
\;\;\;\;x2 \cdot -6\\

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

\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1}{t_1}\\


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

    1. Initial program 32.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 2.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 1.0%

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

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

        \[\leadsto \frac{x1 \cdot x1 - \color{blue}{\left(x2 \cdot -6\right)} \cdot \left(-6 \cdot x2\right)}{x1 - -6 \cdot x2} \]
      3. *-commutative2.0%

        \[\leadsto \frac{x1 \cdot x1 - \left(x2 \cdot -6\right) \cdot \color{blue}{\left(x2 \cdot -6\right)}}{x1 - -6 \cdot x2} \]
      4. *-commutative2.0%

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x1, x1, -\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)\right)}}{x1 - x2 \cdot -6} \]
      2. swap-sqr11.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{\left(x2 \cdot x2\right) \cdot \left(-6 \cdot -6\right)}\right)}{x1 - x2 \cdot -6} \]
      3. unpow211.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{{x2}^{2}} \cdot \left(-6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      4. distribute-rgt-neg-in11.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \color{blue}{{x2}^{2} \cdot \left(--6 \cdot -6\right)}\right)}{x1 - x2 \cdot -6} \]
      5. unpow211.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \color{blue}{\left(x2 \cdot x2\right)} \cdot \left(--6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      6. metadata-eval11.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \left(-\color{blue}{36}\right)\right)}{x1 - x2 \cdot -6} \]
      7. metadata-eval11.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \color{blue}{-36}\right)}{x1 - x2 \cdot -6} \]
      8. sub-neg11.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{\color{blue}{x1 + \left(-x2 \cdot -6\right)}} \]
      9. distribute-rgt-neg-in11.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + \color{blue}{x2 \cdot \left(--6\right)}} \]
      10. metadata-eval11.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot \color{blue}{6}} \]
    7. Simplified11.0%

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

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

        \[\leadsto \frac{\color{blue}{{x2}^{2} \cdot -36}}{x1 + x2 \cdot 6} \]
      2. unpow212.4%

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

        \[\leadsto \frac{\color{blue}{x2 \cdot \left(x2 \cdot -36\right)}}{x1 + x2 \cdot 6} \]
    10. Simplified12.4%

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

    if -2.05000000000000003e30 < x1 < -1.3499999999999999e-104 or 3.8000000000000001e-122 < x1 < 1.35000000000000003e154

    1. Initial program 98.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 63.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 inf 39.0%

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

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

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

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

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

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

    if -1.3499999999999999e-104 < x1 < 3.8000000000000001e-122

    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 99.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 59.4%

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

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

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

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

    if 1.35000000000000003e154 < x1

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x1, x1, -\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)\right)}}{x1 - x2 \cdot -6} \]
      2. swap-sqr90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{\left(x2 \cdot x2\right) \cdot \left(-6 \cdot -6\right)}\right)}{x1 - x2 \cdot -6} \]
      3. unpow290.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{{x2}^{2}} \cdot \left(-6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      4. distribute-rgt-neg-in90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \color{blue}{{x2}^{2} \cdot \left(--6 \cdot -6\right)}\right)}{x1 - x2 \cdot -6} \]
      5. unpow290.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \color{blue}{\left(x2 \cdot x2\right)} \cdot \left(--6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      6. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \left(-\color{blue}{36}\right)\right)}{x1 - x2 \cdot -6} \]
      7. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \color{blue}{-36}\right)}{x1 - x2 \cdot -6} \]
      8. sub-neg90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{\color{blue}{x1 + \left(-x2 \cdot -6\right)}} \]
      9. distribute-rgt-neg-in90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + \color{blue}{x2 \cdot \left(--6\right)}} \]
      10. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot \color{blue}{6}} \]
    7. Simplified90.0%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot 6}} \]
    8. Taylor expanded in x1 around inf 93.3%

      \[\leadsto \frac{\color{blue}{{x1}^{2}}}{x1 + x2 \cdot 6} \]
    9. Step-by-step derivation
      1. unpow293.3%

        \[\leadsto \frac{\color{blue}{x1 \cdot x1}}{x1 + x2 \cdot 6} \]
    10. Simplified93.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -2.05 \cdot 10^{+30}:\\ \;\;\;\;\frac{x2 \cdot \left(x2 \cdot -36\right)}{x1 + x2 \cdot 6}\\ \mathbf{elif}\;x1 \leq -1.35 \cdot 10^{-104}:\\ \;\;\;\;x1 + x1 \cdot \left(\left(x2 \cdot x2\right) \cdot 8\right)\\ \mathbf{elif}\;x1 \leq 3.8 \cdot 10^{-122}:\\ \;\;\;\;x2 \cdot -6\\ \mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;x1 + x1 \cdot \left(\left(x2 \cdot x2\right) \cdot 8\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x1 \cdot x1}{x1 + x2 \cdot 6}\\ \end{array} \]

Alternative 25: 45.4% accurate, 8.4× speedup?

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

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

\mathbf{elif}\;x1 \leq 3.8 \cdot 10^{-122}:\\
\;\;\;\;x2 \cdot -6\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x1 < -2.75000000000000005e-106 or 3.8000000000000001e-122 < x1 < 1.35000000000000003e154

    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 39.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 inf 24.9%

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

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

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

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

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

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

    if -2.75000000000000005e-106 < x1 < 3.8000000000000001e-122

    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 99.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 59.4%

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

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

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

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

    if 1.35000000000000003e154 < x1

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x1, x1, -\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)\right)}}{x1 - x2 \cdot -6} \]
      2. swap-sqr90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{\left(x2 \cdot x2\right) \cdot \left(-6 \cdot -6\right)}\right)}{x1 - x2 \cdot -6} \]
      3. unpow290.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{{x2}^{2}} \cdot \left(-6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      4. distribute-rgt-neg-in90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \color{blue}{{x2}^{2} \cdot \left(--6 \cdot -6\right)}\right)}{x1 - x2 \cdot -6} \]
      5. unpow290.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \color{blue}{\left(x2 \cdot x2\right)} \cdot \left(--6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
      6. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \left(-\color{blue}{36}\right)\right)}{x1 - x2 \cdot -6} \]
      7. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \color{blue}{-36}\right)}{x1 - x2 \cdot -6} \]
      8. sub-neg90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{\color{blue}{x1 + \left(-x2 \cdot -6\right)}} \]
      9. distribute-rgt-neg-in90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + \color{blue}{x2 \cdot \left(--6\right)}} \]
      10. metadata-eval90.0%

        \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot \color{blue}{6}} \]
    7. Simplified90.0%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot 6}} \]
    8. Taylor expanded in x1 around inf 93.3%

      \[\leadsto \frac{\color{blue}{{x1}^{2}}}{x1 + x2 \cdot 6} \]
    9. Step-by-step derivation
      1. unpow293.3%

        \[\leadsto \frac{\color{blue}{x1 \cdot x1}}{x1 + x2 \cdot 6} \]
    10. Simplified93.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -2.75 \cdot 10^{-106}:\\ \;\;\;\;x1 + x1 \cdot \left(\left(x2 \cdot x2\right) \cdot 8\right)\\ \mathbf{elif}\;x1 \leq 3.8 \cdot 10^{-122}:\\ \;\;\;\;x2 \cdot -6\\ \mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;x1 + x1 \cdot \left(\left(x2 \cdot x2\right) \cdot 8\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x1 \cdot x1}{x1 + x2 \cdot 6}\\ \end{array} \]

Alternative 26: 39.8% accurate, 9.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -8.1 \cdot 10^{-106} \lor \neg \left(x1 \leq 3.7 \cdot 10^{-122}\right):\\
\;\;\;\;x1 + x1 \cdot \left(\left(x2 \cdot x2\right) \cdot 8\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x1 < -8.1000000000000002e-106 or 3.6999999999999997e-122 < x1

    1. Initial program 60.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 33.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 inf 29.2%

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

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

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

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

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

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

    if -8.1000000000000002e-106 < x1 < 3.6999999999999997e-122

    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 99.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 59.4%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -8.1 \cdot 10^{-106} \lor \neg \left(x1 \leq 3.7 \cdot 10^{-122}\right):\\ \;\;\;\;x1 + x1 \cdot \left(\left(x2 \cdot x2\right) \cdot 8\right)\\ \mathbf{else}:\\ \;\;\;\;x2 \cdot -6\\ \end{array} \]

Alternative 27: 27.1% accurate, 25.4× speedup?

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

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

    \[\leadsto x1 + \color{blue}{-6 \cdot x2} \]
  4. Final simplification21.9%

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

Alternative 28: 26.9% accurate, 42.3× speedup?

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

\\
x2 \cdot -6
\end{array}
Derivation
  1. Initial program 72.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 53.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 21.9%

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

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

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

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

    \[\leadsto x2 \cdot -6 \]

Alternative 29: 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 72.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 53.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 21.9%

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

      \[\leadsto \color{blue}{\frac{x1 \cdot x1 - \left(-6 \cdot x2\right) \cdot \left(-6 \cdot x2\right)}{x1 - -6 \cdot x2}} \]
    2. *-commutative31.5%

      \[\leadsto \frac{x1 \cdot x1 - \color{blue}{\left(x2 \cdot -6\right)} \cdot \left(-6 \cdot x2\right)}{x1 - -6 \cdot x2} \]
    3. *-commutative31.5%

      \[\leadsto \frac{x1 \cdot x1 - \left(x2 \cdot -6\right) \cdot \color{blue}{\left(x2 \cdot -6\right)}}{x1 - -6 \cdot x2} \]
    4. *-commutative31.5%

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

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

      \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x1, x1, -\left(x2 \cdot -6\right) \cdot \left(x2 \cdot -6\right)\right)}}{x1 - x2 \cdot -6} \]
    2. swap-sqr34.2%

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

      \[\leadsto \frac{\mathsf{fma}\left(x1, x1, -\color{blue}{{x2}^{2}} \cdot \left(-6 \cdot -6\right)\right)}{x1 - x2 \cdot -6} \]
    4. distribute-rgt-neg-in34.2%

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

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

      \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \left(-\color{blue}{36}\right)\right)}{x1 - x2 \cdot -6} \]
    7. metadata-eval34.2%

      \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot \color{blue}{-36}\right)}{x1 - x2 \cdot -6} \]
    8. sub-neg34.2%

      \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{\color{blue}{x1 + \left(-x2 \cdot -6\right)}} \]
    9. distribute-rgt-neg-in34.2%

      \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + \color{blue}{x2 \cdot \left(--6\right)}} \]
    10. metadata-eval34.2%

      \[\leadsto \frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot \color{blue}{6}} \]
  7. Simplified34.2%

    \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot 6}} \]
  8. Taylor expanded in x1 around inf 3.4%

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

    \[\leadsto x1 \]

Reproduce

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