Rosa's FloatVsDoubleBenchmark

Percentage Accurate: 70.9% → 99.5%
Time: 32.8s
Alternatives: 29
Speedup: 3.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 29 alternatives:

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

Initial Program: 70.9% accurate, 1.0× speedup?

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

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

Alternative 1: 99.5% accurate, 0.1× speedup?

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

\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{x1 - t\_0}{\mathsf{fma}\left(x1, x1, 1\right)}\\
t_3 := 3 \cdot \left(x1 \cdot x1\right)\\
t_4 := x1 \cdot \left(x1 \cdot 3\right)\\
t_5 := \frac{\left(t\_4 + 2 \cdot x2\right) - x1}{t\_1}\\
t_6 := \frac{t\_0 - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t\_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_5\right) \cdot \left(t\_5 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_5 \cdot 4 - 6\right)\right) + t\_4 \cdot t\_5\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{x1 - \left(t\_4 - 2 \cdot x2\right)}{-1 - x1 \cdot x1}\right) \leq \infty:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, \frac{t\_3 - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, x1 + \mathsf{fma}\left(\mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, x1 \cdot \mathsf{fma}\left(t\_6, 4, -6\right), \left(x1 \cdot \left(2 \cdot t\_2\right)\right) \cdot \left(t\_2 - -3\right)\right), \mathsf{fma}\left(t\_3, t\_6, {x1}^{3}\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #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.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. Simplified99.6%

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

      \[\leadsto \color{blue}{x1 + \mathsf{fma}\left(3, \frac{3 \cdot \left(x1 \cdot x1\right) - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, x1 + \mathsf{fma}\left(\mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, x1 \cdot \mathsf{fma}\left(\frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}, 4, -6\right), \left(x1 \cdot \left(2 \cdot \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\right)\right) \cdot \left(\frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)} + -3\right)\right), \mathsf{fma}\left(3 \cdot \left(x1 \cdot x1\right), \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}, {x1}^{3}\right)\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in x1 around inf 100.0%

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

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

Alternative 2: 99.4% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_2}\\
t_4 := t\_1 \cdot t\_3\\
t_5 := \left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(t\_3 - 3\right)\\
t_6 := 3 \cdot \frac{x1 - \left(t\_1 - 2 \cdot x2\right)}{-1 - x1 \cdot x1}\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t\_2 \cdot \left(t\_5 + \left(x1 \cdot x1\right) \cdot \left(t\_3 \cdot 4 - 6\right)\right) + t\_4\right) + t\_0\right)\right) + t\_6\right) \leq \infty:\\
\;\;\;\;x1 + \left(t\_6 + \left(x1 + \left(t\_0 + \left(t\_4 + t\_2 \cdot \left(t\_5 - \left(x1 \cdot x1\right) \cdot \left(6 - 4 \cdot \frac{\left(2 \cdot x2 + 3 \cdot {x1}^{2}\right) - x1}{t\_2}\right)\right)\right)\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #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.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 99.4%

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

    if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #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. Simplified0.0%

      \[\leadsto \color{blue}{x1 + \mathsf{fma}\left(3, \frac{3 \cdot \left(x1 \cdot x1\right) - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, x1 + \mathsf{fma}\left(\mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, x1 \cdot \mathsf{fma}\left(\frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}, 4, -6\right), \left(x1 \cdot \left(2 \cdot \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\right)\right) \cdot \left(\frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)} + -3\right)\right), \mathsf{fma}\left(3 \cdot \left(x1 \cdot x1\right), \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}, {x1}^{3}\right)\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in x1 around inf 100.0%

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

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

Alternative 3: 99.4% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #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.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

    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. Simplified0.0%

      \[\leadsto \color{blue}{x1 + \mathsf{fma}\left(3, \frac{3 \cdot \left(x1 \cdot x1\right) - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, x1 + \mathsf{fma}\left(\mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, x1 \cdot \mathsf{fma}\left(\frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}, 4, -6\right), \left(x1 \cdot \left(2 \cdot \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\right)\right) \cdot \left(\frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)} + -3\right)\right), \mathsf{fma}\left(3 \cdot \left(x1 \cdot x1\right), \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}, {x1}^{3}\right)\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in x1 around inf 100.0%

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

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

Alternative 4: 97.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 \cdot x1 + 1\\ t_1 := x1 \cdot \left(x1 \cdot 3\right)\\ t_2 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_0}\\ \mathbf{if}\;x1 \leq -5.2 \cdot 10^{+53}:\\ \;\;\;\;{x1}^{4} \cdot \left(6 + \frac{\frac{9 - 4 \cdot \left(3 - 2 \cdot x2\right)}{x1} - 3}{x1}\right)\\ \mathbf{elif}\;x1 \leq 2.1 \cdot 10^{+54}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{x1 - \left(t\_1 - 2 \cdot x2\right)}{-1 - x1 \cdot x1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_0 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_2 \cdot 4 - 6\right)\right) + 3 \cdot t\_1\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;6 \cdot {x1}^{4}\\ \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_0)))
   (if (<= x1 -5.2e+53)
     (*
      (pow x1 4.0)
      (+ 6.0 (/ (- (/ (- 9.0 (* 4.0 (- 3.0 (* 2.0 x2)))) x1) 3.0) x1)))
     (if (<= x1 2.1e+54)
       (+
        x1
        (+
         (* 3.0 (/ (- x1 (- t_1 (* 2.0 x2))) (- -1.0 (* x1 x1))))
         (+
          x1
          (+
           (* x1 (* x1 x1))
           (+
            (*
             t_0
             (+
              (* (* (* x1 2.0) t_2) (- t_2 3.0))
              (* (* x1 x1) (- (* t_2 4.0) 6.0))))
            (* 3.0 t_1))))))
       (* 6.0 (pow x1 4.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) / t_0;
	double tmp;
	if (x1 <= -5.2e+53) {
		tmp = pow(x1, 4.0) * (6.0 + ((((9.0 - (4.0 * (3.0 - (2.0 * x2)))) / x1) - 3.0) / x1));
	} else if (x1 <= 2.1e+54) {
		tmp = x1 + ((3.0 * ((x1 - (t_1 - (2.0 * x2))) / (-1.0 - (x1 * x1)))) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_1)))));
	} else {
		tmp = 6.0 * pow(x1, 4.0);
	}
	return tmp;
}
real(8) function code(x1, x2)
    real(8), intent (in) :: x1
    real(8), intent (in) :: x2
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_0 = (x1 * x1) + 1.0d0
    t_1 = x1 * (x1 * 3.0d0)
    t_2 = ((t_1 + (2.0d0 * x2)) - x1) / t_0
    if (x1 <= (-5.2d+53)) then
        tmp = (x1 ** 4.0d0) * (6.0d0 + ((((9.0d0 - (4.0d0 * (3.0d0 - (2.0d0 * x2)))) / x1) - 3.0d0) / x1))
    else if (x1 <= 2.1d+54) then
        tmp = x1 + ((3.0d0 * ((x1 - (t_1 - (2.0d0 * x2))) / ((-1.0d0) - (x1 * x1)))) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * ((((x1 * 2.0d0) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((t_2 * 4.0d0) - 6.0d0)))) + (3.0d0 * t_1)))))
    else
        tmp = 6.0d0 * (x1 ** 4.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) / t_0;
	double tmp;
	if (x1 <= -5.2e+53) {
		tmp = Math.pow(x1, 4.0) * (6.0 + ((((9.0 - (4.0 * (3.0 - (2.0 * x2)))) / x1) - 3.0) / x1));
	} else if (x1 <= 2.1e+54) {
		tmp = x1 + ((3.0 * ((x1 - (t_1 - (2.0 * x2))) / (-1.0 - (x1 * x1)))) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_1)))));
	} else {
		tmp = 6.0 * Math.pow(x1, 4.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_0
	tmp = 0
	if x1 <= -5.2e+53:
		tmp = math.pow(x1, 4.0) * (6.0 + ((((9.0 - (4.0 * (3.0 - (2.0 * x2)))) / x1) - 3.0) / x1))
	elif x1 <= 2.1e+54:
		tmp = x1 + ((3.0 * ((x1 - (t_1 - (2.0 * x2))) / (-1.0 - (x1 * x1)))) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_1)))))
	else:
		tmp = 6.0 * math.pow(x1, 4.0)
	return tmp
function code(x1, x2)
	t_0 = Float64(Float64(x1 * x1) + 1.0)
	t_1 = Float64(x1 * Float64(x1 * 3.0))
	t_2 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_0)
	tmp = 0.0
	if (x1 <= -5.2e+53)
		tmp = Float64((x1 ^ 4.0) * Float64(6.0 + Float64(Float64(Float64(Float64(9.0 - Float64(4.0 * Float64(3.0 - Float64(2.0 * x2)))) / x1) - 3.0) / x1)));
	elseif (x1 <= 2.1e+54)
		tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(x1 - Float64(t_1 - Float64(2.0 * x2))) / Float64(-1.0 - Float64(x1 * x1)))) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_0 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(3.0 * t_1))))));
	else
		tmp = Float64(6.0 * (x1 ^ 4.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_0;
	tmp = 0.0;
	if (x1 <= -5.2e+53)
		tmp = (x1 ^ 4.0) * (6.0 + ((((9.0 - (4.0 * (3.0 - (2.0 * x2)))) / x1) - 3.0) / x1));
	elseif (x1 <= 2.1e+54)
		tmp = x1 + ((3.0 * ((x1 - (t_1 - (2.0 * x2))) / (-1.0 - (x1 * x1)))) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_1)))));
	else
		tmp = 6.0 * (x1 ^ 4.0);
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, If[LessEqual[x1, -5.2e+53], N[(N[Power[x1, 4.0], $MachinePrecision] * N[(6.0 + N[(N[(N[(N[(9.0 - N[(4.0 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision] - 3.0), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2.1e+54], N[(x1 + N[(N[(3.0 * N[(N[(x1 - N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$0 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(6.0 * N[Power[x1, 4.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 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_0}\\
\mathbf{if}\;x1 \leq -5.2 \cdot 10^{+53}:\\
\;\;\;\;{x1}^{4} \cdot \left(6 + \frac{\frac{9 - 4 \cdot \left(3 - 2 \cdot x2\right)}{x1} - 3}{x1}\right)\\

\mathbf{elif}\;x1 \leq 2.1 \cdot 10^{+54}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{x1 - \left(t\_1 - 2 \cdot x2\right)}{-1 - x1 \cdot x1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_0 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_2 \cdot 4 - 6\right)\right) + 3 \cdot t\_1\right)\right)\right)\right)\\

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


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

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

      \[\leadsto \color{blue}{x1 + \mathsf{fma}\left(3, \frac{3 \cdot \left(x1 \cdot x1\right) - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, x1 + \mathsf{fma}\left(\mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, x1 \cdot \mathsf{fma}\left(\frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}, 4, -6\right), \left(x1 \cdot \left(2 \cdot \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\right)\right) \cdot \left(\frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)} + -3\right)\right), \mathsf{fma}\left(3 \cdot \left(x1 \cdot x1\right), \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}, {x1}^{3}\right)\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in x1 around -inf 100.0%

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

    if -5.19999999999999996e53 < x1 < 2.09999999999999986e54

    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 inf 97.8%

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

    if 2.09999999999999986e54 < x1

    1. Initial program 26.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. Simplified26.8%

      \[\leadsto \color{blue}{x1 + \mathsf{fma}\left(3, \frac{3 \cdot \left(x1 \cdot x1\right) - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, x1 + \mathsf{fma}\left(\mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, x1 \cdot \mathsf{fma}\left(\frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}, 4, -6\right), \left(x1 \cdot \left(2 \cdot \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\right)\right) \cdot \left(\frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)} + -3\right)\right), \mathsf{fma}\left(3 \cdot \left(x1 \cdot x1\right), \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}, {x1}^{3}\right)\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in x1 around inf 100.0%

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

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

Alternative 5: 88.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 \cdot \left(x1 \cdot x1\right)\\ t_1 := x2 \cdot \left(3 - 2 \cdot x2\right)\\ t_2 := x1 \cdot \left(x1 \cdot 3\right)\\ t_3 := 3 \cdot \left(x2 \cdot -2 - 3\right)\\ t_4 := 3 + x2 \cdot -2\\ t_5 := x2 \cdot t\_4\\ t_6 := x1 \cdot x1 + 1\\ t_7 := \frac{\left(t\_2 + 2 \cdot x2\right) - x1}{t\_6}\\ t_8 := t\_2 \cdot t\_7\\ t_9 := -4 \cdot t\_5\\ t_10 := -1 - x1 \cdot x1\\ t_11 := \left(\left(x1 \cdot x1\right) \cdot \left(6 - t\_7 \cdot 4\right) + \left(t\_7 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(\frac{1}{x1} - 3\right)\right)\right) \cdot t\_10\\ t_12 := 3 \cdot \frac{x1 - \left(t\_2 - 2 \cdot x2\right)}{t\_10}\\ \mathbf{if}\;x1 \leq -5.7 \cdot 10^{+102}:\\ \;\;\;\;x2 \cdot -6 - x1 \cdot \left(\left(x1 \cdot \left(6 + \left(\left(t\_3 - \left(x2 \cdot 6 + \left(x2 \cdot 8 + x1 \cdot \left(\left(t\_9 + 2 \cdot \left(\left(1 + \left(-3 \cdot t\_4 + 2 \cdot t\_1\right)\right) - -2 \cdot t\_5\right)\right) - 3\right)\right)\right)\right) - 2 \cdot \left(3 + x2 \cdot -4\right)\right)\right) - t\_9\right) - -1\right)\\ \mathbf{elif}\;x1 \leq -7.4 \cdot 10^{+31}:\\ \;\;\;\;x1 + \left(t\_12 + \left(x1 + \left(t\_0 + \left(3 \cdot t\_2 + t\_11\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 7.5 \cdot 10^{+28}:\\ \;\;\;\;x1 + \left(t\_12 + \left(x1 + \left(t\_0 + \left(t\_8 + t\_6 \cdot \left(\left(x1 \cdot x1\right) \cdot 6 + \left(\left(x1 \cdot 2\right) \cdot t\_7\right) \cdot \left(\left(2 \cdot x2 - x1\right) - 3\right)\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 5 \cdot 10^{+97}:\\ \;\;\;\;x1 + \left(\left(x1 + \left(t\_0 + \left(t\_8 + t\_11\right)\right)\right) + 3 \cdot \left(x2 \cdot -2\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 - x1 \cdot \left(2 + \left(x1 \cdot \left(t\_3 - x1 \cdot 3\right) + 4 \cdot t\_1\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (* x1 (* x1 x1)))
        (t_1 (* x2 (- 3.0 (* 2.0 x2))))
        (t_2 (* x1 (* x1 3.0)))
        (t_3 (* 3.0 (- (* x2 -2.0) 3.0)))
        (t_4 (+ 3.0 (* x2 -2.0)))
        (t_5 (* x2 t_4))
        (t_6 (+ (* x1 x1) 1.0))
        (t_7 (/ (- (+ t_2 (* 2.0 x2)) x1) t_6))
        (t_8 (* t_2 t_7))
        (t_9 (* -4.0 t_5))
        (t_10 (- -1.0 (* x1 x1)))
        (t_11
         (*
          (+
           (* (* x1 x1) (- 6.0 (* t_7 4.0)))
           (* (- t_7 3.0) (* (* x1 2.0) (- (/ 1.0 x1) 3.0))))
          t_10))
        (t_12 (* 3.0 (/ (- x1 (- t_2 (* 2.0 x2))) t_10))))
   (if (<= x1 -5.7e+102)
     (-
      (* x2 -6.0)
      (*
       x1
       (-
        (-
         (*
          x1
          (+
           6.0
           (-
            (-
             t_3
             (+
              (* x2 6.0)
              (+
               (* x2 8.0)
               (*
                x1
                (-
                 (+
                  t_9
                  (*
                   2.0
                   (- (+ 1.0 (+ (* -3.0 t_4) (* 2.0 t_1))) (* -2.0 t_5))))
                 3.0)))))
            (* 2.0 (+ 3.0 (* x2 -4.0))))))
         t_9)
        -1.0)))
     (if (<= x1 -7.4e+31)
       (+ x1 (+ t_12 (+ x1 (+ t_0 (+ (* 3.0 t_2) t_11)))))
       (if (<= x1 7.5e+28)
         (+
          x1
          (+
           t_12
           (+
            x1
            (+
             t_0
             (+
              t_8
              (*
               t_6
               (+
                (* (* x1 x1) 6.0)
                (* (* (* x1 2.0) t_7) (- (- (* 2.0 x2) x1) 3.0)))))))))
         (if (<= x1 5e+97)
           (+ x1 (+ (+ x1 (+ t_0 (+ t_8 t_11))) (* 3.0 (* x2 -2.0))))
           (+
            x1
            (-
             (* x2 -6.0)
             (* x1 (+ 2.0 (+ (* x1 (- t_3 (* x1 3.0))) (* 4.0 t_1))))))))))))
double code(double x1, double x2) {
	double t_0 = x1 * (x1 * x1);
	double t_1 = x2 * (3.0 - (2.0 * x2));
	double t_2 = x1 * (x1 * 3.0);
	double t_3 = 3.0 * ((x2 * -2.0) - 3.0);
	double t_4 = 3.0 + (x2 * -2.0);
	double t_5 = x2 * t_4;
	double t_6 = (x1 * x1) + 1.0;
	double t_7 = ((t_2 + (2.0 * x2)) - x1) / t_6;
	double t_8 = t_2 * t_7;
	double t_9 = -4.0 * t_5;
	double t_10 = -1.0 - (x1 * x1);
	double t_11 = (((x1 * x1) * (6.0 - (t_7 * 4.0))) + ((t_7 - 3.0) * ((x1 * 2.0) * ((1.0 / x1) - 3.0)))) * t_10;
	double t_12 = 3.0 * ((x1 - (t_2 - (2.0 * x2))) / t_10);
	double tmp;
	if (x1 <= -5.7e+102) {
		tmp = (x2 * -6.0) - (x1 * (((x1 * (6.0 + ((t_3 - ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_9 + (2.0 * ((1.0 + ((-3.0 * t_4) + (2.0 * t_1))) - (-2.0 * t_5)))) - 3.0))))) - (2.0 * (3.0 + (x2 * -4.0)))))) - t_9) - -1.0));
	} else if (x1 <= -7.4e+31) {
		tmp = x1 + (t_12 + (x1 + (t_0 + ((3.0 * t_2) + t_11))));
	} else if (x1 <= 7.5e+28) {
		tmp = x1 + (t_12 + (x1 + (t_0 + (t_8 + (t_6 * (((x1 * x1) * 6.0) + (((x1 * 2.0) * t_7) * (((2.0 * x2) - x1) - 3.0))))))));
	} else if (x1 <= 5e+97) {
		tmp = x1 + ((x1 + (t_0 + (t_8 + t_11))) + (3.0 * (x2 * -2.0)));
	} else {
		tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 + ((x1 * (t_3 - (x1 * 3.0))) + (4.0 * t_1)))));
	}
	return tmp;
}
real(8) function code(x1, x2)
    real(8), intent (in) :: x1
    real(8), intent (in) :: x2
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_10
    real(8) :: t_11
    real(8) :: t_12
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: t_4
    real(8) :: t_5
    real(8) :: t_6
    real(8) :: t_7
    real(8) :: t_8
    real(8) :: t_9
    real(8) :: tmp
    t_0 = x1 * (x1 * x1)
    t_1 = x2 * (3.0d0 - (2.0d0 * x2))
    t_2 = x1 * (x1 * 3.0d0)
    t_3 = 3.0d0 * ((x2 * (-2.0d0)) - 3.0d0)
    t_4 = 3.0d0 + (x2 * (-2.0d0))
    t_5 = x2 * t_4
    t_6 = (x1 * x1) + 1.0d0
    t_7 = ((t_2 + (2.0d0 * x2)) - x1) / t_6
    t_8 = t_2 * t_7
    t_9 = (-4.0d0) * t_5
    t_10 = (-1.0d0) - (x1 * x1)
    t_11 = (((x1 * x1) * (6.0d0 - (t_7 * 4.0d0))) + ((t_7 - 3.0d0) * ((x1 * 2.0d0) * ((1.0d0 / x1) - 3.0d0)))) * t_10
    t_12 = 3.0d0 * ((x1 - (t_2 - (2.0d0 * x2))) / t_10)
    if (x1 <= (-5.7d+102)) then
        tmp = (x2 * (-6.0d0)) - (x1 * (((x1 * (6.0d0 + ((t_3 - ((x2 * 6.0d0) + ((x2 * 8.0d0) + (x1 * ((t_9 + (2.0d0 * ((1.0d0 + (((-3.0d0) * t_4) + (2.0d0 * t_1))) - ((-2.0d0) * t_5)))) - 3.0d0))))) - (2.0d0 * (3.0d0 + (x2 * (-4.0d0))))))) - t_9) - (-1.0d0)))
    else if (x1 <= (-7.4d+31)) then
        tmp = x1 + (t_12 + (x1 + (t_0 + ((3.0d0 * t_2) + t_11))))
    else if (x1 <= 7.5d+28) then
        tmp = x1 + (t_12 + (x1 + (t_0 + (t_8 + (t_6 * (((x1 * x1) * 6.0d0) + (((x1 * 2.0d0) * t_7) * (((2.0d0 * x2) - x1) - 3.0d0))))))))
    else if (x1 <= 5d+97) then
        tmp = x1 + ((x1 + (t_0 + (t_8 + t_11))) + (3.0d0 * (x2 * (-2.0d0))))
    else
        tmp = x1 + ((x2 * (-6.0d0)) - (x1 * (2.0d0 + ((x1 * (t_3 - (x1 * 3.0d0))) + (4.0d0 * t_1)))))
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double t_0 = x1 * (x1 * x1);
	double t_1 = x2 * (3.0 - (2.0 * x2));
	double t_2 = x1 * (x1 * 3.0);
	double t_3 = 3.0 * ((x2 * -2.0) - 3.0);
	double t_4 = 3.0 + (x2 * -2.0);
	double t_5 = x2 * t_4;
	double t_6 = (x1 * x1) + 1.0;
	double t_7 = ((t_2 + (2.0 * x2)) - x1) / t_6;
	double t_8 = t_2 * t_7;
	double t_9 = -4.0 * t_5;
	double t_10 = -1.0 - (x1 * x1);
	double t_11 = (((x1 * x1) * (6.0 - (t_7 * 4.0))) + ((t_7 - 3.0) * ((x1 * 2.0) * ((1.0 / x1) - 3.0)))) * t_10;
	double t_12 = 3.0 * ((x1 - (t_2 - (2.0 * x2))) / t_10);
	double tmp;
	if (x1 <= -5.7e+102) {
		tmp = (x2 * -6.0) - (x1 * (((x1 * (6.0 + ((t_3 - ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_9 + (2.0 * ((1.0 + ((-3.0 * t_4) + (2.0 * t_1))) - (-2.0 * t_5)))) - 3.0))))) - (2.0 * (3.0 + (x2 * -4.0)))))) - t_9) - -1.0));
	} else if (x1 <= -7.4e+31) {
		tmp = x1 + (t_12 + (x1 + (t_0 + ((3.0 * t_2) + t_11))));
	} else if (x1 <= 7.5e+28) {
		tmp = x1 + (t_12 + (x1 + (t_0 + (t_8 + (t_6 * (((x1 * x1) * 6.0) + (((x1 * 2.0) * t_7) * (((2.0 * x2) - x1) - 3.0))))))));
	} else if (x1 <= 5e+97) {
		tmp = x1 + ((x1 + (t_0 + (t_8 + t_11))) + (3.0 * (x2 * -2.0)));
	} else {
		tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 + ((x1 * (t_3 - (x1 * 3.0))) + (4.0 * t_1)))));
	}
	return tmp;
}
def code(x1, x2):
	t_0 = x1 * (x1 * x1)
	t_1 = x2 * (3.0 - (2.0 * x2))
	t_2 = x1 * (x1 * 3.0)
	t_3 = 3.0 * ((x2 * -2.0) - 3.0)
	t_4 = 3.0 + (x2 * -2.0)
	t_5 = x2 * t_4
	t_6 = (x1 * x1) + 1.0
	t_7 = ((t_2 + (2.0 * x2)) - x1) / t_6
	t_8 = t_2 * t_7
	t_9 = -4.0 * t_5
	t_10 = -1.0 - (x1 * x1)
	t_11 = (((x1 * x1) * (6.0 - (t_7 * 4.0))) + ((t_7 - 3.0) * ((x1 * 2.0) * ((1.0 / x1) - 3.0)))) * t_10
	t_12 = 3.0 * ((x1 - (t_2 - (2.0 * x2))) / t_10)
	tmp = 0
	if x1 <= -5.7e+102:
		tmp = (x2 * -6.0) - (x1 * (((x1 * (6.0 + ((t_3 - ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_9 + (2.0 * ((1.0 + ((-3.0 * t_4) + (2.0 * t_1))) - (-2.0 * t_5)))) - 3.0))))) - (2.0 * (3.0 + (x2 * -4.0)))))) - t_9) - -1.0))
	elif x1 <= -7.4e+31:
		tmp = x1 + (t_12 + (x1 + (t_0 + ((3.0 * t_2) + t_11))))
	elif x1 <= 7.5e+28:
		tmp = x1 + (t_12 + (x1 + (t_0 + (t_8 + (t_6 * (((x1 * x1) * 6.0) + (((x1 * 2.0) * t_7) * (((2.0 * x2) - x1) - 3.0))))))))
	elif x1 <= 5e+97:
		tmp = x1 + ((x1 + (t_0 + (t_8 + t_11))) + (3.0 * (x2 * -2.0)))
	else:
		tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 + ((x1 * (t_3 - (x1 * 3.0))) + (4.0 * t_1)))))
	return tmp
function code(x1, x2)
	t_0 = Float64(x1 * Float64(x1 * x1))
	t_1 = Float64(x2 * Float64(3.0 - Float64(2.0 * x2)))
	t_2 = Float64(x1 * Float64(x1 * 3.0))
	t_3 = Float64(3.0 * Float64(Float64(x2 * -2.0) - 3.0))
	t_4 = Float64(3.0 + Float64(x2 * -2.0))
	t_5 = Float64(x2 * t_4)
	t_6 = Float64(Float64(x1 * x1) + 1.0)
	t_7 = Float64(Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) / t_6)
	t_8 = Float64(t_2 * t_7)
	t_9 = Float64(-4.0 * t_5)
	t_10 = Float64(-1.0 - Float64(x1 * x1))
	t_11 = Float64(Float64(Float64(Float64(x1 * x1) * Float64(6.0 - Float64(t_7 * 4.0))) + Float64(Float64(t_7 - 3.0) * Float64(Float64(x1 * 2.0) * Float64(Float64(1.0 / x1) - 3.0)))) * t_10)
	t_12 = Float64(3.0 * Float64(Float64(x1 - Float64(t_2 - Float64(2.0 * x2))) / t_10))
	tmp = 0.0
	if (x1 <= -5.7e+102)
		tmp = Float64(Float64(x2 * -6.0) - Float64(x1 * Float64(Float64(Float64(x1 * Float64(6.0 + Float64(Float64(t_3 - Float64(Float64(x2 * 6.0) + Float64(Float64(x2 * 8.0) + Float64(x1 * Float64(Float64(t_9 + Float64(2.0 * Float64(Float64(1.0 + Float64(Float64(-3.0 * t_4) + Float64(2.0 * t_1))) - Float64(-2.0 * t_5)))) - 3.0))))) - Float64(2.0 * Float64(3.0 + Float64(x2 * -4.0)))))) - t_9) - -1.0)));
	elseif (x1 <= -7.4e+31)
		tmp = Float64(x1 + Float64(t_12 + Float64(x1 + Float64(t_0 + Float64(Float64(3.0 * t_2) + t_11)))));
	elseif (x1 <= 7.5e+28)
		tmp = Float64(x1 + Float64(t_12 + Float64(x1 + Float64(t_0 + Float64(t_8 + Float64(t_6 * Float64(Float64(Float64(x1 * x1) * 6.0) + Float64(Float64(Float64(x1 * 2.0) * t_7) * Float64(Float64(Float64(2.0 * x2) - x1) - 3.0)))))))));
	elseif (x1 <= 5e+97)
		tmp = Float64(x1 + Float64(Float64(x1 + Float64(t_0 + Float64(t_8 + t_11))) + Float64(3.0 * Float64(x2 * -2.0))));
	else
		tmp = Float64(x1 + Float64(Float64(x2 * -6.0) - Float64(x1 * Float64(2.0 + Float64(Float64(x1 * Float64(t_3 - Float64(x1 * 3.0))) + Float64(4.0 * t_1))))));
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	t_0 = x1 * (x1 * x1);
	t_1 = x2 * (3.0 - (2.0 * x2));
	t_2 = x1 * (x1 * 3.0);
	t_3 = 3.0 * ((x2 * -2.0) - 3.0);
	t_4 = 3.0 + (x2 * -2.0);
	t_5 = x2 * t_4;
	t_6 = (x1 * x1) + 1.0;
	t_7 = ((t_2 + (2.0 * x2)) - x1) / t_6;
	t_8 = t_2 * t_7;
	t_9 = -4.0 * t_5;
	t_10 = -1.0 - (x1 * x1);
	t_11 = (((x1 * x1) * (6.0 - (t_7 * 4.0))) + ((t_7 - 3.0) * ((x1 * 2.0) * ((1.0 / x1) - 3.0)))) * t_10;
	t_12 = 3.0 * ((x1 - (t_2 - (2.0 * x2))) / t_10);
	tmp = 0.0;
	if (x1 <= -5.7e+102)
		tmp = (x2 * -6.0) - (x1 * (((x1 * (6.0 + ((t_3 - ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_9 + (2.0 * ((1.0 + ((-3.0 * t_4) + (2.0 * t_1))) - (-2.0 * t_5)))) - 3.0))))) - (2.0 * (3.0 + (x2 * -4.0)))))) - t_9) - -1.0));
	elseif (x1 <= -7.4e+31)
		tmp = x1 + (t_12 + (x1 + (t_0 + ((3.0 * t_2) + t_11))));
	elseif (x1 <= 7.5e+28)
		tmp = x1 + (t_12 + (x1 + (t_0 + (t_8 + (t_6 * (((x1 * x1) * 6.0) + (((x1 * 2.0) * t_7) * (((2.0 * x2) - x1) - 3.0))))))));
	elseif (x1 <= 5e+97)
		tmp = x1 + ((x1 + (t_0 + (t_8 + t_11))) + (3.0 * (x2 * -2.0)));
	else
		tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 + ((x1 * (t_3 - (x1 * 3.0))) + (4.0 * t_1)))));
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(3.0 + N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(x2 * t$95$4), $MachinePrecision]}, Block[{t$95$6 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$7 = N[(N[(N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$6), $MachinePrecision]}, Block[{t$95$8 = N[(t$95$2 * t$95$7), $MachinePrecision]}, Block[{t$95$9 = N[(-4.0 * t$95$5), $MachinePrecision]}, Block[{t$95$10 = N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$11 = N[(N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 - N[(t$95$7 * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$7 - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(1.0 / x1), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$10), $MachinePrecision]}, Block[{t$95$12 = N[(3.0 * N[(N[(x1 - N[(t$95$2 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$10), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.7e+102], N[(N[(x2 * -6.0), $MachinePrecision] - N[(x1 * N[(N[(N[(x1 * N[(6.0 + N[(N[(t$95$3 - N[(N[(x2 * 6.0), $MachinePrecision] + N[(N[(x2 * 8.0), $MachinePrecision] + N[(x1 * N[(N[(t$95$9 + N[(2.0 * N[(N[(1.0 + N[(N[(-3.0 * t$95$4), $MachinePrecision] + N[(2.0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(-2.0 * t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(2.0 * N[(3.0 + N[(x2 * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$9), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -7.4e+31], N[(x1 + N[(t$95$12 + N[(x1 + N[(t$95$0 + N[(N[(3.0 * t$95$2), $MachinePrecision] + t$95$11), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 7.5e+28], N[(x1 + N[(t$95$12 + N[(x1 + N[(t$95$0 + N[(t$95$8 + N[(t$95$6 * N[(N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$7), $MachinePrecision] * N[(N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5e+97], N[(x1 + N[(N[(x1 + N[(t$95$0 + N[(t$95$8 + t$95$11), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] - N[(x1 * N[(2.0 + N[(N[(x1 * N[(t$95$3 - N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(4.0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
t_1 := x2 \cdot \left(3 - 2 \cdot x2\right)\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := 3 \cdot \left(x2 \cdot -2 - 3\right)\\
t_4 := 3 + x2 \cdot -2\\
t_5 := x2 \cdot t\_4\\
t_6 := x1 \cdot x1 + 1\\
t_7 := \frac{\left(t\_2 + 2 \cdot x2\right) - x1}{t\_6}\\
t_8 := t\_2 \cdot t\_7\\
t_9 := -4 \cdot t\_5\\
t_10 := -1 - x1 \cdot x1\\
t_11 := \left(\left(x1 \cdot x1\right) \cdot \left(6 - t\_7 \cdot 4\right) + \left(t\_7 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(\frac{1}{x1} - 3\right)\right)\right) \cdot t\_10\\
t_12 := 3 \cdot \frac{x1 - \left(t\_2 - 2 \cdot x2\right)}{t\_10}\\
\mathbf{if}\;x1 \leq -5.7 \cdot 10^{+102}:\\
\;\;\;\;x2 \cdot -6 - x1 \cdot \left(\left(x1 \cdot \left(6 + \left(\left(t\_3 - \left(x2 \cdot 6 + \left(x2 \cdot 8 + x1 \cdot \left(\left(t\_9 + 2 \cdot \left(\left(1 + \left(-3 \cdot t\_4 + 2 \cdot t\_1\right)\right) - -2 \cdot t\_5\right)\right) - 3\right)\right)\right)\right) - 2 \cdot \left(3 + x2 \cdot -4\right)\right)\right) - t\_9\right) - -1\right)\\

\mathbf{elif}\;x1 \leq -7.4 \cdot 10^{+31}:\\
\;\;\;\;x1 + \left(t\_12 + \left(x1 + \left(t\_0 + \left(3 \cdot t\_2 + t\_11\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 7.5 \cdot 10^{+28}:\\
\;\;\;\;x1 + \left(t\_12 + \left(x1 + \left(t\_0 + \left(t\_8 + t\_6 \cdot \left(\left(x1 \cdot x1\right) \cdot 6 + \left(\left(x1 \cdot 2\right) \cdot t\_7\right) \cdot \left(\left(2 \cdot x2 - x1\right) - 3\right)\right)\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 5 \cdot 10^{+97}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(t\_0 + \left(t\_8 + t\_11\right)\right)\right) + 3 \cdot \left(x2 \cdot -2\right)\right)\\

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


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

    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. Simplified22.0%

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

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

    if -5.6999999999999999e102 < x1 < -7.3999999999999996e31

    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 inf 99.3%

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

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

    if -7.3999999999999996e31 < x1 < 7.4999999999999998e28

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

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

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

    if 7.4999999999999998e28 < x1 < 4.99999999999999999e97

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

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

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

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

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

    if 4.99999999999999999e97 < x1

    1. Initial program 14.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. Simplified14.3%

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

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

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

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

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

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

      \[\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(3 \cdot x1 + 3 \cdot \left(3 - -2 \cdot x2\right)\right)\right) - 2\right)\right)} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification89.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -5.7 \cdot 10^{+102}:\\ \;\;\;\;x2 \cdot -6 - x1 \cdot \left(\left(x1 \cdot \left(6 + \left(\left(3 \cdot \left(x2 \cdot -2 - 3\right) - \left(x2 \cdot 6 + \left(x2 \cdot 8 + x1 \cdot \left(\left(-4 \cdot \left(x2 \cdot \left(3 + x2 \cdot -2\right)\right) + 2 \cdot \left(\left(1 + \left(-3 \cdot \left(3 + x2 \cdot -2\right) + 2 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right)\right) - -2 \cdot \left(x2 \cdot \left(3 + x2 \cdot -2\right)\right)\right)\right) - 3\right)\right)\right)\right) - 2 \cdot \left(3 + x2 \cdot -4\right)\right)\right) - -4 \cdot \left(x2 \cdot \left(3 + x2 \cdot -2\right)\right)\right) - -1\right)\\ \mathbf{elif}\;x1 \leq -7.4 \cdot 10^{+31}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{x1 - \left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right)}{-1 - x1 \cdot x1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot \left(x1 \cdot \left(x1 \cdot 3\right)\right) + \left(\left(x1 \cdot x1\right) \cdot \left(6 - \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} \cdot 4\right) + \left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(\frac{1}{x1} - 3\right)\right)\right) \cdot \left(-1 - x1 \cdot x1\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 7.5 \cdot 10^{+28}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{x1 - \left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right)}{-1 - x1 \cdot x1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(\left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 \cdot x1 + 1\right) \cdot \left(\left(x1 \cdot x1\right) \cdot 6 + \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(\left(2 \cdot x2 - x1\right) - 3\right)\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 5 \cdot 10^{+97}:\\ \;\;\;\;x1 + \left(\left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(\left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(\left(x1 \cdot x1\right) \cdot \left(6 - \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} \cdot 4\right) + \left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(\frac{1}{x1} - 3\right)\right)\right) \cdot \left(-1 - x1 \cdot x1\right)\right)\right)\right) + 3 \cdot \left(x2 \cdot -2\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 - x1 \cdot \left(2 + \left(x1 \cdot \left(3 \cdot \left(x2 \cdot -2 - 3\right) - x1 \cdot 3\right) + 4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 83.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 2 \cdot \left(3 + x2 \cdot -4\right)\\ t_1 := x1 \cdot \left(x1 \cdot x1\right)\\ t_2 := x2 \cdot \left(3 - 2 \cdot x2\right)\\ t_3 := x1 \cdot \left(x1 \cdot 3\right)\\ t_4 := \frac{\left(t\_3 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\\ t_5 := 3 \cdot \left(x2 \cdot -2 - 3\right)\\ t_6 := 3 + x2 \cdot -2\\ t_7 := x2 \cdot t\_6\\ t_8 := -4 \cdot t\_7\\ t_9 := -1 - x1 \cdot x1\\ t_10 := \left(\left(x1 \cdot x1\right) \cdot \left(6 - t\_4 \cdot 4\right) + \left(t\_4 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(\frac{1}{x1} - 3\right)\right)\right) \cdot t\_9\\ \mathbf{if}\;x1 \leq -5.7 \cdot 10^{+102}:\\ \;\;\;\;x2 \cdot -6 - x1 \cdot \left(\left(x1 \cdot \left(6 + \left(\left(t\_5 - \left(x2 \cdot 6 + \left(x2 \cdot 8 + x1 \cdot \left(\left(t\_8 + 2 \cdot \left(\left(1 + \left(-3 \cdot t\_6 + 2 \cdot t\_2\right)\right) - -2 \cdot t\_7\right)\right) - 3\right)\right)\right)\right) - t\_0\right)\right) - t\_8\right) - -1\right)\\ \mathbf{elif}\;x1 \leq -7.4 \cdot 10^{+31}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{x1 - \left(t\_3 - 2 \cdot x2\right)}{t\_9} + \left(x1 + \left(t\_1 + \left(3 \cdot t\_3 + t\_10\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 7.5 \cdot 10^{+28}:\\ \;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + \left(t\_8 + x1 \cdot \left(\left(t\_0 - \left(t\_5 - \left(x2 \cdot 6 + x2 \cdot 8\right)\right)\right) - 6\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 5 \cdot 10^{+97}:\\ \;\;\;\;x1 + \left(\left(x1 + \left(t\_1 + \left(t\_3 \cdot t\_4 + t\_10\right)\right)\right) + 3 \cdot \left(x2 \cdot -2\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 - x1 \cdot \left(2 + \left(x1 \cdot \left(t\_5 - x1 \cdot 3\right) + 4 \cdot t\_2\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (* 2.0 (+ 3.0 (* x2 -4.0))))
        (t_1 (* x1 (* x1 x1)))
        (t_2 (* x2 (- 3.0 (* 2.0 x2))))
        (t_3 (* x1 (* x1 3.0)))
        (t_4 (/ (- (+ t_3 (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)))
        (t_5 (* 3.0 (- (* x2 -2.0) 3.0)))
        (t_6 (+ 3.0 (* x2 -2.0)))
        (t_7 (* x2 t_6))
        (t_8 (* -4.0 t_7))
        (t_9 (- -1.0 (* x1 x1)))
        (t_10
         (*
          (+
           (* (* x1 x1) (- 6.0 (* t_4 4.0)))
           (* (- t_4 3.0) (* (* x1 2.0) (- (/ 1.0 x1) 3.0))))
          t_9)))
   (if (<= x1 -5.7e+102)
     (-
      (* x2 -6.0)
      (*
       x1
       (-
        (-
         (*
          x1
          (+
           6.0
           (-
            (-
             t_5
             (+
              (* x2 6.0)
              (+
               (* x2 8.0)
               (*
                x1
                (-
                 (+
                  t_8
                  (*
                   2.0
                   (- (+ 1.0 (+ (* -3.0 t_6) (* 2.0 t_2))) (* -2.0 t_7))))
                 3.0)))))
            t_0)))
         t_8)
        -1.0)))
     (if (<= x1 -7.4e+31)
       (+
        x1
        (+
         (* 3.0 (/ (- x1 (- t_3 (* 2.0 x2))) t_9))
         (+ x1 (+ t_1 (+ (* 3.0 t_3) t_10)))))
       (if (<= x1 7.5e+28)
         (+
          (* x2 -6.0)
          (*
           x1
           (+
            -1.0
            (+ t_8 (* x1 (- (- t_0 (- t_5 (+ (* x2 6.0) (* x2 8.0)))) 6.0))))))
         (if (<= x1 5e+97)
           (+ x1 (+ (+ x1 (+ t_1 (+ (* t_3 t_4) t_10))) (* 3.0 (* x2 -2.0))))
           (+
            x1
            (-
             (* x2 -6.0)
             (* x1 (+ 2.0 (+ (* x1 (- t_5 (* x1 3.0))) (* 4.0 t_2))))))))))))
double code(double x1, double x2) {
	double t_0 = 2.0 * (3.0 + (x2 * -4.0));
	double t_1 = x1 * (x1 * x1);
	double t_2 = x2 * (3.0 - (2.0 * x2));
	double t_3 = x1 * (x1 * 3.0);
	double t_4 = ((t_3 + (2.0 * x2)) - x1) / ((x1 * x1) + 1.0);
	double t_5 = 3.0 * ((x2 * -2.0) - 3.0);
	double t_6 = 3.0 + (x2 * -2.0);
	double t_7 = x2 * t_6;
	double t_8 = -4.0 * t_7;
	double t_9 = -1.0 - (x1 * x1);
	double t_10 = (((x1 * x1) * (6.0 - (t_4 * 4.0))) + ((t_4 - 3.0) * ((x1 * 2.0) * ((1.0 / x1) - 3.0)))) * t_9;
	double tmp;
	if (x1 <= -5.7e+102) {
		tmp = (x2 * -6.0) - (x1 * (((x1 * (6.0 + ((t_5 - ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_8 + (2.0 * ((1.0 + ((-3.0 * t_6) + (2.0 * t_2))) - (-2.0 * t_7)))) - 3.0))))) - t_0))) - t_8) - -1.0));
	} else if (x1 <= -7.4e+31) {
		tmp = x1 + ((3.0 * ((x1 - (t_3 - (2.0 * x2))) / t_9)) + (x1 + (t_1 + ((3.0 * t_3) + t_10))));
	} else if (x1 <= 7.5e+28) {
		tmp = (x2 * -6.0) + (x1 * (-1.0 + (t_8 + (x1 * ((t_0 - (t_5 - ((x2 * 6.0) + (x2 * 8.0)))) - 6.0)))));
	} else if (x1 <= 5e+97) {
		tmp = x1 + ((x1 + (t_1 + ((t_3 * t_4) + t_10))) + (3.0 * (x2 * -2.0)));
	} else {
		tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 + ((x1 * (t_5 - (x1 * 3.0))) + (4.0 * t_2)))));
	}
	return tmp;
}
real(8) function code(x1, x2)
    real(8), intent (in) :: x1
    real(8), intent (in) :: x2
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_10
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: t_4
    real(8) :: t_5
    real(8) :: t_6
    real(8) :: t_7
    real(8) :: t_8
    real(8) :: t_9
    real(8) :: tmp
    t_0 = 2.0d0 * (3.0d0 + (x2 * (-4.0d0)))
    t_1 = x1 * (x1 * x1)
    t_2 = x2 * (3.0d0 - (2.0d0 * x2))
    t_3 = x1 * (x1 * 3.0d0)
    t_4 = ((t_3 + (2.0d0 * x2)) - x1) / ((x1 * x1) + 1.0d0)
    t_5 = 3.0d0 * ((x2 * (-2.0d0)) - 3.0d0)
    t_6 = 3.0d0 + (x2 * (-2.0d0))
    t_7 = x2 * t_6
    t_8 = (-4.0d0) * t_7
    t_9 = (-1.0d0) - (x1 * x1)
    t_10 = (((x1 * x1) * (6.0d0 - (t_4 * 4.0d0))) + ((t_4 - 3.0d0) * ((x1 * 2.0d0) * ((1.0d0 / x1) - 3.0d0)))) * t_9
    if (x1 <= (-5.7d+102)) then
        tmp = (x2 * (-6.0d0)) - (x1 * (((x1 * (6.0d0 + ((t_5 - ((x2 * 6.0d0) + ((x2 * 8.0d0) + (x1 * ((t_8 + (2.0d0 * ((1.0d0 + (((-3.0d0) * t_6) + (2.0d0 * t_2))) - ((-2.0d0) * t_7)))) - 3.0d0))))) - t_0))) - t_8) - (-1.0d0)))
    else if (x1 <= (-7.4d+31)) then
        tmp = x1 + ((3.0d0 * ((x1 - (t_3 - (2.0d0 * x2))) / t_9)) + (x1 + (t_1 + ((3.0d0 * t_3) + t_10))))
    else if (x1 <= 7.5d+28) then
        tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (t_8 + (x1 * ((t_0 - (t_5 - ((x2 * 6.0d0) + (x2 * 8.0d0)))) - 6.0d0)))))
    else if (x1 <= 5d+97) then
        tmp = x1 + ((x1 + (t_1 + ((t_3 * t_4) + t_10))) + (3.0d0 * (x2 * (-2.0d0))))
    else
        tmp = x1 + ((x2 * (-6.0d0)) - (x1 * (2.0d0 + ((x1 * (t_5 - (x1 * 3.0d0))) + (4.0d0 * t_2)))))
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double t_0 = 2.0 * (3.0 + (x2 * -4.0));
	double t_1 = x1 * (x1 * x1);
	double t_2 = x2 * (3.0 - (2.0 * x2));
	double t_3 = x1 * (x1 * 3.0);
	double t_4 = ((t_3 + (2.0 * x2)) - x1) / ((x1 * x1) + 1.0);
	double t_5 = 3.0 * ((x2 * -2.0) - 3.0);
	double t_6 = 3.0 + (x2 * -2.0);
	double t_7 = x2 * t_6;
	double t_8 = -4.0 * t_7;
	double t_9 = -1.0 - (x1 * x1);
	double t_10 = (((x1 * x1) * (6.0 - (t_4 * 4.0))) + ((t_4 - 3.0) * ((x1 * 2.0) * ((1.0 / x1) - 3.0)))) * t_9;
	double tmp;
	if (x1 <= -5.7e+102) {
		tmp = (x2 * -6.0) - (x1 * (((x1 * (6.0 + ((t_5 - ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_8 + (2.0 * ((1.0 + ((-3.0 * t_6) + (2.0 * t_2))) - (-2.0 * t_7)))) - 3.0))))) - t_0))) - t_8) - -1.0));
	} else if (x1 <= -7.4e+31) {
		tmp = x1 + ((3.0 * ((x1 - (t_3 - (2.0 * x2))) / t_9)) + (x1 + (t_1 + ((3.0 * t_3) + t_10))));
	} else if (x1 <= 7.5e+28) {
		tmp = (x2 * -6.0) + (x1 * (-1.0 + (t_8 + (x1 * ((t_0 - (t_5 - ((x2 * 6.0) + (x2 * 8.0)))) - 6.0)))));
	} else if (x1 <= 5e+97) {
		tmp = x1 + ((x1 + (t_1 + ((t_3 * t_4) + t_10))) + (3.0 * (x2 * -2.0)));
	} else {
		tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 + ((x1 * (t_5 - (x1 * 3.0))) + (4.0 * t_2)))));
	}
	return tmp;
}
def code(x1, x2):
	t_0 = 2.0 * (3.0 + (x2 * -4.0))
	t_1 = x1 * (x1 * x1)
	t_2 = x2 * (3.0 - (2.0 * x2))
	t_3 = x1 * (x1 * 3.0)
	t_4 = ((t_3 + (2.0 * x2)) - x1) / ((x1 * x1) + 1.0)
	t_5 = 3.0 * ((x2 * -2.0) - 3.0)
	t_6 = 3.0 + (x2 * -2.0)
	t_7 = x2 * t_6
	t_8 = -4.0 * t_7
	t_9 = -1.0 - (x1 * x1)
	t_10 = (((x1 * x1) * (6.0 - (t_4 * 4.0))) + ((t_4 - 3.0) * ((x1 * 2.0) * ((1.0 / x1) - 3.0)))) * t_9
	tmp = 0
	if x1 <= -5.7e+102:
		tmp = (x2 * -6.0) - (x1 * (((x1 * (6.0 + ((t_5 - ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_8 + (2.0 * ((1.0 + ((-3.0 * t_6) + (2.0 * t_2))) - (-2.0 * t_7)))) - 3.0))))) - t_0))) - t_8) - -1.0))
	elif x1 <= -7.4e+31:
		tmp = x1 + ((3.0 * ((x1 - (t_3 - (2.0 * x2))) / t_9)) + (x1 + (t_1 + ((3.0 * t_3) + t_10))))
	elif x1 <= 7.5e+28:
		tmp = (x2 * -6.0) + (x1 * (-1.0 + (t_8 + (x1 * ((t_0 - (t_5 - ((x2 * 6.0) + (x2 * 8.0)))) - 6.0)))))
	elif x1 <= 5e+97:
		tmp = x1 + ((x1 + (t_1 + ((t_3 * t_4) + t_10))) + (3.0 * (x2 * -2.0)))
	else:
		tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 + ((x1 * (t_5 - (x1 * 3.0))) + (4.0 * t_2)))))
	return tmp
function code(x1, x2)
	t_0 = Float64(2.0 * Float64(3.0 + Float64(x2 * -4.0)))
	t_1 = Float64(x1 * Float64(x1 * x1))
	t_2 = Float64(x2 * Float64(3.0 - Float64(2.0 * x2)))
	t_3 = Float64(x1 * Float64(x1 * 3.0))
	t_4 = Float64(Float64(Float64(t_3 + Float64(2.0 * x2)) - x1) / Float64(Float64(x1 * x1) + 1.0))
	t_5 = Float64(3.0 * Float64(Float64(x2 * -2.0) - 3.0))
	t_6 = Float64(3.0 + Float64(x2 * -2.0))
	t_7 = Float64(x2 * t_6)
	t_8 = Float64(-4.0 * t_7)
	t_9 = Float64(-1.0 - Float64(x1 * x1))
	t_10 = Float64(Float64(Float64(Float64(x1 * x1) * Float64(6.0 - Float64(t_4 * 4.0))) + Float64(Float64(t_4 - 3.0) * Float64(Float64(x1 * 2.0) * Float64(Float64(1.0 / x1) - 3.0)))) * t_9)
	tmp = 0.0
	if (x1 <= -5.7e+102)
		tmp = Float64(Float64(x2 * -6.0) - Float64(x1 * Float64(Float64(Float64(x1 * Float64(6.0 + Float64(Float64(t_5 - Float64(Float64(x2 * 6.0) + Float64(Float64(x2 * 8.0) + Float64(x1 * Float64(Float64(t_8 + Float64(2.0 * Float64(Float64(1.0 + Float64(Float64(-3.0 * t_6) + Float64(2.0 * t_2))) - Float64(-2.0 * t_7)))) - 3.0))))) - t_0))) - t_8) - -1.0)));
	elseif (x1 <= -7.4e+31)
		tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(x1 - Float64(t_3 - Float64(2.0 * x2))) / t_9)) + Float64(x1 + Float64(t_1 + Float64(Float64(3.0 * t_3) + t_10)))));
	elseif (x1 <= 7.5e+28)
		tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(t_8 + Float64(x1 * Float64(Float64(t_0 - Float64(t_5 - Float64(Float64(x2 * 6.0) + Float64(x2 * 8.0)))) - 6.0))))));
	elseif (x1 <= 5e+97)
		tmp = Float64(x1 + Float64(Float64(x1 + Float64(t_1 + Float64(Float64(t_3 * t_4) + t_10))) + Float64(3.0 * Float64(x2 * -2.0))));
	else
		tmp = Float64(x1 + Float64(Float64(x2 * -6.0) - Float64(x1 * Float64(2.0 + Float64(Float64(x1 * Float64(t_5 - Float64(x1 * 3.0))) + Float64(4.0 * t_2))))));
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	t_0 = 2.0 * (3.0 + (x2 * -4.0));
	t_1 = x1 * (x1 * x1);
	t_2 = x2 * (3.0 - (2.0 * x2));
	t_3 = x1 * (x1 * 3.0);
	t_4 = ((t_3 + (2.0 * x2)) - x1) / ((x1 * x1) + 1.0);
	t_5 = 3.0 * ((x2 * -2.0) - 3.0);
	t_6 = 3.0 + (x2 * -2.0);
	t_7 = x2 * t_6;
	t_8 = -4.0 * t_7;
	t_9 = -1.0 - (x1 * x1);
	t_10 = (((x1 * x1) * (6.0 - (t_4 * 4.0))) + ((t_4 - 3.0) * ((x1 * 2.0) * ((1.0 / x1) - 3.0)))) * t_9;
	tmp = 0.0;
	if (x1 <= -5.7e+102)
		tmp = (x2 * -6.0) - (x1 * (((x1 * (6.0 + ((t_5 - ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_8 + (2.0 * ((1.0 + ((-3.0 * t_6) + (2.0 * t_2))) - (-2.0 * t_7)))) - 3.0))))) - t_0))) - t_8) - -1.0));
	elseif (x1 <= -7.4e+31)
		tmp = x1 + ((3.0 * ((x1 - (t_3 - (2.0 * x2))) / t_9)) + (x1 + (t_1 + ((3.0 * t_3) + t_10))));
	elseif (x1 <= 7.5e+28)
		tmp = (x2 * -6.0) + (x1 * (-1.0 + (t_8 + (x1 * ((t_0 - (t_5 - ((x2 * 6.0) + (x2 * 8.0)))) - 6.0)))));
	elseif (x1 <= 5e+97)
		tmp = x1 + ((x1 + (t_1 + ((t_3 * t_4) + t_10))) + (3.0 * (x2 * -2.0)));
	else
		tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 + ((x1 * (t_5 - (x1 * 3.0))) + (4.0 * t_2)))));
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := Block[{t$95$0 = N[(2.0 * N[(3.0 + N[(x2 * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$3 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(3.0 + N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(x2 * t$95$6), $MachinePrecision]}, Block[{t$95$8 = N[(-4.0 * t$95$7), $MachinePrecision]}, Block[{t$95$9 = N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$10 = N[(N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 - N[(t$95$4 * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$4 - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(1.0 / x1), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$9), $MachinePrecision]}, If[LessEqual[x1, -5.7e+102], N[(N[(x2 * -6.0), $MachinePrecision] - N[(x1 * N[(N[(N[(x1 * N[(6.0 + N[(N[(t$95$5 - N[(N[(x2 * 6.0), $MachinePrecision] + N[(N[(x2 * 8.0), $MachinePrecision] + N[(x1 * N[(N[(t$95$8 + N[(2.0 * N[(N[(1.0 + N[(N[(-3.0 * t$95$6), $MachinePrecision] + N[(2.0 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(-2.0 * t$95$7), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$8), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -7.4e+31], N[(x1 + N[(N[(3.0 * N[(N[(x1 - N[(t$95$3 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$9), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(t$95$1 + N[(N[(3.0 * t$95$3), $MachinePrecision] + t$95$10), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 7.5e+28], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(t$95$8 + N[(x1 * N[(N[(t$95$0 - N[(t$95$5 - N[(N[(x2 * 6.0), $MachinePrecision] + N[(x2 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5e+97], N[(x1 + N[(N[(x1 + N[(t$95$1 + N[(N[(t$95$3 * t$95$4), $MachinePrecision] + t$95$10), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] - N[(x1 * N[(2.0 + N[(N[(x1 * N[(t$95$5 - N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(4.0 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 2 \cdot \left(3 + x2 \cdot -4\right)\\
t_1 := x1 \cdot \left(x1 \cdot x1\right)\\
t_2 := x2 \cdot \left(3 - 2 \cdot x2\right)\\
t_3 := x1 \cdot \left(x1 \cdot 3\right)\\
t_4 := \frac{\left(t\_3 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\\
t_5 := 3 \cdot \left(x2 \cdot -2 - 3\right)\\
t_6 := 3 + x2 \cdot -2\\
t_7 := x2 \cdot t\_6\\
t_8 := -4 \cdot t\_7\\
t_9 := -1 - x1 \cdot x1\\
t_10 := \left(\left(x1 \cdot x1\right) \cdot \left(6 - t\_4 \cdot 4\right) + \left(t\_4 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(\frac{1}{x1} - 3\right)\right)\right) \cdot t\_9\\
\mathbf{if}\;x1 \leq -5.7 \cdot 10^{+102}:\\
\;\;\;\;x2 \cdot -6 - x1 \cdot \left(\left(x1 \cdot \left(6 + \left(\left(t\_5 - \left(x2 \cdot 6 + \left(x2 \cdot 8 + x1 \cdot \left(\left(t\_8 + 2 \cdot \left(\left(1 + \left(-3 \cdot t\_6 + 2 \cdot t\_2\right)\right) - -2 \cdot t\_7\right)\right) - 3\right)\right)\right)\right) - t\_0\right)\right) - t\_8\right) - -1\right)\\

\mathbf{elif}\;x1 \leq -7.4 \cdot 10^{+31}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{x1 - \left(t\_3 - 2 \cdot x2\right)}{t\_9} + \left(x1 + \left(t\_1 + \left(3 \cdot t\_3 + t\_10\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 7.5 \cdot 10^{+28}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + \left(t\_8 + x1 \cdot \left(\left(t\_0 - \left(t\_5 - \left(x2 \cdot 6 + x2 \cdot 8\right)\right)\right) - 6\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 5 \cdot 10^{+97}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(t\_1 + \left(t\_3 \cdot t\_4 + t\_10\right)\right)\right) + 3 \cdot \left(x2 \cdot -2\right)\right)\\

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


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

    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. Simplified22.0%

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

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

    if -5.6999999999999999e102 < x1 < -7.3999999999999996e31

    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 inf 99.3%

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

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

    if -7.3999999999999996e31 < x1 < 7.4999999999999998e28

    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. Simplified88.6%

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

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

    if 7.4999999999999998e28 < x1 < 4.99999999999999999e97

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

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

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

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

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

    if 4.99999999999999999e97 < x1

    1. Initial program 14.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. Simplified14.3%

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

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

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

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

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

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

      \[\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(3 \cdot x1 + 3 \cdot \left(3 - -2 \cdot x2\right)\right)\right) - 2\right)\right)} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification83.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -5.7 \cdot 10^{+102}:\\ \;\;\;\;x2 \cdot -6 - x1 \cdot \left(\left(x1 \cdot \left(6 + \left(\left(3 \cdot \left(x2 \cdot -2 - 3\right) - \left(x2 \cdot 6 + \left(x2 \cdot 8 + x1 \cdot \left(\left(-4 \cdot \left(x2 \cdot \left(3 + x2 \cdot -2\right)\right) + 2 \cdot \left(\left(1 + \left(-3 \cdot \left(3 + x2 \cdot -2\right) + 2 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right)\right) - -2 \cdot \left(x2 \cdot \left(3 + x2 \cdot -2\right)\right)\right)\right) - 3\right)\right)\right)\right) - 2 \cdot \left(3 + x2 \cdot -4\right)\right)\right) - -4 \cdot \left(x2 \cdot \left(3 + x2 \cdot -2\right)\right)\right) - -1\right)\\ \mathbf{elif}\;x1 \leq -7.4 \cdot 10^{+31}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{x1 - \left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right)}{-1 - x1 \cdot x1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot \left(x1 \cdot \left(x1 \cdot 3\right)\right) + \left(\left(x1 \cdot x1\right) \cdot \left(6 - \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} \cdot 4\right) + \left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(\frac{1}{x1} - 3\right)\right)\right) \cdot \left(-1 - x1 \cdot x1\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 7.5 \cdot 10^{+28}:\\ \;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + \left(-4 \cdot \left(x2 \cdot \left(3 + x2 \cdot -2\right)\right) + x1 \cdot \left(\left(2 \cdot \left(3 + x2 \cdot -4\right) - \left(3 \cdot \left(x2 \cdot -2 - 3\right) - \left(x2 \cdot 6 + x2 \cdot 8\right)\right)\right) - 6\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 5 \cdot 10^{+97}:\\ \;\;\;\;x1 + \left(\left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(\left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(\left(x1 \cdot x1\right) \cdot \left(6 - \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} \cdot 4\right) + \left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(\frac{1}{x1} - 3\right)\right)\right) \cdot \left(-1 - x1 \cdot x1\right)\right)\right)\right) + 3 \cdot \left(x2 \cdot -2\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 - x1 \cdot \left(2 + \left(x1 \cdot \left(3 \cdot \left(x2 \cdot -2 - 3\right) - x1 \cdot 3\right) + 4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 97.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 \cdot x1 + 1\\ t_1 := x1 \cdot \left(x1 \cdot 3\right)\\ t_2 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_0}\\ \mathbf{if}\;x1 \leq -5.5 \cdot 10^{+102} \lor \neg \left(x1 \leq 2.1 \cdot 10^{+54}\right):\\ \;\;\;\;6 \cdot {x1}^{4}\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{x1 - \left(t\_1 - 2 \cdot x2\right)}{-1 - x1 \cdot x1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_0 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_2 \cdot 4 - 6\right)\right) + 3 \cdot t\_1\right)\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (+ (* x1 x1) 1.0))
        (t_1 (* x1 (* x1 3.0)))
        (t_2 (/ (- (+ t_1 (* 2.0 x2)) x1) t_0)))
   (if (or (<= x1 -5.5e+102) (not (<= x1 2.1e+54)))
     (* 6.0 (pow x1 4.0))
     (+
      x1
      (+
       (* 3.0 (/ (- x1 (- t_1 (* 2.0 x2))) (- -1.0 (* x1 x1))))
       (+
        x1
        (+
         (* x1 (* x1 x1))
         (+
          (*
           t_0
           (+
            (* (* (* x1 2.0) t_2) (- t_2 3.0))
            (* (* x1 x1) (- (* t_2 4.0) 6.0))))
          (* 3.0 t_1)))))))))
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) / t_0;
	double tmp;
	if ((x1 <= -5.5e+102) || !(x1 <= 2.1e+54)) {
		tmp = 6.0 * pow(x1, 4.0);
	} else {
		tmp = x1 + ((3.0 * ((x1 - (t_1 - (2.0 * x2))) / (-1.0 - (x1 * x1)))) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_1)))));
	}
	return tmp;
}
real(8) function code(x1, x2)
    real(8), intent (in) :: x1
    real(8), intent (in) :: x2
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_0 = (x1 * x1) + 1.0d0
    t_1 = x1 * (x1 * 3.0d0)
    t_2 = ((t_1 + (2.0d0 * x2)) - x1) / t_0
    if ((x1 <= (-5.5d+102)) .or. (.not. (x1 <= 2.1d+54))) then
        tmp = 6.0d0 * (x1 ** 4.0d0)
    else
        tmp = x1 + ((3.0d0 * ((x1 - (t_1 - (2.0d0 * x2))) / ((-1.0d0) - (x1 * x1)))) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * ((((x1 * 2.0d0) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((t_2 * 4.0d0) - 6.0d0)))) + (3.0d0 * t_1)))))
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double t_0 = (x1 * x1) + 1.0;
	double t_1 = x1 * (x1 * 3.0);
	double t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0;
	double tmp;
	if ((x1 <= -5.5e+102) || !(x1 <= 2.1e+54)) {
		tmp = 6.0 * Math.pow(x1, 4.0);
	} else {
		tmp = x1 + ((3.0 * ((x1 - (t_1 - (2.0 * x2))) / (-1.0 - (x1 * x1)))) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_1)))));
	}
	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_0
	tmp = 0
	if (x1 <= -5.5e+102) or not (x1 <= 2.1e+54):
		tmp = 6.0 * math.pow(x1, 4.0)
	else:
		tmp = x1 + ((3.0 * ((x1 - (t_1 - (2.0 * x2))) / (-1.0 - (x1 * x1)))) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_1)))))
	return tmp
function code(x1, x2)
	t_0 = Float64(Float64(x1 * x1) + 1.0)
	t_1 = Float64(x1 * Float64(x1 * 3.0))
	t_2 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_0)
	tmp = 0.0
	if ((x1 <= -5.5e+102) || !(x1 <= 2.1e+54))
		tmp = Float64(6.0 * (x1 ^ 4.0));
	else
		tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(x1 - Float64(t_1 - Float64(2.0 * x2))) / Float64(-1.0 - Float64(x1 * x1)))) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_0 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(3.0 * t_1))))));
	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_0;
	tmp = 0.0;
	if ((x1 <= -5.5e+102) || ~((x1 <= 2.1e+54)))
		tmp = 6.0 * (x1 ^ 4.0);
	else
		tmp = x1 + ((3.0 * ((x1 - (t_1 - (2.0 * x2))) / (-1.0 - (x1 * x1)))) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_1)))));
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, If[Or[LessEqual[x1, -5.5e+102], N[Not[LessEqual[x1, 2.1e+54]], $MachinePrecision]], N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(3.0 * N[(N[(x1 - N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$0 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_0}\\
\mathbf{if}\;x1 \leq -5.5 \cdot 10^{+102} \lor \neg \left(x1 \leq 2.1 \cdot 10^{+54}\right):\\
\;\;\;\;6 \cdot {x1}^{4}\\

\mathbf{else}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{x1 - \left(t\_1 - 2 \cdot x2\right)}{-1 - x1 \cdot x1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_0 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_2 \cdot 4 - 6\right)\right) + 3 \cdot t\_1\right)\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x1 < -5.49999999999999981e102 or 2.09999999999999986e54 < x1

    1. Initial program 13.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. Simplified13.4%

      \[\leadsto \color{blue}{x1 + \mathsf{fma}\left(3, \frac{3 \cdot \left(x1 \cdot x1\right) - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, x1 + \mathsf{fma}\left(\mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, x1 \cdot \mathsf{fma}\left(\frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}, 4, -6\right), \left(x1 \cdot \left(2 \cdot \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\right)\right) \cdot \left(\frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)} + -3\right)\right), \mathsf{fma}\left(3 \cdot \left(x1 \cdot x1\right), \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}, {x1}^{3}\right)\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in x1 around inf 100.0%

      \[\leadsto \color{blue}{6 \cdot {x1}^{4}} \]

    if -5.49999999999999981e102 < x1 < 2.09999999999999986e54

    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 inf 97.9%

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

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

Alternative 8: 83.3% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 2 \cdot \left(3 + x2 \cdot -4\right)\\ t_1 := x2 \cdot \left(3 - 2 \cdot x2\right)\\ t_2 := x1 \cdot \left(x1 \cdot 3\right)\\ t_3 := \frac{\left(t\_2 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\\ t_4 := 3 \cdot \left(x2 \cdot -2 - 3\right)\\ t_5 := 3 + x2 \cdot -2\\ t_6 := x2 \cdot t\_5\\ t_7 := -4 \cdot t\_6\\ t_8 := -1 - x1 \cdot x1\\ t_9 := x1 + \left(3 \cdot \frac{x1 - \left(t\_2 - 2 \cdot x2\right)}{t\_8} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot t\_2 + \left(\left(x1 \cdot x1\right) \cdot \left(6 - t\_3 \cdot 4\right) + \left(t\_3 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(\frac{1}{x1} - 3\right)\right)\right) \cdot t\_8\right)\right)\right)\right)\\ \mathbf{if}\;x1 \leq -5.7 \cdot 10^{+102}:\\ \;\;\;\;x2 \cdot -6 - x1 \cdot \left(\left(x1 \cdot \left(6 + \left(\left(t\_4 - \left(x2 \cdot 6 + \left(x2 \cdot 8 + x1 \cdot \left(\left(t\_7 + 2 \cdot \left(\left(1 + \left(-3 \cdot t\_5 + 2 \cdot t\_1\right)\right) - -2 \cdot t\_6\right)\right) - 3\right)\right)\right)\right) - t\_0\right)\right) - t\_7\right) - -1\right)\\ \mathbf{elif}\;x1 \leq -7.4 \cdot 10^{+31}:\\ \;\;\;\;t\_9\\ \mathbf{elif}\;x1 \leq 7.5 \cdot 10^{+28}:\\ \;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + \left(t\_7 + x1 \cdot \left(\left(t\_0 - \left(t\_4 - \left(x2 \cdot 6 + x2 \cdot 8\right)\right)\right) - 6\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 5 \cdot 10^{+97}:\\ \;\;\;\;t\_9\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 - x1 \cdot \left(2 + \left(x1 \cdot \left(t\_4 - x1 \cdot 3\right) + 4 \cdot t\_1\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (* 2.0 (+ 3.0 (* x2 -4.0))))
        (t_1 (* x2 (- 3.0 (* 2.0 x2))))
        (t_2 (* x1 (* x1 3.0)))
        (t_3 (/ (- (+ t_2 (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)))
        (t_4 (* 3.0 (- (* x2 -2.0) 3.0)))
        (t_5 (+ 3.0 (* x2 -2.0)))
        (t_6 (* x2 t_5))
        (t_7 (* -4.0 t_6))
        (t_8 (- -1.0 (* x1 x1)))
        (t_9
         (+
          x1
          (+
           (* 3.0 (/ (- x1 (- t_2 (* 2.0 x2))) t_8))
           (+
            x1
            (+
             (* x1 (* x1 x1))
             (+
              (* 3.0 t_2)
              (*
               (+
                (* (* x1 x1) (- 6.0 (* t_3 4.0)))
                (* (- t_3 3.0) (* (* x1 2.0) (- (/ 1.0 x1) 3.0))))
               t_8))))))))
   (if (<= x1 -5.7e+102)
     (-
      (* x2 -6.0)
      (*
       x1
       (-
        (-
         (*
          x1
          (+
           6.0
           (-
            (-
             t_4
             (+
              (* x2 6.0)
              (+
               (* x2 8.0)
               (*
                x1
                (-
                 (+
                  t_7
                  (*
                   2.0
                   (- (+ 1.0 (+ (* -3.0 t_5) (* 2.0 t_1))) (* -2.0 t_6))))
                 3.0)))))
            t_0)))
         t_7)
        -1.0)))
     (if (<= x1 -7.4e+31)
       t_9
       (if (<= x1 7.5e+28)
         (+
          (* x2 -6.0)
          (*
           x1
           (+
            -1.0
            (+ t_7 (* x1 (- (- t_0 (- t_4 (+ (* x2 6.0) (* x2 8.0)))) 6.0))))))
         (if (<= x1 5e+97)
           t_9
           (+
            x1
            (-
             (* x2 -6.0)
             (* x1 (+ 2.0 (+ (* x1 (- t_4 (* x1 3.0))) (* 4.0 t_1))))))))))))
double code(double x1, double x2) {
	double t_0 = 2.0 * (3.0 + (x2 * -4.0));
	double t_1 = x2 * (3.0 - (2.0 * x2));
	double t_2 = x1 * (x1 * 3.0);
	double t_3 = ((t_2 + (2.0 * x2)) - x1) / ((x1 * x1) + 1.0);
	double t_4 = 3.0 * ((x2 * -2.0) - 3.0);
	double t_5 = 3.0 + (x2 * -2.0);
	double t_6 = x2 * t_5;
	double t_7 = -4.0 * t_6;
	double t_8 = -1.0 - (x1 * x1);
	double t_9 = x1 + ((3.0 * ((x1 - (t_2 - (2.0 * x2))) / t_8)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_2) + ((((x1 * x1) * (6.0 - (t_3 * 4.0))) + ((t_3 - 3.0) * ((x1 * 2.0) * ((1.0 / x1) - 3.0)))) * t_8)))));
	double tmp;
	if (x1 <= -5.7e+102) {
		tmp = (x2 * -6.0) - (x1 * (((x1 * (6.0 + ((t_4 - ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_7 + (2.0 * ((1.0 + ((-3.0 * t_5) + (2.0 * t_1))) - (-2.0 * t_6)))) - 3.0))))) - t_0))) - t_7) - -1.0));
	} else if (x1 <= -7.4e+31) {
		tmp = t_9;
	} else if (x1 <= 7.5e+28) {
		tmp = (x2 * -6.0) + (x1 * (-1.0 + (t_7 + (x1 * ((t_0 - (t_4 - ((x2 * 6.0) + (x2 * 8.0)))) - 6.0)))));
	} else if (x1 <= 5e+97) {
		tmp = t_9;
	} else {
		tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 + ((x1 * (t_4 - (x1 * 3.0))) + (4.0 * t_1)))));
	}
	return tmp;
}
real(8) function code(x1, x2)
    real(8), intent (in) :: x1
    real(8), intent (in) :: x2
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: t_4
    real(8) :: t_5
    real(8) :: t_6
    real(8) :: t_7
    real(8) :: t_8
    real(8) :: t_9
    real(8) :: tmp
    t_0 = 2.0d0 * (3.0d0 + (x2 * (-4.0d0)))
    t_1 = x2 * (3.0d0 - (2.0d0 * x2))
    t_2 = x1 * (x1 * 3.0d0)
    t_3 = ((t_2 + (2.0d0 * x2)) - x1) / ((x1 * x1) + 1.0d0)
    t_4 = 3.0d0 * ((x2 * (-2.0d0)) - 3.0d0)
    t_5 = 3.0d0 + (x2 * (-2.0d0))
    t_6 = x2 * t_5
    t_7 = (-4.0d0) * t_6
    t_8 = (-1.0d0) - (x1 * x1)
    t_9 = x1 + ((3.0d0 * ((x1 - (t_2 - (2.0d0 * x2))) / t_8)) + (x1 + ((x1 * (x1 * x1)) + ((3.0d0 * t_2) + ((((x1 * x1) * (6.0d0 - (t_3 * 4.0d0))) + ((t_3 - 3.0d0) * ((x1 * 2.0d0) * ((1.0d0 / x1) - 3.0d0)))) * t_8)))))
    if (x1 <= (-5.7d+102)) then
        tmp = (x2 * (-6.0d0)) - (x1 * (((x1 * (6.0d0 + ((t_4 - ((x2 * 6.0d0) + ((x2 * 8.0d0) + (x1 * ((t_7 + (2.0d0 * ((1.0d0 + (((-3.0d0) * t_5) + (2.0d0 * t_1))) - ((-2.0d0) * t_6)))) - 3.0d0))))) - t_0))) - t_7) - (-1.0d0)))
    else if (x1 <= (-7.4d+31)) then
        tmp = t_9
    else if (x1 <= 7.5d+28) then
        tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (t_7 + (x1 * ((t_0 - (t_4 - ((x2 * 6.0d0) + (x2 * 8.0d0)))) - 6.0d0)))))
    else if (x1 <= 5d+97) then
        tmp = t_9
    else
        tmp = x1 + ((x2 * (-6.0d0)) - (x1 * (2.0d0 + ((x1 * (t_4 - (x1 * 3.0d0))) + (4.0d0 * t_1)))))
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double t_0 = 2.0 * (3.0 + (x2 * -4.0));
	double t_1 = x2 * (3.0 - (2.0 * x2));
	double t_2 = x1 * (x1 * 3.0);
	double t_3 = ((t_2 + (2.0 * x2)) - x1) / ((x1 * x1) + 1.0);
	double t_4 = 3.0 * ((x2 * -2.0) - 3.0);
	double t_5 = 3.0 + (x2 * -2.0);
	double t_6 = x2 * t_5;
	double t_7 = -4.0 * t_6;
	double t_8 = -1.0 - (x1 * x1);
	double t_9 = x1 + ((3.0 * ((x1 - (t_2 - (2.0 * x2))) / t_8)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_2) + ((((x1 * x1) * (6.0 - (t_3 * 4.0))) + ((t_3 - 3.0) * ((x1 * 2.0) * ((1.0 / x1) - 3.0)))) * t_8)))));
	double tmp;
	if (x1 <= -5.7e+102) {
		tmp = (x2 * -6.0) - (x1 * (((x1 * (6.0 + ((t_4 - ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_7 + (2.0 * ((1.0 + ((-3.0 * t_5) + (2.0 * t_1))) - (-2.0 * t_6)))) - 3.0))))) - t_0))) - t_7) - -1.0));
	} else if (x1 <= -7.4e+31) {
		tmp = t_9;
	} else if (x1 <= 7.5e+28) {
		tmp = (x2 * -6.0) + (x1 * (-1.0 + (t_7 + (x1 * ((t_0 - (t_4 - ((x2 * 6.0) + (x2 * 8.0)))) - 6.0)))));
	} else if (x1 <= 5e+97) {
		tmp = t_9;
	} else {
		tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 + ((x1 * (t_4 - (x1 * 3.0))) + (4.0 * t_1)))));
	}
	return tmp;
}
def code(x1, x2):
	t_0 = 2.0 * (3.0 + (x2 * -4.0))
	t_1 = x2 * (3.0 - (2.0 * x2))
	t_2 = x1 * (x1 * 3.0)
	t_3 = ((t_2 + (2.0 * x2)) - x1) / ((x1 * x1) + 1.0)
	t_4 = 3.0 * ((x2 * -2.0) - 3.0)
	t_5 = 3.0 + (x2 * -2.0)
	t_6 = x2 * t_5
	t_7 = -4.0 * t_6
	t_8 = -1.0 - (x1 * x1)
	t_9 = x1 + ((3.0 * ((x1 - (t_2 - (2.0 * x2))) / t_8)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_2) + ((((x1 * x1) * (6.0 - (t_3 * 4.0))) + ((t_3 - 3.0) * ((x1 * 2.0) * ((1.0 / x1) - 3.0)))) * t_8)))))
	tmp = 0
	if x1 <= -5.7e+102:
		tmp = (x2 * -6.0) - (x1 * (((x1 * (6.0 + ((t_4 - ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_7 + (2.0 * ((1.0 + ((-3.0 * t_5) + (2.0 * t_1))) - (-2.0 * t_6)))) - 3.0))))) - t_0))) - t_7) - -1.0))
	elif x1 <= -7.4e+31:
		tmp = t_9
	elif x1 <= 7.5e+28:
		tmp = (x2 * -6.0) + (x1 * (-1.0 + (t_7 + (x1 * ((t_0 - (t_4 - ((x2 * 6.0) + (x2 * 8.0)))) - 6.0)))))
	elif x1 <= 5e+97:
		tmp = t_9
	else:
		tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 + ((x1 * (t_4 - (x1 * 3.0))) + (4.0 * t_1)))))
	return tmp
function code(x1, x2)
	t_0 = Float64(2.0 * Float64(3.0 + Float64(x2 * -4.0)))
	t_1 = Float64(x2 * Float64(3.0 - Float64(2.0 * x2)))
	t_2 = Float64(x1 * Float64(x1 * 3.0))
	t_3 = Float64(Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) / Float64(Float64(x1 * x1) + 1.0))
	t_4 = Float64(3.0 * Float64(Float64(x2 * -2.0) - 3.0))
	t_5 = Float64(3.0 + Float64(x2 * -2.0))
	t_6 = Float64(x2 * t_5)
	t_7 = Float64(-4.0 * t_6)
	t_8 = Float64(-1.0 - Float64(x1 * x1))
	t_9 = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(x1 - Float64(t_2 - Float64(2.0 * x2))) / t_8)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(3.0 * t_2) + Float64(Float64(Float64(Float64(x1 * x1) * Float64(6.0 - Float64(t_3 * 4.0))) + Float64(Float64(t_3 - 3.0) * Float64(Float64(x1 * 2.0) * Float64(Float64(1.0 / x1) - 3.0)))) * t_8))))))
	tmp = 0.0
	if (x1 <= -5.7e+102)
		tmp = Float64(Float64(x2 * -6.0) - Float64(x1 * Float64(Float64(Float64(x1 * Float64(6.0 + Float64(Float64(t_4 - Float64(Float64(x2 * 6.0) + Float64(Float64(x2 * 8.0) + Float64(x1 * Float64(Float64(t_7 + Float64(2.0 * Float64(Float64(1.0 + Float64(Float64(-3.0 * t_5) + Float64(2.0 * t_1))) - Float64(-2.0 * t_6)))) - 3.0))))) - t_0))) - t_7) - -1.0)));
	elseif (x1 <= -7.4e+31)
		tmp = t_9;
	elseif (x1 <= 7.5e+28)
		tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(t_7 + Float64(x1 * Float64(Float64(t_0 - Float64(t_4 - Float64(Float64(x2 * 6.0) + Float64(x2 * 8.0)))) - 6.0))))));
	elseif (x1 <= 5e+97)
		tmp = t_9;
	else
		tmp = Float64(x1 + Float64(Float64(x2 * -6.0) - Float64(x1 * Float64(2.0 + Float64(Float64(x1 * Float64(t_4 - Float64(x1 * 3.0))) + Float64(4.0 * t_1))))));
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	t_0 = 2.0 * (3.0 + (x2 * -4.0));
	t_1 = x2 * (3.0 - (2.0 * x2));
	t_2 = x1 * (x1 * 3.0);
	t_3 = ((t_2 + (2.0 * x2)) - x1) / ((x1 * x1) + 1.0);
	t_4 = 3.0 * ((x2 * -2.0) - 3.0);
	t_5 = 3.0 + (x2 * -2.0);
	t_6 = x2 * t_5;
	t_7 = -4.0 * t_6;
	t_8 = -1.0 - (x1 * x1);
	t_9 = x1 + ((3.0 * ((x1 - (t_2 - (2.0 * x2))) / t_8)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_2) + ((((x1 * x1) * (6.0 - (t_3 * 4.0))) + ((t_3 - 3.0) * ((x1 * 2.0) * ((1.0 / x1) - 3.0)))) * t_8)))));
	tmp = 0.0;
	if (x1 <= -5.7e+102)
		tmp = (x2 * -6.0) - (x1 * (((x1 * (6.0 + ((t_4 - ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_7 + (2.0 * ((1.0 + ((-3.0 * t_5) + (2.0 * t_1))) - (-2.0 * t_6)))) - 3.0))))) - t_0))) - t_7) - -1.0));
	elseif (x1 <= -7.4e+31)
		tmp = t_9;
	elseif (x1 <= 7.5e+28)
		tmp = (x2 * -6.0) + (x1 * (-1.0 + (t_7 + (x1 * ((t_0 - (t_4 - ((x2 * 6.0) + (x2 * 8.0)))) - 6.0)))));
	elseif (x1 <= 5e+97)
		tmp = t_9;
	else
		tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 + ((x1 * (t_4 - (x1 * 3.0))) + (4.0 * t_1)))));
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := Block[{t$95$0 = N[(2.0 * N[(3.0 + N[(x2 * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(3.0 + N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(x2 * t$95$5), $MachinePrecision]}, Block[{t$95$7 = N[(-4.0 * t$95$6), $MachinePrecision]}, Block[{t$95$8 = N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$9 = N[(x1 + N[(N[(3.0 * N[(N[(x1 - N[(t$95$2 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$8), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 * t$95$2), $MachinePrecision] + N[(N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 - N[(t$95$3 * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$3 - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(1.0 / x1), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$8), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.7e+102], N[(N[(x2 * -6.0), $MachinePrecision] - N[(x1 * N[(N[(N[(x1 * N[(6.0 + N[(N[(t$95$4 - N[(N[(x2 * 6.0), $MachinePrecision] + N[(N[(x2 * 8.0), $MachinePrecision] + N[(x1 * N[(N[(t$95$7 + N[(2.0 * N[(N[(1.0 + N[(N[(-3.0 * t$95$5), $MachinePrecision] + N[(2.0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(-2.0 * t$95$6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$7), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -7.4e+31], t$95$9, If[LessEqual[x1, 7.5e+28], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(t$95$7 + N[(x1 * N[(N[(t$95$0 - N[(t$95$4 - N[(N[(x2 * 6.0), $MachinePrecision] + N[(x2 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5e+97], t$95$9, N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] - N[(x1 * N[(2.0 + N[(N[(x1 * N[(t$95$4 - N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(4.0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 2 \cdot \left(3 + x2 \cdot -4\right)\\
t_1 := x2 \cdot \left(3 - 2 \cdot x2\right)\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := \frac{\left(t\_2 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\\
t_4 := 3 \cdot \left(x2 \cdot -2 - 3\right)\\
t_5 := 3 + x2 \cdot -2\\
t_6 := x2 \cdot t\_5\\
t_7 := -4 \cdot t\_6\\
t_8 := -1 - x1 \cdot x1\\
t_9 := x1 + \left(3 \cdot \frac{x1 - \left(t\_2 - 2 \cdot x2\right)}{t\_8} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot t\_2 + \left(\left(x1 \cdot x1\right) \cdot \left(6 - t\_3 \cdot 4\right) + \left(t\_3 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(\frac{1}{x1} - 3\right)\right)\right) \cdot t\_8\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -5.7 \cdot 10^{+102}:\\
\;\;\;\;x2 \cdot -6 - x1 \cdot \left(\left(x1 \cdot \left(6 + \left(\left(t\_4 - \left(x2 \cdot 6 + \left(x2 \cdot 8 + x1 \cdot \left(\left(t\_7 + 2 \cdot \left(\left(1 + \left(-3 \cdot t\_5 + 2 \cdot t\_1\right)\right) - -2 \cdot t\_6\right)\right) - 3\right)\right)\right)\right) - t\_0\right)\right) - t\_7\right) - -1\right)\\

\mathbf{elif}\;x1 \leq -7.4 \cdot 10^{+31}:\\
\;\;\;\;t\_9\\

\mathbf{elif}\;x1 \leq 7.5 \cdot 10^{+28}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + \left(t\_7 + x1 \cdot \left(\left(t\_0 - \left(t\_4 - \left(x2 \cdot 6 + x2 \cdot 8\right)\right)\right) - 6\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 5 \cdot 10^{+97}:\\
\;\;\;\;t\_9\\

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


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

    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. Simplified22.0%

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

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

    if -5.6999999999999999e102 < x1 < -7.3999999999999996e31 or 7.4999999999999998e28 < x1 < 4.99999999999999999e97

    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 inf 91.7%

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

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

    if -7.3999999999999996e31 < x1 < 7.4999999999999998e28

    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. Simplified88.6%

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

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

    if 4.99999999999999999e97 < x1

    1. Initial program 14.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. Simplified14.3%

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

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

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

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

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

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

      \[\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(3 \cdot x1 + 3 \cdot \left(3 - -2 \cdot x2\right)\right)\right) - 2\right)\right)} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification83.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -5.7 \cdot 10^{+102}:\\ \;\;\;\;x2 \cdot -6 - x1 \cdot \left(\left(x1 \cdot \left(6 + \left(\left(3 \cdot \left(x2 \cdot -2 - 3\right) - \left(x2 \cdot 6 + \left(x2 \cdot 8 + x1 \cdot \left(\left(-4 \cdot \left(x2 \cdot \left(3 + x2 \cdot -2\right)\right) + 2 \cdot \left(\left(1 + \left(-3 \cdot \left(3 + x2 \cdot -2\right) + 2 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right)\right) - -2 \cdot \left(x2 \cdot \left(3 + x2 \cdot -2\right)\right)\right)\right) - 3\right)\right)\right)\right) - 2 \cdot \left(3 + x2 \cdot -4\right)\right)\right) - -4 \cdot \left(x2 \cdot \left(3 + x2 \cdot -2\right)\right)\right) - -1\right)\\ \mathbf{elif}\;x1 \leq -7.4 \cdot 10^{+31}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{x1 - \left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right)}{-1 - x1 \cdot x1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot \left(x1 \cdot \left(x1 \cdot 3\right)\right) + \left(\left(x1 \cdot x1\right) \cdot \left(6 - \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} \cdot 4\right) + \left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(\frac{1}{x1} - 3\right)\right)\right) \cdot \left(-1 - x1 \cdot x1\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 7.5 \cdot 10^{+28}:\\ \;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + \left(-4 \cdot \left(x2 \cdot \left(3 + x2 \cdot -2\right)\right) + x1 \cdot \left(\left(2 \cdot \left(3 + x2 \cdot -4\right) - \left(3 \cdot \left(x2 \cdot -2 - 3\right) - \left(x2 \cdot 6 + x2 \cdot 8\right)\right)\right) - 6\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 5 \cdot 10^{+97}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{x1 - \left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right)}{-1 - x1 \cdot x1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot \left(x1 \cdot \left(x1 \cdot 3\right)\right) + \left(\left(x1 \cdot x1\right) \cdot \left(6 - \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} \cdot 4\right) + \left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(\frac{1}{x1} - 3\right)\right)\right) \cdot \left(-1 - x1 \cdot x1\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 - x1 \cdot \left(2 + \left(x1 \cdot \left(3 \cdot \left(x2 \cdot -2 - 3\right) - x1 \cdot 3\right) + 4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 96.2% accurate, 1.1× speedup?

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

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

\mathbf{elif}\;x1 \leq 7 \cdot 10^{+44}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_0 \cdot t\_2 + t\_1 \cdot \left(\left(x1 \cdot x1\right) \cdot 6 - \left(\left(x1 \cdot 2\right) \cdot t\_2\right) \cdot \left(3 - t\_2\right)\right)\right)\right)\right)\right)\\

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


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

    1. Initial program 22.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. Simplified22.5%

      \[\leadsto \color{blue}{x1 + \mathsf{fma}\left(3, \frac{3 \cdot \left(x1 \cdot x1\right) - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, x1 + \mathsf{fma}\left(\mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, x1 \cdot \mathsf{fma}\left(\frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}, 4, -6\right), \left(x1 \cdot \left(2 \cdot \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\right)\right) \cdot \left(\frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)} + -3\right)\right), \mathsf{fma}\left(3 \cdot \left(x1 \cdot x1\right), \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}, {x1}^{3}\right)\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in x1 around inf 98.1%

      \[\leadsto \color{blue}{6 \cdot {x1}^{4}} \]

    if -7.99999999999999977e59 < x1 < 6.9999999999999998e44

    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 inf 95.1%

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

    if 6.9999999999999998e44 < x1

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

      \[\leadsto \color{blue}{x1 + \mathsf{fma}\left(3, \frac{3 \cdot \left(x1 \cdot x1\right) - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, x1 + \mathsf{fma}\left(\mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, x1 \cdot \mathsf{fma}\left(\frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}, 4, -6\right), \left(x1 \cdot \left(2 \cdot \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\right)\right) \cdot \left(\frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)} + -3\right)\right), \mathsf{fma}\left(3 \cdot \left(x1 \cdot x1\right), \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}, {x1}^{3}\right)\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in x1 around inf 97.7%

      \[\leadsto \color{blue}{{x1}^{4} \cdot \left(6 - 3 \cdot \frac{1}{x1}\right)} \]
    5. Step-by-step derivation
      1. associate-*r/97.7%

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

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

      \[\leadsto \color{blue}{{x1}^{4} \cdot \left(6 - \frac{3}{x1}\right)} \]
    7. Taylor expanded in x1 around 0 97.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -8 \cdot 10^{+59}:\\ \;\;\;\;6 \cdot {x1}^{4}\\ \mathbf{elif}\;x1 \leq 7 \cdot 10^{+44}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(\left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 \cdot x1 + 1\right) \cdot \left(\left(x1 \cdot x1\right) \cdot 6 - \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}{x1 \cdot x1 + 1}\right)\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;{x1}^{3} \cdot \left(x1 \cdot 6 - 3\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 94.4% accurate, 1.1× speedup?

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

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

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

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


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

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

      \[\leadsto \color{blue}{x1 + \mathsf{fma}\left(3, \frac{3 \cdot \left(x1 \cdot x1\right) - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, x1 + \mathsf{fma}\left(\mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, x1 \cdot \mathsf{fma}\left(\frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}, 4, -6\right), \left(x1 \cdot \left(2 \cdot \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\right)\right) \cdot \left(\frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)} + -3\right)\right), \mathsf{fma}\left(3 \cdot \left(x1 \cdot x1\right), \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}, {x1}^{3}\right)\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in x1 around inf 98.1%

      \[\leadsto \color{blue}{6 \cdot {x1}^{4}} \]

    if -1.34999999999999996e51 < x1 < 2.99999999999999987e44

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

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

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

    if 2.99999999999999987e44 < x1

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

      \[\leadsto \color{blue}{x1 + \mathsf{fma}\left(3, \frac{3 \cdot \left(x1 \cdot x1\right) - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, x1 + \mathsf{fma}\left(\mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, x1 \cdot \mathsf{fma}\left(\frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}, 4, -6\right), \left(x1 \cdot \left(2 \cdot \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\right)\right) \cdot \left(\frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)} + -3\right)\right), \mathsf{fma}\left(3 \cdot \left(x1 \cdot x1\right), \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}, {x1}^{3}\right)\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in x1 around inf 97.7%

      \[\leadsto \color{blue}{{x1}^{4} \cdot \left(6 - 3 \cdot \frac{1}{x1}\right)} \]
    5. Step-by-step derivation
      1. associate-*r/97.7%

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

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

      \[\leadsto \color{blue}{{x1}^{4} \cdot \left(6 - \frac{3}{x1}\right)} \]
    7. Taylor expanded in x1 around 0 97.7%

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

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

Alternative 11: 94.4% accurate, 1.1× speedup?

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

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

\mathbf{elif}\;x1 \leq 6.5 \cdot 10^{+42}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{x1 - \left(t\_0 - 2 \cdot x2\right)}{-1 - x1 \cdot x1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_0 \cdot t\_2 + t\_1 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(t\_2 \cdot 4 - 6\right) + \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2\right)\right) \cdot \left(\left(2 \cdot x2 - x1\right) - 3\right)\right)\right)\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;{x1}^{3} \cdot \left(x1 \cdot 6\right)\\


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

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

      \[\leadsto \color{blue}{x1 + \mathsf{fma}\left(3, \frac{3 \cdot \left(x1 \cdot x1\right) - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, x1 + \mathsf{fma}\left(\mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, x1 \cdot \mathsf{fma}\left(\frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}, 4, -6\right), \left(x1 \cdot \left(2 \cdot \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\right)\right) \cdot \left(\frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)} + -3\right)\right), \mathsf{fma}\left(3 \cdot \left(x1 \cdot x1\right), \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}, {x1}^{3}\right)\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in x1 around inf 98.1%

      \[\leadsto \color{blue}{6 \cdot {x1}^{4}} \]

    if -2.30000000000000002e49 < x1 < 6.50000000000000052e42

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

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

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

    if 6.50000000000000052e42 < x1

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

      \[\leadsto \color{blue}{x1 + \mathsf{fma}\left(3, \frac{3 \cdot \left(x1 \cdot x1\right) - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, x1 + \mathsf{fma}\left(\mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, x1 \cdot \mathsf{fma}\left(\frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}, 4, -6\right), \left(x1 \cdot \left(2 \cdot \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\right)\right) \cdot \left(\frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)} + -3\right)\right), \mathsf{fma}\left(3 \cdot \left(x1 \cdot x1\right), \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}, {x1}^{3}\right)\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in x1 around inf 97.7%

      \[\leadsto \color{blue}{{x1}^{4} \cdot \left(6 - 3 \cdot \frac{1}{x1}\right)} \]
    5. Step-by-step derivation
      1. associate-*r/97.7%

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

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

      \[\leadsto \color{blue}{{x1}^{4} \cdot \left(6 - \frac{3}{x1}\right)} \]
    7. Taylor expanded in x1 around 0 97.7%

      \[\leadsto \color{blue}{{x1}^{3} \cdot \left(6 \cdot x1 - 3\right)} \]
    8. Taylor expanded in x1 around inf 97.7%

      \[\leadsto {x1}^{3} \cdot \color{blue}{\left(6 \cdot x1\right)} \]
    9. Step-by-step derivation
      1. *-commutative97.7%

        \[\leadsto {x1}^{3} \cdot \color{blue}{\left(x1 \cdot 6\right)} \]
    10. Simplified97.7%

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

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

Alternative 12: 94.5% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 \cdot \left(x1 \cdot 3\right)\\ t_1 := x1 \cdot x1 + 1\\ t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\ \mathbf{if}\;x1 \leq -3.1 \cdot 10^{+50} \lor \neg \left(x1 \leq 2.8 \cdot 10^{+53}\right):\\ \;\;\;\;6 \cdot {x1}^{4}\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{x1 - \left(t\_0 - 2 \cdot x2\right)}{-1 - x1 \cdot x1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_0 \cdot t\_2 + t\_1 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(t\_2 \cdot 4 - 6\right) + \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2\right)\right) \cdot \left(\left(2 \cdot x2 - x1\right) - 3\right)\right)\right)\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (* x1 (* x1 3.0)))
        (t_1 (+ (* x1 x1) 1.0))
        (t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
   (if (or (<= x1 -3.1e+50) (not (<= x1 2.8e+53)))
     (* 6.0 (pow x1 4.0))
     (+
      x1
      (+
       (* 3.0 (/ (- x1 (- t_0 (* 2.0 x2))) (- -1.0 (* x1 x1))))
       (+
        x1
        (+
         (* x1 (* x1 x1))
         (+
          (* t_0 t_2)
          (*
           t_1
           (+
            (* (* x1 x1) (- (* t_2 4.0) 6.0))
            (* (* (* x1 2.0) (* 2.0 x2)) (- (- (* 2.0 x2) x1) 3.0))))))))))))
double code(double x1, double x2) {
	double t_0 = x1 * (x1 * 3.0);
	double t_1 = (x1 * x1) + 1.0;
	double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
	double tmp;
	if ((x1 <= -3.1e+50) || !(x1 <= 2.8e+53)) {
		tmp = 6.0 * pow(x1, 4.0);
	} else {
		tmp = x1 + ((3.0 * ((x1 - (t_0 - (2.0 * x2))) / (-1.0 - (x1 * x1)))) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((x1 * x1) * ((t_2 * 4.0) - 6.0)) + (((x1 * 2.0) * (2.0 * x2)) * (((2.0 * x2) - x1) - 3.0))))))));
	}
	return tmp;
}
real(8) function code(x1, x2)
    real(8), intent (in) :: x1
    real(8), intent (in) :: x2
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_0 = x1 * (x1 * 3.0d0)
    t_1 = (x1 * x1) + 1.0d0
    t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
    if ((x1 <= (-3.1d+50)) .or. (.not. (x1 <= 2.8d+53))) then
        tmp = 6.0d0 * (x1 ** 4.0d0)
    else
        tmp = x1 + ((3.0d0 * ((x1 - (t_0 - (2.0d0 * x2))) / ((-1.0d0) - (x1 * x1)))) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((x1 * x1) * ((t_2 * 4.0d0) - 6.0d0)) + (((x1 * 2.0d0) * (2.0d0 * x2)) * (((2.0d0 * x2) - x1) - 3.0d0))))))))
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double t_0 = x1 * (x1 * 3.0);
	double t_1 = (x1 * x1) + 1.0;
	double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
	double tmp;
	if ((x1 <= -3.1e+50) || !(x1 <= 2.8e+53)) {
		tmp = 6.0 * Math.pow(x1, 4.0);
	} else {
		tmp = x1 + ((3.0 * ((x1 - (t_0 - (2.0 * x2))) / (-1.0 - (x1 * x1)))) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((x1 * x1) * ((t_2 * 4.0) - 6.0)) + (((x1 * 2.0) * (2.0 * x2)) * (((2.0 * x2) - x1) - 3.0))))))));
	}
	return tmp;
}
def code(x1, x2):
	t_0 = x1 * (x1 * 3.0)
	t_1 = (x1 * x1) + 1.0
	t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1
	tmp = 0
	if (x1 <= -3.1e+50) or not (x1 <= 2.8e+53):
		tmp = 6.0 * math.pow(x1, 4.0)
	else:
		tmp = x1 + ((3.0 * ((x1 - (t_0 - (2.0 * x2))) / (-1.0 - (x1 * x1)))) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((x1 * x1) * ((t_2 * 4.0) - 6.0)) + (((x1 * 2.0) * (2.0 * x2)) * (((2.0 * x2) - x1) - 3.0))))))))
	return tmp
function code(x1, x2)
	t_0 = Float64(x1 * Float64(x1 * 3.0))
	t_1 = Float64(Float64(x1 * x1) + 1.0)
	t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1)
	tmp = 0.0
	if ((x1 <= -3.1e+50) || !(x1 <= 2.8e+53))
		tmp = Float64(6.0 * (x1 ^ 4.0));
	else
		tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(x1 - Float64(t_0 - Float64(2.0 * x2))) / Float64(-1.0 - Float64(x1 * x1)))) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_0 * t_2) + Float64(t_1 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)) + Float64(Float64(Float64(x1 * 2.0) * Float64(2.0 * x2)) * Float64(Float64(Float64(2.0 * x2) - x1) - 3.0)))))))));
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	t_0 = x1 * (x1 * 3.0);
	t_1 = (x1 * x1) + 1.0;
	t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
	tmp = 0.0;
	if ((x1 <= -3.1e+50) || ~((x1 <= 2.8e+53)))
		tmp = 6.0 * (x1 ^ 4.0);
	else
		tmp = x1 + ((3.0 * ((x1 - (t_0 - (2.0 * x2))) / (-1.0 - (x1 * x1)))) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((x1 * x1) * ((t_2 * 4.0) - 6.0)) + (((x1 * 2.0) * (2.0 * x2)) * (((2.0 * x2) - x1) - 3.0))))))));
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[Or[LessEqual[x1, -3.1e+50], N[Not[LessEqual[x1, 2.8e+53]], $MachinePrecision]], N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(3.0 * N[(N[(x1 - N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$0 * t$95$2), $MachinePrecision] + N[(t$95$1 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
\mathbf{if}\;x1 \leq -3.1 \cdot 10^{+50} \lor \neg \left(x1 \leq 2.8 \cdot 10^{+53}\right):\\
\;\;\;\;6 \cdot {x1}^{4}\\

\mathbf{else}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{x1 - \left(t\_0 - 2 \cdot x2\right)}{-1 - x1 \cdot x1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_0 \cdot t\_2 + t\_1 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(t\_2 \cdot 4 - 6\right) + \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2\right)\right) \cdot \left(\left(2 \cdot x2 - x1\right) - 3\right)\right)\right)\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x1 < -3.10000000000000003e50 or 2.8e53 < x1

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

      \[\leadsto \color{blue}{x1 + \mathsf{fma}\left(3, \frac{3 \cdot \left(x1 \cdot x1\right) - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, x1 + \mathsf{fma}\left(\mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, x1 \cdot \mathsf{fma}\left(\frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}, 4, -6\right), \left(x1 \cdot \left(2 \cdot \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\right)\right) \cdot \left(\frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)} + -3\right)\right), \mathsf{fma}\left(3 \cdot \left(x1 \cdot x1\right), \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}, {x1}^{3}\right)\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in x1 around inf 98.9%

      \[\leadsto \color{blue}{6 \cdot {x1}^{4}} \]

    if -3.10000000000000003e50 < x1 < 2.8e53

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

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

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

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

Alternative 13: 88.4% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 \cdot x1 + 1\\ t_1 := x2 \cdot \left(3 - 2 \cdot x2\right)\\ t_2 := x1 \cdot \left(x1 \cdot 3\right)\\ t_3 := \frac{\left(t\_2 + 2 \cdot x2\right) - x1}{t\_0}\\ t_4 := 3 \cdot \left(x2 \cdot -2 - 3\right)\\ t_5 := 3 + x2 \cdot -2\\ t_6 := x2 \cdot t\_5\\ t_7 := -4 \cdot t\_6\\ \mathbf{if}\;x1 \leq -4.6 \cdot 10^{+102}:\\ \;\;\;\;x2 \cdot -6 - x1 \cdot \left(\left(x1 \cdot \left(6 + \left(\left(t\_4 - \left(x2 \cdot 6 + \left(x2 \cdot 8 + x1 \cdot \left(\left(t\_7 + 2 \cdot \left(\left(1 + \left(-3 \cdot t\_5 + 2 \cdot t\_1\right)\right) - -2 \cdot t\_6\right)\right) - 3\right)\right)\right)\right) - 2 \cdot \left(3 + x2 \cdot -4\right)\right)\right) - t\_7\right) - -1\right)\\ \mathbf{elif}\;x1 \leq 5.6 \cdot 10^{+94}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{x1 - \left(t\_2 - 2 \cdot x2\right)}{-1 - x1 \cdot x1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_2 \cdot t\_3 + t\_0 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(t\_3 \cdot 4 - 6\right) + \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2\right)\right) \cdot \left(\left(2 \cdot x2 - x1\right) - 3\right)\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 - x1 \cdot \left(2 + \left(x1 \cdot \left(t\_4 - x1 \cdot 3\right) + 4 \cdot t\_1\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (+ (* x1 x1) 1.0))
        (t_1 (* x2 (- 3.0 (* 2.0 x2))))
        (t_2 (* x1 (* x1 3.0)))
        (t_3 (/ (- (+ t_2 (* 2.0 x2)) x1) t_0))
        (t_4 (* 3.0 (- (* x2 -2.0) 3.0)))
        (t_5 (+ 3.0 (* x2 -2.0)))
        (t_6 (* x2 t_5))
        (t_7 (* -4.0 t_6)))
   (if (<= x1 -4.6e+102)
     (-
      (* x2 -6.0)
      (*
       x1
       (-
        (-
         (*
          x1
          (+
           6.0
           (-
            (-
             t_4
             (+
              (* x2 6.0)
              (+
               (* x2 8.0)
               (*
                x1
                (-
                 (+
                  t_7
                  (*
                   2.0
                   (- (+ 1.0 (+ (* -3.0 t_5) (* 2.0 t_1))) (* -2.0 t_6))))
                 3.0)))))
            (* 2.0 (+ 3.0 (* x2 -4.0))))))
         t_7)
        -1.0)))
     (if (<= x1 5.6e+94)
       (+
        x1
        (+
         (* 3.0 (/ (- x1 (- t_2 (* 2.0 x2))) (- -1.0 (* x1 x1))))
         (+
          x1
          (+
           (* x1 (* x1 x1))
           (+
            (* t_2 t_3)
            (*
             t_0
             (+
              (* (* x1 x1) (- (* t_3 4.0) 6.0))
              (* (* (* x1 2.0) (* 2.0 x2)) (- (- (* 2.0 x2) x1) 3.0)))))))))
       (+
        x1
        (-
         (* x2 -6.0)
         (* x1 (+ 2.0 (+ (* x1 (- t_4 (* x1 3.0))) (* 4.0 t_1))))))))))
double code(double x1, double x2) {
	double t_0 = (x1 * x1) + 1.0;
	double t_1 = x2 * (3.0 - (2.0 * x2));
	double t_2 = x1 * (x1 * 3.0);
	double t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0;
	double t_4 = 3.0 * ((x2 * -2.0) - 3.0);
	double t_5 = 3.0 + (x2 * -2.0);
	double t_6 = x2 * t_5;
	double t_7 = -4.0 * t_6;
	double tmp;
	if (x1 <= -4.6e+102) {
		tmp = (x2 * -6.0) - (x1 * (((x1 * (6.0 + ((t_4 - ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_7 + (2.0 * ((1.0 + ((-3.0 * t_5) + (2.0 * t_1))) - (-2.0 * t_6)))) - 3.0))))) - (2.0 * (3.0 + (x2 * -4.0)))))) - t_7) - -1.0));
	} else if (x1 <= 5.6e+94) {
		tmp = x1 + ((3.0 * ((x1 - (t_2 - (2.0 * x2))) / (-1.0 - (x1 * x1)))) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * t_3) + (t_0 * (((x1 * x1) * ((t_3 * 4.0) - 6.0)) + (((x1 * 2.0) * (2.0 * x2)) * (((2.0 * x2) - x1) - 3.0))))))));
	} else {
		tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 + ((x1 * (t_4 - (x1 * 3.0))) + (4.0 * t_1)))));
	}
	return tmp;
}
real(8) function code(x1, x2)
    real(8), intent (in) :: x1
    real(8), intent (in) :: x2
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: t_4
    real(8) :: t_5
    real(8) :: t_6
    real(8) :: t_7
    real(8) :: tmp
    t_0 = (x1 * x1) + 1.0d0
    t_1 = x2 * (3.0d0 - (2.0d0 * x2))
    t_2 = x1 * (x1 * 3.0d0)
    t_3 = ((t_2 + (2.0d0 * x2)) - x1) / t_0
    t_4 = 3.0d0 * ((x2 * (-2.0d0)) - 3.0d0)
    t_5 = 3.0d0 + (x2 * (-2.0d0))
    t_6 = x2 * t_5
    t_7 = (-4.0d0) * t_6
    if (x1 <= (-4.6d+102)) then
        tmp = (x2 * (-6.0d0)) - (x1 * (((x1 * (6.0d0 + ((t_4 - ((x2 * 6.0d0) + ((x2 * 8.0d0) + (x1 * ((t_7 + (2.0d0 * ((1.0d0 + (((-3.0d0) * t_5) + (2.0d0 * t_1))) - ((-2.0d0) * t_6)))) - 3.0d0))))) - (2.0d0 * (3.0d0 + (x2 * (-4.0d0))))))) - t_7) - (-1.0d0)))
    else if (x1 <= 5.6d+94) then
        tmp = x1 + ((3.0d0 * ((x1 - (t_2 - (2.0d0 * x2))) / ((-1.0d0) - (x1 * x1)))) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * t_3) + (t_0 * (((x1 * x1) * ((t_3 * 4.0d0) - 6.0d0)) + (((x1 * 2.0d0) * (2.0d0 * x2)) * (((2.0d0 * x2) - x1) - 3.0d0))))))))
    else
        tmp = x1 + ((x2 * (-6.0d0)) - (x1 * (2.0d0 + ((x1 * (t_4 - (x1 * 3.0d0))) + (4.0d0 * t_1)))))
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double t_0 = (x1 * x1) + 1.0;
	double t_1 = x2 * (3.0 - (2.0 * x2));
	double t_2 = x1 * (x1 * 3.0);
	double t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0;
	double t_4 = 3.0 * ((x2 * -2.0) - 3.0);
	double t_5 = 3.0 + (x2 * -2.0);
	double t_6 = x2 * t_5;
	double t_7 = -4.0 * t_6;
	double tmp;
	if (x1 <= -4.6e+102) {
		tmp = (x2 * -6.0) - (x1 * (((x1 * (6.0 + ((t_4 - ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_7 + (2.0 * ((1.0 + ((-3.0 * t_5) + (2.0 * t_1))) - (-2.0 * t_6)))) - 3.0))))) - (2.0 * (3.0 + (x2 * -4.0)))))) - t_7) - -1.0));
	} else if (x1 <= 5.6e+94) {
		tmp = x1 + ((3.0 * ((x1 - (t_2 - (2.0 * x2))) / (-1.0 - (x1 * x1)))) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * t_3) + (t_0 * (((x1 * x1) * ((t_3 * 4.0) - 6.0)) + (((x1 * 2.0) * (2.0 * x2)) * (((2.0 * x2) - x1) - 3.0))))))));
	} else {
		tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 + ((x1 * (t_4 - (x1 * 3.0))) + (4.0 * t_1)))));
	}
	return tmp;
}
def code(x1, x2):
	t_0 = (x1 * x1) + 1.0
	t_1 = x2 * (3.0 - (2.0 * x2))
	t_2 = x1 * (x1 * 3.0)
	t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0
	t_4 = 3.0 * ((x2 * -2.0) - 3.0)
	t_5 = 3.0 + (x2 * -2.0)
	t_6 = x2 * t_5
	t_7 = -4.0 * t_6
	tmp = 0
	if x1 <= -4.6e+102:
		tmp = (x2 * -6.0) - (x1 * (((x1 * (6.0 + ((t_4 - ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_7 + (2.0 * ((1.0 + ((-3.0 * t_5) + (2.0 * t_1))) - (-2.0 * t_6)))) - 3.0))))) - (2.0 * (3.0 + (x2 * -4.0)))))) - t_7) - -1.0))
	elif x1 <= 5.6e+94:
		tmp = x1 + ((3.0 * ((x1 - (t_2 - (2.0 * x2))) / (-1.0 - (x1 * x1)))) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * t_3) + (t_0 * (((x1 * x1) * ((t_3 * 4.0) - 6.0)) + (((x1 * 2.0) * (2.0 * x2)) * (((2.0 * x2) - x1) - 3.0))))))))
	else:
		tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 + ((x1 * (t_4 - (x1 * 3.0))) + (4.0 * t_1)))))
	return tmp
function code(x1, x2)
	t_0 = Float64(Float64(x1 * x1) + 1.0)
	t_1 = Float64(x2 * Float64(3.0 - Float64(2.0 * x2)))
	t_2 = Float64(x1 * Float64(x1 * 3.0))
	t_3 = Float64(Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) / t_0)
	t_4 = Float64(3.0 * Float64(Float64(x2 * -2.0) - 3.0))
	t_5 = Float64(3.0 + Float64(x2 * -2.0))
	t_6 = Float64(x2 * t_5)
	t_7 = Float64(-4.0 * t_6)
	tmp = 0.0
	if (x1 <= -4.6e+102)
		tmp = Float64(Float64(x2 * -6.0) - Float64(x1 * Float64(Float64(Float64(x1 * Float64(6.0 + Float64(Float64(t_4 - Float64(Float64(x2 * 6.0) + Float64(Float64(x2 * 8.0) + Float64(x1 * Float64(Float64(t_7 + Float64(2.0 * Float64(Float64(1.0 + Float64(Float64(-3.0 * t_5) + Float64(2.0 * t_1))) - Float64(-2.0 * t_6)))) - 3.0))))) - Float64(2.0 * Float64(3.0 + Float64(x2 * -4.0)))))) - t_7) - -1.0)));
	elseif (x1 <= 5.6e+94)
		tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(x1 - Float64(t_2 - Float64(2.0 * x2))) / Float64(-1.0 - Float64(x1 * x1)))) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_2 * t_3) + Float64(t_0 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)) + Float64(Float64(Float64(x1 * 2.0) * Float64(2.0 * x2)) * Float64(Float64(Float64(2.0 * x2) - x1) - 3.0)))))))));
	else
		tmp = Float64(x1 + Float64(Float64(x2 * -6.0) - Float64(x1 * Float64(2.0 + Float64(Float64(x1 * Float64(t_4 - Float64(x1 * 3.0))) + Float64(4.0 * t_1))))));
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	t_0 = (x1 * x1) + 1.0;
	t_1 = x2 * (3.0 - (2.0 * x2));
	t_2 = x1 * (x1 * 3.0);
	t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0;
	t_4 = 3.0 * ((x2 * -2.0) - 3.0);
	t_5 = 3.0 + (x2 * -2.0);
	t_6 = x2 * t_5;
	t_7 = -4.0 * t_6;
	tmp = 0.0;
	if (x1 <= -4.6e+102)
		tmp = (x2 * -6.0) - (x1 * (((x1 * (6.0 + ((t_4 - ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_7 + (2.0 * ((1.0 + ((-3.0 * t_5) + (2.0 * t_1))) - (-2.0 * t_6)))) - 3.0))))) - (2.0 * (3.0 + (x2 * -4.0)))))) - t_7) - -1.0));
	elseif (x1 <= 5.6e+94)
		tmp = x1 + ((3.0 * ((x1 - (t_2 - (2.0 * x2))) / (-1.0 - (x1 * x1)))) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * t_3) + (t_0 * (((x1 * x1) * ((t_3 * 4.0) - 6.0)) + (((x1 * 2.0) * (2.0 * x2)) * (((2.0 * x2) - x1) - 3.0))))))));
	else
		tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 + ((x1 * (t_4 - (x1 * 3.0))) + (4.0 * t_1)))));
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$4 = N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(3.0 + N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(x2 * t$95$5), $MachinePrecision]}, Block[{t$95$7 = N[(-4.0 * t$95$6), $MachinePrecision]}, If[LessEqual[x1, -4.6e+102], N[(N[(x2 * -6.0), $MachinePrecision] - N[(x1 * N[(N[(N[(x1 * N[(6.0 + N[(N[(t$95$4 - N[(N[(x2 * 6.0), $MachinePrecision] + N[(N[(x2 * 8.0), $MachinePrecision] + N[(x1 * N[(N[(t$95$7 + N[(2.0 * N[(N[(1.0 + N[(N[(-3.0 * t$95$5), $MachinePrecision] + N[(2.0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(-2.0 * t$95$6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(2.0 * N[(3.0 + N[(x2 * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$7), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5.6e+94], N[(x1 + N[(N[(3.0 * N[(N[(x1 - N[(t$95$2 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 * t$95$3), $MachinePrecision] + N[(t$95$0 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] - N[(x1 * N[(2.0 + N[(N[(x1 * N[(t$95$4 - N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(4.0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x1 \leq 5.6 \cdot 10^{+94}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{x1 - \left(t\_2 - 2 \cdot x2\right)}{-1 - x1 \cdot x1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_2 \cdot t\_3 + t\_0 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(t\_3 \cdot 4 - 6\right) + \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2\right)\right) \cdot \left(\left(2 \cdot x2 - x1\right) - 3\right)\right)\right)\right)\right)\right)\\

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


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

    1. Initial program 2.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. Simplified23.8%

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

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

    if -4.5999999999999998e102 < x1 < 5.59999999999999997e94

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

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

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

    if 5.59999999999999997e94 < x1

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

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

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

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

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

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

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

      \[\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(3 \cdot x1 + 3 \cdot \left(3 - -2 \cdot x2\right)\right)\right) - 2\right)\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification88.4%

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

Alternative 14: 79.4% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;x1 \leq -8 \cdot 10^{+24}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_5 - 2 \cdot x2\right) - x1}{t\_3} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_5 \cdot t\_6 + t\_3 \cdot \left(\left(x1 \cdot x1\right) \cdot 6 - \left(\left(x1 \cdot 2\right) \cdot \left(3 + \frac{-1}{x1}\right)\right) \cdot \left(3 - t\_6\right)\right)\right)\right)\right)\right)\\

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


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

    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. Simplified22.0%

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

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

    if -5.6999999999999999e102 < x1 < -7.9999999999999999e24

    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 x1 around inf 93.0%

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

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

    if -7.9999999999999999e24 < x1

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

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

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

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

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

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

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

      \[\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(3 \cdot x1 + 3 \cdot \left(3 - -2 \cdot x2\right)\right)\right) - 2\right)\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification79.7%

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

Alternative 15: 75.1% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x2 \cdot \left(3 - 2 \cdot x2\right)\\ t_1 := 3 \cdot \left(x2 \cdot -2 - 3\right)\\ t_2 := 3 + x2 \cdot -2\\ t_3 := x2 \cdot t\_2\\ t_4 := -4 \cdot t\_3\\ \mathbf{if}\;x1 \leq -1.05 \cdot 10^{+35}:\\ \;\;\;\;x2 \cdot -6 - x1 \cdot \left(\left(x1 \cdot \left(6 + \left(\left(t\_1 - \left(x2 \cdot 6 + \left(x2 \cdot 8 + x1 \cdot \left(\left(t\_4 + 2 \cdot \left(\left(1 + \left(-3 \cdot t\_2 + 2 \cdot t\_0\right)\right) - -2 \cdot t\_3\right)\right) - 3\right)\right)\right)\right) - 2 \cdot \left(3 + x2 \cdot -4\right)\right)\right) - t\_4\right) - -1\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 - x1 \cdot \left(2 + \left(x1 \cdot \left(t\_1 - x1 \cdot 3\right) + 4 \cdot t\_0\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (* x2 (- 3.0 (* 2.0 x2))))
        (t_1 (* 3.0 (- (* x2 -2.0) 3.0)))
        (t_2 (+ 3.0 (* x2 -2.0)))
        (t_3 (* x2 t_2))
        (t_4 (* -4.0 t_3)))
   (if (<= x1 -1.05e+35)
     (-
      (* x2 -6.0)
      (*
       x1
       (-
        (-
         (*
          x1
          (+
           6.0
           (-
            (-
             t_1
             (+
              (* x2 6.0)
              (+
               (* x2 8.0)
               (*
                x1
                (-
                 (+
                  t_4
                  (*
                   2.0
                   (- (+ 1.0 (+ (* -3.0 t_2) (* 2.0 t_0))) (* -2.0 t_3))))
                 3.0)))))
            (* 2.0 (+ 3.0 (* x2 -4.0))))))
         t_4)
        -1.0)))
     (+
      x1
      (-
       (* x2 -6.0)
       (* x1 (+ 2.0 (+ (* x1 (- t_1 (* x1 3.0))) (* 4.0 t_0)))))))))
double code(double x1, double x2) {
	double t_0 = x2 * (3.0 - (2.0 * x2));
	double t_1 = 3.0 * ((x2 * -2.0) - 3.0);
	double t_2 = 3.0 + (x2 * -2.0);
	double t_3 = x2 * t_2;
	double t_4 = -4.0 * t_3;
	double tmp;
	if (x1 <= -1.05e+35) {
		tmp = (x2 * -6.0) - (x1 * (((x1 * (6.0 + ((t_1 - ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_4 + (2.0 * ((1.0 + ((-3.0 * t_2) + (2.0 * t_0))) - (-2.0 * t_3)))) - 3.0))))) - (2.0 * (3.0 + (x2 * -4.0)))))) - t_4) - -1.0));
	} else {
		tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 + ((x1 * (t_1 - (x1 * 3.0))) + (4.0 * t_0)))));
	}
	return tmp;
}
real(8) function code(x1, x2)
    real(8), intent (in) :: x1
    real(8), intent (in) :: x2
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: t_4
    real(8) :: tmp
    t_0 = x2 * (3.0d0 - (2.0d0 * x2))
    t_1 = 3.0d0 * ((x2 * (-2.0d0)) - 3.0d0)
    t_2 = 3.0d0 + (x2 * (-2.0d0))
    t_3 = x2 * t_2
    t_4 = (-4.0d0) * t_3
    if (x1 <= (-1.05d+35)) then
        tmp = (x2 * (-6.0d0)) - (x1 * (((x1 * (6.0d0 + ((t_1 - ((x2 * 6.0d0) + ((x2 * 8.0d0) + (x1 * ((t_4 + (2.0d0 * ((1.0d0 + (((-3.0d0) * t_2) + (2.0d0 * t_0))) - ((-2.0d0) * t_3)))) - 3.0d0))))) - (2.0d0 * (3.0d0 + (x2 * (-4.0d0))))))) - t_4) - (-1.0d0)))
    else
        tmp = x1 + ((x2 * (-6.0d0)) - (x1 * (2.0d0 + ((x1 * (t_1 - (x1 * 3.0d0))) + (4.0d0 * t_0)))))
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double t_0 = x2 * (3.0 - (2.0 * x2));
	double t_1 = 3.0 * ((x2 * -2.0) - 3.0);
	double t_2 = 3.0 + (x2 * -2.0);
	double t_3 = x2 * t_2;
	double t_4 = -4.0 * t_3;
	double tmp;
	if (x1 <= -1.05e+35) {
		tmp = (x2 * -6.0) - (x1 * (((x1 * (6.0 + ((t_1 - ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_4 + (2.0 * ((1.0 + ((-3.0 * t_2) + (2.0 * t_0))) - (-2.0 * t_3)))) - 3.0))))) - (2.0 * (3.0 + (x2 * -4.0)))))) - t_4) - -1.0));
	} else {
		tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 + ((x1 * (t_1 - (x1 * 3.0))) + (4.0 * t_0)))));
	}
	return tmp;
}
def code(x1, x2):
	t_0 = x2 * (3.0 - (2.0 * x2))
	t_1 = 3.0 * ((x2 * -2.0) - 3.0)
	t_2 = 3.0 + (x2 * -2.0)
	t_3 = x2 * t_2
	t_4 = -4.0 * t_3
	tmp = 0
	if x1 <= -1.05e+35:
		tmp = (x2 * -6.0) - (x1 * (((x1 * (6.0 + ((t_1 - ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_4 + (2.0 * ((1.0 + ((-3.0 * t_2) + (2.0 * t_0))) - (-2.0 * t_3)))) - 3.0))))) - (2.0 * (3.0 + (x2 * -4.0)))))) - t_4) - -1.0))
	else:
		tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 + ((x1 * (t_1 - (x1 * 3.0))) + (4.0 * t_0)))))
	return tmp
function code(x1, x2)
	t_0 = Float64(x2 * Float64(3.0 - Float64(2.0 * x2)))
	t_1 = Float64(3.0 * Float64(Float64(x2 * -2.0) - 3.0))
	t_2 = Float64(3.0 + Float64(x2 * -2.0))
	t_3 = Float64(x2 * t_2)
	t_4 = Float64(-4.0 * t_3)
	tmp = 0.0
	if (x1 <= -1.05e+35)
		tmp = Float64(Float64(x2 * -6.0) - Float64(x1 * Float64(Float64(Float64(x1 * Float64(6.0 + Float64(Float64(t_1 - Float64(Float64(x2 * 6.0) + Float64(Float64(x2 * 8.0) + Float64(x1 * Float64(Float64(t_4 + Float64(2.0 * Float64(Float64(1.0 + Float64(Float64(-3.0 * t_2) + Float64(2.0 * t_0))) - Float64(-2.0 * t_3)))) - 3.0))))) - Float64(2.0 * Float64(3.0 + Float64(x2 * -4.0)))))) - t_4) - -1.0)));
	else
		tmp = Float64(x1 + Float64(Float64(x2 * -6.0) - Float64(x1 * Float64(2.0 + Float64(Float64(x1 * Float64(t_1 - Float64(x1 * 3.0))) + Float64(4.0 * t_0))))));
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	t_0 = x2 * (3.0 - (2.0 * x2));
	t_1 = 3.0 * ((x2 * -2.0) - 3.0);
	t_2 = 3.0 + (x2 * -2.0);
	t_3 = x2 * t_2;
	t_4 = -4.0 * t_3;
	tmp = 0.0;
	if (x1 <= -1.05e+35)
		tmp = (x2 * -6.0) - (x1 * (((x1 * (6.0 + ((t_1 - ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_4 + (2.0 * ((1.0 + ((-3.0 * t_2) + (2.0 * t_0))) - (-2.0 * t_3)))) - 3.0))))) - (2.0 * (3.0 + (x2 * -4.0)))))) - t_4) - -1.0));
	else
		tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 + ((x1 * (t_1 - (x1 * 3.0))) + (4.0 * t_0)))));
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := Block[{t$95$0 = N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(3.0 + N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x2 * t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(-4.0 * t$95$3), $MachinePrecision]}, If[LessEqual[x1, -1.05e+35], N[(N[(x2 * -6.0), $MachinePrecision] - N[(x1 * N[(N[(N[(x1 * N[(6.0 + N[(N[(t$95$1 - N[(N[(x2 * 6.0), $MachinePrecision] + N[(N[(x2 * 8.0), $MachinePrecision] + N[(x1 * N[(N[(t$95$4 + N[(2.0 * N[(N[(1.0 + N[(N[(-3.0 * t$95$2), $MachinePrecision] + N[(2.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(-2.0 * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(2.0 * N[(3.0 + N[(x2 * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$4), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] - N[(x1 * N[(2.0 + N[(N[(x1 * N[(t$95$1 - N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(4.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x2 \cdot \left(3 - 2 \cdot x2\right)\\
t_1 := 3 \cdot \left(x2 \cdot -2 - 3\right)\\
t_2 := 3 + x2 \cdot -2\\
t_3 := x2 \cdot t\_2\\
t_4 := -4 \cdot t\_3\\
\mathbf{if}\;x1 \leq -1.05 \cdot 10^{+35}:\\
\;\;\;\;x2 \cdot -6 - x1 \cdot \left(\left(x1 \cdot \left(6 + \left(\left(t\_1 - \left(x2 \cdot 6 + \left(x2 \cdot 8 + x1 \cdot \left(\left(t\_4 + 2 \cdot \left(\left(1 + \left(-3 \cdot t\_2 + 2 \cdot t\_0\right)\right) - -2 \cdot t\_3\right)\right) - 3\right)\right)\right)\right) - 2 \cdot \left(3 + x2 \cdot -4\right)\right)\right) - t\_4\right) - -1\right)\\

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


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

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

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

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

    if -1.0499999999999999e35 < x1

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

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

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

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

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

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

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

      \[\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(3 \cdot x1 + 3 \cdot \left(3 - -2 \cdot x2\right)\right)\right) - 2\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification75.7%

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

Alternative 16: 74.8% accurate, 1.6× speedup?

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

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

\mathbf{elif}\;x1 \leq -3.05 \cdot 10^{+25}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + x1 \cdot \left(\left(2 \cdot \left(1 + 3 \cdot t\_0\right) + x1 \cdot \left(x2 \cdot 6 + x1 \cdot \left(\left(3 \cdot \left(x1 \cdot t\_2\right) - 2 \cdot \left(-1 + 3 \cdot t\_2\right)\right) - 6\right)\right)\right) - 4\right)\right)\right)\\

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


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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

    if -1.35000000000000003e154 < x1 < -3.0500000000000001e25

    1. Initial program 63.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 0 12.5%

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

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

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

    if -3.0500000000000001e25 < x1

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

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

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

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

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

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

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

      \[\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(3 \cdot x1 + 3 \cdot \left(3 - -2 \cdot x2\right)\right)\right) - 2\right)\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification76.4%

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

Alternative 17: 74.4% accurate, 2.2× speedup?

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

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

\mathbf{elif}\;x1 \leq -4.5 \cdot 10^{-238}:\\
\;\;\;\;x1 + \left(t\_2 + \left(x1 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) + x1 \cdot \left(x1 \cdot -22 + x2 \cdot \left(6 + x1 \cdot 12\right)\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 2.2 \cdot 10^{-187}:\\
\;\;\;\;x1 + \left(t\_2 + \left(x1 + 12 \cdot \left(x1 \cdot x2\right)\right)\right)\\

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


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

    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. Simplified0.0%

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

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

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

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

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

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

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

    if -1.22e154 < x1 < -4.49999999999999996e-238

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

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

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

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

    if -4.49999999999999996e-238 < x1 < 2.20000000000000008e-187

    1. Initial program 99.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 0 99.6%

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

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

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

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

        \[\leadsto x1 + \left(\left(12 \cdot \color{blue}{\left(x2 \cdot x1\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. Simplified96.6%

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

    if 2.20000000000000008e-187 < x1

    1. Initial program 68.5%

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

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

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

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

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

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

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

      \[\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(3 \cdot x1 + 3 \cdot \left(3 - -2 \cdot x2\right)\right)\right) - 2\right)\right)} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification76.9%

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

Alternative 18: 73.7% accurate, 2.5× speedup?

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

\\
\begin{array}{l}
t_0 := x2 \cdot -2 - 3\\
t_1 := 4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\\
\mathbf{if}\;x1 \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 - x1 \cdot \left(2 + \left(3 \cdot \left(x1 \cdot t\_0\right) + t\_1\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 7 \cdot 10^{+89}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{x1 - \left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right)}{-1 - x1 \cdot x1} + \left(x1 + x1 \cdot \left(x1 \cdot \left(x1 \cdot -22\right) - t\_1\right)\right)\right)\\

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


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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

    if -1.35000000000000003e154 < x1 < 7.0000000000000001e89

    1. Initial program 94.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 0 78.3%

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

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

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

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

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

    if 7.0000000000000001e89 < x1

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

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

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

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

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

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

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

      \[\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(3 \cdot x1 + 3 \cdot \left(3 - -2 \cdot x2\right)\right)\right) - 2\right)\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification75.0%

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

Alternative 19: 72.4% accurate, 3.0× speedup?

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

\\
\begin{array}{l}
t_0 := x2 \cdot -2 - 3\\
t_1 := 4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\\
\mathbf{if}\;x1 \leq -4.9 \cdot 10^{-238}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 - x1 \cdot \left(2 + \left(3 \cdot \left(x1 \cdot t\_0\right) + t\_1\right)\right)\right)\\

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

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


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

    1. Initial program 59.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. Simplified60.0%

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

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

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

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

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

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

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

    if -4.8999999999999998e-238 < x1 < 2.40000000000000013e-187

    1. Initial program 99.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 0 99.6%

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

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

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

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

        \[\leadsto x1 + \left(\left(12 \cdot \color{blue}{\left(x2 \cdot x1\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. Simplified96.6%

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

    if 2.40000000000000013e-187 < x1

    1. Initial program 68.5%

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

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

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

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

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

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

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

      \[\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(3 \cdot x1 + 3 \cdot \left(3 - -2 \cdot x2\right)\right)\right) - 2\right)\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification74.2%

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

Alternative 20: 69.9% accurate, 3.0× speedup?

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

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

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


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

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

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

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

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

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

    if -8.4999999999999996e98 < x1

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

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

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

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

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

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

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

      \[\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(3 \cdot x1 + 3 \cdot \left(3 - -2 \cdot x2\right)\right)\right) - 2\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification72.8%

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

Alternative 21: 69.4% accurate, 3.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 #s(literal 2 binary64) x2) < -1e4

    1. Initial program 77.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. Simplified77.5%

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

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

    if -1e4 < (*.f64 #s(literal 2 binary64) x2)

    1. Initial program 70.3%

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

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

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

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

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

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

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

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

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

Alternative 22: 57.7% accurate, 4.0× speedup?

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

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

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

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


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

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

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

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

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

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

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

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

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

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

    if -1.8000000000000001e102 < x1 < 1.9199999999999999e198

    1. Initial program 94.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. Simplified94.5%

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

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

    if 1.9199999999999999e198 < 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. Simplified0.0%

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

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

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

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

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

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

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

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

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

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

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

Alternative 23: 57.7% accurate, 4.2× speedup?

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

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

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

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


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

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

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

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

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

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

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

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

    if -4.1e101 < x1 < 1.80000000000000001e199

    1. Initial program 94.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. Simplified94.5%

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

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

    if 1.80000000000000001e199 < 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. Simplified0.0%

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

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

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

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

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

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

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

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

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

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

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

Alternative 24: 42.7% accurate, 5.1× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x2 < -2.3e136 or 5.4000000000000002e149 < x2

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

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

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

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

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

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

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

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

    if -2.3e136 < x2 < 5.4000000000000002e149

    1. Initial program 72.7%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 25: 55.1% accurate, 5.8× speedup?

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

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

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


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

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

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

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

    if 3.15000000000000001e196 < 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. Simplified0.0%

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

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

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

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

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

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

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

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

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

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

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

Alternative 26: 31.6% accurate, 18.1× speedup?

\[\begin{array}{l} \\ x2 \cdot \left(\frac{x1}{x2} - 6\right) \end{array} \]
(FPCore (x1 x2) :precision binary64 (* x2 (- (/ x1 x2) 6.0)))
double code(double x1, double x2) {
	return x2 * ((x1 / x2) - 6.0);
}
real(8) function code(x1, x2)
    real(8), intent (in) :: x1
    real(8), intent (in) :: x2
    code = x2 * ((x1 / x2) - 6.0d0)
end function
public static double code(double x1, double x2) {
	return x2 * ((x1 / x2) - 6.0);
}
def code(x1, x2):
	return x2 * ((x1 / x2) - 6.0)
function code(x1, x2)
	return Float64(x2 * Float64(Float64(x1 / x2) - 6.0))
end
function tmp = code(x1, x2)
	tmp = x2 * ((x1 / x2) - 6.0);
end
code[x1_, x2_] := N[(x2 * N[(N[(x1 / x2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x2 \cdot \left(\frac{x1}{x2} - 6\right)
\end{array}
Derivation
  1. Initial program 71.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. Simplified72.0%

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{x2 \cdot \left(\frac{x1}{x2} - 6\right)} \]
  11. Add Preprocessing

Alternative 27: 26.3% accurate, 25.4× speedup?

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

\\
x1 + x2 \cdot -6
\end{array}
Derivation
  1. Initial program 71.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. Simplified72.0%

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

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

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

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

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

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

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

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

    \[\leadsto x1 + \color{blue}{x2 \cdot -6} \]
  10. Add Preprocessing

Alternative 28: 26.2% accurate, 42.3× speedup?

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

\\
x2 \cdot -6
\end{array}
Derivation
  1. Initial program 71.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. Simplified72.0%

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

    \[\leadsto \color{blue}{-6 \cdot x2} \]
  5. Final simplification30.4%

    \[\leadsto x2 \cdot -6 \]
  6. Add Preprocessing

Alternative 29: 3.2% accurate, 127.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{x1} \]
  11. Add Preprocessing

Reproduce

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