Rosa's FloatVsDoubleBenchmark

Percentage Accurate: 70.6% → 99.2%
Time: 19.4s
Alternatives: 24
Speedup: 7.6×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 24 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.6% 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.2% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(2, x2, \mathsf{fma}\left(x1, x1 \cdot 3, -x1\right)\right)\\
t_1 := \frac{t\_0}{\mathsf{fma}\left(x1, x1, 1\right)}\\
t_2 := \mathsf{fma}\left(4, \mathsf{fma}\left(x2, 2, -3\right), 9\right)\\
\mathbf{if}\;x1 \leq -2.6 \cdot 10^{+50}:\\
\;\;\;\;x1 + {x1}^{4} \cdot \left(6 + \frac{\frac{t\_2}{x1} - 3}{x1}\right)\\

\mathbf{elif}\;x1 \leq 2.55 \cdot 10^{+69}:\\
\;\;\;\;x1 + \mathsf{fma}\left(\frac{x1 \cdot \left(x1 \cdot 3\right) - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, 3, \mathsf{fma}\left(\mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, x1 \cdot \mathsf{fma}\left(t\_1, 4, -6\right), \frac{\left(-3 + t\_1\right) \cdot \left(\left(x1 \cdot 2\right) \cdot t\_0\right)}{\mathsf{fma}\left(x1, x1, 1\right)}\right), \mathsf{fma}\left(x1, \left(x1 \cdot 3\right) \cdot t\_1, \mathsf{fma}\left(x1, x1 \cdot x1, x1\right)\right)\right)\right)\\

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


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

    1. Initial program 24.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. Add Preprocessing
    3. Taylor expanded in x1 around -inf

      \[\leadsto x1 + \color{blue}{{x1}^{4} \cdot \left(6 + -1 \cdot \frac{3 + -1 \cdot \frac{9 + 4 \cdot \left(2 \cdot x2 - 3\right)}{x1}}{x1}\right)} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto x1 + \color{blue}{{x1}^{4} \cdot \left(6 + -1 \cdot \frac{3 + -1 \cdot \frac{9 + 4 \cdot \left(2 \cdot x2 - 3\right)}{x1}}{x1}\right)} \]
      2. lower-pow.f64N/A

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

        \[\leadsto x1 + {x1}^{4} \cdot \left(6 + \color{blue}{\left(\mathsf{neg}\left(\frac{3 + -1 \cdot \frac{9 + 4 \cdot \left(2 \cdot x2 - 3\right)}{x1}}{x1}\right)\right)}\right) \]
      4. unsub-negN/A

        \[\leadsto x1 + {x1}^{4} \cdot \color{blue}{\left(6 - \frac{3 + -1 \cdot \frac{9 + 4 \cdot \left(2 \cdot x2 - 3\right)}{x1}}{x1}\right)} \]
      5. lower--.f64N/A

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

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

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

    if -2.6000000000000002e50 < x1 < 2.54999999999999999e69

    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. Add Preprocessing
    3. Applied rewrites99.7%

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

    if 2.54999999999999999e69 < x1

    1. Initial program 39.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. Add Preprocessing
    3. Taylor expanded in x1 around -inf

      \[\leadsto x1 + \color{blue}{{x1}^{4} \cdot \left(6 + -1 \cdot \frac{3 + -1 \cdot \frac{9 + \left(-1 \cdot \frac{2 + -2 \cdot \left(1 + 3 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1} + 4 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1}}{x1}\right)} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto x1 + \color{blue}{{x1}^{4} \cdot \left(6 + -1 \cdot \frac{3 + -1 \cdot \frac{9 + \left(-1 \cdot \frac{2 + -2 \cdot \left(1 + 3 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1} + 4 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1}}{x1}\right)} \]
      2. lower-pow.f64N/A

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

        \[\leadsto x1 + {x1}^{4} \cdot \left(6 + \color{blue}{\left(\mathsf{neg}\left(\frac{3 + -1 \cdot \frac{9 + \left(-1 \cdot \frac{2 + -2 \cdot \left(1 + 3 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1} + 4 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1}}{x1}\right)\right)}\right) \]
      4. unsub-negN/A

        \[\leadsto x1 + {x1}^{4} \cdot \color{blue}{\left(6 - \frac{3 + -1 \cdot \frac{9 + \left(-1 \cdot \frac{2 + -2 \cdot \left(1 + 3 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1} + 4 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1}}{x1}\right)} \]
      5. lower--.f64N/A

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

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

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

      \[\leadsto \color{blue}{x1 \cdot \left(1 + \left(6 \cdot \left(2 \cdot x2 - 3\right) + x1 \cdot \left(9 + \left(4 \cdot \left(2 \cdot x2 - 3\right) + x1 \cdot \left(6 \cdot x1 - 3\right)\right)\right)\right)\right)} \]
    7. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto x1 \cdot \color{blue}{\left(\left(6 \cdot \left(2 \cdot x2 - 3\right) + x1 \cdot \left(9 + \left(4 \cdot \left(2 \cdot x2 - 3\right) + x1 \cdot \left(6 \cdot x1 - 3\right)\right)\right)\right) + 1\right)} \]
      2. distribute-lft-inN/A

        \[\leadsto \color{blue}{x1 \cdot \left(6 \cdot \left(2 \cdot x2 - 3\right) + x1 \cdot \left(9 + \left(4 \cdot \left(2 \cdot x2 - 3\right) + x1 \cdot \left(6 \cdot x1 - 3\right)\right)\right)\right) + x1 \cdot 1} \]
      3. *-rgt-identityN/A

        \[\leadsto x1 \cdot \left(6 \cdot \left(2 \cdot x2 - 3\right) + x1 \cdot \left(9 + \left(4 \cdot \left(2 \cdot x2 - 3\right) + x1 \cdot \left(6 \cdot x1 - 3\right)\right)\right)\right) + \color{blue}{x1} \]
      4. lower-fma.f64N/A

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -2.6 \cdot 10^{+50}:\\ \;\;\;\;x1 + {x1}^{4} \cdot \left(6 + \frac{\frac{\mathsf{fma}\left(4, \mathsf{fma}\left(x2, 2, -3\right), 9\right)}{x1} - 3}{x1}\right)\\ \mathbf{elif}\;x1 \leq 2.55 \cdot 10^{+69}:\\ \;\;\;\;x1 + \mathsf{fma}\left(\frac{x1 \cdot \left(x1 \cdot 3\right) - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, 3, \mathsf{fma}\left(\mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, x1 \cdot \mathsf{fma}\left(\frac{\mathsf{fma}\left(2, x2, \mathsf{fma}\left(x1, x1 \cdot 3, -x1\right)\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, 4, -6\right), \frac{\left(-3 + \frac{\mathsf{fma}\left(2, x2, \mathsf{fma}\left(x1, x1 \cdot 3, -x1\right)\right)}{\mathsf{fma}\left(x1, x1, 1\right)}\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \mathsf{fma}\left(2, x2, \mathsf{fma}\left(x1, x1 \cdot 3, -x1\right)\right)\right)}{\mathsf{fma}\left(x1, x1, 1\right)}\right), \mathsf{fma}\left(x1, \left(x1 \cdot 3\right) \cdot \frac{\mathsf{fma}\left(2, x2, \mathsf{fma}\left(x1, x1 \cdot 3, -x1\right)\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, \mathsf{fma}\left(x1, x1 \cdot x1, x1\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x1, \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, 6, -3\right), \mathsf{fma}\left(4, \mathsf{fma}\left(x2, 2, -3\right), 9\right)\right), 6 \cdot \mathsf{fma}\left(x2, 2, -3\right)\right), x1\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 75.5% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := \left(t\_1 + 2 \cdot x2\right) - x1\\
t_3 := \frac{t\_2}{t\_0}\\
t_4 := -1 - x1 \cdot x1\\
t_5 := \frac{t\_2}{t\_4}\\
t_6 := x1 + \left(\left(x1 + \left(\left(\left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_5\right) + \left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(3 + t\_5\right)\right) \cdot t\_4 + 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\_0}\right)\\
t_7 := x1 + x2 \cdot \left(x1 \cdot \left(x2 \cdot 8\right)\right)\\
\mathbf{if}\;t\_6 \leq -2 \cdot 10^{+173}:\\
\;\;\;\;t\_7\\

\mathbf{elif}\;t\_6 \leq 5 \cdot 10^{+228}:\\
\;\;\;\;x2 \cdot -6 - x1\\

\mathbf{elif}\;t\_6 \leq \infty:\\
\;\;\;\;t\_7\\

\mathbf{else}:\\
\;\;\;\;x1 \cdot \mathsf{fma}\left(x1, 9, -1\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < -2e173 or 5e228 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < +inf.0

    1. Initial program 99.8%

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

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

      \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(x1, \mathsf{fma}\left(x1, \mathsf{fma}\left(x2, -4, \mathsf{fma}\left(2, \mathsf{fma}\left(x2, -2, 3\right), \mathsf{fma}\left(3, \mathsf{fma}\left(x2, 2, 3\right), \mathsf{fma}\left(x2, 14, -6\right)\right)\right)\right), \mathsf{fma}\left(x2, \mathsf{fma}\left(4, x2 \cdot 2, -12\right), -2\right)\right), x2 \cdot -6\right)} \]
    5. Taylor expanded in x2 around inf

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

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

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

        \[\leadsto x1 + \color{blue}{\left(x2 \cdot x2\right)} \cdot \left(8 \cdot x1\right) \]
      4. associate-*l*N/A

        \[\leadsto x1 + \color{blue}{x2 \cdot \left(x2 \cdot \left(8 \cdot x1\right)\right)} \]
      5. *-commutativeN/A

        \[\leadsto x1 + x2 \cdot \color{blue}{\left(\left(8 \cdot x1\right) \cdot x2\right)} \]
      6. associate-*r*N/A

        \[\leadsto x1 + x2 \cdot \color{blue}{\left(8 \cdot \left(x1 \cdot x2\right)\right)} \]
      7. lower-*.f64N/A

        \[\leadsto x1 + \color{blue}{x2 \cdot \left(8 \cdot \left(x1 \cdot x2\right)\right)} \]
      8. *-commutativeN/A

        \[\leadsto x1 + x2 \cdot \left(8 \cdot \color{blue}{\left(x2 \cdot x1\right)}\right) \]
      9. associate-*r*N/A

        \[\leadsto x1 + x2 \cdot \color{blue}{\left(\left(8 \cdot x2\right) \cdot x1\right)} \]
      10. lower-*.f64N/A

        \[\leadsto x1 + x2 \cdot \color{blue}{\left(\left(8 \cdot x2\right) \cdot x1\right)} \]
      11. *-commutativeN/A

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

        \[\leadsto x1 + x2 \cdot \left(\color{blue}{\left(x2 \cdot 8\right)} \cdot x1\right) \]
    7. Applied rewrites64.1%

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

    if -2e173 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < 5e228

    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. Add Preprocessing
    3. Taylor expanded in x2 around 0

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

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

      \[\leadsto x1 + \color{blue}{\left(-6 \cdot x2 + x1 \cdot \left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) - 2\right)\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto x1 + \left(\color{blue}{x2 \cdot -6} + x1 \cdot \left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) - 2\right)\right) \]
      2. lower-fma.f64N/A

        \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(x2, -6, x1 \cdot \left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) - 2\right)\right)} \]
      3. sub-negN/A

        \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \color{blue}{\left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) + \left(\mathsf{neg}\left(2\right)\right)\right)}\right) \]
      4. associate-*r*N/A

        \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(\color{blue}{\left(3 \cdot x1\right) \cdot \left(3 - -2 \cdot x2\right)} + \left(\mathsf{neg}\left(2\right)\right)\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(\color{blue}{\left(x1 \cdot 3\right)} \cdot \left(3 - -2 \cdot x2\right) + \left(\mathsf{neg}\left(2\right)\right)\right)\right) \]
      6. associate-*r*N/A

        \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(\color{blue}{x1 \cdot \left(3 \cdot \left(3 - -2 \cdot x2\right)\right)} + \left(\mathsf{neg}\left(2\right)\right)\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 - -2 \cdot x2\right)\right) + \color{blue}{-2}\right)\right) \]
      8. lower-*.f64N/A

        \[\leadsto x1 + \mathsf{fma}\left(x2, -6, \color{blue}{x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 - -2 \cdot x2\right)\right) + -2\right)}\right) \]
      9. cancel-sign-sub-invN/A

        \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(x1 \cdot \left(3 \cdot \color{blue}{\left(3 + \left(\mathsf{neg}\left(-2\right)\right) \cdot x2\right)}\right) + -2\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + \color{blue}{2} \cdot x2\right)\right) + -2\right)\right) \]
      11. lower-fma.f64N/A

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

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

      \[\leadsto \color{blue}{-6 \cdot x2 + -1 \cdot x1} \]
    9. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto -6 \cdot x2 + \color{blue}{\left(\mathsf{neg}\left(x1\right)\right)} \]
      2. unsub-negN/A

        \[\leadsto \color{blue}{-6 \cdot x2 - x1} \]
      3. lower--.f64N/A

        \[\leadsto \color{blue}{-6 \cdot x2 - x1} \]
      4. lower-*.f6481.3

        \[\leadsto \color{blue}{-6 \cdot x2} - x1 \]
    10. Applied rewrites81.3%

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

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

    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. Add Preprocessing
    3. Taylor expanded in x2 around 0

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

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

      \[\leadsto x1 + \color{blue}{\left(-6 \cdot x2 + x1 \cdot \left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) - 2\right)\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto x1 + \left(\color{blue}{x2 \cdot -6} + x1 \cdot \left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) - 2\right)\right) \]
      2. lower-fma.f64N/A

        \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(x2, -6, x1 \cdot \left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) - 2\right)\right)} \]
      3. sub-negN/A

        \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \color{blue}{\left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) + \left(\mathsf{neg}\left(2\right)\right)\right)}\right) \]
      4. associate-*r*N/A

        \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(\color{blue}{\left(3 \cdot x1\right) \cdot \left(3 - -2 \cdot x2\right)} + \left(\mathsf{neg}\left(2\right)\right)\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(\color{blue}{\left(x1 \cdot 3\right)} \cdot \left(3 - -2 \cdot x2\right) + \left(\mathsf{neg}\left(2\right)\right)\right)\right) \]
      6. associate-*r*N/A

        \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(\color{blue}{x1 \cdot \left(3 \cdot \left(3 - -2 \cdot x2\right)\right)} + \left(\mathsf{neg}\left(2\right)\right)\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 - -2 \cdot x2\right)\right) + \color{blue}{-2}\right)\right) \]
      8. lower-*.f64N/A

        \[\leadsto x1 + \mathsf{fma}\left(x2, -6, \color{blue}{x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 - -2 \cdot x2\right)\right) + -2\right)}\right) \]
      9. cancel-sign-sub-invN/A

        \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(x1 \cdot \left(3 \cdot \color{blue}{\left(3 + \left(\mathsf{neg}\left(-2\right)\right) \cdot x2\right)}\right) + -2\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + \color{blue}{2} \cdot x2\right)\right) + -2\right)\right) \]
      11. lower-fma.f64N/A

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

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

      \[\leadsto \color{blue}{x1 + x1 \cdot \left(9 \cdot x1 - 2\right)} \]
    9. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{x1 \cdot \left(9 \cdot x1 - 2\right) + x1} \]
      2. *-rgt-identityN/A

        \[\leadsto x1 \cdot \left(9 \cdot x1 - 2\right) + \color{blue}{x1 \cdot 1} \]
      3. distribute-lft-outN/A

        \[\leadsto \color{blue}{x1 \cdot \left(\left(9 \cdot x1 - 2\right) + 1\right)} \]
      4. lower-*.f64N/A

        \[\leadsto \color{blue}{x1 \cdot \left(\left(9 \cdot x1 - 2\right) + 1\right)} \]
      5. sub-negN/A

        \[\leadsto x1 \cdot \left(\color{blue}{\left(9 \cdot x1 + \left(\mathsf{neg}\left(2\right)\right)\right)} + 1\right) \]
      6. metadata-evalN/A

        \[\leadsto x1 \cdot \left(\left(9 \cdot x1 + \color{blue}{-2}\right) + 1\right) \]
      7. associate-+l+N/A

        \[\leadsto x1 \cdot \color{blue}{\left(9 \cdot x1 + \left(-2 + 1\right)\right)} \]
      8. metadata-evalN/A

        \[\leadsto x1 \cdot \left(9 \cdot x1 + \color{blue}{-1}\right) \]
      9. *-commutativeN/A

        \[\leadsto x1 \cdot \left(\color{blue}{x1 \cdot 9} + -1\right) \]
      10. lower-fma.f6488.4

        \[\leadsto x1 \cdot \color{blue}{\mathsf{fma}\left(x1, 9, -1\right)} \]
    10. Applied rewrites88.4%

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

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

Alternative 3: 82.2% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 \cdot x1 + 1\\ t_1 := x1 \cdot \left(x1 \cdot 3\right)\\ t_2 := \left(t\_1 + 2 \cdot x2\right) - x1\\ t_3 := \frac{t\_2}{t\_0}\\ t_4 := -1 - x1 \cdot x1\\ t_5 := \frac{t\_2}{t\_4}\\ t_6 := x1 + \left(\left(x1 + \left(\left(\left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_5\right) + \left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(3 + t\_5\right)\right) \cdot t\_4 + 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\_0}\right)\\ \mathbf{if}\;t\_6 \leq -2 \cdot 10^{+173}:\\ \;\;\;\;x1 + x2 \cdot \left(x1 \cdot \left(x2 \cdot 8\right)\right)\\ \mathbf{elif}\;t\_6 \leq 5 \cdot 10^{+59}:\\ \;\;\;\;x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \mathsf{fma}\left(x1, \mathsf{fma}\left(x2, 6, 9\right), -2\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x1 \cdot x1, x1 \cdot \mathsf{fma}\left(x1, 6, -3\right), x1\right)\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (+ (* x1 x1) 1.0))
        (t_1 (* x1 (* x1 3.0)))
        (t_2 (- (+ t_1 (* 2.0 x2)) x1))
        (t_3 (/ t_2 t_0))
        (t_4 (- -1.0 (* x1 x1)))
        (t_5 (/ t_2 t_4))
        (t_6
         (+
          x1
          (+
           (+
            x1
            (+
             (+
              (*
               (+
                (* (* x1 x1) (+ 6.0 (* 4.0 t_5)))
                (* (* (* x1 2.0) t_3) (+ 3.0 t_5)))
               t_4)
              (* t_1 t_3))
             (* x1 (* x1 x1))))
           (* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_0))))))
   (if (<= t_6 -2e+173)
     (+ x1 (* x2 (* x1 (* x2 8.0))))
     (if (<= t_6 5e+59)
       (+ x1 (fma x2 -6.0 (* x1 (fma x1 (fma x2 6.0 9.0) -2.0))))
       (fma (* x1 x1) (* x1 (fma x1 6.0 -3.0)) x1)))))
double code(double x1, double x2) {
	double t_0 = (x1 * x1) + 1.0;
	double t_1 = x1 * (x1 * 3.0);
	double t_2 = (t_1 + (2.0 * x2)) - x1;
	double t_3 = t_2 / t_0;
	double t_4 = -1.0 - (x1 * x1);
	double t_5 = t_2 / t_4;
	double t_6 = x1 + ((x1 + ((((((x1 * x1) * (6.0 + (4.0 * t_5))) + (((x1 * 2.0) * t_3) * (3.0 + t_5))) * t_4) + (t_1 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)));
	double tmp;
	if (t_6 <= -2e+173) {
		tmp = x1 + (x2 * (x1 * (x2 * 8.0)));
	} else if (t_6 <= 5e+59) {
		tmp = x1 + fma(x2, -6.0, (x1 * fma(x1, fma(x2, 6.0, 9.0), -2.0)));
	} else {
		tmp = fma((x1 * x1), (x1 * fma(x1, 6.0, -3.0)), x1);
	}
	return tmp;
}
function code(x1, x2)
	t_0 = Float64(Float64(x1 * x1) + 1.0)
	t_1 = Float64(x1 * Float64(x1 * 3.0))
	t_2 = Float64(Float64(t_1 + Float64(2.0 * x2)) - x1)
	t_3 = Float64(t_2 / t_0)
	t_4 = Float64(-1.0 - Float64(x1 * x1))
	t_5 = Float64(t_2 / t_4)
	t_6 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_5))) + Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(3.0 + t_5))) * t_4) + Float64(t_1 * t_3)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_0))))
	tmp = 0.0
	if (t_6 <= -2e+173)
		tmp = Float64(x1 + Float64(x2 * Float64(x1 * Float64(x2 * 8.0))));
	elseif (t_6 <= 5e+59)
		tmp = Float64(x1 + fma(x2, -6.0, Float64(x1 * fma(x1, fma(x2, 6.0, 9.0), -2.0))));
	else
		tmp = fma(Float64(x1 * x1), Float64(x1 * fma(x1, 6.0, -3.0)), x1);
	end
	return tmp
end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 / t$95$0), $MachinePrecision]}, Block[{t$95$4 = N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$2 / t$95$4), $MachinePrecision]}, Block[{t$95$6 = N[(x1 + N[(N[(x1 + N[(N[(N[(N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(3.0 + t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$4), $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$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$6, -2e+173], N[(x1 + N[(x2 * N[(x1 * N[(x2 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$6, 5e+59], N[(x1 + N[(x2 * -6.0 + N[(x1 * N[(x1 * N[(x2 * 6.0 + 9.0), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x1 * x1), $MachinePrecision] * N[(x1 * N[(x1 * 6.0 + -3.0), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision]]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := \left(t\_1 + 2 \cdot x2\right) - x1\\
t_3 := \frac{t\_2}{t\_0}\\
t_4 := -1 - x1 \cdot x1\\
t_5 := \frac{t\_2}{t\_4}\\
t_6 := x1 + \left(\left(x1 + \left(\left(\left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_5\right) + \left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(3 + t\_5\right)\right) \cdot t\_4 + 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\_0}\right)\\
\mathbf{if}\;t\_6 \leq -2 \cdot 10^{+173}:\\
\;\;\;\;x1 + x2 \cdot \left(x1 \cdot \left(x2 \cdot 8\right)\right)\\

\mathbf{elif}\;t\_6 \leq 5 \cdot 10^{+59}:\\
\;\;\;\;x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \mathsf{fma}\left(x1, \mathsf{fma}\left(x2, 6, 9\right), -2\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x1 \cdot x1, x1 \cdot \mathsf{fma}\left(x1, 6, -3\right), x1\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < -2e173

    1. Initial program 99.8%

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

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

      \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(x1, \mathsf{fma}\left(x1, \mathsf{fma}\left(x2, -4, \mathsf{fma}\left(2, \mathsf{fma}\left(x2, -2, 3\right), \mathsf{fma}\left(3, \mathsf{fma}\left(x2, 2, 3\right), \mathsf{fma}\left(x2, 14, -6\right)\right)\right)\right), \mathsf{fma}\left(x2, \mathsf{fma}\left(4, x2 \cdot 2, -12\right), -2\right)\right), x2 \cdot -6\right)} \]
    5. Taylor expanded in x2 around inf

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

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

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

        \[\leadsto x1 + \color{blue}{\left(x2 \cdot x2\right)} \cdot \left(8 \cdot x1\right) \]
      4. associate-*l*N/A

        \[\leadsto x1 + \color{blue}{x2 \cdot \left(x2 \cdot \left(8 \cdot x1\right)\right)} \]
      5. *-commutativeN/A

        \[\leadsto x1 + x2 \cdot \color{blue}{\left(\left(8 \cdot x1\right) \cdot x2\right)} \]
      6. associate-*r*N/A

        \[\leadsto x1 + x2 \cdot \color{blue}{\left(8 \cdot \left(x1 \cdot x2\right)\right)} \]
      7. lower-*.f64N/A

        \[\leadsto x1 + \color{blue}{x2 \cdot \left(8 \cdot \left(x1 \cdot x2\right)\right)} \]
      8. *-commutativeN/A

        \[\leadsto x1 + x2 \cdot \left(8 \cdot \color{blue}{\left(x2 \cdot x1\right)}\right) \]
      9. associate-*r*N/A

        \[\leadsto x1 + x2 \cdot \color{blue}{\left(\left(8 \cdot x2\right) \cdot x1\right)} \]
      10. lower-*.f64N/A

        \[\leadsto x1 + x2 \cdot \color{blue}{\left(\left(8 \cdot x2\right) \cdot x1\right)} \]
      11. *-commutativeN/A

        \[\leadsto x1 + x2 \cdot \left(\color{blue}{\left(x2 \cdot 8\right)} \cdot x1\right) \]
      12. lower-*.f6489.4

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

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

    if -2e173 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < 4.9999999999999997e59

    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. Add Preprocessing
    3. Taylor expanded in x2 around 0

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

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

      \[\leadsto x1 + \color{blue}{\left(-6 \cdot x2 + x1 \cdot \left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) - 2\right)\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto x1 + \left(\color{blue}{x2 \cdot -6} + x1 \cdot \left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) - 2\right)\right) \]
      2. lower-fma.f64N/A

        \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(x2, -6, x1 \cdot \left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) - 2\right)\right)} \]
      3. sub-negN/A

        \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \color{blue}{\left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) + \left(\mathsf{neg}\left(2\right)\right)\right)}\right) \]
      4. associate-*r*N/A

        \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(\color{blue}{\left(3 \cdot x1\right) \cdot \left(3 - -2 \cdot x2\right)} + \left(\mathsf{neg}\left(2\right)\right)\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(\color{blue}{\left(x1 \cdot 3\right)} \cdot \left(3 - -2 \cdot x2\right) + \left(\mathsf{neg}\left(2\right)\right)\right)\right) \]
      6. associate-*r*N/A

        \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(\color{blue}{x1 \cdot \left(3 \cdot \left(3 - -2 \cdot x2\right)\right)} + \left(\mathsf{neg}\left(2\right)\right)\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 - -2 \cdot x2\right)\right) + \color{blue}{-2}\right)\right) \]
      8. lower-*.f64N/A

        \[\leadsto x1 + \mathsf{fma}\left(x2, -6, \color{blue}{x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 - -2 \cdot x2\right)\right) + -2\right)}\right) \]
      9. cancel-sign-sub-invN/A

        \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(x1 \cdot \left(3 \cdot \color{blue}{\left(3 + \left(\mathsf{neg}\left(-2\right)\right) \cdot x2\right)}\right) + -2\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + \color{blue}{2} \cdot x2\right)\right) + -2\right)\right) \]
      11. lower-fma.f64N/A

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

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

    if 4.9999999999999997e59 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))))

    1. Initial program 46.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. Add Preprocessing
    3. Taylor expanded in x1 around inf

      \[\leadsto x1 + \color{blue}{{x1}^{4} \cdot \left(6 - 3 \cdot \frac{1}{x1}\right)} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto x1 + \color{blue}{{x1}^{4} \cdot \left(6 - 3 \cdot \frac{1}{x1}\right)} \]
      2. lower-pow.f64N/A

        \[\leadsto x1 + \color{blue}{{x1}^{4}} \cdot \left(6 - 3 \cdot \frac{1}{x1}\right) \]
      3. sub-negN/A

        \[\leadsto x1 + {x1}^{4} \cdot \color{blue}{\left(6 + \left(\mathsf{neg}\left(3 \cdot \frac{1}{x1}\right)\right)\right)} \]
      4. lower-+.f64N/A

        \[\leadsto x1 + {x1}^{4} \cdot \color{blue}{\left(6 + \left(\mathsf{neg}\left(3 \cdot \frac{1}{x1}\right)\right)\right)} \]
      5. associate-*r/N/A

        \[\leadsto x1 + {x1}^{4} \cdot \left(6 + \left(\mathsf{neg}\left(\color{blue}{\frac{3 \cdot 1}{x1}}\right)\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto x1 + {x1}^{4} \cdot \left(6 + \left(\mathsf{neg}\left(\frac{\color{blue}{3}}{x1}\right)\right)\right) \]
      7. distribute-neg-fracN/A

        \[\leadsto x1 + {x1}^{4} \cdot \left(6 + \color{blue}{\frac{\mathsf{neg}\left(3\right)}{x1}}\right) \]
      8. lower-/.f64N/A

        \[\leadsto x1 + {x1}^{4} \cdot \left(6 + \color{blue}{\frac{\mathsf{neg}\left(3\right)}{x1}}\right) \]
      9. metadata-eval81.7

        \[\leadsto x1 + {x1}^{4} \cdot \left(6 + \frac{\color{blue}{-3}}{x1}\right) \]
    5. Applied rewrites81.7%

      \[\leadsto x1 + \color{blue}{{x1}^{4} \cdot \left(6 + \frac{-3}{x1}\right)} \]
    6. Step-by-step derivation
      1. lift-pow.f64N/A

        \[\leadsto x1 + \color{blue}{{x1}^{4}} \cdot \left(6 + \frac{-3}{x1}\right) \]
      2. lift-/.f64N/A

        \[\leadsto x1 + {x1}^{4} \cdot \left(6 + \color{blue}{\frac{-3}{x1}}\right) \]
      3. lift-+.f64N/A

        \[\leadsto x1 + {x1}^{4} \cdot \color{blue}{\left(6 + \frac{-3}{x1}\right)} \]
      4. lift-*.f64N/A

        \[\leadsto x1 + \color{blue}{{x1}^{4} \cdot \left(6 + \frac{-3}{x1}\right)} \]
      5. +-commutativeN/A

        \[\leadsto \color{blue}{{x1}^{4} \cdot \left(6 + \frac{-3}{x1}\right) + x1} \]
      6. lift-*.f64N/A

        \[\leadsto \color{blue}{{x1}^{4} \cdot \left(6 + \frac{-3}{x1}\right)} + x1 \]
      7. *-commutativeN/A

        \[\leadsto \color{blue}{\left(6 + \frac{-3}{x1}\right) \cdot {x1}^{4}} + x1 \]
      8. lower-fma.f6481.7

        \[\leadsto \color{blue}{\mathsf{fma}\left(6 + \frac{-3}{x1}, {x1}^{4}, x1\right)} \]
      9. lift-pow.f64N/A

        \[\leadsto \mathsf{fma}\left(6 + \frac{-3}{x1}, \color{blue}{{x1}^{4}}, x1\right) \]
      10. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(6 + \frac{-3}{x1}, {x1}^{\color{blue}{\left(2 + 2\right)}}, x1\right) \]
      11. pow-prod-upN/A

        \[\leadsto \mathsf{fma}\left(6 + \frac{-3}{x1}, \color{blue}{{x1}^{2} \cdot {x1}^{2}}, x1\right) \]
      12. pow-prod-downN/A

        \[\leadsto \mathsf{fma}\left(6 + \frac{-3}{x1}, \color{blue}{{\left(x1 \cdot x1\right)}^{2}}, x1\right) \]
      13. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(6 + \frac{-3}{x1}, {\color{blue}{\left(x1 \cdot x1\right)}}^{2}, x1\right) \]
      14. pow2N/A

        \[\leadsto \mathsf{fma}\left(6 + \frac{-3}{x1}, \color{blue}{\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)}, x1\right) \]
      15. lower-*.f6481.7

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

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

      \[\leadsto \color{blue}{x1 \cdot \left(1 + {x1}^{2} \cdot \left(6 \cdot x1 - 3\right)\right)} \]
    9. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto x1 \cdot \color{blue}{\left({x1}^{2} \cdot \left(6 \cdot x1 - 3\right) + 1\right)} \]
      2. distribute-rgt-inN/A

        \[\leadsto \color{blue}{\left({x1}^{2} \cdot \left(6 \cdot x1 - 3\right)\right) \cdot x1 + 1 \cdot x1} \]
      3. associate-*l*N/A

        \[\leadsto \color{blue}{{x1}^{2} \cdot \left(\left(6 \cdot x1 - 3\right) \cdot x1\right)} + 1 \cdot x1 \]
      4. *-lft-identityN/A

        \[\leadsto {x1}^{2} \cdot \left(\left(6 \cdot x1 - 3\right) \cdot x1\right) + \color{blue}{x1} \]
      5. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left({x1}^{2}, \left(6 \cdot x1 - 3\right) \cdot x1, x1\right)} \]
      6. unpow2N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{x1 \cdot x1}, \left(6 \cdot x1 - 3\right) \cdot x1, x1\right) \]
      7. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{x1 \cdot x1}, \left(6 \cdot x1 - 3\right) \cdot x1, x1\right) \]
      8. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(x1 \cdot x1, \color{blue}{\left(6 \cdot x1 - 3\right) \cdot x1}, x1\right) \]
      9. sub-negN/A

        \[\leadsto \mathsf{fma}\left(x1 \cdot x1, \color{blue}{\left(6 \cdot x1 + \left(\mathsf{neg}\left(3\right)\right)\right)} \cdot x1, x1\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(x1 \cdot x1, \left(\color{blue}{x1 \cdot 6} + \left(\mathsf{neg}\left(3\right)\right)\right) \cdot x1, x1\right) \]
      11. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(x1 \cdot x1, \left(x1 \cdot 6 + \color{blue}{-3}\right) \cdot x1, x1\right) \]
      12. lower-fma.f6481.7

        \[\leadsto \mathsf{fma}\left(x1 \cdot x1, \color{blue}{\mathsf{fma}\left(x1, 6, -3\right)} \cdot x1, x1\right) \]
    10. Applied rewrites81.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 + \left(\left(x1 + \left(\left(\left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{-1 - x1 \cdot x1}\right) + \left(\left(x1 \cdot 2\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(3 + \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{-1 - x1 \cdot x1}\right)\right) \cdot \left(-1 - x1 \cdot x1\right) + \left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \leq -2 \cdot 10^{+173}:\\ \;\;\;\;x1 + x2 \cdot \left(x1 \cdot \left(x2 \cdot 8\right)\right)\\ \mathbf{elif}\;x1 + \left(\left(x1 + \left(\left(\left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{-1 - x1 \cdot x1}\right) + \left(\left(x1 \cdot 2\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(3 + \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{-1 - x1 \cdot x1}\right)\right) \cdot \left(-1 - x1 \cdot x1\right) + \left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \leq 5 \cdot 10^{+59}:\\ \;\;\;\;x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \mathsf{fma}\left(x1, \mathsf{fma}\left(x2, 6, 9\right), -2\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x1 \cdot x1, x1 \cdot \mathsf{fma}\left(x1, 6, -3\right), x1\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 81.6% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 \cdot x1 + 1\\ t_1 := x1 \cdot \left(x1 \cdot 3\right)\\ t_2 := \left(t\_1 + 2 \cdot x2\right) - x1\\ t_3 := \frac{t\_2}{t\_0}\\ t_4 := -1 - x1 \cdot x1\\ t_5 := \frac{t\_2}{t\_4}\\ t_6 := x1 + \left(\left(x1 + \left(\left(\left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_5\right) + \left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(3 + t\_5\right)\right) \cdot t\_4 + 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\_0}\right)\\ \mathbf{if}\;t\_6 \leq -2 \cdot 10^{+173}:\\ \;\;\;\;x1 + x2 \cdot \left(x1 \cdot \left(x2 \cdot 8\right)\right)\\ \mathbf{elif}\;t\_6 \leq 2 \cdot 10^{+42}:\\ \;\;\;\;x1 + \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, x1 \cdot -19, -2\right), x2 \cdot -6\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x1 \cdot x1, x1 \cdot \mathsf{fma}\left(x1, 6, -3\right), x1\right)\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (+ (* x1 x1) 1.0))
        (t_1 (* x1 (* x1 3.0)))
        (t_2 (- (+ t_1 (* 2.0 x2)) x1))
        (t_3 (/ t_2 t_0))
        (t_4 (- -1.0 (* x1 x1)))
        (t_5 (/ t_2 t_4))
        (t_6
         (+
          x1
          (+
           (+
            x1
            (+
             (+
              (*
               (+
                (* (* x1 x1) (+ 6.0 (* 4.0 t_5)))
                (* (* (* x1 2.0) t_3) (+ 3.0 t_5)))
               t_4)
              (* t_1 t_3))
             (* x1 (* x1 x1))))
           (* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_0))))))
   (if (<= t_6 -2e+173)
     (+ x1 (* x2 (* x1 (* x2 8.0))))
     (if (<= t_6 2e+42)
       (+ x1 (fma x1 (fma x1 (* x1 -19.0) -2.0) (* x2 -6.0)))
       (fma (* x1 x1) (* x1 (fma x1 6.0 -3.0)) x1)))))
double code(double x1, double x2) {
	double t_0 = (x1 * x1) + 1.0;
	double t_1 = x1 * (x1 * 3.0);
	double t_2 = (t_1 + (2.0 * x2)) - x1;
	double t_3 = t_2 / t_0;
	double t_4 = -1.0 - (x1 * x1);
	double t_5 = t_2 / t_4;
	double t_6 = x1 + ((x1 + ((((((x1 * x1) * (6.0 + (4.0 * t_5))) + (((x1 * 2.0) * t_3) * (3.0 + t_5))) * t_4) + (t_1 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)));
	double tmp;
	if (t_6 <= -2e+173) {
		tmp = x1 + (x2 * (x1 * (x2 * 8.0)));
	} else if (t_6 <= 2e+42) {
		tmp = x1 + fma(x1, fma(x1, (x1 * -19.0), -2.0), (x2 * -6.0));
	} else {
		tmp = fma((x1 * x1), (x1 * fma(x1, 6.0, -3.0)), x1);
	}
	return tmp;
}
function code(x1, x2)
	t_0 = Float64(Float64(x1 * x1) + 1.0)
	t_1 = Float64(x1 * Float64(x1 * 3.0))
	t_2 = Float64(Float64(t_1 + Float64(2.0 * x2)) - x1)
	t_3 = Float64(t_2 / t_0)
	t_4 = Float64(-1.0 - Float64(x1 * x1))
	t_5 = Float64(t_2 / t_4)
	t_6 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_5))) + Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(3.0 + t_5))) * t_4) + Float64(t_1 * t_3)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_0))))
	tmp = 0.0
	if (t_6 <= -2e+173)
		tmp = Float64(x1 + Float64(x2 * Float64(x1 * Float64(x2 * 8.0))));
	elseif (t_6 <= 2e+42)
		tmp = Float64(x1 + fma(x1, fma(x1, Float64(x1 * -19.0), -2.0), Float64(x2 * -6.0)));
	else
		tmp = fma(Float64(x1 * x1), Float64(x1 * fma(x1, 6.0, -3.0)), x1);
	end
	return tmp
end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 / t$95$0), $MachinePrecision]}, Block[{t$95$4 = N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$2 / t$95$4), $MachinePrecision]}, Block[{t$95$6 = N[(x1 + N[(N[(x1 + N[(N[(N[(N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(3.0 + t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$4), $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$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$6, -2e+173], N[(x1 + N[(x2 * N[(x1 * N[(x2 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$6, 2e+42], N[(x1 + N[(x1 * N[(x1 * N[(x1 * -19.0), $MachinePrecision] + -2.0), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x1 * x1), $MachinePrecision] * N[(x1 * N[(x1 * 6.0 + -3.0), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision]]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := \left(t\_1 + 2 \cdot x2\right) - x1\\
t_3 := \frac{t\_2}{t\_0}\\
t_4 := -1 - x1 \cdot x1\\
t_5 := \frac{t\_2}{t\_4}\\
t_6 := x1 + \left(\left(x1 + \left(\left(\left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_5\right) + \left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(3 + t\_5\right)\right) \cdot t\_4 + 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\_0}\right)\\
\mathbf{if}\;t\_6 \leq -2 \cdot 10^{+173}:\\
\;\;\;\;x1 + x2 \cdot \left(x1 \cdot \left(x2 \cdot 8\right)\right)\\

\mathbf{elif}\;t\_6 \leq 2 \cdot 10^{+42}:\\
\;\;\;\;x1 + \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, x1 \cdot -19, -2\right), x2 \cdot -6\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x1 \cdot x1, x1 \cdot \mathsf{fma}\left(x1, 6, -3\right), x1\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < -2e173

    1. Initial program 99.8%

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

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

      \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(x1, \mathsf{fma}\left(x1, \mathsf{fma}\left(x2, -4, \mathsf{fma}\left(2, \mathsf{fma}\left(x2, -2, 3\right), \mathsf{fma}\left(3, \mathsf{fma}\left(x2, 2, 3\right), \mathsf{fma}\left(x2, 14, -6\right)\right)\right)\right), \mathsf{fma}\left(x2, \mathsf{fma}\left(4, x2 \cdot 2, -12\right), -2\right)\right), x2 \cdot -6\right)} \]
    5. Taylor expanded in x2 around inf

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

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

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

        \[\leadsto x1 + \color{blue}{\left(x2 \cdot x2\right)} \cdot \left(8 \cdot x1\right) \]
      4. associate-*l*N/A

        \[\leadsto x1 + \color{blue}{x2 \cdot \left(x2 \cdot \left(8 \cdot x1\right)\right)} \]
      5. *-commutativeN/A

        \[\leadsto x1 + x2 \cdot \color{blue}{\left(\left(8 \cdot x1\right) \cdot x2\right)} \]
      6. associate-*r*N/A

        \[\leadsto x1 + x2 \cdot \color{blue}{\left(8 \cdot \left(x1 \cdot x2\right)\right)} \]
      7. lower-*.f64N/A

        \[\leadsto x1 + \color{blue}{x2 \cdot \left(8 \cdot \left(x1 \cdot x2\right)\right)} \]
      8. *-commutativeN/A

        \[\leadsto x1 + x2 \cdot \left(8 \cdot \color{blue}{\left(x2 \cdot x1\right)}\right) \]
      9. associate-*r*N/A

        \[\leadsto x1 + x2 \cdot \color{blue}{\left(\left(8 \cdot x2\right) \cdot x1\right)} \]
      10. lower-*.f64N/A

        \[\leadsto x1 + x2 \cdot \color{blue}{\left(\left(8 \cdot x2\right) \cdot x1\right)} \]
      11. *-commutativeN/A

        \[\leadsto x1 + x2 \cdot \left(\color{blue}{\left(x2 \cdot 8\right)} \cdot x1\right) \]
      12. lower-*.f6489.4

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

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

    if -2e173 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < 2.00000000000000009e42

    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. Add Preprocessing
    3. Taylor expanded in x2 around 0

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

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

      \[\leadsto x1 + \color{blue}{\left(-6 \cdot x2 + x1 \cdot \left(x1 \cdot \left(-19 \cdot x1 + 3 \cdot \left(3 - -2 \cdot x2\right)\right) - 2\right)\right)} \]
    6. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto x1 + \color{blue}{\left(x1 \cdot \left(x1 \cdot \left(-19 \cdot x1 + 3 \cdot \left(3 - -2 \cdot x2\right)\right) - 2\right) + -6 \cdot x2\right)} \]
      2. lower-fma.f64N/A

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

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

      \[\leadsto x1 + \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, \color{blue}{-19 \cdot x1}, -2\right), x2 \cdot -6\right) \]
    9. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto x1 + \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, \color{blue}{x1 \cdot -19}, -2\right), x2 \cdot -6\right) \]
      2. lower-*.f6493.1

        \[\leadsto x1 + \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, \color{blue}{x1 \cdot -19}, -2\right), x2 \cdot -6\right) \]
    10. Applied rewrites93.1%

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

    if 2.00000000000000009e42 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))))

    1. Initial program 47.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. Add Preprocessing
    3. Taylor expanded in x1 around inf

      \[\leadsto x1 + \color{blue}{{x1}^{4} \cdot \left(6 - 3 \cdot \frac{1}{x1}\right)} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto x1 + \color{blue}{{x1}^{4} \cdot \left(6 - 3 \cdot \frac{1}{x1}\right)} \]
      2. lower-pow.f64N/A

        \[\leadsto x1 + \color{blue}{{x1}^{4}} \cdot \left(6 - 3 \cdot \frac{1}{x1}\right) \]
      3. sub-negN/A

        \[\leadsto x1 + {x1}^{4} \cdot \color{blue}{\left(6 + \left(\mathsf{neg}\left(3 \cdot \frac{1}{x1}\right)\right)\right)} \]
      4. lower-+.f64N/A

        \[\leadsto x1 + {x1}^{4} \cdot \color{blue}{\left(6 + \left(\mathsf{neg}\left(3 \cdot \frac{1}{x1}\right)\right)\right)} \]
      5. associate-*r/N/A

        \[\leadsto x1 + {x1}^{4} \cdot \left(6 + \left(\mathsf{neg}\left(\color{blue}{\frac{3 \cdot 1}{x1}}\right)\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto x1 + {x1}^{4} \cdot \left(6 + \left(\mathsf{neg}\left(\frac{\color{blue}{3}}{x1}\right)\right)\right) \]
      7. distribute-neg-fracN/A

        \[\leadsto x1 + {x1}^{4} \cdot \left(6 + \color{blue}{\frac{\mathsf{neg}\left(3\right)}{x1}}\right) \]
      8. lower-/.f64N/A

        \[\leadsto x1 + {x1}^{4} \cdot \left(6 + \color{blue}{\frac{\mathsf{neg}\left(3\right)}{x1}}\right) \]
      9. metadata-eval80.9

        \[\leadsto x1 + {x1}^{4} \cdot \left(6 + \frac{\color{blue}{-3}}{x1}\right) \]
    5. Applied rewrites80.9%

      \[\leadsto x1 + \color{blue}{{x1}^{4} \cdot \left(6 + \frac{-3}{x1}\right)} \]
    6. Step-by-step derivation
      1. lift-pow.f64N/A

        \[\leadsto x1 + \color{blue}{{x1}^{4}} \cdot \left(6 + \frac{-3}{x1}\right) \]
      2. lift-/.f64N/A

        \[\leadsto x1 + {x1}^{4} \cdot \left(6 + \color{blue}{\frac{-3}{x1}}\right) \]
      3. lift-+.f64N/A

        \[\leadsto x1 + {x1}^{4} \cdot \color{blue}{\left(6 + \frac{-3}{x1}\right)} \]
      4. lift-*.f64N/A

        \[\leadsto x1 + \color{blue}{{x1}^{4} \cdot \left(6 + \frac{-3}{x1}\right)} \]
      5. +-commutativeN/A

        \[\leadsto \color{blue}{{x1}^{4} \cdot \left(6 + \frac{-3}{x1}\right) + x1} \]
      6. lift-*.f64N/A

        \[\leadsto \color{blue}{{x1}^{4} \cdot \left(6 + \frac{-3}{x1}\right)} + x1 \]
      7. *-commutativeN/A

        \[\leadsto \color{blue}{\left(6 + \frac{-3}{x1}\right) \cdot {x1}^{4}} + x1 \]
      8. lower-fma.f6480.9

        \[\leadsto \color{blue}{\mathsf{fma}\left(6 + \frac{-3}{x1}, {x1}^{4}, x1\right)} \]
      9. lift-pow.f64N/A

        \[\leadsto \mathsf{fma}\left(6 + \frac{-3}{x1}, \color{blue}{{x1}^{4}}, x1\right) \]
      10. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(6 + \frac{-3}{x1}, {x1}^{\color{blue}{\left(2 + 2\right)}}, x1\right) \]
      11. pow-prod-upN/A

        \[\leadsto \mathsf{fma}\left(6 + \frac{-3}{x1}, \color{blue}{{x1}^{2} \cdot {x1}^{2}}, x1\right) \]
      12. pow-prod-downN/A

        \[\leadsto \mathsf{fma}\left(6 + \frac{-3}{x1}, \color{blue}{{\left(x1 \cdot x1\right)}^{2}}, x1\right) \]
      13. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(6 + \frac{-3}{x1}, {\color{blue}{\left(x1 \cdot x1\right)}}^{2}, x1\right) \]
      14. pow2N/A

        \[\leadsto \mathsf{fma}\left(6 + \frac{-3}{x1}, \color{blue}{\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)}, x1\right) \]
      15. lower-*.f6480.9

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

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

      \[\leadsto \color{blue}{x1 \cdot \left(1 + {x1}^{2} \cdot \left(6 \cdot x1 - 3\right)\right)} \]
    9. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto x1 \cdot \color{blue}{\left({x1}^{2} \cdot \left(6 \cdot x1 - 3\right) + 1\right)} \]
      2. distribute-rgt-inN/A

        \[\leadsto \color{blue}{\left({x1}^{2} \cdot \left(6 \cdot x1 - 3\right)\right) \cdot x1 + 1 \cdot x1} \]
      3. associate-*l*N/A

        \[\leadsto \color{blue}{{x1}^{2} \cdot \left(\left(6 \cdot x1 - 3\right) \cdot x1\right)} + 1 \cdot x1 \]
      4. *-lft-identityN/A

        \[\leadsto {x1}^{2} \cdot \left(\left(6 \cdot x1 - 3\right) \cdot x1\right) + \color{blue}{x1} \]
      5. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left({x1}^{2}, \left(6 \cdot x1 - 3\right) \cdot x1, x1\right)} \]
      6. unpow2N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{x1 \cdot x1}, \left(6 \cdot x1 - 3\right) \cdot x1, x1\right) \]
      7. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{x1 \cdot x1}, \left(6 \cdot x1 - 3\right) \cdot x1, x1\right) \]
      8. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(x1 \cdot x1, \color{blue}{\left(6 \cdot x1 - 3\right) \cdot x1}, x1\right) \]
      9. sub-negN/A

        \[\leadsto \mathsf{fma}\left(x1 \cdot x1, \color{blue}{\left(6 \cdot x1 + \left(\mathsf{neg}\left(3\right)\right)\right)} \cdot x1, x1\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(x1 \cdot x1, \left(\color{blue}{x1 \cdot 6} + \left(\mathsf{neg}\left(3\right)\right)\right) \cdot x1, x1\right) \]
      11. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(x1 \cdot x1, \left(x1 \cdot 6 + \color{blue}{-3}\right) \cdot x1, x1\right) \]
      12. lower-fma.f6480.9

        \[\leadsto \mathsf{fma}\left(x1 \cdot x1, \color{blue}{\mathsf{fma}\left(x1, 6, -3\right)} \cdot x1, x1\right) \]
    10. Applied rewrites80.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 + \left(\left(x1 + \left(\left(\left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{-1 - x1 \cdot x1}\right) + \left(\left(x1 \cdot 2\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(3 + \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{-1 - x1 \cdot x1}\right)\right) \cdot \left(-1 - x1 \cdot x1\right) + \left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \leq -2 \cdot 10^{+173}:\\ \;\;\;\;x1 + x2 \cdot \left(x1 \cdot \left(x2 \cdot 8\right)\right)\\ \mathbf{elif}\;x1 + \left(\left(x1 + \left(\left(\left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{-1 - x1 \cdot x1}\right) + \left(\left(x1 \cdot 2\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(3 + \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{-1 - x1 \cdot x1}\right)\right) \cdot \left(-1 - x1 \cdot x1\right) + \left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \leq 2 \cdot 10^{+42}:\\ \;\;\;\;x1 + \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, x1 \cdot -19, -2\right), x2 \cdot -6\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x1 \cdot x1, x1 \cdot \mathsf{fma}\left(x1, 6, -3\right), x1\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 81.6% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 \cdot x1 + 1\\ t_1 := x1 \cdot \left(x1 \cdot 3\right)\\ t_2 := \left(t\_1 + 2 \cdot x2\right) - x1\\ t_3 := \frac{t\_2}{t\_0}\\ t_4 := -1 - x1 \cdot x1\\ t_5 := \frac{t\_2}{t\_4}\\ t_6 := x1 + \left(\left(x1 + \left(\left(\left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_5\right) + \left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(3 + t\_5\right)\right) \cdot t\_4 + 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\_0}\right)\\ \mathbf{if}\;t\_6 \leq -2 \cdot 10^{+173}:\\ \;\;\;\;x1 + x2 \cdot \left(x1 \cdot \left(x2 \cdot 8\right)\right)\\ \mathbf{elif}\;t\_6 \leq 2 \cdot 10^{+42}:\\ \;\;\;\;x2 \cdot -6 - x1\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x1 \cdot x1, x1 \cdot \mathsf{fma}\left(x1, 6, -3\right), x1\right)\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (+ (* x1 x1) 1.0))
        (t_1 (* x1 (* x1 3.0)))
        (t_2 (- (+ t_1 (* 2.0 x2)) x1))
        (t_3 (/ t_2 t_0))
        (t_4 (- -1.0 (* x1 x1)))
        (t_5 (/ t_2 t_4))
        (t_6
         (+
          x1
          (+
           (+
            x1
            (+
             (+
              (*
               (+
                (* (* x1 x1) (+ 6.0 (* 4.0 t_5)))
                (* (* (* x1 2.0) t_3) (+ 3.0 t_5)))
               t_4)
              (* t_1 t_3))
             (* x1 (* x1 x1))))
           (* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_0))))))
   (if (<= t_6 -2e+173)
     (+ x1 (* x2 (* x1 (* x2 8.0))))
     (if (<= t_6 2e+42)
       (- (* x2 -6.0) x1)
       (fma (* x1 x1) (* x1 (fma x1 6.0 -3.0)) x1)))))
double code(double x1, double x2) {
	double t_0 = (x1 * x1) + 1.0;
	double t_1 = x1 * (x1 * 3.0);
	double t_2 = (t_1 + (2.0 * x2)) - x1;
	double t_3 = t_2 / t_0;
	double t_4 = -1.0 - (x1 * x1);
	double t_5 = t_2 / t_4;
	double t_6 = x1 + ((x1 + ((((((x1 * x1) * (6.0 + (4.0 * t_5))) + (((x1 * 2.0) * t_3) * (3.0 + t_5))) * t_4) + (t_1 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)));
	double tmp;
	if (t_6 <= -2e+173) {
		tmp = x1 + (x2 * (x1 * (x2 * 8.0)));
	} else if (t_6 <= 2e+42) {
		tmp = (x2 * -6.0) - x1;
	} else {
		tmp = fma((x1 * x1), (x1 * fma(x1, 6.0, -3.0)), x1);
	}
	return tmp;
}
function code(x1, x2)
	t_0 = Float64(Float64(x1 * x1) + 1.0)
	t_1 = Float64(x1 * Float64(x1 * 3.0))
	t_2 = Float64(Float64(t_1 + Float64(2.0 * x2)) - x1)
	t_3 = Float64(t_2 / t_0)
	t_4 = Float64(-1.0 - Float64(x1 * x1))
	t_5 = Float64(t_2 / t_4)
	t_6 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_5))) + Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(3.0 + t_5))) * t_4) + Float64(t_1 * t_3)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_0))))
	tmp = 0.0
	if (t_6 <= -2e+173)
		tmp = Float64(x1 + Float64(x2 * Float64(x1 * Float64(x2 * 8.0))));
	elseif (t_6 <= 2e+42)
		tmp = Float64(Float64(x2 * -6.0) - x1);
	else
		tmp = fma(Float64(x1 * x1), Float64(x1 * fma(x1, 6.0, -3.0)), x1);
	end
	return tmp
end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 / t$95$0), $MachinePrecision]}, Block[{t$95$4 = N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$2 / t$95$4), $MachinePrecision]}, Block[{t$95$6 = N[(x1 + N[(N[(x1 + N[(N[(N[(N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(3.0 + t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$4), $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$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$6, -2e+173], N[(x1 + N[(x2 * N[(x1 * N[(x2 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$6, 2e+42], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision], N[(N[(x1 * x1), $MachinePrecision] * N[(x1 * N[(x1 * 6.0 + -3.0), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision]]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := \left(t\_1 + 2 \cdot x2\right) - x1\\
t_3 := \frac{t\_2}{t\_0}\\
t_4 := -1 - x1 \cdot x1\\
t_5 := \frac{t\_2}{t\_4}\\
t_6 := x1 + \left(\left(x1 + \left(\left(\left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_5\right) + \left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(3 + t\_5\right)\right) \cdot t\_4 + 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\_0}\right)\\
\mathbf{if}\;t\_6 \leq -2 \cdot 10^{+173}:\\
\;\;\;\;x1 + x2 \cdot \left(x1 \cdot \left(x2 \cdot 8\right)\right)\\

\mathbf{elif}\;t\_6 \leq 2 \cdot 10^{+42}:\\
\;\;\;\;x2 \cdot -6 - x1\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x1 \cdot x1, x1 \cdot \mathsf{fma}\left(x1, 6, -3\right), x1\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < -2e173

    1. Initial program 99.8%

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

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

      \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(x1, \mathsf{fma}\left(x1, \mathsf{fma}\left(x2, -4, \mathsf{fma}\left(2, \mathsf{fma}\left(x2, -2, 3\right), \mathsf{fma}\left(3, \mathsf{fma}\left(x2, 2, 3\right), \mathsf{fma}\left(x2, 14, -6\right)\right)\right)\right), \mathsf{fma}\left(x2, \mathsf{fma}\left(4, x2 \cdot 2, -12\right), -2\right)\right), x2 \cdot -6\right)} \]
    5. Taylor expanded in x2 around inf

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

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

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

        \[\leadsto x1 + \color{blue}{\left(x2 \cdot x2\right)} \cdot \left(8 \cdot x1\right) \]
      4. associate-*l*N/A

        \[\leadsto x1 + \color{blue}{x2 \cdot \left(x2 \cdot \left(8 \cdot x1\right)\right)} \]
      5. *-commutativeN/A

        \[\leadsto x1 + x2 \cdot \color{blue}{\left(\left(8 \cdot x1\right) \cdot x2\right)} \]
      6. associate-*r*N/A

        \[\leadsto x1 + x2 \cdot \color{blue}{\left(8 \cdot \left(x1 \cdot x2\right)\right)} \]
      7. lower-*.f64N/A

        \[\leadsto x1 + \color{blue}{x2 \cdot \left(8 \cdot \left(x1 \cdot x2\right)\right)} \]
      8. *-commutativeN/A

        \[\leadsto x1 + x2 \cdot \left(8 \cdot \color{blue}{\left(x2 \cdot x1\right)}\right) \]
      9. associate-*r*N/A

        \[\leadsto x1 + x2 \cdot \color{blue}{\left(\left(8 \cdot x2\right) \cdot x1\right)} \]
      10. lower-*.f64N/A

        \[\leadsto x1 + x2 \cdot \color{blue}{\left(\left(8 \cdot x2\right) \cdot x1\right)} \]
      11. *-commutativeN/A

        \[\leadsto x1 + x2 \cdot \left(\color{blue}{\left(x2 \cdot 8\right)} \cdot x1\right) \]
      12. lower-*.f6489.4

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

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

    if -2e173 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < 2.00000000000000009e42

    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. Add Preprocessing
    3. Taylor expanded in x2 around 0

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

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

      \[\leadsto x1 + \color{blue}{\left(-6 \cdot x2 + x1 \cdot \left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) - 2\right)\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto x1 + \left(\color{blue}{x2 \cdot -6} + x1 \cdot \left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) - 2\right)\right) \]
      2. lower-fma.f64N/A

        \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(x2, -6, x1 \cdot \left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) - 2\right)\right)} \]
      3. sub-negN/A

        \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \color{blue}{\left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) + \left(\mathsf{neg}\left(2\right)\right)\right)}\right) \]
      4. associate-*r*N/A

        \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(\color{blue}{\left(3 \cdot x1\right) \cdot \left(3 - -2 \cdot x2\right)} + \left(\mathsf{neg}\left(2\right)\right)\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(\color{blue}{\left(x1 \cdot 3\right)} \cdot \left(3 - -2 \cdot x2\right) + \left(\mathsf{neg}\left(2\right)\right)\right)\right) \]
      6. associate-*r*N/A

        \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(\color{blue}{x1 \cdot \left(3 \cdot \left(3 - -2 \cdot x2\right)\right)} + \left(\mathsf{neg}\left(2\right)\right)\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 - -2 \cdot x2\right)\right) + \color{blue}{-2}\right)\right) \]
      8. lower-*.f64N/A

        \[\leadsto x1 + \mathsf{fma}\left(x2, -6, \color{blue}{x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 - -2 \cdot x2\right)\right) + -2\right)}\right) \]
      9. cancel-sign-sub-invN/A

        \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(x1 \cdot \left(3 \cdot \color{blue}{\left(3 + \left(\mathsf{neg}\left(-2\right)\right) \cdot x2\right)}\right) + -2\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + \color{blue}{2} \cdot x2\right)\right) + -2\right)\right) \]
      11. lower-fma.f64N/A

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

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

      \[\leadsto \color{blue}{-6 \cdot x2 + -1 \cdot x1} \]
    9. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto -6 \cdot x2 + \color{blue}{\left(\mathsf{neg}\left(x1\right)\right)} \]
      2. unsub-negN/A

        \[\leadsto \color{blue}{-6 \cdot x2 - x1} \]
      3. lower--.f64N/A

        \[\leadsto \color{blue}{-6 \cdot x2 - x1} \]
      4. lower-*.f6493.0

        \[\leadsto \color{blue}{-6 \cdot x2} - x1 \]
    10. Applied rewrites93.0%

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

    if 2.00000000000000009e42 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))))

    1. Initial program 47.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. Add Preprocessing
    3. Taylor expanded in x1 around inf

      \[\leadsto x1 + \color{blue}{{x1}^{4} \cdot \left(6 - 3 \cdot \frac{1}{x1}\right)} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto x1 + \color{blue}{{x1}^{4} \cdot \left(6 - 3 \cdot \frac{1}{x1}\right)} \]
      2. lower-pow.f64N/A

        \[\leadsto x1 + \color{blue}{{x1}^{4}} \cdot \left(6 - 3 \cdot \frac{1}{x1}\right) \]
      3. sub-negN/A

        \[\leadsto x1 + {x1}^{4} \cdot \color{blue}{\left(6 + \left(\mathsf{neg}\left(3 \cdot \frac{1}{x1}\right)\right)\right)} \]
      4. lower-+.f64N/A

        \[\leadsto x1 + {x1}^{4} \cdot \color{blue}{\left(6 + \left(\mathsf{neg}\left(3 \cdot \frac{1}{x1}\right)\right)\right)} \]
      5. associate-*r/N/A

        \[\leadsto x1 + {x1}^{4} \cdot \left(6 + \left(\mathsf{neg}\left(\color{blue}{\frac{3 \cdot 1}{x1}}\right)\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto x1 + {x1}^{4} \cdot \left(6 + \left(\mathsf{neg}\left(\frac{\color{blue}{3}}{x1}\right)\right)\right) \]
      7. distribute-neg-fracN/A

        \[\leadsto x1 + {x1}^{4} \cdot \left(6 + \color{blue}{\frac{\mathsf{neg}\left(3\right)}{x1}}\right) \]
      8. lower-/.f64N/A

        \[\leadsto x1 + {x1}^{4} \cdot \left(6 + \color{blue}{\frac{\mathsf{neg}\left(3\right)}{x1}}\right) \]
      9. metadata-eval80.9

        \[\leadsto x1 + {x1}^{4} \cdot \left(6 + \frac{\color{blue}{-3}}{x1}\right) \]
    5. Applied rewrites80.9%

      \[\leadsto x1 + \color{blue}{{x1}^{4} \cdot \left(6 + \frac{-3}{x1}\right)} \]
    6. Step-by-step derivation
      1. lift-pow.f64N/A

        \[\leadsto x1 + \color{blue}{{x1}^{4}} \cdot \left(6 + \frac{-3}{x1}\right) \]
      2. lift-/.f64N/A

        \[\leadsto x1 + {x1}^{4} \cdot \left(6 + \color{blue}{\frac{-3}{x1}}\right) \]
      3. lift-+.f64N/A

        \[\leadsto x1 + {x1}^{4} \cdot \color{blue}{\left(6 + \frac{-3}{x1}\right)} \]
      4. lift-*.f64N/A

        \[\leadsto x1 + \color{blue}{{x1}^{4} \cdot \left(6 + \frac{-3}{x1}\right)} \]
      5. +-commutativeN/A

        \[\leadsto \color{blue}{{x1}^{4} \cdot \left(6 + \frac{-3}{x1}\right) + x1} \]
      6. lift-*.f64N/A

        \[\leadsto \color{blue}{{x1}^{4} \cdot \left(6 + \frac{-3}{x1}\right)} + x1 \]
      7. *-commutativeN/A

        \[\leadsto \color{blue}{\left(6 + \frac{-3}{x1}\right) \cdot {x1}^{4}} + x1 \]
      8. lower-fma.f6480.9

        \[\leadsto \color{blue}{\mathsf{fma}\left(6 + \frac{-3}{x1}, {x1}^{4}, x1\right)} \]
      9. lift-pow.f64N/A

        \[\leadsto \mathsf{fma}\left(6 + \frac{-3}{x1}, \color{blue}{{x1}^{4}}, x1\right) \]
      10. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(6 + \frac{-3}{x1}, {x1}^{\color{blue}{\left(2 + 2\right)}}, x1\right) \]
      11. pow-prod-upN/A

        \[\leadsto \mathsf{fma}\left(6 + \frac{-3}{x1}, \color{blue}{{x1}^{2} \cdot {x1}^{2}}, x1\right) \]
      12. pow-prod-downN/A

        \[\leadsto \mathsf{fma}\left(6 + \frac{-3}{x1}, \color{blue}{{\left(x1 \cdot x1\right)}^{2}}, x1\right) \]
      13. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(6 + \frac{-3}{x1}, {\color{blue}{\left(x1 \cdot x1\right)}}^{2}, x1\right) \]
      14. pow2N/A

        \[\leadsto \mathsf{fma}\left(6 + \frac{-3}{x1}, \color{blue}{\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)}, x1\right) \]
      15. lower-*.f6480.9

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

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

      \[\leadsto \color{blue}{x1 \cdot \left(1 + {x1}^{2} \cdot \left(6 \cdot x1 - 3\right)\right)} \]
    9. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto x1 \cdot \color{blue}{\left({x1}^{2} \cdot \left(6 \cdot x1 - 3\right) + 1\right)} \]
      2. distribute-rgt-inN/A

        \[\leadsto \color{blue}{\left({x1}^{2} \cdot \left(6 \cdot x1 - 3\right)\right) \cdot x1 + 1 \cdot x1} \]
      3. associate-*l*N/A

        \[\leadsto \color{blue}{{x1}^{2} \cdot \left(\left(6 \cdot x1 - 3\right) \cdot x1\right)} + 1 \cdot x1 \]
      4. *-lft-identityN/A

        \[\leadsto {x1}^{2} \cdot \left(\left(6 \cdot x1 - 3\right) \cdot x1\right) + \color{blue}{x1} \]
      5. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left({x1}^{2}, \left(6 \cdot x1 - 3\right) \cdot x1, x1\right)} \]
      6. unpow2N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{x1 \cdot x1}, \left(6 \cdot x1 - 3\right) \cdot x1, x1\right) \]
      7. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{x1 \cdot x1}, \left(6 \cdot x1 - 3\right) \cdot x1, x1\right) \]
      8. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(x1 \cdot x1, \color{blue}{\left(6 \cdot x1 - 3\right) \cdot x1}, x1\right) \]
      9. sub-negN/A

        \[\leadsto \mathsf{fma}\left(x1 \cdot x1, \color{blue}{\left(6 \cdot x1 + \left(\mathsf{neg}\left(3\right)\right)\right)} \cdot x1, x1\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(x1 \cdot x1, \left(\color{blue}{x1 \cdot 6} + \left(\mathsf{neg}\left(3\right)\right)\right) \cdot x1, x1\right) \]
      11. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(x1 \cdot x1, \left(x1 \cdot 6 + \color{blue}{-3}\right) \cdot x1, x1\right) \]
      12. lower-fma.f6480.9

        \[\leadsto \mathsf{fma}\left(x1 \cdot x1, \color{blue}{\mathsf{fma}\left(x1, 6, -3\right)} \cdot x1, x1\right) \]
    10. Applied rewrites80.9%

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

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

Alternative 6: 81.9% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 \cdot x1 + 1\\ t_1 := x1 \cdot \left(x1 \cdot 3\right)\\ t_2 := \left(t\_1 + 2 \cdot x2\right) - x1\\ t_3 := \frac{t\_2}{t\_0}\\ t_4 := -1 - x1 \cdot x1\\ t_5 := \frac{t\_2}{t\_4}\\ t_6 := x1 + \left(\left(x1 + \left(\left(\left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_5\right) + \left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(3 + t\_5\right)\right) \cdot t\_4 + 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\_0}\right)\\ \mathbf{if}\;t\_6 \leq -2 \cdot 10^{+173}:\\ \;\;\;\;x1 + x2 \cdot \left(x1 \cdot \left(x2 \cdot 8\right)\right)\\ \mathbf{elif}\;t\_6 \leq 5 \cdot 10^{+59}:\\ \;\;\;\;x2 \cdot -6 - x1\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(6, \left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right), x1\right)\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (+ (* x1 x1) 1.0))
        (t_1 (* x1 (* x1 3.0)))
        (t_2 (- (+ t_1 (* 2.0 x2)) x1))
        (t_3 (/ t_2 t_0))
        (t_4 (- -1.0 (* x1 x1)))
        (t_5 (/ t_2 t_4))
        (t_6
         (+
          x1
          (+
           (+
            x1
            (+
             (+
              (*
               (+
                (* (* x1 x1) (+ 6.0 (* 4.0 t_5)))
                (* (* (* x1 2.0) t_3) (+ 3.0 t_5)))
               t_4)
              (* t_1 t_3))
             (* x1 (* x1 x1))))
           (* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_0))))))
   (if (<= t_6 -2e+173)
     (+ x1 (* x2 (* x1 (* x2 8.0))))
     (if (<= t_6 5e+59)
       (- (* x2 -6.0) x1)
       (fma 6.0 (* (* x1 x1) (* x1 x1)) x1)))))
double code(double x1, double x2) {
	double t_0 = (x1 * x1) + 1.0;
	double t_1 = x1 * (x1 * 3.0);
	double t_2 = (t_1 + (2.0 * x2)) - x1;
	double t_3 = t_2 / t_0;
	double t_4 = -1.0 - (x1 * x1);
	double t_5 = t_2 / t_4;
	double t_6 = x1 + ((x1 + ((((((x1 * x1) * (6.0 + (4.0 * t_5))) + (((x1 * 2.0) * t_3) * (3.0 + t_5))) * t_4) + (t_1 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)));
	double tmp;
	if (t_6 <= -2e+173) {
		tmp = x1 + (x2 * (x1 * (x2 * 8.0)));
	} else if (t_6 <= 5e+59) {
		tmp = (x2 * -6.0) - x1;
	} else {
		tmp = fma(6.0, ((x1 * x1) * (x1 * x1)), x1);
	}
	return tmp;
}
function code(x1, x2)
	t_0 = Float64(Float64(x1 * x1) + 1.0)
	t_1 = Float64(x1 * Float64(x1 * 3.0))
	t_2 = Float64(Float64(t_1 + Float64(2.0 * x2)) - x1)
	t_3 = Float64(t_2 / t_0)
	t_4 = Float64(-1.0 - Float64(x1 * x1))
	t_5 = Float64(t_2 / t_4)
	t_6 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_5))) + Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(3.0 + t_5))) * t_4) + Float64(t_1 * t_3)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_0))))
	tmp = 0.0
	if (t_6 <= -2e+173)
		tmp = Float64(x1 + Float64(x2 * Float64(x1 * Float64(x2 * 8.0))));
	elseif (t_6 <= 5e+59)
		tmp = Float64(Float64(x2 * -6.0) - x1);
	else
		tmp = fma(6.0, Float64(Float64(x1 * x1) * Float64(x1 * x1)), x1);
	end
	return tmp
end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 / t$95$0), $MachinePrecision]}, Block[{t$95$4 = N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$2 / t$95$4), $MachinePrecision]}, Block[{t$95$6 = N[(x1 + N[(N[(x1 + N[(N[(N[(N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(3.0 + t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$4), $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$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$6, -2e+173], N[(x1 + N[(x2 * N[(x1 * N[(x2 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$6, 5e+59], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision], N[(6.0 * N[(N[(x1 * x1), $MachinePrecision] * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision]]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := \left(t\_1 + 2 \cdot x2\right) - x1\\
t_3 := \frac{t\_2}{t\_0}\\
t_4 := -1 - x1 \cdot x1\\
t_5 := \frac{t\_2}{t\_4}\\
t_6 := x1 + \left(\left(x1 + \left(\left(\left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_5\right) + \left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(3 + t\_5\right)\right) \cdot t\_4 + 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\_0}\right)\\
\mathbf{if}\;t\_6 \leq -2 \cdot 10^{+173}:\\
\;\;\;\;x1 + x2 \cdot \left(x1 \cdot \left(x2 \cdot 8\right)\right)\\

\mathbf{elif}\;t\_6 \leq 5 \cdot 10^{+59}:\\
\;\;\;\;x2 \cdot -6 - x1\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(6, \left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right), x1\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < -2e173

    1. Initial program 99.8%

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

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

      \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(x1, \mathsf{fma}\left(x1, \mathsf{fma}\left(x2, -4, \mathsf{fma}\left(2, \mathsf{fma}\left(x2, -2, 3\right), \mathsf{fma}\left(3, \mathsf{fma}\left(x2, 2, 3\right), \mathsf{fma}\left(x2, 14, -6\right)\right)\right)\right), \mathsf{fma}\left(x2, \mathsf{fma}\left(4, x2 \cdot 2, -12\right), -2\right)\right), x2 \cdot -6\right)} \]
    5. Taylor expanded in x2 around inf

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

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

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

        \[\leadsto x1 + \color{blue}{\left(x2 \cdot x2\right)} \cdot \left(8 \cdot x1\right) \]
      4. associate-*l*N/A

        \[\leadsto x1 + \color{blue}{x2 \cdot \left(x2 \cdot \left(8 \cdot x1\right)\right)} \]
      5. *-commutativeN/A

        \[\leadsto x1 + x2 \cdot \color{blue}{\left(\left(8 \cdot x1\right) \cdot x2\right)} \]
      6. associate-*r*N/A

        \[\leadsto x1 + x2 \cdot \color{blue}{\left(8 \cdot \left(x1 \cdot x2\right)\right)} \]
      7. lower-*.f64N/A

        \[\leadsto x1 + \color{blue}{x2 \cdot \left(8 \cdot \left(x1 \cdot x2\right)\right)} \]
      8. *-commutativeN/A

        \[\leadsto x1 + x2 \cdot \left(8 \cdot \color{blue}{\left(x2 \cdot x1\right)}\right) \]
      9. associate-*r*N/A

        \[\leadsto x1 + x2 \cdot \color{blue}{\left(\left(8 \cdot x2\right) \cdot x1\right)} \]
      10. lower-*.f64N/A

        \[\leadsto x1 + x2 \cdot \color{blue}{\left(\left(8 \cdot x2\right) \cdot x1\right)} \]
      11. *-commutativeN/A

        \[\leadsto x1 + x2 \cdot \left(\color{blue}{\left(x2 \cdot 8\right)} \cdot x1\right) \]
      12. lower-*.f6489.4

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

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

    if -2e173 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < 4.9999999999999997e59

    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. Add Preprocessing
    3. Taylor expanded in x2 around 0

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

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

      \[\leadsto x1 + \color{blue}{\left(-6 \cdot x2 + x1 \cdot \left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) - 2\right)\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto x1 + \left(\color{blue}{x2 \cdot -6} + x1 \cdot \left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) - 2\right)\right) \]
      2. lower-fma.f64N/A

        \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(x2, -6, x1 \cdot \left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) - 2\right)\right)} \]
      3. sub-negN/A

        \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \color{blue}{\left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) + \left(\mathsf{neg}\left(2\right)\right)\right)}\right) \]
      4. associate-*r*N/A

        \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(\color{blue}{\left(3 \cdot x1\right) \cdot \left(3 - -2 \cdot x2\right)} + \left(\mathsf{neg}\left(2\right)\right)\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(\color{blue}{\left(x1 \cdot 3\right)} \cdot \left(3 - -2 \cdot x2\right) + \left(\mathsf{neg}\left(2\right)\right)\right)\right) \]
      6. associate-*r*N/A

        \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(\color{blue}{x1 \cdot \left(3 \cdot \left(3 - -2 \cdot x2\right)\right)} + \left(\mathsf{neg}\left(2\right)\right)\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 - -2 \cdot x2\right)\right) + \color{blue}{-2}\right)\right) \]
      8. lower-*.f64N/A

        \[\leadsto x1 + \mathsf{fma}\left(x2, -6, \color{blue}{x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 - -2 \cdot x2\right)\right) + -2\right)}\right) \]
      9. cancel-sign-sub-invN/A

        \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(x1 \cdot \left(3 \cdot \color{blue}{\left(3 + \left(\mathsf{neg}\left(-2\right)\right) \cdot x2\right)}\right) + -2\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + \color{blue}{2} \cdot x2\right)\right) + -2\right)\right) \]
      11. lower-fma.f64N/A

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

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

      \[\leadsto \color{blue}{-6 \cdot x2 + -1 \cdot x1} \]
    9. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto -6 \cdot x2 + \color{blue}{\left(\mathsf{neg}\left(x1\right)\right)} \]
      2. unsub-negN/A

        \[\leadsto \color{blue}{-6 \cdot x2 - x1} \]
      3. lower--.f64N/A

        \[\leadsto \color{blue}{-6 \cdot x2 - x1} \]
      4. lower-*.f6490.9

        \[\leadsto \color{blue}{-6 \cdot x2} - x1 \]
    10. Applied rewrites90.9%

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

    if 4.9999999999999997e59 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))))

    1. Initial program 46.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. Add Preprocessing
    3. Taylor expanded in x1 around inf

      \[\leadsto x1 + \color{blue}{{x1}^{4} \cdot \left(6 - 3 \cdot \frac{1}{x1}\right)} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto x1 + \color{blue}{{x1}^{4} \cdot \left(6 - 3 \cdot \frac{1}{x1}\right)} \]
      2. lower-pow.f64N/A

        \[\leadsto x1 + \color{blue}{{x1}^{4}} \cdot \left(6 - 3 \cdot \frac{1}{x1}\right) \]
      3. sub-negN/A

        \[\leadsto x1 + {x1}^{4} \cdot \color{blue}{\left(6 + \left(\mathsf{neg}\left(3 \cdot \frac{1}{x1}\right)\right)\right)} \]
      4. lower-+.f64N/A

        \[\leadsto x1 + {x1}^{4} \cdot \color{blue}{\left(6 + \left(\mathsf{neg}\left(3 \cdot \frac{1}{x1}\right)\right)\right)} \]
      5. associate-*r/N/A

        \[\leadsto x1 + {x1}^{4} \cdot \left(6 + \left(\mathsf{neg}\left(\color{blue}{\frac{3 \cdot 1}{x1}}\right)\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto x1 + {x1}^{4} \cdot \left(6 + \left(\mathsf{neg}\left(\frac{\color{blue}{3}}{x1}\right)\right)\right) \]
      7. distribute-neg-fracN/A

        \[\leadsto x1 + {x1}^{4} \cdot \left(6 + \color{blue}{\frac{\mathsf{neg}\left(3\right)}{x1}}\right) \]
      8. lower-/.f64N/A

        \[\leadsto x1 + {x1}^{4} \cdot \left(6 + \color{blue}{\frac{\mathsf{neg}\left(3\right)}{x1}}\right) \]
      9. metadata-eval81.7

        \[\leadsto x1 + {x1}^{4} \cdot \left(6 + \frac{\color{blue}{-3}}{x1}\right) \]
    5. Applied rewrites81.7%

      \[\leadsto x1 + \color{blue}{{x1}^{4} \cdot \left(6 + \frac{-3}{x1}\right)} \]
    6. Step-by-step derivation
      1. lift-pow.f64N/A

        \[\leadsto x1 + \color{blue}{{x1}^{4}} \cdot \left(6 + \frac{-3}{x1}\right) \]
      2. lift-/.f64N/A

        \[\leadsto x1 + {x1}^{4} \cdot \left(6 + \color{blue}{\frac{-3}{x1}}\right) \]
      3. lift-+.f64N/A

        \[\leadsto x1 + {x1}^{4} \cdot \color{blue}{\left(6 + \frac{-3}{x1}\right)} \]
      4. lift-*.f64N/A

        \[\leadsto x1 + \color{blue}{{x1}^{4} \cdot \left(6 + \frac{-3}{x1}\right)} \]
      5. +-commutativeN/A

        \[\leadsto \color{blue}{{x1}^{4} \cdot \left(6 + \frac{-3}{x1}\right) + x1} \]
      6. lift-*.f64N/A

        \[\leadsto \color{blue}{{x1}^{4} \cdot \left(6 + \frac{-3}{x1}\right)} + x1 \]
      7. *-commutativeN/A

        \[\leadsto \color{blue}{\left(6 + \frac{-3}{x1}\right) \cdot {x1}^{4}} + x1 \]
      8. lower-fma.f6481.7

        \[\leadsto \color{blue}{\mathsf{fma}\left(6 + \frac{-3}{x1}, {x1}^{4}, x1\right)} \]
      9. lift-pow.f64N/A

        \[\leadsto \mathsf{fma}\left(6 + \frac{-3}{x1}, \color{blue}{{x1}^{4}}, x1\right) \]
      10. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(6 + \frac{-3}{x1}, {x1}^{\color{blue}{\left(2 + 2\right)}}, x1\right) \]
      11. pow-prod-upN/A

        \[\leadsto \mathsf{fma}\left(6 + \frac{-3}{x1}, \color{blue}{{x1}^{2} \cdot {x1}^{2}}, x1\right) \]
      12. pow-prod-downN/A

        \[\leadsto \mathsf{fma}\left(6 + \frac{-3}{x1}, \color{blue}{{\left(x1 \cdot x1\right)}^{2}}, x1\right) \]
      13. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(6 + \frac{-3}{x1}, {\color{blue}{\left(x1 \cdot x1\right)}}^{2}, x1\right) \]
      14. pow2N/A

        \[\leadsto \mathsf{fma}\left(6 + \frac{-3}{x1}, \color{blue}{\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)}, x1\right) \]
      15. lower-*.f6481.7

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

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

      \[\leadsto \mathsf{fma}\left(\color{blue}{6}, \left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right), x1\right) \]
    9. Step-by-step derivation
      1. Applied rewrites81.7%

        \[\leadsto \mathsf{fma}\left(\color{blue}{6}, \left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right), x1\right) \]
    10. Recombined 3 regimes into one program.
    11. Final simplification85.5%

      \[\leadsto \begin{array}{l} \mathbf{if}\;x1 + \left(\left(x1 + \left(\left(\left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{-1 - x1 \cdot x1}\right) + \left(\left(x1 \cdot 2\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(3 + \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{-1 - x1 \cdot x1}\right)\right) \cdot \left(-1 - x1 \cdot x1\right) + \left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \leq -2 \cdot 10^{+173}:\\ \;\;\;\;x1 + x2 \cdot \left(x1 \cdot \left(x2 \cdot 8\right)\right)\\ \mathbf{elif}\;x1 + \left(\left(x1 + \left(\left(\left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{-1 - x1 \cdot x1}\right) + \left(\left(x1 \cdot 2\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(3 + \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{-1 - x1 \cdot x1}\right)\right) \cdot \left(-1 - x1 \cdot x1\right) + \left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \leq 5 \cdot 10^{+59}:\\ \;\;\;\;x2 \cdot -6 - x1\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(6, \left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right), x1\right)\\ \end{array} \]
    12. Add Preprocessing

    Alternative 7: 99.3% accurate, 0.5× speedup?

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

      1. Initial program 99.4%

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

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

      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. Add Preprocessing
      3. Taylor expanded in x1 around inf

        \[\leadsto x1 + \color{blue}{{x1}^{4} \cdot \left(6 - 3 \cdot \frac{1}{x1}\right)} \]
      4. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto x1 + \color{blue}{{x1}^{4} \cdot \left(6 - 3 \cdot \frac{1}{x1}\right)} \]
        2. lower-pow.f64N/A

          \[\leadsto x1 + \color{blue}{{x1}^{4}} \cdot \left(6 - 3 \cdot \frac{1}{x1}\right) \]
        3. sub-negN/A

          \[\leadsto x1 + {x1}^{4} \cdot \color{blue}{\left(6 + \left(\mathsf{neg}\left(3 \cdot \frac{1}{x1}\right)\right)\right)} \]
        4. lower-+.f64N/A

          \[\leadsto x1 + {x1}^{4} \cdot \color{blue}{\left(6 + \left(\mathsf{neg}\left(3 \cdot \frac{1}{x1}\right)\right)\right)} \]
        5. associate-*r/N/A

          \[\leadsto x1 + {x1}^{4} \cdot \left(6 + \left(\mathsf{neg}\left(\color{blue}{\frac{3 \cdot 1}{x1}}\right)\right)\right) \]
        6. metadata-evalN/A

          \[\leadsto x1 + {x1}^{4} \cdot \left(6 + \left(\mathsf{neg}\left(\frac{\color{blue}{3}}{x1}\right)\right)\right) \]
        7. distribute-neg-fracN/A

          \[\leadsto x1 + {x1}^{4} \cdot \left(6 + \color{blue}{\frac{\mathsf{neg}\left(3\right)}{x1}}\right) \]
        8. lower-/.f64N/A

          \[\leadsto x1 + {x1}^{4} \cdot \left(6 + \color{blue}{\frac{\mathsf{neg}\left(3\right)}{x1}}\right) \]
        9. metadata-eval100.0

          \[\leadsto x1 + {x1}^{4} \cdot \left(6 + \frac{\color{blue}{-3}}{x1}\right) \]
      5. Applied rewrites100.0%

        \[\leadsto x1 + \color{blue}{{x1}^{4} \cdot \left(6 + \frac{-3}{x1}\right)} \]
      6. Step-by-step derivation
        1. lift-pow.f64N/A

          \[\leadsto x1 + \color{blue}{{x1}^{4}} \cdot \left(6 + \frac{-3}{x1}\right) \]
        2. lift-/.f64N/A

          \[\leadsto x1 + {x1}^{4} \cdot \left(6 + \color{blue}{\frac{-3}{x1}}\right) \]
        3. lift-+.f64N/A

          \[\leadsto x1 + {x1}^{4} \cdot \color{blue}{\left(6 + \frac{-3}{x1}\right)} \]
        4. lift-*.f64N/A

          \[\leadsto x1 + \color{blue}{{x1}^{4} \cdot \left(6 + \frac{-3}{x1}\right)} \]
        5. +-commutativeN/A

          \[\leadsto \color{blue}{{x1}^{4} \cdot \left(6 + \frac{-3}{x1}\right) + x1} \]
        6. lift-*.f64N/A

          \[\leadsto \color{blue}{{x1}^{4} \cdot \left(6 + \frac{-3}{x1}\right)} + x1 \]
        7. *-commutativeN/A

          \[\leadsto \color{blue}{\left(6 + \frac{-3}{x1}\right) \cdot {x1}^{4}} + x1 \]
        8. lower-fma.f64100.0

          \[\leadsto \color{blue}{\mathsf{fma}\left(6 + \frac{-3}{x1}, {x1}^{4}, x1\right)} \]
        9. lift-pow.f64N/A

          \[\leadsto \mathsf{fma}\left(6 + \frac{-3}{x1}, \color{blue}{{x1}^{4}}, x1\right) \]
        10. metadata-evalN/A

          \[\leadsto \mathsf{fma}\left(6 + \frac{-3}{x1}, {x1}^{\color{blue}{\left(2 + 2\right)}}, x1\right) \]
        11. pow-prod-upN/A

          \[\leadsto \mathsf{fma}\left(6 + \frac{-3}{x1}, \color{blue}{{x1}^{2} \cdot {x1}^{2}}, x1\right) \]
        12. pow-prod-downN/A

          \[\leadsto \mathsf{fma}\left(6 + \frac{-3}{x1}, \color{blue}{{\left(x1 \cdot x1\right)}^{2}}, x1\right) \]
        13. lift-*.f64N/A

          \[\leadsto \mathsf{fma}\left(6 + \frac{-3}{x1}, {\color{blue}{\left(x1 \cdot x1\right)}}^{2}, x1\right) \]
        14. pow2N/A

          \[\leadsto \mathsf{fma}\left(6 + \frac{-3}{x1}, \color{blue}{\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)}, x1\right) \]
        15. lower-*.f64100.0

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

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

        \[\leadsto \mathsf{fma}\left(\color{blue}{6}, \left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right), x1\right) \]
      9. Step-by-step derivation
        1. Applied rewrites100.0%

          \[\leadsto \mathsf{fma}\left(\color{blue}{6}, \left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right), x1\right) \]
      10. Recombined 2 regimes into one program.
      11. Final simplification99.6%

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

      Alternative 8: 63.2% accurate, 0.9× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 \cdot x1 + 1\\ t_1 := x1 \cdot \left(x1 \cdot 3\right)\\ t_2 := \left(t\_1 + 2 \cdot x2\right) - x1\\ t_3 := \frac{t\_2}{t\_0}\\ t_4 := -1 - x1 \cdot x1\\ t_5 := \frac{t\_2}{t\_4}\\ \mathbf{if}\;x1 + \left(\left(x1 + \left(\left(\left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_5\right) + \left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(3 + t\_5\right)\right) \cdot t\_4 + 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\_0}\right) \leq 2 \cdot 10^{+255}:\\ \;\;\;\;x2 \cdot -6 - x1\\ \mathbf{else}:\\ \;\;\;\;x1 \cdot \mathsf{fma}\left(x1, 9, -1\right)\\ \end{array} \end{array} \]
      (FPCore (x1 x2)
       :precision binary64
       (let* ((t_0 (+ (* x1 x1) 1.0))
              (t_1 (* x1 (* x1 3.0)))
              (t_2 (- (+ t_1 (* 2.0 x2)) x1))
              (t_3 (/ t_2 t_0))
              (t_4 (- -1.0 (* x1 x1)))
              (t_5 (/ t_2 t_4)))
         (if (<=
              (+
               x1
               (+
                (+
                 x1
                 (+
                  (+
                   (*
                    (+
                     (* (* x1 x1) (+ 6.0 (* 4.0 t_5)))
                     (* (* (* x1 2.0) t_3) (+ 3.0 t_5)))
                    t_4)
                   (* t_1 t_3))
                  (* x1 (* x1 x1))))
                (* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_0))))
              2e+255)
           (- (* x2 -6.0) x1)
           (* x1 (fma x1 9.0 -1.0)))))
      double code(double x1, double x2) {
      	double t_0 = (x1 * x1) + 1.0;
      	double t_1 = x1 * (x1 * 3.0);
      	double t_2 = (t_1 + (2.0 * x2)) - x1;
      	double t_3 = t_2 / t_0;
      	double t_4 = -1.0 - (x1 * x1);
      	double t_5 = t_2 / t_4;
      	double tmp;
      	if ((x1 + ((x1 + ((((((x1 * x1) * (6.0 + (4.0 * t_5))) + (((x1 * 2.0) * t_3) * (3.0 + t_5))) * t_4) + (t_1 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)))) <= 2e+255) {
      		tmp = (x2 * -6.0) - x1;
      	} else {
      		tmp = x1 * fma(x1, 9.0, -1.0);
      	}
      	return tmp;
      }
      
      function code(x1, x2)
      	t_0 = Float64(Float64(x1 * x1) + 1.0)
      	t_1 = Float64(x1 * Float64(x1 * 3.0))
      	t_2 = Float64(Float64(t_1 + Float64(2.0 * x2)) - x1)
      	t_3 = Float64(t_2 / t_0)
      	t_4 = Float64(-1.0 - Float64(x1 * x1))
      	t_5 = Float64(t_2 / t_4)
      	tmp = 0.0
      	if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_5))) + Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(3.0 + t_5))) * t_4) + Float64(t_1 * t_3)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_0)))) <= 2e+255)
      		tmp = Float64(Float64(x2 * -6.0) - x1);
      	else
      		tmp = Float64(x1 * fma(x1, 9.0, -1.0));
      	end
      	return tmp
      end
      
      code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 / t$95$0), $MachinePrecision]}, Block[{t$95$4 = N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$2 / t$95$4), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(3.0 + t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$4), $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$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2e+255], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision], N[(x1 * N[(x1 * 9.0 + -1.0), $MachinePrecision]), $MachinePrecision]]]]]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := x1 \cdot x1 + 1\\
      t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
      t_2 := \left(t\_1 + 2 \cdot x2\right) - x1\\
      t_3 := \frac{t\_2}{t\_0}\\
      t_4 := -1 - x1 \cdot x1\\
      t_5 := \frac{t\_2}{t\_4}\\
      \mathbf{if}\;x1 + \left(\left(x1 + \left(\left(\left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_5\right) + \left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(3 + t\_5\right)\right) \cdot t\_4 + 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\_0}\right) \leq 2 \cdot 10^{+255}:\\
      \;\;\;\;x2 \cdot -6 - x1\\
      
      \mathbf{else}:\\
      \;\;\;\;x1 \cdot \mathsf{fma}\left(x1, 9, -1\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 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < 1.99999999999999998e255

        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. Add Preprocessing
        3. Taylor expanded in x2 around 0

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

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

          \[\leadsto x1 + \color{blue}{\left(-6 \cdot x2 + x1 \cdot \left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) - 2\right)\right)} \]
        6. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto x1 + \left(\color{blue}{x2 \cdot -6} + x1 \cdot \left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) - 2\right)\right) \]
          2. lower-fma.f64N/A

            \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(x2, -6, x1 \cdot \left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) - 2\right)\right)} \]
          3. sub-negN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \color{blue}{\left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) + \left(\mathsf{neg}\left(2\right)\right)\right)}\right) \]
          4. associate-*r*N/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(\color{blue}{\left(3 \cdot x1\right) \cdot \left(3 - -2 \cdot x2\right)} + \left(\mathsf{neg}\left(2\right)\right)\right)\right) \]
          5. *-commutativeN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(\color{blue}{\left(x1 \cdot 3\right)} \cdot \left(3 - -2 \cdot x2\right) + \left(\mathsf{neg}\left(2\right)\right)\right)\right) \]
          6. associate-*r*N/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(\color{blue}{x1 \cdot \left(3 \cdot \left(3 - -2 \cdot x2\right)\right)} + \left(\mathsf{neg}\left(2\right)\right)\right)\right) \]
          7. metadata-evalN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 - -2 \cdot x2\right)\right) + \color{blue}{-2}\right)\right) \]
          8. lower-*.f64N/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, \color{blue}{x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 - -2 \cdot x2\right)\right) + -2\right)}\right) \]
          9. cancel-sign-sub-invN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(x1 \cdot \left(3 \cdot \color{blue}{\left(3 + \left(\mathsf{neg}\left(-2\right)\right) \cdot x2\right)}\right) + -2\right)\right) \]
          10. metadata-evalN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + \color{blue}{2} \cdot x2\right)\right) + -2\right)\right) \]
          11. lower-fma.f64N/A

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

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

          \[\leadsto \color{blue}{-6 \cdot x2 + -1 \cdot x1} \]
        9. Step-by-step derivation
          1. mul-1-negN/A

            \[\leadsto -6 \cdot x2 + \color{blue}{\left(\mathsf{neg}\left(x1\right)\right)} \]
          2. unsub-negN/A

            \[\leadsto \color{blue}{-6 \cdot x2 - x1} \]
          3. lower--.f64N/A

            \[\leadsto \color{blue}{-6 \cdot x2 - x1} \]
          4. lower-*.f6464.5

            \[\leadsto \color{blue}{-6 \cdot x2} - x1 \]
        10. Applied rewrites64.5%

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

        if 1.99999999999999998e255 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))))

        1. Initial program 37.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. Add Preprocessing
        3. Taylor expanded in x2 around 0

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

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

          \[\leadsto x1 + \color{blue}{\left(-6 \cdot x2 + x1 \cdot \left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) - 2\right)\right)} \]
        6. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto x1 + \left(\color{blue}{x2 \cdot -6} + x1 \cdot \left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) - 2\right)\right) \]
          2. lower-fma.f64N/A

            \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(x2, -6, x1 \cdot \left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) - 2\right)\right)} \]
          3. sub-negN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \color{blue}{\left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) + \left(\mathsf{neg}\left(2\right)\right)\right)}\right) \]
          4. associate-*r*N/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(\color{blue}{\left(3 \cdot x1\right) \cdot \left(3 - -2 \cdot x2\right)} + \left(\mathsf{neg}\left(2\right)\right)\right)\right) \]
          5. *-commutativeN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(\color{blue}{\left(x1 \cdot 3\right)} \cdot \left(3 - -2 \cdot x2\right) + \left(\mathsf{neg}\left(2\right)\right)\right)\right) \]
          6. associate-*r*N/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(\color{blue}{x1 \cdot \left(3 \cdot \left(3 - -2 \cdot x2\right)\right)} + \left(\mathsf{neg}\left(2\right)\right)\right)\right) \]
          7. metadata-evalN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 - -2 \cdot x2\right)\right) + \color{blue}{-2}\right)\right) \]
          8. lower-*.f64N/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, \color{blue}{x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 - -2 \cdot x2\right)\right) + -2\right)}\right) \]
          9. cancel-sign-sub-invN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(x1 \cdot \left(3 \cdot \color{blue}{\left(3 + \left(\mathsf{neg}\left(-2\right)\right) \cdot x2\right)}\right) + -2\right)\right) \]
          10. metadata-evalN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + \color{blue}{2} \cdot x2\right)\right) + -2\right)\right) \]
          11. lower-fma.f64N/A

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

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

          \[\leadsto \color{blue}{x1 + x1 \cdot \left(9 \cdot x1 - 2\right)} \]
        9. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto \color{blue}{x1 \cdot \left(9 \cdot x1 - 2\right) + x1} \]
          2. *-rgt-identityN/A

            \[\leadsto x1 \cdot \left(9 \cdot x1 - 2\right) + \color{blue}{x1 \cdot 1} \]
          3. distribute-lft-outN/A

            \[\leadsto \color{blue}{x1 \cdot \left(\left(9 \cdot x1 - 2\right) + 1\right)} \]
          4. lower-*.f64N/A

            \[\leadsto \color{blue}{x1 \cdot \left(\left(9 \cdot x1 - 2\right) + 1\right)} \]
          5. sub-negN/A

            \[\leadsto x1 \cdot \left(\color{blue}{\left(9 \cdot x1 + \left(\mathsf{neg}\left(2\right)\right)\right)} + 1\right) \]
          6. metadata-evalN/A

            \[\leadsto x1 \cdot \left(\left(9 \cdot x1 + \color{blue}{-2}\right) + 1\right) \]
          7. associate-+l+N/A

            \[\leadsto x1 \cdot \color{blue}{\left(9 \cdot x1 + \left(-2 + 1\right)\right)} \]
          8. metadata-evalN/A

            \[\leadsto x1 \cdot \left(9 \cdot x1 + \color{blue}{-1}\right) \]
          9. *-commutativeN/A

            \[\leadsto x1 \cdot \left(\color{blue}{x1 \cdot 9} + -1\right) \]
          10. lower-fma.f6457.2

            \[\leadsto x1 \cdot \color{blue}{\mathsf{fma}\left(x1, 9, -1\right)} \]
        10. Applied rewrites57.2%

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

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

      Alternative 9: 44.1% accurate, 0.9× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 \cdot x1 + 1\\ t_1 := x1 \cdot \left(x1 \cdot 3\right)\\ t_2 := \left(t\_1 + 2 \cdot x2\right) - x1\\ t_3 := \frac{t\_2}{t\_0}\\ t_4 := -1 - x1 \cdot x1\\ t_5 := \frac{t\_2}{t\_4}\\ \mathbf{if}\;x1 + \left(\left(x1 + \left(\left(\left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_5\right) + \left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(3 + t\_5\right)\right) \cdot t\_4 + 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\_0}\right) \leq 4 \cdot 10^{+305}:\\ \;\;\;\;x2 \cdot -6 - x1\\ \mathbf{else}:\\ \;\;\;\;\left(x1 \cdot x2\right) \cdot 12\\ \end{array} \end{array} \]
      (FPCore (x1 x2)
       :precision binary64
       (let* ((t_0 (+ (* x1 x1) 1.0))
              (t_1 (* x1 (* x1 3.0)))
              (t_2 (- (+ t_1 (* 2.0 x2)) x1))
              (t_3 (/ t_2 t_0))
              (t_4 (- -1.0 (* x1 x1)))
              (t_5 (/ t_2 t_4)))
         (if (<=
              (+
               x1
               (+
                (+
                 x1
                 (+
                  (+
                   (*
                    (+
                     (* (* x1 x1) (+ 6.0 (* 4.0 t_5)))
                     (* (* (* x1 2.0) t_3) (+ 3.0 t_5)))
                    t_4)
                   (* t_1 t_3))
                  (* x1 (* x1 x1))))
                (* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_0))))
              4e+305)
           (- (* x2 -6.0) x1)
           (* (* x1 x2) 12.0))))
      double code(double x1, double x2) {
      	double t_0 = (x1 * x1) + 1.0;
      	double t_1 = x1 * (x1 * 3.0);
      	double t_2 = (t_1 + (2.0 * x2)) - x1;
      	double t_3 = t_2 / t_0;
      	double t_4 = -1.0 - (x1 * x1);
      	double t_5 = t_2 / t_4;
      	double tmp;
      	if ((x1 + ((x1 + ((((((x1 * x1) * (6.0 + (4.0 * t_5))) + (((x1 * 2.0) * t_3) * (3.0 + t_5))) * t_4) + (t_1 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)))) <= 4e+305) {
      		tmp = (x2 * -6.0) - x1;
      	} else {
      		tmp = (x1 * x2) * 12.0;
      	}
      	return tmp;
      }
      
      real(8) function code(x1, x2)
          real(8), intent (in) :: x1
          real(8), intent (in) :: x2
          real(8) :: t_0
          real(8) :: t_1
          real(8) :: t_2
          real(8) :: t_3
          real(8) :: t_4
          real(8) :: t_5
          real(8) :: tmp
          t_0 = (x1 * x1) + 1.0d0
          t_1 = x1 * (x1 * 3.0d0)
          t_2 = (t_1 + (2.0d0 * x2)) - x1
          t_3 = t_2 / t_0
          t_4 = (-1.0d0) - (x1 * x1)
          t_5 = t_2 / t_4
          if ((x1 + ((x1 + ((((((x1 * x1) * (6.0d0 + (4.0d0 * t_5))) + (((x1 * 2.0d0) * t_3) * (3.0d0 + t_5))) * t_4) + (t_1 * t_3)) + (x1 * (x1 * x1)))) + (3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_0)))) <= 4d+305) then
              tmp = (x2 * (-6.0d0)) - x1
          else
              tmp = (x1 * x2) * 12.0d0
          end if
          code = tmp
      end function
      
      public static double code(double x1, double x2) {
      	double t_0 = (x1 * x1) + 1.0;
      	double t_1 = x1 * (x1 * 3.0);
      	double t_2 = (t_1 + (2.0 * x2)) - x1;
      	double t_3 = t_2 / t_0;
      	double t_4 = -1.0 - (x1 * x1);
      	double t_5 = t_2 / t_4;
      	double tmp;
      	if ((x1 + ((x1 + ((((((x1 * x1) * (6.0 + (4.0 * t_5))) + (((x1 * 2.0) * t_3) * (3.0 + t_5))) * t_4) + (t_1 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)))) <= 4e+305) {
      		tmp = (x2 * -6.0) - x1;
      	} else {
      		tmp = (x1 * x2) * 12.0;
      	}
      	return tmp;
      }
      
      def code(x1, x2):
      	t_0 = (x1 * x1) + 1.0
      	t_1 = x1 * (x1 * 3.0)
      	t_2 = (t_1 + (2.0 * x2)) - x1
      	t_3 = t_2 / t_0
      	t_4 = -1.0 - (x1 * x1)
      	t_5 = t_2 / t_4
      	tmp = 0
      	if (x1 + ((x1 + ((((((x1 * x1) * (6.0 + (4.0 * t_5))) + (((x1 * 2.0) * t_3) * (3.0 + t_5))) * t_4) + (t_1 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)))) <= 4e+305:
      		tmp = (x2 * -6.0) - x1
      	else:
      		tmp = (x1 * x2) * 12.0
      	return tmp
      
      function code(x1, x2)
      	t_0 = Float64(Float64(x1 * x1) + 1.0)
      	t_1 = Float64(x1 * Float64(x1 * 3.0))
      	t_2 = Float64(Float64(t_1 + Float64(2.0 * x2)) - x1)
      	t_3 = Float64(t_2 / t_0)
      	t_4 = Float64(-1.0 - Float64(x1 * x1))
      	t_5 = Float64(t_2 / t_4)
      	tmp = 0.0
      	if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_5))) + Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(3.0 + t_5))) * t_4) + Float64(t_1 * t_3)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_0)))) <= 4e+305)
      		tmp = Float64(Float64(x2 * -6.0) - x1);
      	else
      		tmp = Float64(Float64(x1 * x2) * 12.0);
      	end
      	return tmp
      end
      
      function tmp_2 = code(x1, x2)
      	t_0 = (x1 * x1) + 1.0;
      	t_1 = x1 * (x1 * 3.0);
      	t_2 = (t_1 + (2.0 * x2)) - x1;
      	t_3 = t_2 / t_0;
      	t_4 = -1.0 - (x1 * x1);
      	t_5 = t_2 / t_4;
      	tmp = 0.0;
      	if ((x1 + ((x1 + ((((((x1 * x1) * (6.0 + (4.0 * t_5))) + (((x1 * 2.0) * t_3) * (3.0 + t_5))) * t_4) + (t_1 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)))) <= 4e+305)
      		tmp = (x2 * -6.0) - x1;
      	else
      		tmp = (x1 * x2) * 12.0;
      	end
      	tmp_2 = tmp;
      end
      
      code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 / t$95$0), $MachinePrecision]}, Block[{t$95$4 = N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$2 / t$95$4), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(3.0 + t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$4), $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$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 4e+305], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision], N[(N[(x1 * x2), $MachinePrecision] * 12.0), $MachinePrecision]]]]]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := x1 \cdot x1 + 1\\
      t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
      t_2 := \left(t\_1 + 2 \cdot x2\right) - x1\\
      t_3 := \frac{t\_2}{t\_0}\\
      t_4 := -1 - x1 \cdot x1\\
      t_5 := \frac{t\_2}{t\_4}\\
      \mathbf{if}\;x1 + \left(\left(x1 + \left(\left(\left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_5\right) + \left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(3 + t\_5\right)\right) \cdot t\_4 + 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\_0}\right) \leq 4 \cdot 10^{+305}:\\
      \;\;\;\;x2 \cdot -6 - x1\\
      
      \mathbf{else}:\\
      \;\;\;\;\left(x1 \cdot x2\right) \cdot 12\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < 3.9999999999999998e305

        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. Add Preprocessing
        3. Taylor expanded in x2 around 0

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

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

          \[\leadsto x1 + \color{blue}{\left(-6 \cdot x2 + x1 \cdot \left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) - 2\right)\right)} \]
        6. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto x1 + \left(\color{blue}{x2 \cdot -6} + x1 \cdot \left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) - 2\right)\right) \]
          2. lower-fma.f64N/A

            \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(x2, -6, x1 \cdot \left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) - 2\right)\right)} \]
          3. sub-negN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \color{blue}{\left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) + \left(\mathsf{neg}\left(2\right)\right)\right)}\right) \]
          4. associate-*r*N/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(\color{blue}{\left(3 \cdot x1\right) \cdot \left(3 - -2 \cdot x2\right)} + \left(\mathsf{neg}\left(2\right)\right)\right)\right) \]
          5. *-commutativeN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(\color{blue}{\left(x1 \cdot 3\right)} \cdot \left(3 - -2 \cdot x2\right) + \left(\mathsf{neg}\left(2\right)\right)\right)\right) \]
          6. associate-*r*N/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(\color{blue}{x1 \cdot \left(3 \cdot \left(3 - -2 \cdot x2\right)\right)} + \left(\mathsf{neg}\left(2\right)\right)\right)\right) \]
          7. metadata-evalN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 - -2 \cdot x2\right)\right) + \color{blue}{-2}\right)\right) \]
          8. lower-*.f64N/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, \color{blue}{x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 - -2 \cdot x2\right)\right) + -2\right)}\right) \]
          9. cancel-sign-sub-invN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(x1 \cdot \left(3 \cdot \color{blue}{\left(3 + \left(\mathsf{neg}\left(-2\right)\right) \cdot x2\right)}\right) + -2\right)\right) \]
          10. metadata-evalN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + \color{blue}{2} \cdot x2\right)\right) + -2\right)\right) \]
          11. lower-fma.f64N/A

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

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

          \[\leadsto \color{blue}{-6 \cdot x2 + -1 \cdot x1} \]
        9. Step-by-step derivation
          1. mul-1-negN/A

            \[\leadsto -6 \cdot x2 + \color{blue}{\left(\mathsf{neg}\left(x1\right)\right)} \]
          2. unsub-negN/A

            \[\leadsto \color{blue}{-6 \cdot x2 - x1} \]
          3. lower--.f64N/A

            \[\leadsto \color{blue}{-6 \cdot x2 - x1} \]
          4. lower-*.f6461.8

            \[\leadsto \color{blue}{-6 \cdot x2} - x1 \]
        10. Applied rewrites61.8%

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

        if 3.9999999999999998e305 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))))

        1. Initial program 34.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. Add Preprocessing
        3. Taylor expanded in x1 around -inf

          \[\leadsto x1 + \color{blue}{{x1}^{4} \cdot \left(6 + -1 \cdot \frac{3 + -1 \cdot \frac{9 + \left(-1 \cdot \frac{2 + -2 \cdot \left(1 + 3 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1} + 4 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1}}{x1}\right)} \]
        4. Step-by-step derivation
          1. lower-*.f64N/A

            \[\leadsto x1 + \color{blue}{{x1}^{4} \cdot \left(6 + -1 \cdot \frac{3 + -1 \cdot \frac{9 + \left(-1 \cdot \frac{2 + -2 \cdot \left(1 + 3 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1} + 4 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1}}{x1}\right)} \]
          2. lower-pow.f64N/A

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

            \[\leadsto x1 + {x1}^{4} \cdot \left(6 + \color{blue}{\left(\mathsf{neg}\left(\frac{3 + -1 \cdot \frac{9 + \left(-1 \cdot \frac{2 + -2 \cdot \left(1 + 3 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1} + 4 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1}}{x1}\right)\right)}\right) \]
          4. unsub-negN/A

            \[\leadsto x1 + {x1}^{4} \cdot \color{blue}{\left(6 - \frac{3 + -1 \cdot \frac{9 + \left(-1 \cdot \frac{2 + -2 \cdot \left(1 + 3 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1} + 4 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1}}{x1}\right)} \]
          5. lower--.f64N/A

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

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

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

          \[\leadsto \color{blue}{x1 \cdot \left(1 + 6 \cdot \left(2 \cdot x2 - 3\right)\right)} \]
        7. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto x1 \cdot \color{blue}{\left(6 \cdot \left(2 \cdot x2 - 3\right) + 1\right)} \]
          2. distribute-lft-inN/A

            \[\leadsto \color{blue}{x1 \cdot \left(6 \cdot \left(2 \cdot x2 - 3\right)\right) + x1 \cdot 1} \]
          3. *-rgt-identityN/A

            \[\leadsto x1 \cdot \left(6 \cdot \left(2 \cdot x2 - 3\right)\right) + \color{blue}{x1} \]
          4. lower-fma.f64N/A

            \[\leadsto \color{blue}{\mathsf{fma}\left(x1, 6 \cdot \left(2 \cdot x2 - 3\right), x1\right)} \]
          5. lower-*.f64N/A

            \[\leadsto \mathsf{fma}\left(x1, \color{blue}{6 \cdot \left(2 \cdot x2 - 3\right)}, x1\right) \]
          6. sub-negN/A

            \[\leadsto \mathsf{fma}\left(x1, 6 \cdot \color{blue}{\left(2 \cdot x2 + \left(\mathsf{neg}\left(3\right)\right)\right)}, x1\right) \]
          7. *-commutativeN/A

            \[\leadsto \mathsf{fma}\left(x1, 6 \cdot \left(\color{blue}{x2 \cdot 2} + \left(\mathsf{neg}\left(3\right)\right)\right), x1\right) \]
          8. metadata-evalN/A

            \[\leadsto \mathsf{fma}\left(x1, 6 \cdot \left(x2 \cdot 2 + \color{blue}{-3}\right), x1\right) \]
          9. lower-fma.f6412.3

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

          \[\leadsto \color{blue}{\mathsf{fma}\left(x1, 6 \cdot \mathsf{fma}\left(x2, 2, -3\right), x1\right)} \]
        9. Taylor expanded in x2 around inf

          \[\leadsto \color{blue}{12 \cdot \left(x1 \cdot x2\right)} \]
        10. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \color{blue}{\left(x1 \cdot x2\right) \cdot 12} \]
          2. lower-*.f64N/A

            \[\leadsto \color{blue}{\left(x1 \cdot x2\right) \cdot 12} \]
          3. lower-*.f6411.6

            \[\leadsto \color{blue}{\left(x1 \cdot x2\right)} \cdot 12 \]
        11. Applied rewrites11.6%

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

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

      Alternative 10: 95.3% accurate, 2.9× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, 6, -3\right), \mathsf{fma}\left(4, \mathsf{fma}\left(x2, 2, -3\right), 9\right)\right), 6 \cdot \mathsf{fma}\left(x2, 2, -3\right)\right), x1\right)\\ \mathbf{if}\;x1 \leq -2.3:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x1 \leq 740000000:\\ \;\;\;\;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) + 4 \cdot \left(x2 \cdot \left(x1 \cdot \mathsf{fma}\left(x2, 2, -3\right)\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
      (FPCore (x1 x2)
       :precision binary64
       (let* ((t_0
               (fma
                x1
                (fma
                 x1
                 (fma x1 (fma x1 6.0 -3.0) (fma 4.0 (fma x2 2.0 -3.0) 9.0))
                 (* 6.0 (fma x2 2.0 -3.0)))
                x1)))
         (if (<= x1 -2.3)
           t_0
           (if (<= x1 740000000.0)
             (+
              x1
              (+
               (* 3.0 (/ (- (- (* x1 (* x1 3.0)) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)))
               (+ x1 (+ (* x1 (* x1 x1)) (* 4.0 (* x2 (* x1 (fma x2 2.0 -3.0))))))))
             t_0))))
      double code(double x1, double x2) {
      	double t_0 = fma(x1, fma(x1, fma(x1, fma(x1, 6.0, -3.0), fma(4.0, fma(x2, 2.0, -3.0), 9.0)), (6.0 * fma(x2, 2.0, -3.0))), x1);
      	double tmp;
      	if (x1 <= -2.3) {
      		tmp = t_0;
      	} else if (x1 <= 740000000.0) {
      		tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + ((x1 * (x1 * x1)) + (4.0 * (x2 * (x1 * fma(x2, 2.0, -3.0)))))));
      	} else {
      		tmp = t_0;
      	}
      	return tmp;
      }
      
      function code(x1, x2)
      	t_0 = fma(x1, fma(x1, fma(x1, fma(x1, 6.0, -3.0), fma(4.0, fma(x2, 2.0, -3.0), 9.0)), Float64(6.0 * fma(x2, 2.0, -3.0))), x1)
      	tmp = 0.0
      	if (x1 <= -2.3)
      		tmp = t_0;
      	elseif (x1 <= 740000000.0)
      		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(Float64(x1 * Float64(x1 * x1)) + Float64(4.0 * Float64(x2 * Float64(x1 * fma(x2, 2.0, -3.0))))))));
      	else
      		tmp = t_0;
      	end
      	return tmp
      end
      
      code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * N[(x1 * N[(x1 * 6.0 + -3.0), $MachinePrecision] + N[(4.0 * N[(x2 * 2.0 + -3.0), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision] + N[(6.0 * N[(x2 * 2.0 + -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision]}, If[LessEqual[x1, -2.3], t$95$0, If[LessEqual[x1, 740000000.0], 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[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(4.0 * N[(x2 * N[(x1 * N[(x2 * 2.0 + -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, 6, -3\right), \mathsf{fma}\left(4, \mathsf{fma}\left(x2, 2, -3\right), 9\right)\right), 6 \cdot \mathsf{fma}\left(x2, 2, -3\right)\right), x1\right)\\
      \mathbf{if}\;x1 \leq -2.3:\\
      \;\;\;\;t\_0\\
      
      \mathbf{elif}\;x1 \leq 740000000:\\
      \;\;\;\;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) + 4 \cdot \left(x2 \cdot \left(x1 \cdot \mathsf{fma}\left(x2, 2, -3\right)\right)\right)\right)\right)\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_0\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if x1 < -2.2999999999999998 or 7.4e8 < x1

        1. Initial program 43.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. Add Preprocessing
        3. Taylor expanded in x1 around -inf

          \[\leadsto x1 + \color{blue}{{x1}^{4} \cdot \left(6 + -1 \cdot \frac{3 + -1 \cdot \frac{9 + \left(-1 \cdot \frac{2 + -2 \cdot \left(1 + 3 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1} + 4 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1}}{x1}\right)} \]
        4. Step-by-step derivation
          1. lower-*.f64N/A

            \[\leadsto x1 + \color{blue}{{x1}^{4} \cdot \left(6 + -1 \cdot \frac{3 + -1 \cdot \frac{9 + \left(-1 \cdot \frac{2 + -2 \cdot \left(1 + 3 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1} + 4 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1}}{x1}\right)} \]
          2. lower-pow.f64N/A

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

            \[\leadsto x1 + {x1}^{4} \cdot \left(6 + \color{blue}{\left(\mathsf{neg}\left(\frac{3 + -1 \cdot \frac{9 + \left(-1 \cdot \frac{2 + -2 \cdot \left(1 + 3 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1} + 4 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1}}{x1}\right)\right)}\right) \]
          4. unsub-negN/A

            \[\leadsto x1 + {x1}^{4} \cdot \color{blue}{\left(6 - \frac{3 + -1 \cdot \frac{9 + \left(-1 \cdot \frac{2 + -2 \cdot \left(1 + 3 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1} + 4 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1}}{x1}\right)} \]
          5. lower--.f64N/A

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

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

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

          \[\leadsto \color{blue}{x1 \cdot \left(1 + \left(6 \cdot \left(2 \cdot x2 - 3\right) + x1 \cdot \left(9 + \left(4 \cdot \left(2 \cdot x2 - 3\right) + x1 \cdot \left(6 \cdot x1 - 3\right)\right)\right)\right)\right)} \]
        7. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto x1 \cdot \color{blue}{\left(\left(6 \cdot \left(2 \cdot x2 - 3\right) + x1 \cdot \left(9 + \left(4 \cdot \left(2 \cdot x2 - 3\right) + x1 \cdot \left(6 \cdot x1 - 3\right)\right)\right)\right) + 1\right)} \]
          2. distribute-lft-inN/A

            \[\leadsto \color{blue}{x1 \cdot \left(6 \cdot \left(2 \cdot x2 - 3\right) + x1 \cdot \left(9 + \left(4 \cdot \left(2 \cdot x2 - 3\right) + x1 \cdot \left(6 \cdot x1 - 3\right)\right)\right)\right) + x1 \cdot 1} \]
          3. *-rgt-identityN/A

            \[\leadsto x1 \cdot \left(6 \cdot \left(2 \cdot x2 - 3\right) + x1 \cdot \left(9 + \left(4 \cdot \left(2 \cdot x2 - 3\right) + x1 \cdot \left(6 \cdot x1 - 3\right)\right)\right)\right) + \color{blue}{x1} \]
          4. lower-fma.f64N/A

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

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

        if -2.2999999999999998 < x1 < 7.4e8

        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. Add Preprocessing
        3. Taylor expanded in x1 around 0

          \[\leadsto x1 + \left(\left(\left(\color{blue}{4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\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) \]
        4. Step-by-step derivation
          1. lower-*.f64N/A

            \[\leadsto x1 + \left(\left(\left(\color{blue}{4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\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) \]
          2. *-commutativeN/A

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

            \[\leadsto x1 + \left(\left(\left(4 \cdot \color{blue}{\left(x2 \cdot \left(\left(2 \cdot x2 - 3\right) \cdot 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. lower-*.f64N/A

            \[\leadsto x1 + \left(\left(\left(4 \cdot \color{blue}{\left(x2 \cdot \left(\left(2 \cdot x2 - 3\right) \cdot 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. lower-*.f64N/A

            \[\leadsto x1 + \left(\left(\left(4 \cdot \left(x2 \cdot \color{blue}{\left(\left(2 \cdot x2 - 3\right) \cdot 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. sub-negN/A

            \[\leadsto x1 + \left(\left(\left(4 \cdot \left(x2 \cdot \left(\color{blue}{\left(2 \cdot x2 + \left(\mathsf{neg}\left(3\right)\right)\right)} \cdot 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. *-commutativeN/A

            \[\leadsto x1 + \left(\left(\left(4 \cdot \left(x2 \cdot \left(\left(\color{blue}{x2 \cdot 2} + \left(\mathsf{neg}\left(3\right)\right)\right) \cdot 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) \]
          8. lower-fma.f64N/A

            \[\leadsto x1 + \left(\left(\left(4 \cdot \left(x2 \cdot \left(\color{blue}{\mathsf{fma}\left(x2, 2, \mathsf{neg}\left(3\right)\right)} \cdot 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) \]
          9. metadata-eval96.8

            \[\leadsto x1 + \left(\left(\left(4 \cdot \left(x2 \cdot \left(\mathsf{fma}\left(x2, 2, \color{blue}{-3}\right) \cdot 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. Applied rewrites96.8%

          \[\leadsto x1 + \left(\left(\left(\color{blue}{4 \cdot \left(x2 \cdot \left(\mathsf{fma}\left(x2, 2, -3\right) \cdot 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. Recombined 2 regimes into one program.
      4. Final simplification95.6%

        \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -2.3:\\ \;\;\;\;\mathsf{fma}\left(x1, \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, 6, -3\right), \mathsf{fma}\left(4, \mathsf{fma}\left(x2, 2, -3\right), 9\right)\right), 6 \cdot \mathsf{fma}\left(x2, 2, -3\right)\right), x1\right)\\ \mathbf{elif}\;x1 \leq 740000000:\\ \;\;\;\;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) + 4 \cdot \left(x2 \cdot \left(x1 \cdot \mathsf{fma}\left(x2, 2, -3\right)\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x1, \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, 6, -3\right), \mathsf{fma}\left(4, \mathsf{fma}\left(x2, 2, -3\right), 9\right)\right), 6 \cdot \mathsf{fma}\left(x2, 2, -3\right)\right), x1\right)\\ \end{array} \]
      5. Add Preprocessing

      Alternative 11: 95.3% accurate, 3.4× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, 6, -3\right), \mathsf{fma}\left(4, \mathsf{fma}\left(x2, 2, -3\right), 9\right)\right), 6 \cdot \mathsf{fma}\left(x2, 2, -3\right)\right), x1\right)\\ \mathbf{if}\;x1 \leq -2.5:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x1 \leq 740000000:\\ \;\;\;\;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 \mathsf{fma}\left(x2, 2, -3\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
      (FPCore (x1 x2)
       :precision binary64
       (let* ((t_0
               (fma
                x1
                (fma
                 x1
                 (fma x1 (fma x1 6.0 -3.0) (fma 4.0 (fma x2 2.0 -3.0) 9.0))
                 (* 6.0 (fma x2 2.0 -3.0)))
                x1)))
         (if (<= x1 -2.5)
           t_0
           (if (<= x1 740000000.0)
             (+
              x1
              (+
               (* 3.0 (/ (- (- (* x1 (* x1 3.0)) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)))
               (+ x1 (* 4.0 (* x2 (* x1 (fma x2 2.0 -3.0)))))))
             t_0))))
      double code(double x1, double x2) {
      	double t_0 = fma(x1, fma(x1, fma(x1, fma(x1, 6.0, -3.0), fma(4.0, fma(x2, 2.0, -3.0), 9.0)), (6.0 * fma(x2, 2.0, -3.0))), x1);
      	double tmp;
      	if (x1 <= -2.5) {
      		tmp = t_0;
      	} else if (x1 <= 740000000.0) {
      		tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x2 * (x1 * fma(x2, 2.0, -3.0))))));
      	} else {
      		tmp = t_0;
      	}
      	return tmp;
      }
      
      function code(x1, x2)
      	t_0 = fma(x1, fma(x1, fma(x1, fma(x1, 6.0, -3.0), fma(4.0, fma(x2, 2.0, -3.0), 9.0)), Float64(6.0 * fma(x2, 2.0, -3.0))), x1)
      	tmp = 0.0
      	if (x1 <= -2.5)
      		tmp = t_0;
      	elseif (x1 <= 740000000.0)
      		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 * fma(x2, 2.0, -3.0)))))));
      	else
      		tmp = t_0;
      	end
      	return tmp
      end
      
      code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * N[(x1 * N[(x1 * 6.0 + -3.0), $MachinePrecision] + N[(4.0 * N[(x2 * 2.0 + -3.0), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision] + N[(6.0 * N[(x2 * 2.0 + -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision]}, If[LessEqual[x1, -2.5], t$95$0, If[LessEqual[x1, 740000000.0], 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[(x2 * 2.0 + -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, 6, -3\right), \mathsf{fma}\left(4, \mathsf{fma}\left(x2, 2, -3\right), 9\right)\right), 6 \cdot \mathsf{fma}\left(x2, 2, -3\right)\right), x1\right)\\
      \mathbf{if}\;x1 \leq -2.5:\\
      \;\;\;\;t\_0\\
      
      \mathbf{elif}\;x1 \leq 740000000:\\
      \;\;\;\;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 \mathsf{fma}\left(x2, 2, -3\right)\right)\right)\right)\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_0\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if x1 < -2.5 or 7.4e8 < x1

        1. Initial program 43.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. Add Preprocessing
        3. Taylor expanded in x1 around -inf

          \[\leadsto x1 + \color{blue}{{x1}^{4} \cdot \left(6 + -1 \cdot \frac{3 + -1 \cdot \frac{9 + \left(-1 \cdot \frac{2 + -2 \cdot \left(1 + 3 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1} + 4 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1}}{x1}\right)} \]
        4. Step-by-step derivation
          1. lower-*.f64N/A

            \[\leadsto x1 + \color{blue}{{x1}^{4} \cdot \left(6 + -1 \cdot \frac{3 + -1 \cdot \frac{9 + \left(-1 \cdot \frac{2 + -2 \cdot \left(1 + 3 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1} + 4 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1}}{x1}\right)} \]
          2. lower-pow.f64N/A

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

            \[\leadsto x1 + {x1}^{4} \cdot \left(6 + \color{blue}{\left(\mathsf{neg}\left(\frac{3 + -1 \cdot \frac{9 + \left(-1 \cdot \frac{2 + -2 \cdot \left(1 + 3 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1} + 4 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1}}{x1}\right)\right)}\right) \]
          4. unsub-negN/A

            \[\leadsto x1 + {x1}^{4} \cdot \color{blue}{\left(6 - \frac{3 + -1 \cdot \frac{9 + \left(-1 \cdot \frac{2 + -2 \cdot \left(1 + 3 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1} + 4 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1}}{x1}\right)} \]
          5. lower--.f64N/A

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

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

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

          \[\leadsto \color{blue}{x1 \cdot \left(1 + \left(6 \cdot \left(2 \cdot x2 - 3\right) + x1 \cdot \left(9 + \left(4 \cdot \left(2 \cdot x2 - 3\right) + x1 \cdot \left(6 \cdot x1 - 3\right)\right)\right)\right)\right)} \]
        7. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto x1 \cdot \color{blue}{\left(\left(6 \cdot \left(2 \cdot x2 - 3\right) + x1 \cdot \left(9 + \left(4 \cdot \left(2 \cdot x2 - 3\right) + x1 \cdot \left(6 \cdot x1 - 3\right)\right)\right)\right) + 1\right)} \]
          2. distribute-lft-inN/A

            \[\leadsto \color{blue}{x1 \cdot \left(6 \cdot \left(2 \cdot x2 - 3\right) + x1 \cdot \left(9 + \left(4 \cdot \left(2 \cdot x2 - 3\right) + x1 \cdot \left(6 \cdot x1 - 3\right)\right)\right)\right) + x1 \cdot 1} \]
          3. *-rgt-identityN/A

            \[\leadsto x1 \cdot \left(6 \cdot \left(2 \cdot x2 - 3\right) + x1 \cdot \left(9 + \left(4 \cdot \left(2 \cdot x2 - 3\right) + x1 \cdot \left(6 \cdot x1 - 3\right)\right)\right)\right) + \color{blue}{x1} \]
          4. lower-fma.f64N/A

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

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

        if -2.5 < x1 < 7.4e8

        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. Add Preprocessing
        3. Taylor expanded in x1 around 0

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

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

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

            \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(x2 \cdot \left(\left(2 \cdot x2 - 3\right) \cdot x1\right)\right)} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
          4. lower-*.f64N/A

            \[\leadsto x1 + \left(\left(4 \cdot \color{blue}{\left(x2 \cdot \left(\left(2 \cdot x2 - 3\right) \cdot x1\right)\right)} + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
          5. lower-*.f64N/A

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

            \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(\color{blue}{\left(2 \cdot x2 + \left(\mathsf{neg}\left(3\right)\right)\right)} \cdot x1\right)\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
          7. *-commutativeN/A

            \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(\left(\color{blue}{x2 \cdot 2} + \left(\mathsf{neg}\left(3\right)\right)\right) \cdot x1\right)\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
          8. lower-fma.f64N/A

            \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(\color{blue}{\mathsf{fma}\left(x2, 2, \mathsf{neg}\left(3\right)\right)} \cdot x1\right)\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
          9. metadata-eval96.8

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

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -2.5:\\ \;\;\;\;\mathsf{fma}\left(x1, \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, 6, -3\right), \mathsf{fma}\left(4, \mathsf{fma}\left(x2, 2, -3\right), 9\right)\right), 6 \cdot \mathsf{fma}\left(x2, 2, -3\right)\right), x1\right)\\ \mathbf{elif}\;x1 \leq 740000000:\\ \;\;\;\;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 \mathsf{fma}\left(x2, 2, -3\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x1, \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, 6, -3\right), \mathsf{fma}\left(4, \mathsf{fma}\left(x2, 2, -3\right), 9\right)\right), 6 \cdot \mathsf{fma}\left(x2, 2, -3\right)\right), x1\right)\\ \end{array} \]
      5. Add Preprocessing

      Alternative 12: 89.3% accurate, 3.5× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, 6, -3\right), \mathsf{fma}\left(4, \mathsf{fma}\left(x2, 2, -3\right), 9\right)\right), 6 \cdot \mathsf{fma}\left(x2, 2, -3\right)\right), x1\right)\\ \mathbf{if}\;x1 \leq -2.5:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x1 \leq 740000000:\\ \;\;\;\;x1 + \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, \mathsf{fma}\left(x2, -4, \mathsf{fma}\left(2, \mathsf{fma}\left(x2, -2, 3\right), \mathsf{fma}\left(3, \mathsf{fma}\left(x2, 2, 3\right), \mathsf{fma}\left(x2, 14, -6\right)\right)\right)\right), \mathsf{fma}\left(x2, \mathsf{fma}\left(4, 2 \cdot x2, -12\right), -2\right)\right), x2 \cdot -6\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
      (FPCore (x1 x2)
       :precision binary64
       (let* ((t_0
               (fma
                x1
                (fma
                 x1
                 (fma x1 (fma x1 6.0 -3.0) (fma 4.0 (fma x2 2.0 -3.0) 9.0))
                 (* 6.0 (fma x2 2.0 -3.0)))
                x1)))
         (if (<= x1 -2.5)
           t_0
           (if (<= x1 740000000.0)
             (+
              x1
              (fma
               x1
               (fma
                x1
                (fma
                 x2
                 -4.0
                 (fma
                  2.0
                  (fma x2 -2.0 3.0)
                  (fma 3.0 (fma x2 2.0 3.0) (fma x2 14.0 -6.0))))
                (fma x2 (fma 4.0 (* 2.0 x2) -12.0) -2.0))
               (* x2 -6.0)))
             t_0))))
      double code(double x1, double x2) {
      	double t_0 = fma(x1, fma(x1, fma(x1, fma(x1, 6.0, -3.0), fma(4.0, fma(x2, 2.0, -3.0), 9.0)), (6.0 * fma(x2, 2.0, -3.0))), x1);
      	double tmp;
      	if (x1 <= -2.5) {
      		tmp = t_0;
      	} else if (x1 <= 740000000.0) {
      		tmp = x1 + fma(x1, fma(x1, fma(x2, -4.0, fma(2.0, fma(x2, -2.0, 3.0), fma(3.0, fma(x2, 2.0, 3.0), fma(x2, 14.0, -6.0)))), fma(x2, fma(4.0, (2.0 * x2), -12.0), -2.0)), (x2 * -6.0));
      	} else {
      		tmp = t_0;
      	}
      	return tmp;
      }
      
      function code(x1, x2)
      	t_0 = fma(x1, fma(x1, fma(x1, fma(x1, 6.0, -3.0), fma(4.0, fma(x2, 2.0, -3.0), 9.0)), Float64(6.0 * fma(x2, 2.0, -3.0))), x1)
      	tmp = 0.0
      	if (x1 <= -2.5)
      		tmp = t_0;
      	elseif (x1 <= 740000000.0)
      		tmp = Float64(x1 + fma(x1, fma(x1, fma(x2, -4.0, fma(2.0, fma(x2, -2.0, 3.0), fma(3.0, fma(x2, 2.0, 3.0), fma(x2, 14.0, -6.0)))), fma(x2, fma(4.0, Float64(2.0 * x2), -12.0), -2.0)), Float64(x2 * -6.0)));
      	else
      		tmp = t_0;
      	end
      	return tmp
      end
      
      code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * N[(x1 * N[(x1 * 6.0 + -3.0), $MachinePrecision] + N[(4.0 * N[(x2 * 2.0 + -3.0), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision] + N[(6.0 * N[(x2 * 2.0 + -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision]}, If[LessEqual[x1, -2.5], t$95$0, If[LessEqual[x1, 740000000.0], N[(x1 + N[(x1 * N[(x1 * N[(x2 * -4.0 + N[(2.0 * N[(x2 * -2.0 + 3.0), $MachinePrecision] + N[(3.0 * N[(x2 * 2.0 + 3.0), $MachinePrecision] + N[(x2 * 14.0 + -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x2 * N[(4.0 * N[(2.0 * x2), $MachinePrecision] + -12.0), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, 6, -3\right), \mathsf{fma}\left(4, \mathsf{fma}\left(x2, 2, -3\right), 9\right)\right), 6 \cdot \mathsf{fma}\left(x2, 2, -3\right)\right), x1\right)\\
      \mathbf{if}\;x1 \leq -2.5:\\
      \;\;\;\;t\_0\\
      
      \mathbf{elif}\;x1 \leq 740000000:\\
      \;\;\;\;x1 + \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, \mathsf{fma}\left(x2, -4, \mathsf{fma}\left(2, \mathsf{fma}\left(x2, -2, 3\right), \mathsf{fma}\left(3, \mathsf{fma}\left(x2, 2, 3\right), \mathsf{fma}\left(x2, 14, -6\right)\right)\right)\right), \mathsf{fma}\left(x2, \mathsf{fma}\left(4, 2 \cdot x2, -12\right), -2\right)\right), x2 \cdot -6\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_0\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if x1 < -2.5 or 7.4e8 < x1

        1. Initial program 43.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. Add Preprocessing
        3. Taylor expanded in x1 around -inf

          \[\leadsto x1 + \color{blue}{{x1}^{4} \cdot \left(6 + -1 \cdot \frac{3 + -1 \cdot \frac{9 + \left(-1 \cdot \frac{2 + -2 \cdot \left(1 + 3 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1} + 4 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1}}{x1}\right)} \]
        4. Step-by-step derivation
          1. lower-*.f64N/A

            \[\leadsto x1 + \color{blue}{{x1}^{4} \cdot \left(6 + -1 \cdot \frac{3 + -1 \cdot \frac{9 + \left(-1 \cdot \frac{2 + -2 \cdot \left(1 + 3 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1} + 4 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1}}{x1}\right)} \]
          2. lower-pow.f64N/A

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

            \[\leadsto x1 + {x1}^{4} \cdot \left(6 + \color{blue}{\left(\mathsf{neg}\left(\frac{3 + -1 \cdot \frac{9 + \left(-1 \cdot \frac{2 + -2 \cdot \left(1 + 3 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1} + 4 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1}}{x1}\right)\right)}\right) \]
          4. unsub-negN/A

            \[\leadsto x1 + {x1}^{4} \cdot \color{blue}{\left(6 - \frac{3 + -1 \cdot \frac{9 + \left(-1 \cdot \frac{2 + -2 \cdot \left(1 + 3 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1} + 4 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1}}{x1}\right)} \]
          5. lower--.f64N/A

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

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

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

          \[\leadsto \color{blue}{x1 \cdot \left(1 + \left(6 \cdot \left(2 \cdot x2 - 3\right) + x1 \cdot \left(9 + \left(4 \cdot \left(2 \cdot x2 - 3\right) + x1 \cdot \left(6 \cdot x1 - 3\right)\right)\right)\right)\right)} \]
        7. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto x1 \cdot \color{blue}{\left(\left(6 \cdot \left(2 \cdot x2 - 3\right) + x1 \cdot \left(9 + \left(4 \cdot \left(2 \cdot x2 - 3\right) + x1 \cdot \left(6 \cdot x1 - 3\right)\right)\right)\right) + 1\right)} \]
          2. distribute-lft-inN/A

            \[\leadsto \color{blue}{x1 \cdot \left(6 \cdot \left(2 \cdot x2 - 3\right) + x1 \cdot \left(9 + \left(4 \cdot \left(2 \cdot x2 - 3\right) + x1 \cdot \left(6 \cdot x1 - 3\right)\right)\right)\right) + x1 \cdot 1} \]
          3. *-rgt-identityN/A

            \[\leadsto x1 \cdot \left(6 \cdot \left(2 \cdot x2 - 3\right) + x1 \cdot \left(9 + \left(4 \cdot \left(2 \cdot x2 - 3\right) + x1 \cdot \left(6 \cdot x1 - 3\right)\right)\right)\right) + \color{blue}{x1} \]
          4. lower-fma.f64N/A

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

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

        if -2.5 < x1 < 7.4e8

        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. Add Preprocessing
        3. Taylor expanded in x1 around 0

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

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -2.5:\\ \;\;\;\;\mathsf{fma}\left(x1, \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, 6, -3\right), \mathsf{fma}\left(4, \mathsf{fma}\left(x2, 2, -3\right), 9\right)\right), 6 \cdot \mathsf{fma}\left(x2, 2, -3\right)\right), x1\right)\\ \mathbf{elif}\;x1 \leq 740000000:\\ \;\;\;\;x1 + \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, \mathsf{fma}\left(x2, -4, \mathsf{fma}\left(2, \mathsf{fma}\left(x2, -2, 3\right), \mathsf{fma}\left(3, \mathsf{fma}\left(x2, 2, 3\right), \mathsf{fma}\left(x2, 14, -6\right)\right)\right)\right), \mathsf{fma}\left(x2, \mathsf{fma}\left(4, 2 \cdot x2, -12\right), -2\right)\right), x2 \cdot -6\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x1, \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, 6, -3\right), \mathsf{fma}\left(4, \mathsf{fma}\left(x2, 2, -3\right), 9\right)\right), 6 \cdot \mathsf{fma}\left(x2, 2, -3\right)\right), x1\right)\\ \end{array} \]
      5. Add Preprocessing

      Alternative 13: 89.2% accurate, 5.0× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, 6, -3\right), \mathsf{fma}\left(4, \mathsf{fma}\left(x2, 2, -3\right), 9\right)\right), 6 \cdot \mathsf{fma}\left(x2, 2, -3\right)\right), x1\right)\\ \mathbf{if}\;x1 \leq -2.5:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x1 \leq 740000000:\\ \;\;\;\;x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \mathsf{fma}\left(x2, \mathsf{fma}\left(x2, 8, -12\right), -2\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
      (FPCore (x1 x2)
       :precision binary64
       (let* ((t_0
               (fma
                x1
                (fma
                 x1
                 (fma x1 (fma x1 6.0 -3.0) (fma 4.0 (fma x2 2.0 -3.0) 9.0))
                 (* 6.0 (fma x2 2.0 -3.0)))
                x1)))
         (if (<= x1 -2.5)
           t_0
           (if (<= x1 740000000.0)
             (+ x1 (fma x2 -6.0 (* x1 (fma x2 (fma x2 8.0 -12.0) -2.0))))
             t_0))))
      double code(double x1, double x2) {
      	double t_0 = fma(x1, fma(x1, fma(x1, fma(x1, 6.0, -3.0), fma(4.0, fma(x2, 2.0, -3.0), 9.0)), (6.0 * fma(x2, 2.0, -3.0))), x1);
      	double tmp;
      	if (x1 <= -2.5) {
      		tmp = t_0;
      	} else if (x1 <= 740000000.0) {
      		tmp = x1 + fma(x2, -6.0, (x1 * fma(x2, fma(x2, 8.0, -12.0), -2.0)));
      	} else {
      		tmp = t_0;
      	}
      	return tmp;
      }
      
      function code(x1, x2)
      	t_0 = fma(x1, fma(x1, fma(x1, fma(x1, 6.0, -3.0), fma(4.0, fma(x2, 2.0, -3.0), 9.0)), Float64(6.0 * fma(x2, 2.0, -3.0))), x1)
      	tmp = 0.0
      	if (x1 <= -2.5)
      		tmp = t_0;
      	elseif (x1 <= 740000000.0)
      		tmp = Float64(x1 + fma(x2, -6.0, Float64(x1 * fma(x2, fma(x2, 8.0, -12.0), -2.0))));
      	else
      		tmp = t_0;
      	end
      	return tmp
      end
      
      code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * N[(x1 * N[(x1 * 6.0 + -3.0), $MachinePrecision] + N[(4.0 * N[(x2 * 2.0 + -3.0), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision] + N[(6.0 * N[(x2 * 2.0 + -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision]}, If[LessEqual[x1, -2.5], t$95$0, If[LessEqual[x1, 740000000.0], N[(x1 + N[(x2 * -6.0 + N[(x1 * N[(x2 * N[(x2 * 8.0 + -12.0), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, 6, -3\right), \mathsf{fma}\left(4, \mathsf{fma}\left(x2, 2, -3\right), 9\right)\right), 6 \cdot \mathsf{fma}\left(x2, 2, -3\right)\right), x1\right)\\
      \mathbf{if}\;x1 \leq -2.5:\\
      \;\;\;\;t\_0\\
      
      \mathbf{elif}\;x1 \leq 740000000:\\
      \;\;\;\;x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \mathsf{fma}\left(x2, \mathsf{fma}\left(x2, 8, -12\right), -2\right)\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_0\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if x1 < -2.5 or 7.4e8 < x1

        1. Initial program 43.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. Add Preprocessing
        3. Taylor expanded in x1 around -inf

          \[\leadsto x1 + \color{blue}{{x1}^{4} \cdot \left(6 + -1 \cdot \frac{3 + -1 \cdot \frac{9 + \left(-1 \cdot \frac{2 + -2 \cdot \left(1 + 3 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1} + 4 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1}}{x1}\right)} \]
        4. Step-by-step derivation
          1. lower-*.f64N/A

            \[\leadsto x1 + \color{blue}{{x1}^{4} \cdot \left(6 + -1 \cdot \frac{3 + -1 \cdot \frac{9 + \left(-1 \cdot \frac{2 + -2 \cdot \left(1 + 3 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1} + 4 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1}}{x1}\right)} \]
          2. lower-pow.f64N/A

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

            \[\leadsto x1 + {x1}^{4} \cdot \left(6 + \color{blue}{\left(\mathsf{neg}\left(\frac{3 + -1 \cdot \frac{9 + \left(-1 \cdot \frac{2 + -2 \cdot \left(1 + 3 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1} + 4 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1}}{x1}\right)\right)}\right) \]
          4. unsub-negN/A

            \[\leadsto x1 + {x1}^{4} \cdot \color{blue}{\left(6 - \frac{3 + -1 \cdot \frac{9 + \left(-1 \cdot \frac{2 + -2 \cdot \left(1 + 3 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1} + 4 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1}}{x1}\right)} \]
          5. lower--.f64N/A

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

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

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

          \[\leadsto \color{blue}{x1 \cdot \left(1 + \left(6 \cdot \left(2 \cdot x2 - 3\right) + x1 \cdot \left(9 + \left(4 \cdot \left(2 \cdot x2 - 3\right) + x1 \cdot \left(6 \cdot x1 - 3\right)\right)\right)\right)\right)} \]
        7. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto x1 \cdot \color{blue}{\left(\left(6 \cdot \left(2 \cdot x2 - 3\right) + x1 \cdot \left(9 + \left(4 \cdot \left(2 \cdot x2 - 3\right) + x1 \cdot \left(6 \cdot x1 - 3\right)\right)\right)\right) + 1\right)} \]
          2. distribute-lft-inN/A

            \[\leadsto \color{blue}{x1 \cdot \left(6 \cdot \left(2 \cdot x2 - 3\right) + x1 \cdot \left(9 + \left(4 \cdot \left(2 \cdot x2 - 3\right) + x1 \cdot \left(6 \cdot x1 - 3\right)\right)\right)\right) + x1 \cdot 1} \]
          3. *-rgt-identityN/A

            \[\leadsto x1 \cdot \left(6 \cdot \left(2 \cdot x2 - 3\right) + x1 \cdot \left(9 + \left(4 \cdot \left(2 \cdot x2 - 3\right) + x1 \cdot \left(6 \cdot x1 - 3\right)\right)\right)\right) + \color{blue}{x1} \]
          4. lower-fma.f64N/A

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

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

        if -2.5 < x1 < 7.4e8

        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. Add Preprocessing
        3. Taylor expanded in x1 around 0

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

          \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(x1, \mathsf{fma}\left(x1, \mathsf{fma}\left(x2, -4, \mathsf{fma}\left(2, \mathsf{fma}\left(x2, -2, 3\right), \mathsf{fma}\left(3, \mathsf{fma}\left(x2, 2, 3\right), \mathsf{fma}\left(x2, 14, -6\right)\right)\right)\right), \mathsf{fma}\left(x2, \mathsf{fma}\left(4, x2 \cdot 2, -12\right), -2\right)\right), x2 \cdot -6\right)} \]
        5. Taylor expanded in x1 around 0

          \[\leadsto x1 + \color{blue}{\left(-6 \cdot x2 + x1 \cdot \left(x2 \cdot \left(8 \cdot x2 - 12\right) - 2\right)\right)} \]
        6. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto x1 + \left(\color{blue}{x2 \cdot -6} + x1 \cdot \left(x2 \cdot \left(8 \cdot x2 - 12\right) - 2\right)\right) \]
          2. lower-fma.f64N/A

            \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(x2, -6, x1 \cdot \left(x2 \cdot \left(8 \cdot x2 - 12\right) - 2\right)\right)} \]
          3. lower-*.f64N/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, \color{blue}{x1 \cdot \left(x2 \cdot \left(8 \cdot x2 - 12\right) - 2\right)}\right) \]
          4. sub-negN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \color{blue}{\left(x2 \cdot \left(8 \cdot x2 - 12\right) + \left(\mathsf{neg}\left(2\right)\right)\right)}\right) \]
          5. metadata-evalN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(x2 \cdot \left(8 \cdot x2 - 12\right) + \color{blue}{-2}\right)\right) \]
          6. lower-fma.f64N/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \color{blue}{\mathsf{fma}\left(x2, 8 \cdot x2 - 12, -2\right)}\right) \]
          7. sub-negN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \mathsf{fma}\left(x2, \color{blue}{8 \cdot x2 + \left(\mathsf{neg}\left(12\right)\right)}, -2\right)\right) \]
          8. *-commutativeN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \mathsf{fma}\left(x2, \color{blue}{x2 \cdot 8} + \left(\mathsf{neg}\left(12\right)\right), -2\right)\right) \]
          9. metadata-evalN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \mathsf{fma}\left(x2, x2 \cdot 8 + \color{blue}{-12}, -2\right)\right) \]
          10. lower-fma.f6486.9

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \mathsf{fma}\left(x2, \color{blue}{\mathsf{fma}\left(x2, 8, -12\right)}, -2\right)\right) \]
        7. Applied rewrites86.9%

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

      Alternative 14: 86.5% accurate, 6.0× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 + \left(x1 \cdot \left(x1 \cdot \left(x1 \cdot x1\right)\right)\right) \cdot \left(6 + \frac{-3}{x1}\right)\\ \mathbf{if}\;x1 \leq -1.18 \cdot 10^{+45}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x1 \leq 740000000:\\ \;\;\;\;x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \mathsf{fma}\left(x2, \mathsf{fma}\left(x2, 8, -12\right), -2\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
      (FPCore (x1 x2)
       :precision binary64
       (let* ((t_0 (+ x1 (* (* x1 (* x1 (* x1 x1))) (+ 6.0 (/ -3.0 x1))))))
         (if (<= x1 -1.18e+45)
           t_0
           (if (<= x1 740000000.0)
             (+ x1 (fma x2 -6.0 (* x1 (fma x2 (fma x2 8.0 -12.0) -2.0))))
             t_0))))
      double code(double x1, double x2) {
      	double t_0 = x1 + ((x1 * (x1 * (x1 * x1))) * (6.0 + (-3.0 / x1)));
      	double tmp;
      	if (x1 <= -1.18e+45) {
      		tmp = t_0;
      	} else if (x1 <= 740000000.0) {
      		tmp = x1 + fma(x2, -6.0, (x1 * fma(x2, fma(x2, 8.0, -12.0), -2.0)));
      	} else {
      		tmp = t_0;
      	}
      	return tmp;
      }
      
      function code(x1, x2)
      	t_0 = Float64(x1 + Float64(Float64(x1 * Float64(x1 * Float64(x1 * x1))) * Float64(6.0 + Float64(-3.0 / x1))))
      	tmp = 0.0
      	if (x1 <= -1.18e+45)
      		tmp = t_0;
      	elseif (x1 <= 740000000.0)
      		tmp = Float64(x1 + fma(x2, -6.0, Float64(x1 * fma(x2, fma(x2, 8.0, -12.0), -2.0))));
      	else
      		tmp = t_0;
      	end
      	return tmp
      end
      
      code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(N[(x1 * N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(6.0 + N[(-3.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.18e+45], t$95$0, If[LessEqual[x1, 740000000.0], N[(x1 + N[(x2 * -6.0 + N[(x1 * N[(x2 * N[(x2 * 8.0 + -12.0), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := x1 + \left(x1 \cdot \left(x1 \cdot \left(x1 \cdot x1\right)\right)\right) \cdot \left(6 + \frac{-3}{x1}\right)\\
      \mathbf{if}\;x1 \leq -1.18 \cdot 10^{+45}:\\
      \;\;\;\;t\_0\\
      
      \mathbf{elif}\;x1 \leq 740000000:\\
      \;\;\;\;x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \mathsf{fma}\left(x2, \mathsf{fma}\left(x2, 8, -12\right), -2\right)\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_0\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if x1 < -1.17999999999999993e45 or 7.4e8 < x1

        1. Initial program 38.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. Add Preprocessing
        3. Taylor expanded in x1 around inf

          \[\leadsto x1 + \color{blue}{{x1}^{4} \cdot \left(6 - 3 \cdot \frac{1}{x1}\right)} \]
        4. Step-by-step derivation
          1. lower-*.f64N/A

            \[\leadsto x1 + \color{blue}{{x1}^{4} \cdot \left(6 - 3 \cdot \frac{1}{x1}\right)} \]
          2. lower-pow.f64N/A

            \[\leadsto x1 + \color{blue}{{x1}^{4}} \cdot \left(6 - 3 \cdot \frac{1}{x1}\right) \]
          3. sub-negN/A

            \[\leadsto x1 + {x1}^{4} \cdot \color{blue}{\left(6 + \left(\mathsf{neg}\left(3 \cdot \frac{1}{x1}\right)\right)\right)} \]
          4. lower-+.f64N/A

            \[\leadsto x1 + {x1}^{4} \cdot \color{blue}{\left(6 + \left(\mathsf{neg}\left(3 \cdot \frac{1}{x1}\right)\right)\right)} \]
          5. associate-*r/N/A

            \[\leadsto x1 + {x1}^{4} \cdot \left(6 + \left(\mathsf{neg}\left(\color{blue}{\frac{3 \cdot 1}{x1}}\right)\right)\right) \]
          6. metadata-evalN/A

            \[\leadsto x1 + {x1}^{4} \cdot \left(6 + \left(\mathsf{neg}\left(\frac{\color{blue}{3}}{x1}\right)\right)\right) \]
          7. distribute-neg-fracN/A

            \[\leadsto x1 + {x1}^{4} \cdot \left(6 + \color{blue}{\frac{\mathsf{neg}\left(3\right)}{x1}}\right) \]
          8. lower-/.f64N/A

            \[\leadsto x1 + {x1}^{4} \cdot \left(6 + \color{blue}{\frac{\mathsf{neg}\left(3\right)}{x1}}\right) \]
          9. metadata-eval91.8

            \[\leadsto x1 + {x1}^{4} \cdot \left(6 + \frac{\color{blue}{-3}}{x1}\right) \]
        5. Applied rewrites91.8%

          \[\leadsto x1 + \color{blue}{{x1}^{4} \cdot \left(6 + \frac{-3}{x1}\right)} \]
        6. Step-by-step derivation
          1. metadata-evalN/A

            \[\leadsto x1 + {x1}^{\color{blue}{\left(2 + 2\right)}} \cdot \left(6 + \frac{-3}{x1}\right) \]
          2. pow-prod-upN/A

            \[\leadsto x1 + \color{blue}{\left({x1}^{2} \cdot {x1}^{2}\right)} \cdot \left(6 + \frac{-3}{x1}\right) \]
          3. pow2N/A

            \[\leadsto x1 + \left(\color{blue}{\left(x1 \cdot x1\right)} \cdot {x1}^{2}\right) \cdot \left(6 + \frac{-3}{x1}\right) \]
          4. lift-*.f64N/A

            \[\leadsto x1 + \left(\color{blue}{\left(x1 \cdot x1\right)} \cdot {x1}^{2}\right) \cdot \left(6 + \frac{-3}{x1}\right) \]
          5. pow2N/A

            \[\leadsto x1 + \left(\left(x1 \cdot x1\right) \cdot \color{blue}{\left(x1 \cdot x1\right)}\right) \cdot \left(6 + \frac{-3}{x1}\right) \]
          6. associate-*r*N/A

            \[\leadsto x1 + \color{blue}{\left(\left(\left(x1 \cdot x1\right) \cdot x1\right) \cdot x1\right)} \cdot \left(6 + \frac{-3}{x1}\right) \]
          7. *-commutativeN/A

            \[\leadsto x1 + \left(\color{blue}{\left(x1 \cdot \left(x1 \cdot x1\right)\right)} \cdot x1\right) \cdot \left(6 + \frac{-3}{x1}\right) \]
          8. lift-*.f64N/A

            \[\leadsto x1 + \left(\color{blue}{\left(x1 \cdot \left(x1 \cdot x1\right)\right)} \cdot x1\right) \cdot \left(6 + \frac{-3}{x1}\right) \]
          9. lower-*.f6491.8

            \[\leadsto x1 + \color{blue}{\left(\left(x1 \cdot \left(x1 \cdot x1\right)\right) \cdot x1\right)} \cdot \left(6 + \frac{-3}{x1}\right) \]
        7. Applied rewrites91.8%

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

        if -1.17999999999999993e45 < x1 < 7.4e8

        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. Add Preprocessing
        3. Taylor expanded in x1 around 0

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

          \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(x1, \mathsf{fma}\left(x1, \mathsf{fma}\left(x2, -4, \mathsf{fma}\left(2, \mathsf{fma}\left(x2, -2, 3\right), \mathsf{fma}\left(3, \mathsf{fma}\left(x2, 2, 3\right), \mathsf{fma}\left(x2, 14, -6\right)\right)\right)\right), \mathsf{fma}\left(x2, \mathsf{fma}\left(4, x2 \cdot 2, -12\right), -2\right)\right), x2 \cdot -6\right)} \]
        5. Taylor expanded in x1 around 0

          \[\leadsto x1 + \color{blue}{\left(-6 \cdot x2 + x1 \cdot \left(x2 \cdot \left(8 \cdot x2 - 12\right) - 2\right)\right)} \]
        6. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto x1 + \left(\color{blue}{x2 \cdot -6} + x1 \cdot \left(x2 \cdot \left(8 \cdot x2 - 12\right) - 2\right)\right) \]
          2. lower-fma.f64N/A

            \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(x2, -6, x1 \cdot \left(x2 \cdot \left(8 \cdot x2 - 12\right) - 2\right)\right)} \]
          3. lower-*.f64N/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, \color{blue}{x1 \cdot \left(x2 \cdot \left(8 \cdot x2 - 12\right) - 2\right)}\right) \]
          4. sub-negN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \color{blue}{\left(x2 \cdot \left(8 \cdot x2 - 12\right) + \left(\mathsf{neg}\left(2\right)\right)\right)}\right) \]
          5. metadata-evalN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(x2 \cdot \left(8 \cdot x2 - 12\right) + \color{blue}{-2}\right)\right) \]
          6. lower-fma.f64N/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \color{blue}{\mathsf{fma}\left(x2, 8 \cdot x2 - 12, -2\right)}\right) \]
          7. sub-negN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \mathsf{fma}\left(x2, \color{blue}{8 \cdot x2 + \left(\mathsf{neg}\left(12\right)\right)}, -2\right)\right) \]
          8. *-commutativeN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \mathsf{fma}\left(x2, \color{blue}{x2 \cdot 8} + \left(\mathsf{neg}\left(12\right)\right), -2\right)\right) \]
          9. metadata-evalN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \mathsf{fma}\left(x2, x2 \cdot 8 + \color{blue}{-12}, -2\right)\right) \]
          10. lower-fma.f6483.7

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \mathsf{fma}\left(x2, \color{blue}{\mathsf{fma}\left(x2, 8, -12\right)}, -2\right)\right) \]
        7. Applied rewrites83.7%

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -1.18 \cdot 10^{+45}:\\ \;\;\;\;x1 + \left(x1 \cdot \left(x1 \cdot \left(x1 \cdot x1\right)\right)\right) \cdot \left(6 + \frac{-3}{x1}\right)\\ \mathbf{elif}\;x1 \leq 740000000:\\ \;\;\;\;x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \mathsf{fma}\left(x2, \mathsf{fma}\left(x2, 8, -12\right), -2\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x1 \cdot \left(x1 \cdot \left(x1 \cdot x1\right)\right)\right) \cdot \left(6 + \frac{-3}{x1}\right)\\ \end{array} \]
      5. Add Preprocessing

      Alternative 15: 86.5% accurate, 6.2× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(\left(x1 \cdot \left(x1 \cdot x1\right)\right) \cdot \left(6 + \frac{-3}{x1}\right), x1, x1\right)\\ \mathbf{if}\;x1 \leq -1.18 \cdot 10^{+45}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x1 \leq 740000000:\\ \;\;\;\;x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \mathsf{fma}\left(x2, \mathsf{fma}\left(x2, 8, -12\right), -2\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
      (FPCore (x1 x2)
       :precision binary64
       (let* ((t_0 (fma (* (* x1 (* x1 x1)) (+ 6.0 (/ -3.0 x1))) x1 x1)))
         (if (<= x1 -1.18e+45)
           t_0
           (if (<= x1 740000000.0)
             (+ x1 (fma x2 -6.0 (* x1 (fma x2 (fma x2 8.0 -12.0) -2.0))))
             t_0))))
      double code(double x1, double x2) {
      	double t_0 = fma(((x1 * (x1 * x1)) * (6.0 + (-3.0 / x1))), x1, x1);
      	double tmp;
      	if (x1 <= -1.18e+45) {
      		tmp = t_0;
      	} else if (x1 <= 740000000.0) {
      		tmp = x1 + fma(x2, -6.0, (x1 * fma(x2, fma(x2, 8.0, -12.0), -2.0)));
      	} else {
      		tmp = t_0;
      	}
      	return tmp;
      }
      
      function code(x1, x2)
      	t_0 = fma(Float64(Float64(x1 * Float64(x1 * x1)) * Float64(6.0 + Float64(-3.0 / x1))), x1, x1)
      	tmp = 0.0
      	if (x1 <= -1.18e+45)
      		tmp = t_0;
      	elseif (x1 <= 740000000.0)
      		tmp = Float64(x1 + fma(x2, -6.0, Float64(x1 * fma(x2, fma(x2, 8.0, -12.0), -2.0))));
      	else
      		tmp = t_0;
      	end
      	return tmp
      end
      
      code[x1_, x2_] := Block[{t$95$0 = N[(N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] * N[(6.0 + N[(-3.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x1 + x1), $MachinePrecision]}, If[LessEqual[x1, -1.18e+45], t$95$0, If[LessEqual[x1, 740000000.0], N[(x1 + N[(x2 * -6.0 + N[(x1 * N[(x2 * N[(x2 * 8.0 + -12.0), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := \mathsf{fma}\left(\left(x1 \cdot \left(x1 \cdot x1\right)\right) \cdot \left(6 + \frac{-3}{x1}\right), x1, x1\right)\\
      \mathbf{if}\;x1 \leq -1.18 \cdot 10^{+45}:\\
      \;\;\;\;t\_0\\
      
      \mathbf{elif}\;x1 \leq 740000000:\\
      \;\;\;\;x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \mathsf{fma}\left(x2, \mathsf{fma}\left(x2, 8, -12\right), -2\right)\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_0\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if x1 < -1.17999999999999993e45 or 7.4e8 < x1

        1. Initial program 38.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. Add Preprocessing
        3. Taylor expanded in x1 around inf

          \[\leadsto x1 + \color{blue}{{x1}^{4} \cdot \left(6 - 3 \cdot \frac{1}{x1}\right)} \]
        4. Step-by-step derivation
          1. lower-*.f64N/A

            \[\leadsto x1 + \color{blue}{{x1}^{4} \cdot \left(6 - 3 \cdot \frac{1}{x1}\right)} \]
          2. lower-pow.f64N/A

            \[\leadsto x1 + \color{blue}{{x1}^{4}} \cdot \left(6 - 3 \cdot \frac{1}{x1}\right) \]
          3. sub-negN/A

            \[\leadsto x1 + {x1}^{4} \cdot \color{blue}{\left(6 + \left(\mathsf{neg}\left(3 \cdot \frac{1}{x1}\right)\right)\right)} \]
          4. lower-+.f64N/A

            \[\leadsto x1 + {x1}^{4} \cdot \color{blue}{\left(6 + \left(\mathsf{neg}\left(3 \cdot \frac{1}{x1}\right)\right)\right)} \]
          5. associate-*r/N/A

            \[\leadsto x1 + {x1}^{4} \cdot \left(6 + \left(\mathsf{neg}\left(\color{blue}{\frac{3 \cdot 1}{x1}}\right)\right)\right) \]
          6. metadata-evalN/A

            \[\leadsto x1 + {x1}^{4} \cdot \left(6 + \left(\mathsf{neg}\left(\frac{\color{blue}{3}}{x1}\right)\right)\right) \]
          7. distribute-neg-fracN/A

            \[\leadsto x1 + {x1}^{4} \cdot \left(6 + \color{blue}{\frac{\mathsf{neg}\left(3\right)}{x1}}\right) \]
          8. lower-/.f64N/A

            \[\leadsto x1 + {x1}^{4} \cdot \left(6 + \color{blue}{\frac{\mathsf{neg}\left(3\right)}{x1}}\right) \]
          9. metadata-eval91.8

            \[\leadsto x1 + {x1}^{4} \cdot \left(6 + \frac{\color{blue}{-3}}{x1}\right) \]
        5. Applied rewrites91.8%

          \[\leadsto x1 + \color{blue}{{x1}^{4} \cdot \left(6 + \frac{-3}{x1}\right)} \]
        6. Step-by-step derivation
          1. lift-pow.f64N/A

            \[\leadsto x1 + \color{blue}{{x1}^{4}} \cdot \left(6 + \frac{-3}{x1}\right) \]
          2. lift-/.f64N/A

            \[\leadsto x1 + {x1}^{4} \cdot \left(6 + \color{blue}{\frac{-3}{x1}}\right) \]
          3. lift-+.f64N/A

            \[\leadsto x1 + {x1}^{4} \cdot \color{blue}{\left(6 + \frac{-3}{x1}\right)} \]
          4. lift-*.f64N/A

            \[\leadsto x1 + \color{blue}{{x1}^{4} \cdot \left(6 + \frac{-3}{x1}\right)} \]
          5. +-commutativeN/A

            \[\leadsto \color{blue}{{x1}^{4} \cdot \left(6 + \frac{-3}{x1}\right) + x1} \]
          6. lift-*.f64N/A

            \[\leadsto \color{blue}{{x1}^{4} \cdot \left(6 + \frac{-3}{x1}\right)} + x1 \]
          7. *-commutativeN/A

            \[\leadsto \color{blue}{\left(6 + \frac{-3}{x1}\right) \cdot {x1}^{4}} + x1 \]
          8. lower-fma.f6491.8

            \[\leadsto \color{blue}{\mathsf{fma}\left(6 + \frac{-3}{x1}, {x1}^{4}, x1\right)} \]
          9. lift-pow.f64N/A

            \[\leadsto \mathsf{fma}\left(6 + \frac{-3}{x1}, \color{blue}{{x1}^{4}}, x1\right) \]
          10. metadata-evalN/A

            \[\leadsto \mathsf{fma}\left(6 + \frac{-3}{x1}, {x1}^{\color{blue}{\left(2 + 2\right)}}, x1\right) \]
          11. pow-prod-upN/A

            \[\leadsto \mathsf{fma}\left(6 + \frac{-3}{x1}, \color{blue}{{x1}^{2} \cdot {x1}^{2}}, x1\right) \]
          12. pow-prod-downN/A

            \[\leadsto \mathsf{fma}\left(6 + \frac{-3}{x1}, \color{blue}{{\left(x1 \cdot x1\right)}^{2}}, x1\right) \]
          13. lift-*.f64N/A

            \[\leadsto \mathsf{fma}\left(6 + \frac{-3}{x1}, {\color{blue}{\left(x1 \cdot x1\right)}}^{2}, x1\right) \]
          14. pow2N/A

            \[\leadsto \mathsf{fma}\left(6 + \frac{-3}{x1}, \color{blue}{\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)}, x1\right) \]
          15. lower-*.f6491.8

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

          \[\leadsto \color{blue}{\mathsf{fma}\left(6 + \frac{-3}{x1}, \left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right), x1\right)} \]
        8. Step-by-step derivation
          1. lift-/.f64N/A

            \[\leadsto \left(6 + \color{blue}{\frac{-3}{x1}}\right) \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right) + x1 \]
          2. lift-+.f64N/A

            \[\leadsto \color{blue}{\left(6 + \frac{-3}{x1}\right)} \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right) + x1 \]
          3. lift-*.f64N/A

            \[\leadsto \left(6 + \frac{-3}{x1}\right) \cdot \left(\color{blue}{\left(x1 \cdot x1\right)} \cdot \left(x1 \cdot x1\right)\right) + x1 \]
          4. lift-*.f64N/A

            \[\leadsto \left(6 + \frac{-3}{x1}\right) \cdot \left(\left(x1 \cdot x1\right) \cdot \color{blue}{\left(x1 \cdot x1\right)}\right) + x1 \]
          5. lift-*.f64N/A

            \[\leadsto \left(6 + \frac{-3}{x1}\right) \cdot \color{blue}{\left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)} + x1 \]
          6. lift-*.f64N/A

            \[\leadsto \left(6 + \frac{-3}{x1}\right) \cdot \color{blue}{\left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)} + x1 \]
          7. lift-*.f64N/A

            \[\leadsto \left(6 + \frac{-3}{x1}\right) \cdot \left(\color{blue}{\left(x1 \cdot x1\right)} \cdot \left(x1 \cdot x1\right)\right) + x1 \]
          8. associate-*l*N/A

            \[\leadsto \left(6 + \frac{-3}{x1}\right) \cdot \color{blue}{\left(x1 \cdot \left(x1 \cdot \left(x1 \cdot x1\right)\right)\right)} + x1 \]
          9. lift-*.f64N/A

            \[\leadsto \left(6 + \frac{-3}{x1}\right) \cdot \left(x1 \cdot \color{blue}{\left(x1 \cdot \left(x1 \cdot x1\right)\right)}\right) + x1 \]
          10. *-commutativeN/A

            \[\leadsto \left(6 + \frac{-3}{x1}\right) \cdot \color{blue}{\left(\left(x1 \cdot \left(x1 \cdot x1\right)\right) \cdot x1\right)} + x1 \]
          11. associate-*r*N/A

            \[\leadsto \color{blue}{\left(\left(6 + \frac{-3}{x1}\right) \cdot \left(x1 \cdot \left(x1 \cdot x1\right)\right)\right) \cdot x1} + x1 \]
          12. lower-fma.f64N/A

            \[\leadsto \color{blue}{\mathsf{fma}\left(\left(6 + \frac{-3}{x1}\right) \cdot \left(x1 \cdot \left(x1 \cdot x1\right)\right), x1, x1\right)} \]
          13. lower-*.f6491.8

            \[\leadsto \mathsf{fma}\left(\color{blue}{\left(6 + \frac{-3}{x1}\right) \cdot \left(x1 \cdot \left(x1 \cdot x1\right)\right)}, x1, x1\right) \]
        9. Applied rewrites91.8%

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

        if -1.17999999999999993e45 < x1 < 7.4e8

        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. Add Preprocessing
        3. Taylor expanded in x1 around 0

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

          \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(x1, \mathsf{fma}\left(x1, \mathsf{fma}\left(x2, -4, \mathsf{fma}\left(2, \mathsf{fma}\left(x2, -2, 3\right), \mathsf{fma}\left(3, \mathsf{fma}\left(x2, 2, 3\right), \mathsf{fma}\left(x2, 14, -6\right)\right)\right)\right), \mathsf{fma}\left(x2, \mathsf{fma}\left(4, x2 \cdot 2, -12\right), -2\right)\right), x2 \cdot -6\right)} \]
        5. Taylor expanded in x1 around 0

          \[\leadsto x1 + \color{blue}{\left(-6 \cdot x2 + x1 \cdot \left(x2 \cdot \left(8 \cdot x2 - 12\right) - 2\right)\right)} \]
        6. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto x1 + \left(\color{blue}{x2 \cdot -6} + x1 \cdot \left(x2 \cdot \left(8 \cdot x2 - 12\right) - 2\right)\right) \]
          2. lower-fma.f64N/A

            \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(x2, -6, x1 \cdot \left(x2 \cdot \left(8 \cdot x2 - 12\right) - 2\right)\right)} \]
          3. lower-*.f64N/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, \color{blue}{x1 \cdot \left(x2 \cdot \left(8 \cdot x2 - 12\right) - 2\right)}\right) \]
          4. sub-negN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \color{blue}{\left(x2 \cdot \left(8 \cdot x2 - 12\right) + \left(\mathsf{neg}\left(2\right)\right)\right)}\right) \]
          5. metadata-evalN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(x2 \cdot \left(8 \cdot x2 - 12\right) + \color{blue}{-2}\right)\right) \]
          6. lower-fma.f64N/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \color{blue}{\mathsf{fma}\left(x2, 8 \cdot x2 - 12, -2\right)}\right) \]
          7. sub-negN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \mathsf{fma}\left(x2, \color{blue}{8 \cdot x2 + \left(\mathsf{neg}\left(12\right)\right)}, -2\right)\right) \]
          8. *-commutativeN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \mathsf{fma}\left(x2, \color{blue}{x2 \cdot 8} + \left(\mathsf{neg}\left(12\right)\right), -2\right)\right) \]
          9. metadata-evalN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \mathsf{fma}\left(x2, x2 \cdot 8 + \color{blue}{-12}, -2\right)\right) \]
          10. lower-fma.f6483.7

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \mathsf{fma}\left(x2, \color{blue}{\mathsf{fma}\left(x2, 8, -12\right)}, -2\right)\right) \]
        7. Applied rewrites83.7%

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -1.18 \cdot 10^{+45}:\\ \;\;\;\;\mathsf{fma}\left(\left(x1 \cdot \left(x1 \cdot x1\right)\right) \cdot \left(6 + \frac{-3}{x1}\right), x1, x1\right)\\ \mathbf{elif}\;x1 \leq 740000000:\\ \;\;\;\;x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \mathsf{fma}\left(x2, \mathsf{fma}\left(x2, 8, -12\right), -2\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(x1 \cdot \left(x1 \cdot x1\right)\right) \cdot \left(6 + \frac{-3}{x1}\right), x1, x1\right)\\ \end{array} \]
      5. Add Preprocessing

      Alternative 16: 86.5% accurate, 7.6× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(x1 \cdot x1, x1 \cdot \mathsf{fma}\left(x1, 6, -3\right), x1\right)\\ \mathbf{if}\;x1 \leq -1.18 \cdot 10^{+45}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x1 \leq 740000000:\\ \;\;\;\;x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \mathsf{fma}\left(x2, \mathsf{fma}\left(x2, 8, -12\right), -2\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
      (FPCore (x1 x2)
       :precision binary64
       (let* ((t_0 (fma (* x1 x1) (* x1 (fma x1 6.0 -3.0)) x1)))
         (if (<= x1 -1.18e+45)
           t_0
           (if (<= x1 740000000.0)
             (+ x1 (fma x2 -6.0 (* x1 (fma x2 (fma x2 8.0 -12.0) -2.0))))
             t_0))))
      double code(double x1, double x2) {
      	double t_0 = fma((x1 * x1), (x1 * fma(x1, 6.0, -3.0)), x1);
      	double tmp;
      	if (x1 <= -1.18e+45) {
      		tmp = t_0;
      	} else if (x1 <= 740000000.0) {
      		tmp = x1 + fma(x2, -6.0, (x1 * fma(x2, fma(x2, 8.0, -12.0), -2.0)));
      	} else {
      		tmp = t_0;
      	}
      	return tmp;
      }
      
      function code(x1, x2)
      	t_0 = fma(Float64(x1 * x1), Float64(x1 * fma(x1, 6.0, -3.0)), x1)
      	tmp = 0.0
      	if (x1 <= -1.18e+45)
      		tmp = t_0;
      	elseif (x1 <= 740000000.0)
      		tmp = Float64(x1 + fma(x2, -6.0, Float64(x1 * fma(x2, fma(x2, 8.0, -12.0), -2.0))));
      	else
      		tmp = t_0;
      	end
      	return tmp
      end
      
      code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] * N[(x1 * N[(x1 * 6.0 + -3.0), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision]}, If[LessEqual[x1, -1.18e+45], t$95$0, If[LessEqual[x1, 740000000.0], N[(x1 + N[(x2 * -6.0 + N[(x1 * N[(x2 * N[(x2 * 8.0 + -12.0), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := \mathsf{fma}\left(x1 \cdot x1, x1 \cdot \mathsf{fma}\left(x1, 6, -3\right), x1\right)\\
      \mathbf{if}\;x1 \leq -1.18 \cdot 10^{+45}:\\
      \;\;\;\;t\_0\\
      
      \mathbf{elif}\;x1 \leq 740000000:\\
      \;\;\;\;x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \mathsf{fma}\left(x2, \mathsf{fma}\left(x2, 8, -12\right), -2\right)\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_0\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if x1 < -1.17999999999999993e45 or 7.4e8 < x1

        1. Initial program 38.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. Add Preprocessing
        3. Taylor expanded in x1 around inf

          \[\leadsto x1 + \color{blue}{{x1}^{4} \cdot \left(6 - 3 \cdot \frac{1}{x1}\right)} \]
        4. Step-by-step derivation
          1. lower-*.f64N/A

            \[\leadsto x1 + \color{blue}{{x1}^{4} \cdot \left(6 - 3 \cdot \frac{1}{x1}\right)} \]
          2. lower-pow.f64N/A

            \[\leadsto x1 + \color{blue}{{x1}^{4}} \cdot \left(6 - 3 \cdot \frac{1}{x1}\right) \]
          3. sub-negN/A

            \[\leadsto x1 + {x1}^{4} \cdot \color{blue}{\left(6 + \left(\mathsf{neg}\left(3 \cdot \frac{1}{x1}\right)\right)\right)} \]
          4. lower-+.f64N/A

            \[\leadsto x1 + {x1}^{4} \cdot \color{blue}{\left(6 + \left(\mathsf{neg}\left(3 \cdot \frac{1}{x1}\right)\right)\right)} \]
          5. associate-*r/N/A

            \[\leadsto x1 + {x1}^{4} \cdot \left(6 + \left(\mathsf{neg}\left(\color{blue}{\frac{3 \cdot 1}{x1}}\right)\right)\right) \]
          6. metadata-evalN/A

            \[\leadsto x1 + {x1}^{4} \cdot \left(6 + \left(\mathsf{neg}\left(\frac{\color{blue}{3}}{x1}\right)\right)\right) \]
          7. distribute-neg-fracN/A

            \[\leadsto x1 + {x1}^{4} \cdot \left(6 + \color{blue}{\frac{\mathsf{neg}\left(3\right)}{x1}}\right) \]
          8. lower-/.f64N/A

            \[\leadsto x1 + {x1}^{4} \cdot \left(6 + \color{blue}{\frac{\mathsf{neg}\left(3\right)}{x1}}\right) \]
          9. metadata-eval91.8

            \[\leadsto x1 + {x1}^{4} \cdot \left(6 + \frac{\color{blue}{-3}}{x1}\right) \]
        5. Applied rewrites91.8%

          \[\leadsto x1 + \color{blue}{{x1}^{4} \cdot \left(6 + \frac{-3}{x1}\right)} \]
        6. Step-by-step derivation
          1. lift-pow.f64N/A

            \[\leadsto x1 + \color{blue}{{x1}^{4}} \cdot \left(6 + \frac{-3}{x1}\right) \]
          2. lift-/.f64N/A

            \[\leadsto x1 + {x1}^{4} \cdot \left(6 + \color{blue}{\frac{-3}{x1}}\right) \]
          3. lift-+.f64N/A

            \[\leadsto x1 + {x1}^{4} \cdot \color{blue}{\left(6 + \frac{-3}{x1}\right)} \]
          4. lift-*.f64N/A

            \[\leadsto x1 + \color{blue}{{x1}^{4} \cdot \left(6 + \frac{-3}{x1}\right)} \]
          5. +-commutativeN/A

            \[\leadsto \color{blue}{{x1}^{4} \cdot \left(6 + \frac{-3}{x1}\right) + x1} \]
          6. lift-*.f64N/A

            \[\leadsto \color{blue}{{x1}^{4} \cdot \left(6 + \frac{-3}{x1}\right)} + x1 \]
          7. *-commutativeN/A

            \[\leadsto \color{blue}{\left(6 + \frac{-3}{x1}\right) \cdot {x1}^{4}} + x1 \]
          8. lower-fma.f6491.8

            \[\leadsto \color{blue}{\mathsf{fma}\left(6 + \frac{-3}{x1}, {x1}^{4}, x1\right)} \]
          9. lift-pow.f64N/A

            \[\leadsto \mathsf{fma}\left(6 + \frac{-3}{x1}, \color{blue}{{x1}^{4}}, x1\right) \]
          10. metadata-evalN/A

            \[\leadsto \mathsf{fma}\left(6 + \frac{-3}{x1}, {x1}^{\color{blue}{\left(2 + 2\right)}}, x1\right) \]
          11. pow-prod-upN/A

            \[\leadsto \mathsf{fma}\left(6 + \frac{-3}{x1}, \color{blue}{{x1}^{2} \cdot {x1}^{2}}, x1\right) \]
          12. pow-prod-downN/A

            \[\leadsto \mathsf{fma}\left(6 + \frac{-3}{x1}, \color{blue}{{\left(x1 \cdot x1\right)}^{2}}, x1\right) \]
          13. lift-*.f64N/A

            \[\leadsto \mathsf{fma}\left(6 + \frac{-3}{x1}, {\color{blue}{\left(x1 \cdot x1\right)}}^{2}, x1\right) \]
          14. pow2N/A

            \[\leadsto \mathsf{fma}\left(6 + \frac{-3}{x1}, \color{blue}{\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)}, x1\right) \]
          15. lower-*.f6491.8

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

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

          \[\leadsto \color{blue}{x1 \cdot \left(1 + {x1}^{2} \cdot \left(6 \cdot x1 - 3\right)\right)} \]
        9. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto x1 \cdot \color{blue}{\left({x1}^{2} \cdot \left(6 \cdot x1 - 3\right) + 1\right)} \]
          2. distribute-rgt-inN/A

            \[\leadsto \color{blue}{\left({x1}^{2} \cdot \left(6 \cdot x1 - 3\right)\right) \cdot x1 + 1 \cdot x1} \]
          3. associate-*l*N/A

            \[\leadsto \color{blue}{{x1}^{2} \cdot \left(\left(6 \cdot x1 - 3\right) \cdot x1\right)} + 1 \cdot x1 \]
          4. *-lft-identityN/A

            \[\leadsto {x1}^{2} \cdot \left(\left(6 \cdot x1 - 3\right) \cdot x1\right) + \color{blue}{x1} \]
          5. lower-fma.f64N/A

            \[\leadsto \color{blue}{\mathsf{fma}\left({x1}^{2}, \left(6 \cdot x1 - 3\right) \cdot x1, x1\right)} \]
          6. unpow2N/A

            \[\leadsto \mathsf{fma}\left(\color{blue}{x1 \cdot x1}, \left(6 \cdot x1 - 3\right) \cdot x1, x1\right) \]
          7. lower-*.f64N/A

            \[\leadsto \mathsf{fma}\left(\color{blue}{x1 \cdot x1}, \left(6 \cdot x1 - 3\right) \cdot x1, x1\right) \]
          8. lower-*.f64N/A

            \[\leadsto \mathsf{fma}\left(x1 \cdot x1, \color{blue}{\left(6 \cdot x1 - 3\right) \cdot x1}, x1\right) \]
          9. sub-negN/A

            \[\leadsto \mathsf{fma}\left(x1 \cdot x1, \color{blue}{\left(6 \cdot x1 + \left(\mathsf{neg}\left(3\right)\right)\right)} \cdot x1, x1\right) \]
          10. *-commutativeN/A

            \[\leadsto \mathsf{fma}\left(x1 \cdot x1, \left(\color{blue}{x1 \cdot 6} + \left(\mathsf{neg}\left(3\right)\right)\right) \cdot x1, x1\right) \]
          11. metadata-evalN/A

            \[\leadsto \mathsf{fma}\left(x1 \cdot x1, \left(x1 \cdot 6 + \color{blue}{-3}\right) \cdot x1, x1\right) \]
          12. lower-fma.f6491.8

            \[\leadsto \mathsf{fma}\left(x1 \cdot x1, \color{blue}{\mathsf{fma}\left(x1, 6, -3\right)} \cdot x1, x1\right) \]
        10. Applied rewrites91.8%

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

        if -1.17999999999999993e45 < x1 < 7.4e8

        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. Add Preprocessing
        3. Taylor expanded in x1 around 0

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

          \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(x1, \mathsf{fma}\left(x1, \mathsf{fma}\left(x2, -4, \mathsf{fma}\left(2, \mathsf{fma}\left(x2, -2, 3\right), \mathsf{fma}\left(3, \mathsf{fma}\left(x2, 2, 3\right), \mathsf{fma}\left(x2, 14, -6\right)\right)\right)\right), \mathsf{fma}\left(x2, \mathsf{fma}\left(4, x2 \cdot 2, -12\right), -2\right)\right), x2 \cdot -6\right)} \]
        5. Taylor expanded in x1 around 0

          \[\leadsto x1 + \color{blue}{\left(-6 \cdot x2 + x1 \cdot \left(x2 \cdot \left(8 \cdot x2 - 12\right) - 2\right)\right)} \]
        6. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto x1 + \left(\color{blue}{x2 \cdot -6} + x1 \cdot \left(x2 \cdot \left(8 \cdot x2 - 12\right) - 2\right)\right) \]
          2. lower-fma.f64N/A

            \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(x2, -6, x1 \cdot \left(x2 \cdot \left(8 \cdot x2 - 12\right) - 2\right)\right)} \]
          3. lower-*.f64N/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, \color{blue}{x1 \cdot \left(x2 \cdot \left(8 \cdot x2 - 12\right) - 2\right)}\right) \]
          4. sub-negN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \color{blue}{\left(x2 \cdot \left(8 \cdot x2 - 12\right) + \left(\mathsf{neg}\left(2\right)\right)\right)}\right) \]
          5. metadata-evalN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(x2 \cdot \left(8 \cdot x2 - 12\right) + \color{blue}{-2}\right)\right) \]
          6. lower-fma.f64N/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \color{blue}{\mathsf{fma}\left(x2, 8 \cdot x2 - 12, -2\right)}\right) \]
          7. sub-negN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \mathsf{fma}\left(x2, \color{blue}{8 \cdot x2 + \left(\mathsf{neg}\left(12\right)\right)}, -2\right)\right) \]
          8. *-commutativeN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \mathsf{fma}\left(x2, \color{blue}{x2 \cdot 8} + \left(\mathsf{neg}\left(12\right)\right), -2\right)\right) \]
          9. metadata-evalN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \mathsf{fma}\left(x2, x2 \cdot 8 + \color{blue}{-12}, -2\right)\right) \]
          10. lower-fma.f6483.7

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \mathsf{fma}\left(x2, \color{blue}{\mathsf{fma}\left(x2, 8, -12\right)}, -2\right)\right) \]
        7. Applied rewrites83.7%

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -1.18 \cdot 10^{+45}:\\ \;\;\;\;\mathsf{fma}\left(x1 \cdot x1, x1 \cdot \mathsf{fma}\left(x1, 6, -3\right), x1\right)\\ \mathbf{elif}\;x1 \leq 740000000:\\ \;\;\;\;x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \mathsf{fma}\left(x2, \mathsf{fma}\left(x2, 8, -12\right), -2\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x1 \cdot x1, x1 \cdot \mathsf{fma}\left(x1, 6, -3\right), x1\right)\\ \end{array} \]
      5. Add Preprocessing

      Alternative 17: 68.4% accurate, 8.5× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x1 \leq -2.4 \cdot 10^{+44}:\\ \;\;\;\;x1 \cdot \left(x1 \cdot \left(x1 \cdot -19\right)\right)\\ \mathbf{elif}\;x1 \leq 0.19:\\ \;\;\;\;x2 \cdot -6 - x1\\ \mathbf{elif}\;x1 \leq 1.7 \cdot 10^{+150}:\\ \;\;\;\;x2 \cdot \frac{x1}{x2}\\ \mathbf{else}:\\ \;\;\;\;x1 \cdot \mathsf{fma}\left(x1, 9, -1\right)\\ \end{array} \end{array} \]
      (FPCore (x1 x2)
       :precision binary64
       (if (<= x1 -2.4e+44)
         (* x1 (* x1 (* x1 -19.0)))
         (if (<= x1 0.19)
           (- (* x2 -6.0) x1)
           (if (<= x1 1.7e+150) (* x2 (/ x1 x2)) (* x1 (fma x1 9.0 -1.0))))))
      double code(double x1, double x2) {
      	double tmp;
      	if (x1 <= -2.4e+44) {
      		tmp = x1 * (x1 * (x1 * -19.0));
      	} else if (x1 <= 0.19) {
      		tmp = (x2 * -6.0) - x1;
      	} else if (x1 <= 1.7e+150) {
      		tmp = x2 * (x1 / x2);
      	} else {
      		tmp = x1 * fma(x1, 9.0, -1.0);
      	}
      	return tmp;
      }
      
      function code(x1, x2)
      	tmp = 0.0
      	if (x1 <= -2.4e+44)
      		tmp = Float64(x1 * Float64(x1 * Float64(x1 * -19.0)));
      	elseif (x1 <= 0.19)
      		tmp = Float64(Float64(x2 * -6.0) - x1);
      	elseif (x1 <= 1.7e+150)
      		tmp = Float64(x2 * Float64(x1 / x2));
      	else
      		tmp = Float64(x1 * fma(x1, 9.0, -1.0));
      	end
      	return tmp
      end
      
      code[x1_, x2_] := If[LessEqual[x1, -2.4e+44], N[(x1 * N[(x1 * N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 0.19], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision], If[LessEqual[x1, 1.7e+150], N[(x2 * N[(x1 / x2), $MachinePrecision]), $MachinePrecision], N[(x1 * N[(x1 * 9.0 + -1.0), $MachinePrecision]), $MachinePrecision]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;x1 \leq -2.4 \cdot 10^{+44}:\\
      \;\;\;\;x1 \cdot \left(x1 \cdot \left(x1 \cdot -19\right)\right)\\
      
      \mathbf{elif}\;x1 \leq 0.19:\\
      \;\;\;\;x2 \cdot -6 - x1\\
      
      \mathbf{elif}\;x1 \leq 1.7 \cdot 10^{+150}:\\
      \;\;\;\;x2 \cdot \frac{x1}{x2}\\
      
      \mathbf{else}:\\
      \;\;\;\;x1 \cdot \mathsf{fma}\left(x1, 9, -1\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 4 regimes
      2. if x1 < -2.40000000000000013e44

        1. Initial program 26.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. Add Preprocessing
        3. Taylor expanded in x2 around 0

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

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

          \[\leadsto x1 + \color{blue}{\left(-6 \cdot x2 + x1 \cdot \left(x1 \cdot \left(-19 \cdot x1 + 3 \cdot \left(3 - -2 \cdot x2\right)\right) - 2\right)\right)} \]
        6. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto x1 + \color{blue}{\left(x1 \cdot \left(x1 \cdot \left(-19 \cdot x1 + 3 \cdot \left(3 - -2 \cdot x2\right)\right) - 2\right) + -6 \cdot x2\right)} \]
          2. lower-fma.f64N/A

            \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(x1, x1 \cdot \left(-19 \cdot x1 + 3 \cdot \left(3 - -2 \cdot x2\right)\right) - 2, -6 \cdot x2\right)} \]
        7. Applied rewrites80.0%

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

          \[\leadsto \color{blue}{-19 \cdot {x1}^{3}} \]
        9. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \color{blue}{{x1}^{3} \cdot -19} \]
          2. cube-multN/A

            \[\leadsto \color{blue}{\left(x1 \cdot \left(x1 \cdot x1\right)\right)} \cdot -19 \]
          3. unpow2N/A

            \[\leadsto \left(x1 \cdot \color{blue}{{x1}^{2}}\right) \cdot -19 \]
          4. associate-*l*N/A

            \[\leadsto \color{blue}{x1 \cdot \left({x1}^{2} \cdot -19\right)} \]
          5. unpow2N/A

            \[\leadsto x1 \cdot \left(\color{blue}{\left(x1 \cdot x1\right)} \cdot -19\right) \]
          6. associate-*r*N/A

            \[\leadsto x1 \cdot \color{blue}{\left(x1 \cdot \left(x1 \cdot -19\right)\right)} \]
          7. *-commutativeN/A

            \[\leadsto x1 \cdot \left(x1 \cdot \color{blue}{\left(-19 \cdot x1\right)}\right) \]
          8. lower-*.f64N/A

            \[\leadsto \color{blue}{x1 \cdot \left(x1 \cdot \left(-19 \cdot x1\right)\right)} \]
          9. lower-*.f64N/A

            \[\leadsto x1 \cdot \color{blue}{\left(x1 \cdot \left(-19 \cdot x1\right)\right)} \]
          10. *-commutativeN/A

            \[\leadsto x1 \cdot \left(x1 \cdot \color{blue}{\left(x1 \cdot -19\right)}\right) \]
          11. lower-*.f6475.3

            \[\leadsto x1 \cdot \left(x1 \cdot \color{blue}{\left(x1 \cdot -19\right)}\right) \]
        10. Applied rewrites75.3%

          \[\leadsto \color{blue}{x1 \cdot \left(x1 \cdot \left(x1 \cdot -19\right)\right)} \]

        if -2.40000000000000013e44 < x1 < 0.19

        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. Add Preprocessing
        3. Taylor expanded in x2 around 0

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

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

          \[\leadsto x1 + \color{blue}{\left(-6 \cdot x2 + x1 \cdot \left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) - 2\right)\right)} \]
        6. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto x1 + \left(\color{blue}{x2 \cdot -6} + x1 \cdot \left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) - 2\right)\right) \]
          2. lower-fma.f64N/A

            \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(x2, -6, x1 \cdot \left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) - 2\right)\right)} \]
          3. sub-negN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \color{blue}{\left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) + \left(\mathsf{neg}\left(2\right)\right)\right)}\right) \]
          4. associate-*r*N/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(\color{blue}{\left(3 \cdot x1\right) \cdot \left(3 - -2 \cdot x2\right)} + \left(\mathsf{neg}\left(2\right)\right)\right)\right) \]
          5. *-commutativeN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(\color{blue}{\left(x1 \cdot 3\right)} \cdot \left(3 - -2 \cdot x2\right) + \left(\mathsf{neg}\left(2\right)\right)\right)\right) \]
          6. associate-*r*N/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(\color{blue}{x1 \cdot \left(3 \cdot \left(3 - -2 \cdot x2\right)\right)} + \left(\mathsf{neg}\left(2\right)\right)\right)\right) \]
          7. metadata-evalN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 - -2 \cdot x2\right)\right) + \color{blue}{-2}\right)\right) \]
          8. lower-*.f64N/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, \color{blue}{x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 - -2 \cdot x2\right)\right) + -2\right)}\right) \]
          9. cancel-sign-sub-invN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(x1 \cdot \left(3 \cdot \color{blue}{\left(3 + \left(\mathsf{neg}\left(-2\right)\right) \cdot x2\right)}\right) + -2\right)\right) \]
          10. metadata-evalN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + \color{blue}{2} \cdot x2\right)\right) + -2\right)\right) \]
          11. lower-fma.f64N/A

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

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

          \[\leadsto \color{blue}{-6 \cdot x2 + -1 \cdot x1} \]
        9. Step-by-step derivation
          1. mul-1-negN/A

            \[\leadsto -6 \cdot x2 + \color{blue}{\left(\mathsf{neg}\left(x1\right)\right)} \]
          2. unsub-negN/A

            \[\leadsto \color{blue}{-6 \cdot x2 - x1} \]
          3. lower--.f64N/A

            \[\leadsto \color{blue}{-6 \cdot x2 - x1} \]
          4. lower-*.f6468.3

            \[\leadsto \color{blue}{-6 \cdot x2} - x1 \]
        10. Applied rewrites68.3%

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

        if 0.19 < x1 < 1.69999999999999991e150

        1. Initial program 99.7%

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

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

            \[\leadsto x1 + \color{blue}{x2 \cdot -6} \]
          2. lower-*.f643.9

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

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

          \[\leadsto \color{blue}{x2 \cdot \left(\frac{x1}{x2} - 6\right)} \]
        7. Step-by-step derivation
          1. lower-*.f64N/A

            \[\leadsto \color{blue}{x2 \cdot \left(\frac{x1}{x2} - 6\right)} \]
          2. sub-negN/A

            \[\leadsto x2 \cdot \color{blue}{\left(\frac{x1}{x2} + \left(\mathsf{neg}\left(6\right)\right)\right)} \]
          3. metadata-evalN/A

            \[\leadsto x2 \cdot \left(\frac{x1}{x2} + \color{blue}{-6}\right) \]
          4. +-commutativeN/A

            \[\leadsto x2 \cdot \color{blue}{\left(-6 + \frac{x1}{x2}\right)} \]
          5. lower-+.f64N/A

            \[\leadsto x2 \cdot \color{blue}{\left(-6 + \frac{x1}{x2}\right)} \]
          6. lower-/.f6419.9

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

          \[\leadsto \color{blue}{x2 \cdot \left(-6 + \frac{x1}{x2}\right)} \]
        9. Taylor expanded in x1 around inf

          \[\leadsto x2 \cdot \color{blue}{\frac{x1}{x2}} \]
        10. Step-by-step derivation
          1. lower-/.f6420.5

            \[\leadsto x2 \cdot \color{blue}{\frac{x1}{x2}} \]
        11. Applied rewrites20.5%

          \[\leadsto x2 \cdot \color{blue}{\frac{x1}{x2}} \]

        if 1.69999999999999991e150 < x1

        1. Initial program 3.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. Add Preprocessing
        3. Taylor expanded in x2 around 0

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

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

          \[\leadsto x1 + \color{blue}{\left(-6 \cdot x2 + x1 \cdot \left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) - 2\right)\right)} \]
        6. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto x1 + \left(\color{blue}{x2 \cdot -6} + x1 \cdot \left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) - 2\right)\right) \]
          2. lower-fma.f64N/A

            \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(x2, -6, x1 \cdot \left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) - 2\right)\right)} \]
          3. sub-negN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \color{blue}{\left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) + \left(\mathsf{neg}\left(2\right)\right)\right)}\right) \]
          4. associate-*r*N/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(\color{blue}{\left(3 \cdot x1\right) \cdot \left(3 - -2 \cdot x2\right)} + \left(\mathsf{neg}\left(2\right)\right)\right)\right) \]
          5. *-commutativeN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(\color{blue}{\left(x1 \cdot 3\right)} \cdot \left(3 - -2 \cdot x2\right) + \left(\mathsf{neg}\left(2\right)\right)\right)\right) \]
          6. associate-*r*N/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(\color{blue}{x1 \cdot \left(3 \cdot \left(3 - -2 \cdot x2\right)\right)} + \left(\mathsf{neg}\left(2\right)\right)\right)\right) \]
          7. metadata-evalN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 - -2 \cdot x2\right)\right) + \color{blue}{-2}\right)\right) \]
          8. lower-*.f64N/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, \color{blue}{x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 - -2 \cdot x2\right)\right) + -2\right)}\right) \]
          9. cancel-sign-sub-invN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(x1 \cdot \left(3 \cdot \color{blue}{\left(3 + \left(\mathsf{neg}\left(-2\right)\right) \cdot x2\right)}\right) + -2\right)\right) \]
          10. metadata-evalN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + \color{blue}{2} \cdot x2\right)\right) + -2\right)\right) \]
          11. lower-fma.f64N/A

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

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

          \[\leadsto \color{blue}{x1 + x1 \cdot \left(9 \cdot x1 - 2\right)} \]
        9. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto \color{blue}{x1 \cdot \left(9 \cdot x1 - 2\right) + x1} \]
          2. *-rgt-identityN/A

            \[\leadsto x1 \cdot \left(9 \cdot x1 - 2\right) + \color{blue}{x1 \cdot 1} \]
          3. distribute-lft-outN/A

            \[\leadsto \color{blue}{x1 \cdot \left(\left(9 \cdot x1 - 2\right) + 1\right)} \]
          4. lower-*.f64N/A

            \[\leadsto \color{blue}{x1 \cdot \left(\left(9 \cdot x1 - 2\right) + 1\right)} \]
          5. sub-negN/A

            \[\leadsto x1 \cdot \left(\color{blue}{\left(9 \cdot x1 + \left(\mathsf{neg}\left(2\right)\right)\right)} + 1\right) \]
          6. metadata-evalN/A

            \[\leadsto x1 \cdot \left(\left(9 \cdot x1 + \color{blue}{-2}\right) + 1\right) \]
          7. associate-+l+N/A

            \[\leadsto x1 \cdot \color{blue}{\left(9 \cdot x1 + \left(-2 + 1\right)\right)} \]
          8. metadata-evalN/A

            \[\leadsto x1 \cdot \left(9 \cdot x1 + \color{blue}{-1}\right) \]
          9. *-commutativeN/A

            \[\leadsto x1 \cdot \left(\color{blue}{x1 \cdot 9} + -1\right) \]
          10. lower-fma.f6497.2

            \[\leadsto x1 \cdot \color{blue}{\mathsf{fma}\left(x1, 9, -1\right)} \]
        10. Applied rewrites97.2%

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -2.4 \cdot 10^{+44}:\\ \;\;\;\;x1 \cdot \left(x1 \cdot \left(x1 \cdot -19\right)\right)\\ \mathbf{elif}\;x1 \leq 0.19:\\ \;\;\;\;x2 \cdot -6 - x1\\ \mathbf{elif}\;x1 \leq 1.7 \cdot 10^{+150}:\\ \;\;\;\;x2 \cdot \frac{x1}{x2}\\ \mathbf{else}:\\ \;\;\;\;x1 \cdot \mathsf{fma}\left(x1, 9, -1\right)\\ \end{array} \]
      5. Add Preprocessing

      Alternative 18: 68.9% accurate, 8.5× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x1 \leq -2.4 \cdot 10^{+44}:\\ \;\;\;\;x1 \cdot \left(x1 \cdot \left(x1 \cdot -19\right)\right)\\ \mathbf{elif}\;x1 \leq 740000000:\\ \;\;\;\;x2 \cdot -6 - x1\\ \mathbf{elif}\;x1 \leq 1.4 \cdot 10^{+153}:\\ \;\;\;\;x1 \cdot \left(x1 \cdot \mathsf{fma}\left(x2, 6, 9\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 \cdot \mathsf{fma}\left(x1, 9, -1\right)\\ \end{array} \end{array} \]
      (FPCore (x1 x2)
       :precision binary64
       (if (<= x1 -2.4e+44)
         (* x1 (* x1 (* x1 -19.0)))
         (if (<= x1 740000000.0)
           (- (* x2 -6.0) x1)
           (if (<= x1 1.4e+153)
             (* x1 (* x1 (fma x2 6.0 9.0)))
             (* x1 (fma x1 9.0 -1.0))))))
      double code(double x1, double x2) {
      	double tmp;
      	if (x1 <= -2.4e+44) {
      		tmp = x1 * (x1 * (x1 * -19.0));
      	} else if (x1 <= 740000000.0) {
      		tmp = (x2 * -6.0) - x1;
      	} else if (x1 <= 1.4e+153) {
      		tmp = x1 * (x1 * fma(x2, 6.0, 9.0));
      	} else {
      		tmp = x1 * fma(x1, 9.0, -1.0);
      	}
      	return tmp;
      }
      
      function code(x1, x2)
      	tmp = 0.0
      	if (x1 <= -2.4e+44)
      		tmp = Float64(x1 * Float64(x1 * Float64(x1 * -19.0)));
      	elseif (x1 <= 740000000.0)
      		tmp = Float64(Float64(x2 * -6.0) - x1);
      	elseif (x1 <= 1.4e+153)
      		tmp = Float64(x1 * Float64(x1 * fma(x2, 6.0, 9.0)));
      	else
      		tmp = Float64(x1 * fma(x1, 9.0, -1.0));
      	end
      	return tmp
      end
      
      code[x1_, x2_] := If[LessEqual[x1, -2.4e+44], N[(x1 * N[(x1 * N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 740000000.0], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision], If[LessEqual[x1, 1.4e+153], N[(x1 * N[(x1 * N[(x2 * 6.0 + 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 * N[(x1 * 9.0 + -1.0), $MachinePrecision]), $MachinePrecision]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;x1 \leq -2.4 \cdot 10^{+44}:\\
      \;\;\;\;x1 \cdot \left(x1 \cdot \left(x1 \cdot -19\right)\right)\\
      
      \mathbf{elif}\;x1 \leq 740000000:\\
      \;\;\;\;x2 \cdot -6 - x1\\
      
      \mathbf{elif}\;x1 \leq 1.4 \cdot 10^{+153}:\\
      \;\;\;\;x1 \cdot \left(x1 \cdot \mathsf{fma}\left(x2, 6, 9\right)\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;x1 \cdot \mathsf{fma}\left(x1, 9, -1\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 4 regimes
      2. if x1 < -2.40000000000000013e44

        1. Initial program 26.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. Add Preprocessing
        3. Taylor expanded in x2 around 0

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

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

          \[\leadsto x1 + \color{blue}{\left(-6 \cdot x2 + x1 \cdot \left(x1 \cdot \left(-19 \cdot x1 + 3 \cdot \left(3 - -2 \cdot x2\right)\right) - 2\right)\right)} \]
        6. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto x1 + \color{blue}{\left(x1 \cdot \left(x1 \cdot \left(-19 \cdot x1 + 3 \cdot \left(3 - -2 \cdot x2\right)\right) - 2\right) + -6 \cdot x2\right)} \]
          2. lower-fma.f64N/A

            \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(x1, x1 \cdot \left(-19 \cdot x1 + 3 \cdot \left(3 - -2 \cdot x2\right)\right) - 2, -6 \cdot x2\right)} \]
        7. Applied rewrites80.0%

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

          \[\leadsto \color{blue}{-19 \cdot {x1}^{3}} \]
        9. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \color{blue}{{x1}^{3} \cdot -19} \]
          2. cube-multN/A

            \[\leadsto \color{blue}{\left(x1 \cdot \left(x1 \cdot x1\right)\right)} \cdot -19 \]
          3. unpow2N/A

            \[\leadsto \left(x1 \cdot \color{blue}{{x1}^{2}}\right) \cdot -19 \]
          4. associate-*l*N/A

            \[\leadsto \color{blue}{x1 \cdot \left({x1}^{2} \cdot -19\right)} \]
          5. unpow2N/A

            \[\leadsto x1 \cdot \left(\color{blue}{\left(x1 \cdot x1\right)} \cdot -19\right) \]
          6. associate-*r*N/A

            \[\leadsto x1 \cdot \color{blue}{\left(x1 \cdot \left(x1 \cdot -19\right)\right)} \]
          7. *-commutativeN/A

            \[\leadsto x1 \cdot \left(x1 \cdot \color{blue}{\left(-19 \cdot x1\right)}\right) \]
          8. lower-*.f64N/A

            \[\leadsto \color{blue}{x1 \cdot \left(x1 \cdot \left(-19 \cdot x1\right)\right)} \]
          9. lower-*.f64N/A

            \[\leadsto x1 \cdot \color{blue}{\left(x1 \cdot \left(-19 \cdot x1\right)\right)} \]
          10. *-commutativeN/A

            \[\leadsto x1 \cdot \left(x1 \cdot \color{blue}{\left(x1 \cdot -19\right)}\right) \]
          11. lower-*.f6475.3

            \[\leadsto x1 \cdot \left(x1 \cdot \color{blue}{\left(x1 \cdot -19\right)}\right) \]
        10. Applied rewrites75.3%

          \[\leadsto \color{blue}{x1 \cdot \left(x1 \cdot \left(x1 \cdot -19\right)\right)} \]

        if -2.40000000000000013e44 < x1 < 7.4e8

        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. Add Preprocessing
        3. Taylor expanded in x2 around 0

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

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

          \[\leadsto x1 + \color{blue}{\left(-6 \cdot x2 + x1 \cdot \left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) - 2\right)\right)} \]
        6. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto x1 + \left(\color{blue}{x2 \cdot -6} + x1 \cdot \left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) - 2\right)\right) \]
          2. lower-fma.f64N/A

            \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(x2, -6, x1 \cdot \left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) - 2\right)\right)} \]
          3. sub-negN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \color{blue}{\left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) + \left(\mathsf{neg}\left(2\right)\right)\right)}\right) \]
          4. associate-*r*N/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(\color{blue}{\left(3 \cdot x1\right) \cdot \left(3 - -2 \cdot x2\right)} + \left(\mathsf{neg}\left(2\right)\right)\right)\right) \]
          5. *-commutativeN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(\color{blue}{\left(x1 \cdot 3\right)} \cdot \left(3 - -2 \cdot x2\right) + \left(\mathsf{neg}\left(2\right)\right)\right)\right) \]
          6. associate-*r*N/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(\color{blue}{x1 \cdot \left(3 \cdot \left(3 - -2 \cdot x2\right)\right)} + \left(\mathsf{neg}\left(2\right)\right)\right)\right) \]
          7. metadata-evalN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 - -2 \cdot x2\right)\right) + \color{blue}{-2}\right)\right) \]
          8. lower-*.f64N/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, \color{blue}{x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 - -2 \cdot x2\right)\right) + -2\right)}\right) \]
          9. cancel-sign-sub-invN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(x1 \cdot \left(3 \cdot \color{blue}{\left(3 + \left(\mathsf{neg}\left(-2\right)\right) \cdot x2\right)}\right) + -2\right)\right) \]
          10. metadata-evalN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + \color{blue}{2} \cdot x2\right)\right) + -2\right)\right) \]
          11. lower-fma.f64N/A

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

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

          \[\leadsto \color{blue}{-6 \cdot x2 + -1 \cdot x1} \]
        9. Step-by-step derivation
          1. mul-1-negN/A

            \[\leadsto -6 \cdot x2 + \color{blue}{\left(\mathsf{neg}\left(x1\right)\right)} \]
          2. unsub-negN/A

            \[\leadsto \color{blue}{-6 \cdot x2 - x1} \]
          3. lower--.f64N/A

            \[\leadsto \color{blue}{-6 \cdot x2 - x1} \]
          4. lower-*.f6466.8

            \[\leadsto \color{blue}{-6 \cdot x2} - x1 \]
        10. Applied rewrites66.8%

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

        if 7.4e8 < x1 < 1.39999999999999993e153

        1. Initial program 99.7%

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

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

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

          \[\leadsto x1 + \color{blue}{\left(-6 \cdot x2 + x1 \cdot \left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) - 2\right)\right)} \]
        6. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto x1 + \left(\color{blue}{x2 \cdot -6} + x1 \cdot \left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) - 2\right)\right) \]
          2. lower-fma.f64N/A

            \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(x2, -6, x1 \cdot \left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) - 2\right)\right)} \]
          3. sub-negN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \color{blue}{\left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) + \left(\mathsf{neg}\left(2\right)\right)\right)}\right) \]
          4. associate-*r*N/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(\color{blue}{\left(3 \cdot x1\right) \cdot \left(3 - -2 \cdot x2\right)} + \left(\mathsf{neg}\left(2\right)\right)\right)\right) \]
          5. *-commutativeN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(\color{blue}{\left(x1 \cdot 3\right)} \cdot \left(3 - -2 \cdot x2\right) + \left(\mathsf{neg}\left(2\right)\right)\right)\right) \]
          6. associate-*r*N/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(\color{blue}{x1 \cdot \left(3 \cdot \left(3 - -2 \cdot x2\right)\right)} + \left(\mathsf{neg}\left(2\right)\right)\right)\right) \]
          7. metadata-evalN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 - -2 \cdot x2\right)\right) + \color{blue}{-2}\right)\right) \]
          8. lower-*.f64N/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, \color{blue}{x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 - -2 \cdot x2\right)\right) + -2\right)}\right) \]
          9. cancel-sign-sub-invN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(x1 \cdot \left(3 \cdot \color{blue}{\left(3 + \left(\mathsf{neg}\left(-2\right)\right) \cdot x2\right)}\right) + -2\right)\right) \]
          10. metadata-evalN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + \color{blue}{2} \cdot x2\right)\right) + -2\right)\right) \]
          11. lower-fma.f64N/A

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

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

          \[\leadsto \color{blue}{{x1}^{2} \cdot \left(9 + 6 \cdot x2\right)} \]
        9. Step-by-step derivation
          1. unpow2N/A

            \[\leadsto \color{blue}{\left(x1 \cdot x1\right)} \cdot \left(9 + 6 \cdot x2\right) \]
          2. associate-*l*N/A

            \[\leadsto \color{blue}{x1 \cdot \left(x1 \cdot \left(9 + 6 \cdot x2\right)\right)} \]
          3. lower-*.f64N/A

            \[\leadsto \color{blue}{x1 \cdot \left(x1 \cdot \left(9 + 6 \cdot x2\right)\right)} \]
          4. lower-*.f64N/A

            \[\leadsto x1 \cdot \color{blue}{\left(x1 \cdot \left(9 + 6 \cdot x2\right)\right)} \]
          5. +-commutativeN/A

            \[\leadsto x1 \cdot \left(x1 \cdot \color{blue}{\left(6 \cdot x2 + 9\right)}\right) \]
          6. *-commutativeN/A

            \[\leadsto x1 \cdot \left(x1 \cdot \left(\color{blue}{x2 \cdot 6} + 9\right)\right) \]
          7. lower-fma.f6420.5

            \[\leadsto x1 \cdot \left(x1 \cdot \color{blue}{\mathsf{fma}\left(x2, 6, 9\right)}\right) \]
        10. Applied rewrites20.5%

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

        if 1.39999999999999993e153 < 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. Add Preprocessing
        3. Taylor expanded in x2 around 0

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

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

          \[\leadsto x1 + \color{blue}{\left(-6 \cdot x2 + x1 \cdot \left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) - 2\right)\right)} \]
        6. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto x1 + \left(\color{blue}{x2 \cdot -6} + x1 \cdot \left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) - 2\right)\right) \]
          2. lower-fma.f64N/A

            \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(x2, -6, x1 \cdot \left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) - 2\right)\right)} \]
          3. sub-negN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \color{blue}{\left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) + \left(\mathsf{neg}\left(2\right)\right)\right)}\right) \]
          4. associate-*r*N/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(\color{blue}{\left(3 \cdot x1\right) \cdot \left(3 - -2 \cdot x2\right)} + \left(\mathsf{neg}\left(2\right)\right)\right)\right) \]
          5. *-commutativeN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(\color{blue}{\left(x1 \cdot 3\right)} \cdot \left(3 - -2 \cdot x2\right) + \left(\mathsf{neg}\left(2\right)\right)\right)\right) \]
          6. associate-*r*N/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(\color{blue}{x1 \cdot \left(3 \cdot \left(3 - -2 \cdot x2\right)\right)} + \left(\mathsf{neg}\left(2\right)\right)\right)\right) \]
          7. metadata-evalN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 - -2 \cdot x2\right)\right) + \color{blue}{-2}\right)\right) \]
          8. lower-*.f64N/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, \color{blue}{x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 - -2 \cdot x2\right)\right) + -2\right)}\right) \]
          9. cancel-sign-sub-invN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(x1 \cdot \left(3 \cdot \color{blue}{\left(3 + \left(\mathsf{neg}\left(-2\right)\right) \cdot x2\right)}\right) + -2\right)\right) \]
          10. metadata-evalN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + \color{blue}{2} \cdot x2\right)\right) + -2\right)\right) \]
          11. lower-fma.f64N/A

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

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

          \[\leadsto \color{blue}{x1 + x1 \cdot \left(9 \cdot x1 - 2\right)} \]
        9. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto \color{blue}{x1 \cdot \left(9 \cdot x1 - 2\right) + x1} \]
          2. *-rgt-identityN/A

            \[\leadsto x1 \cdot \left(9 \cdot x1 - 2\right) + \color{blue}{x1 \cdot 1} \]
          3. distribute-lft-outN/A

            \[\leadsto \color{blue}{x1 \cdot \left(\left(9 \cdot x1 - 2\right) + 1\right)} \]
          4. lower-*.f64N/A

            \[\leadsto \color{blue}{x1 \cdot \left(\left(9 \cdot x1 - 2\right) + 1\right)} \]
          5. sub-negN/A

            \[\leadsto x1 \cdot \left(\color{blue}{\left(9 \cdot x1 + \left(\mathsf{neg}\left(2\right)\right)\right)} + 1\right) \]
          6. metadata-evalN/A

            \[\leadsto x1 \cdot \left(\left(9 \cdot x1 + \color{blue}{-2}\right) + 1\right) \]
          7. associate-+l+N/A

            \[\leadsto x1 \cdot \color{blue}{\left(9 \cdot x1 + \left(-2 + 1\right)\right)} \]
          8. metadata-evalN/A

            \[\leadsto x1 \cdot \left(9 \cdot x1 + \color{blue}{-1}\right) \]
          9. *-commutativeN/A

            \[\leadsto x1 \cdot \left(\color{blue}{x1 \cdot 9} + -1\right) \]
          10. lower-fma.f64100.0

            \[\leadsto x1 \cdot \color{blue}{\mathsf{fma}\left(x1, 9, -1\right)} \]
        10. Applied rewrites100.0%

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -2.4 \cdot 10^{+44}:\\ \;\;\;\;x1 \cdot \left(x1 \cdot \left(x1 \cdot -19\right)\right)\\ \mathbf{elif}\;x1 \leq 740000000:\\ \;\;\;\;x2 \cdot -6 - x1\\ \mathbf{elif}\;x1 \leq 1.4 \cdot 10^{+153}:\\ \;\;\;\;x1 \cdot \left(x1 \cdot \mathsf{fma}\left(x2, 6, 9\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 \cdot \mathsf{fma}\left(x1, 9, -1\right)\\ \end{array} \]
      5. Add Preprocessing

      Alternative 19: 67.4% accurate, 12.4× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x1 \leq -2.4 \cdot 10^{+44}:\\ \;\;\;\;x1 \cdot \left(x1 \cdot \left(x1 \cdot -19\right)\right)\\ \mathbf{elif}\;x1 \leq 9.5 \cdot 10^{-11}:\\ \;\;\;\;x2 \cdot -6 - x1\\ \mathbf{else}:\\ \;\;\;\;x1 \cdot \mathsf{fma}\left(x1, 9, -1\right)\\ \end{array} \end{array} \]
      (FPCore (x1 x2)
       :precision binary64
       (if (<= x1 -2.4e+44)
         (* x1 (* x1 (* x1 -19.0)))
         (if (<= x1 9.5e-11) (- (* x2 -6.0) x1) (* x1 (fma x1 9.0 -1.0)))))
      double code(double x1, double x2) {
      	double tmp;
      	if (x1 <= -2.4e+44) {
      		tmp = x1 * (x1 * (x1 * -19.0));
      	} else if (x1 <= 9.5e-11) {
      		tmp = (x2 * -6.0) - x1;
      	} else {
      		tmp = x1 * fma(x1, 9.0, -1.0);
      	}
      	return tmp;
      }
      
      function code(x1, x2)
      	tmp = 0.0
      	if (x1 <= -2.4e+44)
      		tmp = Float64(x1 * Float64(x1 * Float64(x1 * -19.0)));
      	elseif (x1 <= 9.5e-11)
      		tmp = Float64(Float64(x2 * -6.0) - x1);
      	else
      		tmp = Float64(x1 * fma(x1, 9.0, -1.0));
      	end
      	return tmp
      end
      
      code[x1_, x2_] := If[LessEqual[x1, -2.4e+44], N[(x1 * N[(x1 * N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 9.5e-11], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision], N[(x1 * N[(x1 * 9.0 + -1.0), $MachinePrecision]), $MachinePrecision]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;x1 \leq -2.4 \cdot 10^{+44}:\\
      \;\;\;\;x1 \cdot \left(x1 \cdot \left(x1 \cdot -19\right)\right)\\
      
      \mathbf{elif}\;x1 \leq 9.5 \cdot 10^{-11}:\\
      \;\;\;\;x2 \cdot -6 - x1\\
      
      \mathbf{else}:\\
      \;\;\;\;x1 \cdot \mathsf{fma}\left(x1, 9, -1\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if x1 < -2.40000000000000013e44

        1. Initial program 26.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. Add Preprocessing
        3. Taylor expanded in x2 around 0

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

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

          \[\leadsto x1 + \color{blue}{\left(-6 \cdot x2 + x1 \cdot \left(x1 \cdot \left(-19 \cdot x1 + 3 \cdot \left(3 - -2 \cdot x2\right)\right) - 2\right)\right)} \]
        6. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto x1 + \color{blue}{\left(x1 \cdot \left(x1 \cdot \left(-19 \cdot x1 + 3 \cdot \left(3 - -2 \cdot x2\right)\right) - 2\right) + -6 \cdot x2\right)} \]
          2. lower-fma.f64N/A

            \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(x1, x1 \cdot \left(-19 \cdot x1 + 3 \cdot \left(3 - -2 \cdot x2\right)\right) - 2, -6 \cdot x2\right)} \]
        7. Applied rewrites80.0%

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

          \[\leadsto \color{blue}{-19 \cdot {x1}^{3}} \]
        9. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \color{blue}{{x1}^{3} \cdot -19} \]
          2. cube-multN/A

            \[\leadsto \color{blue}{\left(x1 \cdot \left(x1 \cdot x1\right)\right)} \cdot -19 \]
          3. unpow2N/A

            \[\leadsto \left(x1 \cdot \color{blue}{{x1}^{2}}\right) \cdot -19 \]
          4. associate-*l*N/A

            \[\leadsto \color{blue}{x1 \cdot \left({x1}^{2} \cdot -19\right)} \]
          5. unpow2N/A

            \[\leadsto x1 \cdot \left(\color{blue}{\left(x1 \cdot x1\right)} \cdot -19\right) \]
          6. associate-*r*N/A

            \[\leadsto x1 \cdot \color{blue}{\left(x1 \cdot \left(x1 \cdot -19\right)\right)} \]
          7. *-commutativeN/A

            \[\leadsto x1 \cdot \left(x1 \cdot \color{blue}{\left(-19 \cdot x1\right)}\right) \]
          8. lower-*.f64N/A

            \[\leadsto \color{blue}{x1 \cdot \left(x1 \cdot \left(-19 \cdot x1\right)\right)} \]
          9. lower-*.f64N/A

            \[\leadsto x1 \cdot \color{blue}{\left(x1 \cdot \left(-19 \cdot x1\right)\right)} \]
          10. *-commutativeN/A

            \[\leadsto x1 \cdot \left(x1 \cdot \color{blue}{\left(x1 \cdot -19\right)}\right) \]
          11. lower-*.f6475.3

            \[\leadsto x1 \cdot \left(x1 \cdot \color{blue}{\left(x1 \cdot -19\right)}\right) \]
        10. Applied rewrites75.3%

          \[\leadsto \color{blue}{x1 \cdot \left(x1 \cdot \left(x1 \cdot -19\right)\right)} \]

        if -2.40000000000000013e44 < x1 < 9.49999999999999951e-11

        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. Add Preprocessing
        3. Taylor expanded in x2 around 0

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

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

          \[\leadsto x1 + \color{blue}{\left(-6 \cdot x2 + x1 \cdot \left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) - 2\right)\right)} \]
        6. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto x1 + \left(\color{blue}{x2 \cdot -6} + x1 \cdot \left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) - 2\right)\right) \]
          2. lower-fma.f64N/A

            \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(x2, -6, x1 \cdot \left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) - 2\right)\right)} \]
          3. sub-negN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \color{blue}{\left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) + \left(\mathsf{neg}\left(2\right)\right)\right)}\right) \]
          4. associate-*r*N/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(\color{blue}{\left(3 \cdot x1\right) \cdot \left(3 - -2 \cdot x2\right)} + \left(\mathsf{neg}\left(2\right)\right)\right)\right) \]
          5. *-commutativeN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(\color{blue}{\left(x1 \cdot 3\right)} \cdot \left(3 - -2 \cdot x2\right) + \left(\mathsf{neg}\left(2\right)\right)\right)\right) \]
          6. associate-*r*N/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(\color{blue}{x1 \cdot \left(3 \cdot \left(3 - -2 \cdot x2\right)\right)} + \left(\mathsf{neg}\left(2\right)\right)\right)\right) \]
          7. metadata-evalN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 - -2 \cdot x2\right)\right) + \color{blue}{-2}\right)\right) \]
          8. lower-*.f64N/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, \color{blue}{x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 - -2 \cdot x2\right)\right) + -2\right)}\right) \]
          9. cancel-sign-sub-invN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(x1 \cdot \left(3 \cdot \color{blue}{\left(3 + \left(\mathsf{neg}\left(-2\right)\right) \cdot x2\right)}\right) + -2\right)\right) \]
          10. metadata-evalN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + \color{blue}{2} \cdot x2\right)\right) + -2\right)\right) \]
          11. lower-fma.f64N/A

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

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

          \[\leadsto \color{blue}{-6 \cdot x2 + -1 \cdot x1} \]
        9. Step-by-step derivation
          1. mul-1-negN/A

            \[\leadsto -6 \cdot x2 + \color{blue}{\left(\mathsf{neg}\left(x1\right)\right)} \]
          2. unsub-negN/A

            \[\leadsto \color{blue}{-6 \cdot x2 - x1} \]
          3. lower--.f64N/A

            \[\leadsto \color{blue}{-6 \cdot x2 - x1} \]
          4. lower-*.f6468.7

            \[\leadsto \color{blue}{-6 \cdot x2} - x1 \]
        10. Applied rewrites68.7%

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

        if 9.49999999999999951e-11 < x1

        1. Initial program 54.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. Add Preprocessing
        3. Taylor expanded in x2 around 0

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

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

          \[\leadsto x1 + \color{blue}{\left(-6 \cdot x2 + x1 \cdot \left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) - 2\right)\right)} \]
        6. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto x1 + \left(\color{blue}{x2 \cdot -6} + x1 \cdot \left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) - 2\right)\right) \]
          2. lower-fma.f64N/A

            \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(x2, -6, x1 \cdot \left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) - 2\right)\right)} \]
          3. sub-negN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \color{blue}{\left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) + \left(\mathsf{neg}\left(2\right)\right)\right)}\right) \]
          4. associate-*r*N/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(\color{blue}{\left(3 \cdot x1\right) \cdot \left(3 - -2 \cdot x2\right)} + \left(\mathsf{neg}\left(2\right)\right)\right)\right) \]
          5. *-commutativeN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(\color{blue}{\left(x1 \cdot 3\right)} \cdot \left(3 - -2 \cdot x2\right) + \left(\mathsf{neg}\left(2\right)\right)\right)\right) \]
          6. associate-*r*N/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(\color{blue}{x1 \cdot \left(3 \cdot \left(3 - -2 \cdot x2\right)\right)} + \left(\mathsf{neg}\left(2\right)\right)\right)\right) \]
          7. metadata-evalN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 - -2 \cdot x2\right)\right) + \color{blue}{-2}\right)\right) \]
          8. lower-*.f64N/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, \color{blue}{x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 - -2 \cdot x2\right)\right) + -2\right)}\right) \]
          9. cancel-sign-sub-invN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(x1 \cdot \left(3 \cdot \color{blue}{\left(3 + \left(\mathsf{neg}\left(-2\right)\right) \cdot x2\right)}\right) + -2\right)\right) \]
          10. metadata-evalN/A

            \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + \color{blue}{2} \cdot x2\right)\right) + -2\right)\right) \]
          11. lower-fma.f64N/A

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

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

          \[\leadsto \color{blue}{x1 + x1 \cdot \left(9 \cdot x1 - 2\right)} \]
        9. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto \color{blue}{x1 \cdot \left(9 \cdot x1 - 2\right) + x1} \]
          2. *-rgt-identityN/A

            \[\leadsto x1 \cdot \left(9 \cdot x1 - 2\right) + \color{blue}{x1 \cdot 1} \]
          3. distribute-lft-outN/A

            \[\leadsto \color{blue}{x1 \cdot \left(\left(9 \cdot x1 - 2\right) + 1\right)} \]
          4. lower-*.f64N/A

            \[\leadsto \color{blue}{x1 \cdot \left(\left(9 \cdot x1 - 2\right) + 1\right)} \]
          5. sub-negN/A

            \[\leadsto x1 \cdot \left(\color{blue}{\left(9 \cdot x1 + \left(\mathsf{neg}\left(2\right)\right)\right)} + 1\right) \]
          6. metadata-evalN/A

            \[\leadsto x1 \cdot \left(\left(9 \cdot x1 + \color{blue}{-2}\right) + 1\right) \]
          7. associate-+l+N/A

            \[\leadsto x1 \cdot \color{blue}{\left(9 \cdot x1 + \left(-2 + 1\right)\right)} \]
          8. metadata-evalN/A

            \[\leadsto x1 \cdot \left(9 \cdot x1 + \color{blue}{-1}\right) \]
          9. *-commutativeN/A

            \[\leadsto x1 \cdot \left(\color{blue}{x1 \cdot 9} + -1\right) \]
          10. lower-fma.f6448.7

            \[\leadsto x1 \cdot \color{blue}{\mathsf{fma}\left(x1, 9, -1\right)} \]
        10. Applied rewrites48.7%

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -2.4 \cdot 10^{+44}:\\ \;\;\;\;x1 \cdot \left(x1 \cdot \left(x1 \cdot -19\right)\right)\\ \mathbf{elif}\;x1 \leq 9.5 \cdot 10^{-11}:\\ \;\;\;\;x2 \cdot -6 - x1\\ \mathbf{else}:\\ \;\;\;\;x1 \cdot \mathsf{fma}\left(x1, 9, -1\right)\\ \end{array} \]
      5. Add Preprocessing

      Alternative 20: 28.4% accurate, 19.8× speedup?

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

        1. Initial program 38.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. Add Preprocessing
        3. Taylor expanded in x1 around -inf

          \[\leadsto x1 + \color{blue}{{x1}^{4} \cdot \left(6 + -1 \cdot \frac{3 + -1 \cdot \frac{9 + \left(-1 \cdot \frac{2 + -2 \cdot \left(1 + 3 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1} + 4 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1}}{x1}\right)} \]
        4. Step-by-step derivation
          1. lower-*.f64N/A

            \[\leadsto x1 + \color{blue}{{x1}^{4} \cdot \left(6 + -1 \cdot \frac{3 + -1 \cdot \frac{9 + \left(-1 \cdot \frac{2 + -2 \cdot \left(1 + 3 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1} + 4 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1}}{x1}\right)} \]
          2. lower-pow.f64N/A

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

            \[\leadsto x1 + {x1}^{4} \cdot \left(6 + \color{blue}{\left(\mathsf{neg}\left(\frac{3 + -1 \cdot \frac{9 + \left(-1 \cdot \frac{2 + -2 \cdot \left(1 + 3 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1} + 4 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1}}{x1}\right)\right)}\right) \]
          4. unsub-negN/A

            \[\leadsto x1 + {x1}^{4} \cdot \color{blue}{\left(6 - \frac{3 + -1 \cdot \frac{9 + \left(-1 \cdot \frac{2 + -2 \cdot \left(1 + 3 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1} + 4 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1}}{x1}\right)} \]
          5. lower--.f64N/A

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

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

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

          \[\leadsto \color{blue}{x1 \cdot \left(1 + 6 \cdot \left(2 \cdot x2 - 3\right)\right)} \]
        7. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto x1 \cdot \color{blue}{\left(6 \cdot \left(2 \cdot x2 - 3\right) + 1\right)} \]
          2. distribute-lft-inN/A

            \[\leadsto \color{blue}{x1 \cdot \left(6 \cdot \left(2 \cdot x2 - 3\right)\right) + x1 \cdot 1} \]
          3. *-rgt-identityN/A

            \[\leadsto x1 \cdot \left(6 \cdot \left(2 \cdot x2 - 3\right)\right) + \color{blue}{x1} \]
          4. lower-fma.f64N/A

            \[\leadsto \color{blue}{\mathsf{fma}\left(x1, 6 \cdot \left(2 \cdot x2 - 3\right), x1\right)} \]
          5. lower-*.f64N/A

            \[\leadsto \mathsf{fma}\left(x1, \color{blue}{6 \cdot \left(2 \cdot x2 - 3\right)}, x1\right) \]
          6. sub-negN/A

            \[\leadsto \mathsf{fma}\left(x1, 6 \cdot \color{blue}{\left(2 \cdot x2 + \left(\mathsf{neg}\left(3\right)\right)\right)}, x1\right) \]
          7. *-commutativeN/A

            \[\leadsto \mathsf{fma}\left(x1, 6 \cdot \left(\color{blue}{x2 \cdot 2} + \left(\mathsf{neg}\left(3\right)\right)\right), x1\right) \]
          8. metadata-evalN/A

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

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

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

          \[\leadsto \color{blue}{x1 + -18 \cdot x1} \]
        10. Step-by-step derivation
          1. distribute-rgt1-inN/A

            \[\leadsto \color{blue}{\left(-18 + 1\right) \cdot x1} \]
          2. *-commutativeN/A

            \[\leadsto \color{blue}{x1 \cdot \left(-18 + 1\right)} \]
          3. lower-*.f64N/A

            \[\leadsto \color{blue}{x1 \cdot \left(-18 + 1\right)} \]
          4. metadata-eval6.8

            \[\leadsto x1 \cdot \color{blue}{-17} \]
        11. Applied rewrites6.8%

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

        if -2.8000000000000001e-16 < x1

        1. Initial program 82.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. Add Preprocessing
        3. Taylor expanded in x1 around 0

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

            \[\leadsto x1 + \color{blue}{x2 \cdot -6} \]
          2. lower-*.f6434.6

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

          \[\leadsto x1 + \color{blue}{x2 \cdot -6} \]
      3. Recombined 2 regimes into one program.
      4. Add Preprocessing

      Alternative 21: 28.4% accurate, 22.9× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x1 \leq -2.8 \cdot 10^{-16}:\\ \;\;\;\;x1 \cdot -17\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x2, -6, x1\right)\\ \end{array} \end{array} \]
      (FPCore (x1 x2)
       :precision binary64
       (if (<= x1 -2.8e-16) (* x1 -17.0) (fma x2 -6.0 x1)))
      double code(double x1, double x2) {
      	double tmp;
      	if (x1 <= -2.8e-16) {
      		tmp = x1 * -17.0;
      	} else {
      		tmp = fma(x2, -6.0, x1);
      	}
      	return tmp;
      }
      
      function code(x1, x2)
      	tmp = 0.0
      	if (x1 <= -2.8e-16)
      		tmp = Float64(x1 * -17.0);
      	else
      		tmp = fma(x2, -6.0, x1);
      	end
      	return tmp
      end
      
      code[x1_, x2_] := If[LessEqual[x1, -2.8e-16], N[(x1 * -17.0), $MachinePrecision], N[(x2 * -6.0 + x1), $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;x1 \leq -2.8 \cdot 10^{-16}:\\
      \;\;\;\;x1 \cdot -17\\
      
      \mathbf{else}:\\
      \;\;\;\;\mathsf{fma}\left(x2, -6, x1\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if x1 < -2.8000000000000001e-16

        1. Initial program 38.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. Add Preprocessing
        3. Taylor expanded in x1 around -inf

          \[\leadsto x1 + \color{blue}{{x1}^{4} \cdot \left(6 + -1 \cdot \frac{3 + -1 \cdot \frac{9 + \left(-1 \cdot \frac{2 + -2 \cdot \left(1 + 3 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1} + 4 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1}}{x1}\right)} \]
        4. Step-by-step derivation
          1. lower-*.f64N/A

            \[\leadsto x1 + \color{blue}{{x1}^{4} \cdot \left(6 + -1 \cdot \frac{3 + -1 \cdot \frac{9 + \left(-1 \cdot \frac{2 + -2 \cdot \left(1 + 3 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1} + 4 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1}}{x1}\right)} \]
          2. lower-pow.f64N/A

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

            \[\leadsto x1 + {x1}^{4} \cdot \left(6 + \color{blue}{\left(\mathsf{neg}\left(\frac{3 + -1 \cdot \frac{9 + \left(-1 \cdot \frac{2 + -2 \cdot \left(1 + 3 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1} + 4 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1}}{x1}\right)\right)}\right) \]
          4. unsub-negN/A

            \[\leadsto x1 + {x1}^{4} \cdot \color{blue}{\left(6 - \frac{3 + -1 \cdot \frac{9 + \left(-1 \cdot \frac{2 + -2 \cdot \left(1 + 3 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1} + 4 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1}}{x1}\right)} \]
          5. lower--.f64N/A

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

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

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

          \[\leadsto \color{blue}{x1 \cdot \left(1 + 6 \cdot \left(2 \cdot x2 - 3\right)\right)} \]
        7. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto x1 \cdot \color{blue}{\left(6 \cdot \left(2 \cdot x2 - 3\right) + 1\right)} \]
          2. distribute-lft-inN/A

            \[\leadsto \color{blue}{x1 \cdot \left(6 \cdot \left(2 \cdot x2 - 3\right)\right) + x1 \cdot 1} \]
          3. *-rgt-identityN/A

            \[\leadsto x1 \cdot \left(6 \cdot \left(2 \cdot x2 - 3\right)\right) + \color{blue}{x1} \]
          4. lower-fma.f64N/A

            \[\leadsto \color{blue}{\mathsf{fma}\left(x1, 6 \cdot \left(2 \cdot x2 - 3\right), x1\right)} \]
          5. lower-*.f64N/A

            \[\leadsto \mathsf{fma}\left(x1, \color{blue}{6 \cdot \left(2 \cdot x2 - 3\right)}, x1\right) \]
          6. sub-negN/A

            \[\leadsto \mathsf{fma}\left(x1, 6 \cdot \color{blue}{\left(2 \cdot x2 + \left(\mathsf{neg}\left(3\right)\right)\right)}, x1\right) \]
          7. *-commutativeN/A

            \[\leadsto \mathsf{fma}\left(x1, 6 \cdot \left(\color{blue}{x2 \cdot 2} + \left(\mathsf{neg}\left(3\right)\right)\right), x1\right) \]
          8. metadata-evalN/A

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

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

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

          \[\leadsto \color{blue}{x1 + -18 \cdot x1} \]
        10. Step-by-step derivation
          1. distribute-rgt1-inN/A

            \[\leadsto \color{blue}{\left(-18 + 1\right) \cdot x1} \]
          2. *-commutativeN/A

            \[\leadsto \color{blue}{x1 \cdot \left(-18 + 1\right)} \]
          3. lower-*.f64N/A

            \[\leadsto \color{blue}{x1 \cdot \left(-18 + 1\right)} \]
          4. metadata-eval6.8

            \[\leadsto x1 \cdot \color{blue}{-17} \]
        11. Applied rewrites6.8%

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

        if -2.8000000000000001e-16 < x1

        1. Initial program 82.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. Add Preprocessing
        3. Taylor expanded in x1 around 0

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

            \[\leadsto x1 + \color{blue}{x2 \cdot -6} \]
          2. lower-*.f6434.6

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

          \[\leadsto x1 + \color{blue}{x2 \cdot -6} \]
        6. Step-by-step derivation
          1. lift-*.f64N/A

            \[\leadsto x1 + \color{blue}{x2 \cdot -6} \]
          2. +-commutativeN/A

            \[\leadsto \color{blue}{x2 \cdot -6 + x1} \]
          3. lift-*.f64N/A

            \[\leadsto \color{blue}{x2 \cdot -6} + x1 \]
          4. lower-fma.f6434.6

            \[\leadsto \color{blue}{\mathsf{fma}\left(x2, -6, x1\right)} \]
        7. Applied rewrites34.6%

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

      Alternative 22: 39.0% accurate, 33.1× speedup?

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

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

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

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

        \[\leadsto x1 + \color{blue}{\left(-6 \cdot x2 + x1 \cdot \left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) - 2\right)\right)} \]
      6. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto x1 + \left(\color{blue}{x2 \cdot -6} + x1 \cdot \left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) - 2\right)\right) \]
        2. lower-fma.f64N/A

          \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(x2, -6, x1 \cdot \left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) - 2\right)\right)} \]
        3. sub-negN/A

          \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \color{blue}{\left(3 \cdot \left(x1 \cdot \left(3 - -2 \cdot x2\right)\right) + \left(\mathsf{neg}\left(2\right)\right)\right)}\right) \]
        4. associate-*r*N/A

          \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(\color{blue}{\left(3 \cdot x1\right) \cdot \left(3 - -2 \cdot x2\right)} + \left(\mathsf{neg}\left(2\right)\right)\right)\right) \]
        5. *-commutativeN/A

          \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(\color{blue}{\left(x1 \cdot 3\right)} \cdot \left(3 - -2 \cdot x2\right) + \left(\mathsf{neg}\left(2\right)\right)\right)\right) \]
        6. associate-*r*N/A

          \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(\color{blue}{x1 \cdot \left(3 \cdot \left(3 - -2 \cdot x2\right)\right)} + \left(\mathsf{neg}\left(2\right)\right)\right)\right) \]
        7. metadata-evalN/A

          \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 - -2 \cdot x2\right)\right) + \color{blue}{-2}\right)\right) \]
        8. lower-*.f64N/A

          \[\leadsto x1 + \mathsf{fma}\left(x2, -6, \color{blue}{x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 - -2 \cdot x2\right)\right) + -2\right)}\right) \]
        9. cancel-sign-sub-invN/A

          \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(x1 \cdot \left(3 \cdot \color{blue}{\left(3 + \left(\mathsf{neg}\left(-2\right)\right) \cdot x2\right)}\right) + -2\right)\right) \]
        10. metadata-evalN/A

          \[\leadsto x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \left(x1 \cdot \left(3 \cdot \left(3 + \color{blue}{2} \cdot x2\right)\right) + -2\right)\right) \]
        11. lower-fma.f64N/A

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

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

        \[\leadsto \color{blue}{-6 \cdot x2 + -1 \cdot x1} \]
      9. Step-by-step derivation
        1. mul-1-negN/A

          \[\leadsto -6 \cdot x2 + \color{blue}{\left(\mathsf{neg}\left(x1\right)\right)} \]
        2. unsub-negN/A

          \[\leadsto \color{blue}{-6 \cdot x2 - x1} \]
        3. lower--.f64N/A

          \[\leadsto \color{blue}{-6 \cdot x2 - x1} \]
        4. lower-*.f6434.5

          \[\leadsto \color{blue}{-6 \cdot x2} - x1 \]
      10. Applied rewrites34.5%

        \[\leadsto \color{blue}{-6 \cdot x2 - x1} \]
      11. Final simplification34.5%

        \[\leadsto x2 \cdot -6 - x1 \]
      12. Add Preprocessing

      Alternative 23: 27.0% accurate, 49.7× 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 68.7%

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

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

          \[\leadsto x1 + \color{blue}{x2 \cdot -6} \]
        2. lower-*.f6424.2

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

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

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

          \[\leadsto \color{blue}{x2 \cdot -6} \]
        2. lower-*.f6423.9

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

        \[\leadsto \color{blue}{x2 \cdot -6} \]
      9. Add Preprocessing

      Alternative 24: 4.6% accurate, 49.7× speedup?

      \[\begin{array}{l} \\ x1 \cdot -17 \end{array} \]
      (FPCore (x1 x2) :precision binary64 (* x1 -17.0))
      double code(double x1, double x2) {
      	return x1 * -17.0;
      }
      
      real(8) function code(x1, x2)
          real(8), intent (in) :: x1
          real(8), intent (in) :: x2
          code = x1 * (-17.0d0)
      end function
      
      public static double code(double x1, double x2) {
      	return x1 * -17.0;
      }
      
      def code(x1, x2):
      	return x1 * -17.0
      
      function code(x1, x2)
      	return Float64(x1 * -17.0)
      end
      
      function tmp = code(x1, x2)
      	tmp = x1 * -17.0;
      end
      
      code[x1_, x2_] := N[(x1 * -17.0), $MachinePrecision]
      
      \begin{array}{l}
      
      \\
      x1 \cdot -17
      \end{array}
      
      Derivation
      1. Initial program 68.7%

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

        \[\leadsto x1 + \color{blue}{{x1}^{4} \cdot \left(6 + -1 \cdot \frac{3 + -1 \cdot \frac{9 + \left(-1 \cdot \frac{2 + -2 \cdot \left(1 + 3 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1} + 4 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1}}{x1}\right)} \]
      4. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto x1 + \color{blue}{{x1}^{4} \cdot \left(6 + -1 \cdot \frac{3 + -1 \cdot \frac{9 + \left(-1 \cdot \frac{2 + -2 \cdot \left(1 + 3 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1} + 4 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1}}{x1}\right)} \]
        2. lower-pow.f64N/A

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

          \[\leadsto x1 + {x1}^{4} \cdot \left(6 + \color{blue}{\left(\mathsf{neg}\left(\frac{3 + -1 \cdot \frac{9 + \left(-1 \cdot \frac{2 + -2 \cdot \left(1 + 3 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1} + 4 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1}}{x1}\right)\right)}\right) \]
        4. unsub-negN/A

          \[\leadsto x1 + {x1}^{4} \cdot \color{blue}{\left(6 - \frac{3 + -1 \cdot \frac{9 + \left(-1 \cdot \frac{2 + -2 \cdot \left(1 + 3 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1} + 4 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1}}{x1}\right)} \]
        5. lower--.f64N/A

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

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

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

        \[\leadsto \color{blue}{x1 \cdot \left(1 + 6 \cdot \left(2 \cdot x2 - 3\right)\right)} \]
      7. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto x1 \cdot \color{blue}{\left(6 \cdot \left(2 \cdot x2 - 3\right) + 1\right)} \]
        2. distribute-lft-inN/A

          \[\leadsto \color{blue}{x1 \cdot \left(6 \cdot \left(2 \cdot x2 - 3\right)\right) + x1 \cdot 1} \]
        3. *-rgt-identityN/A

          \[\leadsto x1 \cdot \left(6 \cdot \left(2 \cdot x2 - 3\right)\right) + \color{blue}{x1} \]
        4. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(x1, 6 \cdot \left(2 \cdot x2 - 3\right), x1\right)} \]
        5. lower-*.f64N/A

          \[\leadsto \mathsf{fma}\left(x1, \color{blue}{6 \cdot \left(2 \cdot x2 - 3\right)}, x1\right) \]
        6. sub-negN/A

          \[\leadsto \mathsf{fma}\left(x1, 6 \cdot \color{blue}{\left(2 \cdot x2 + \left(\mathsf{neg}\left(3\right)\right)\right)}, x1\right) \]
        7. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(x1, 6 \cdot \left(\color{blue}{x2 \cdot 2} + \left(\mathsf{neg}\left(3\right)\right)\right), x1\right) \]
        8. metadata-evalN/A

          \[\leadsto \mathsf{fma}\left(x1, 6 \cdot \left(x2 \cdot 2 + \color{blue}{-3}\right), x1\right) \]
        9. lower-fma.f649.2

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

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

        \[\leadsto \color{blue}{x1 + -18 \cdot x1} \]
      10. Step-by-step derivation
        1. distribute-rgt1-inN/A

          \[\leadsto \color{blue}{\left(-18 + 1\right) \cdot x1} \]
        2. *-commutativeN/A

          \[\leadsto \color{blue}{x1 \cdot \left(-18 + 1\right)} \]
        3. lower-*.f64N/A

          \[\leadsto \color{blue}{x1 \cdot \left(-18 + 1\right)} \]
        4. metadata-eval4.6

          \[\leadsto x1 \cdot \color{blue}{-17} \]
      11. Applied rewrites4.6%

        \[\leadsto \color{blue}{x1 \cdot -17} \]
      12. Add Preprocessing

      Reproduce

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