Rosa's FloatVsDoubleBenchmark

Percentage Accurate: 71.0% → 95.9%
Time: 1.2min
Alternatives: 18
Speedup: 1.3×

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 18 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: 71.0% 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: 95.9% accurate, 0.1× speedup?

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

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

\mathbf{elif}\;x1 \leq 4.2 \cdot 10^{+149}:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, \frac{t\_1 - \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\_0, 4, -6\right), \left(x1 \cdot \left(2 \cdot t\_0\right)\right) \cdot \left(-3 + t\_0\right)\right), \mathsf{fma}\left(t\_1, t\_0, {x1}^{3}\right)\right)\right)\\

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


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

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

      \[\leadsto x1 + \left(\left(\color{blue}{\left(-3 \cdot {x1}^{3} + 6 \cdot {x1}^{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) \]
    4. Taylor expanded in x1 around 0 96.5%

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

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

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

    if -3.80000000000000022e73 < x1 < 4.2000000000000003e149

    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. Simplified99.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

    if 4.2000000000000003e149 < x1

    1. Initial program 3.4%

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

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

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

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

Alternative 2: 95.8% accurate, 0.1× speedup?

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

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

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

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


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

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

      \[\leadsto x1 + \left(\left(\color{blue}{\left(-3 \cdot {x1}^{3} + 6 \cdot {x1}^{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) \]
    4. Taylor expanded in x1 around 0 96.5%

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

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

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

    if -3.80000000000000022e73 < x1 < 4.2000000000000003e149

    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. Simplified99.4%

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

    if 4.2000000000000003e149 < x1

    1. Initial program 3.4%

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

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

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

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

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

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

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


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

    1. Initial program 99.4%

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

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

    1. Initial program 0.0%

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

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

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

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

Alternative 4: 95.8% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;x1 \leq 4.2 \cdot 10^{+149}:\\
\;\;\;\;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(4 \cdot t\_2 - 6\right)\right) + t\_0 \cdot t\_2\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t\_0 - x2 \cdot 2\right) - x1}{t\_1}\right)\\

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


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

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

      \[\leadsto x1 + \left(\left(\color{blue}{\left(-3 \cdot {x1}^{3} + 6 \cdot {x1}^{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) \]
    4. Taylor expanded in x1 around 0 96.5%

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

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

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

    if -3.80000000000000022e73 < x1 < 4.2000000000000003e149

    1. Initial program 99.4%

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

    if 4.2000000000000003e149 < x1

    1. Initial program 3.4%

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

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

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

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

Alternative 5: 82.9% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;x1 \leq -3.8 \cdot 10^{+73}:\\
\;\;\;\;x1 + \left(t\_3 + \left(x1 + 6 \cdot {x1}^{4}\right)\right)\\

\mathbf{elif}\;x1 \leq 1.32 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(\left(t\_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t\_2 - 6\right)\right) + t\_0 \cdot t\_2\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + t\_3\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x1 < -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. Add Preprocessing
    3. Taylor expanded in x1 around 0 0.0%

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

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

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

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

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

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

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

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

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

    if -1.35000000000000003e154 < x1 < -3.80000000000000022e73

    1. Initial program 38.8%

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

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

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

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

    if -3.80000000000000022e73 < x1 < 1.31999999999999998e154

    1. Initial program 99.4%

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

    if 1.31999999999999998e154 < x1

    1. Initial program 0.0%

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

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

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

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

Alternative 6: 79.9% accurate, 0.9× speedup?

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

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

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

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


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

    1. Initial program 2.0%

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

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

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

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

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

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

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

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

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

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

    if -5.8000000000000005e102 < x1 < 1.31999999999999998e154

    1. Initial program 98.8%

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

    if 1.31999999999999998e154 < x1

    1. Initial program 0.0%

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

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

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

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

Alternative 7: 68.8% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 \cdot \left(x1 \cdot x1\right)\\ t_1 := x1 \cdot \left(x1 \cdot 3\right)\\ t_2 := x2 \cdot \left(x2 \cdot 2 - 3\right)\\ t_3 := x1 \cdot x1 + 1\\ t_4 := 3 \cdot \frac{\left(t\_1 - x2 \cdot 2\right) - x1}{t\_3}\\ t_5 := x1 + \left(x1 \cdot -2 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\ t_6 := t\_3 \cdot \left(6 \cdot \left(x1 \cdot x1\right) + \left(\frac{\left(x2 \cdot 2 + t\_1\right) - x1}{t\_3} - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(3 + \frac{-1}{x1}\right)\right)\right)\\ t_7 := x1 + \left(t\_4 + \left(x1 + 4 \cdot \left(x1 \cdot t\_2\right)\right)\right)\\ \mathbf{if}\;x1 \leq -5.8 \cdot 10^{+102}:\\ \;\;\;\;t\_5\\ \mathbf{elif}\;x1 \leq -850:\\ \;\;\;\;x1 + \left(t\_4 + \left(x1 + \left(t\_0 + \left(3 \cdot t\_1 + t\_6\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq -2.2 \cdot 10^{-212}:\\ \;\;\;\;t\_7\\ \mathbf{elif}\;x1 \leq 1.95 \cdot 10^{-238}:\\ \;\;\;\;t\_5\\ \mathbf{elif}\;x1 \leq 185:\\ \;\;\;\;t\_7\\ \mathbf{elif}\;x1 \leq 5.2 \cdot 10^{+125}:\\ \;\;\;\;x1 + \left(t\_4 + \left(x1 + \left(t\_0 + \left(t\_6 + \left(x2 \cdot 2\right) \cdot t\_1\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot t\_2\right)\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (* x1 (* x1 x1)))
        (t_1 (* x1 (* x1 3.0)))
        (t_2 (* x2 (- (* x2 2.0) 3.0)))
        (t_3 (+ (* x1 x1) 1.0))
        (t_4 (* 3.0 (/ (- (- t_1 (* x2 2.0)) x1) t_3)))
        (t_5 (+ x1 (+ (* x1 -2.0) (* x2 (- (* x1 -12.0) 6.0)))))
        (t_6
         (*
          t_3
          (+
           (* 6.0 (* x1 x1))
           (*
            (- (/ (- (+ (* x2 2.0) t_1) x1) t_3) 3.0)
            (* (* x1 2.0) (+ 3.0 (/ -1.0 x1)))))))
        (t_7 (+ x1 (+ t_4 (+ x1 (* 4.0 (* x1 t_2)))))))
   (if (<= x1 -5.8e+102)
     t_5
     (if (<= x1 -850.0)
       (+ x1 (+ t_4 (+ x1 (+ t_0 (+ (* 3.0 t_1) t_6)))))
       (if (<= x1 -2.2e-212)
         t_7
         (if (<= x1 1.95e-238)
           t_5
           (if (<= x1 185.0)
             t_7
             (if (<= x1 5.2e+125)
               (+ x1 (+ t_4 (+ x1 (+ t_0 (+ t_6 (* (* x2 2.0) t_1))))))
               (+ x1 (* x1 (+ 1.0 (* 4.0 t_2))))))))))))
double code(double x1, double x2) {
	double t_0 = x1 * (x1 * x1);
	double t_1 = x1 * (x1 * 3.0);
	double t_2 = x2 * ((x2 * 2.0) - 3.0);
	double t_3 = (x1 * x1) + 1.0;
	double t_4 = 3.0 * (((t_1 - (x2 * 2.0)) - x1) / t_3);
	double t_5 = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
	double t_6 = t_3 * ((6.0 * (x1 * x1)) + ((((((x2 * 2.0) + t_1) - x1) / t_3) - 3.0) * ((x1 * 2.0) * (3.0 + (-1.0 / x1)))));
	double t_7 = x1 + (t_4 + (x1 + (4.0 * (x1 * t_2))));
	double tmp;
	if (x1 <= -5.8e+102) {
		tmp = t_5;
	} else if (x1 <= -850.0) {
		tmp = x1 + (t_4 + (x1 + (t_0 + ((3.0 * t_1) + t_6))));
	} else if (x1 <= -2.2e-212) {
		tmp = t_7;
	} else if (x1 <= 1.95e-238) {
		tmp = t_5;
	} else if (x1 <= 185.0) {
		tmp = t_7;
	} else if (x1 <= 5.2e+125) {
		tmp = x1 + (t_4 + (x1 + (t_0 + (t_6 + ((x2 * 2.0) * t_1)))));
	} else {
		tmp = x1 + (x1 * (1.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_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 * x1)
    t_1 = x1 * (x1 * 3.0d0)
    t_2 = x2 * ((x2 * 2.0d0) - 3.0d0)
    t_3 = (x1 * x1) + 1.0d0
    t_4 = 3.0d0 * (((t_1 - (x2 * 2.0d0)) - x1) / t_3)
    t_5 = x1 + ((x1 * (-2.0d0)) + (x2 * ((x1 * (-12.0d0)) - 6.0d0)))
    t_6 = t_3 * ((6.0d0 * (x1 * x1)) + ((((((x2 * 2.0d0) + t_1) - x1) / t_3) - 3.0d0) * ((x1 * 2.0d0) * (3.0d0 + ((-1.0d0) / x1)))))
    t_7 = x1 + (t_4 + (x1 + (4.0d0 * (x1 * t_2))))
    if (x1 <= (-5.8d+102)) then
        tmp = t_5
    else if (x1 <= (-850.0d0)) then
        tmp = x1 + (t_4 + (x1 + (t_0 + ((3.0d0 * t_1) + t_6))))
    else if (x1 <= (-2.2d-212)) then
        tmp = t_7
    else if (x1 <= 1.95d-238) then
        tmp = t_5
    else if (x1 <= 185.0d0) then
        tmp = t_7
    else if (x1 <= 5.2d+125) then
        tmp = x1 + (t_4 + (x1 + (t_0 + (t_6 + ((x2 * 2.0d0) * t_1)))))
    else
        tmp = x1 + (x1 * (1.0d0 + (4.0d0 * t_2)))
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double t_0 = x1 * (x1 * x1);
	double t_1 = x1 * (x1 * 3.0);
	double t_2 = x2 * ((x2 * 2.0) - 3.0);
	double t_3 = (x1 * x1) + 1.0;
	double t_4 = 3.0 * (((t_1 - (x2 * 2.0)) - x1) / t_3);
	double t_5 = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
	double t_6 = t_3 * ((6.0 * (x1 * x1)) + ((((((x2 * 2.0) + t_1) - x1) / t_3) - 3.0) * ((x1 * 2.0) * (3.0 + (-1.0 / x1)))));
	double t_7 = x1 + (t_4 + (x1 + (4.0 * (x1 * t_2))));
	double tmp;
	if (x1 <= -5.8e+102) {
		tmp = t_5;
	} else if (x1 <= -850.0) {
		tmp = x1 + (t_4 + (x1 + (t_0 + ((3.0 * t_1) + t_6))));
	} else if (x1 <= -2.2e-212) {
		tmp = t_7;
	} else if (x1 <= 1.95e-238) {
		tmp = t_5;
	} else if (x1 <= 185.0) {
		tmp = t_7;
	} else if (x1 <= 5.2e+125) {
		tmp = x1 + (t_4 + (x1 + (t_0 + (t_6 + ((x2 * 2.0) * t_1)))));
	} else {
		tmp = x1 + (x1 * (1.0 + (4.0 * t_2)));
	}
	return tmp;
}
def code(x1, x2):
	t_0 = x1 * (x1 * x1)
	t_1 = x1 * (x1 * 3.0)
	t_2 = x2 * ((x2 * 2.0) - 3.0)
	t_3 = (x1 * x1) + 1.0
	t_4 = 3.0 * (((t_1 - (x2 * 2.0)) - x1) / t_3)
	t_5 = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)))
	t_6 = t_3 * ((6.0 * (x1 * x1)) + ((((((x2 * 2.0) + t_1) - x1) / t_3) - 3.0) * ((x1 * 2.0) * (3.0 + (-1.0 / x1)))))
	t_7 = x1 + (t_4 + (x1 + (4.0 * (x1 * t_2))))
	tmp = 0
	if x1 <= -5.8e+102:
		tmp = t_5
	elif x1 <= -850.0:
		tmp = x1 + (t_4 + (x1 + (t_0 + ((3.0 * t_1) + t_6))))
	elif x1 <= -2.2e-212:
		tmp = t_7
	elif x1 <= 1.95e-238:
		tmp = t_5
	elif x1 <= 185.0:
		tmp = t_7
	elif x1 <= 5.2e+125:
		tmp = x1 + (t_4 + (x1 + (t_0 + (t_6 + ((x2 * 2.0) * t_1)))))
	else:
		tmp = x1 + (x1 * (1.0 + (4.0 * t_2)))
	return tmp
function code(x1, x2)
	t_0 = Float64(x1 * Float64(x1 * x1))
	t_1 = Float64(x1 * Float64(x1 * 3.0))
	t_2 = Float64(x2 * Float64(Float64(x2 * 2.0) - 3.0))
	t_3 = Float64(Float64(x1 * x1) + 1.0)
	t_4 = Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(x2 * 2.0)) - x1) / t_3))
	t_5 = Float64(x1 + Float64(Float64(x1 * -2.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0))))
	t_6 = Float64(t_3 * Float64(Float64(6.0 * Float64(x1 * x1)) + Float64(Float64(Float64(Float64(Float64(Float64(x2 * 2.0) + t_1) - x1) / t_3) - 3.0) * Float64(Float64(x1 * 2.0) * Float64(3.0 + Float64(-1.0 / x1))))))
	t_7 = Float64(x1 + Float64(t_4 + Float64(x1 + Float64(4.0 * Float64(x1 * t_2)))))
	tmp = 0.0
	if (x1 <= -5.8e+102)
		tmp = t_5;
	elseif (x1 <= -850.0)
		tmp = Float64(x1 + Float64(t_4 + Float64(x1 + Float64(t_0 + Float64(Float64(3.0 * t_1) + t_6)))));
	elseif (x1 <= -2.2e-212)
		tmp = t_7;
	elseif (x1 <= 1.95e-238)
		tmp = t_5;
	elseif (x1 <= 185.0)
		tmp = t_7;
	elseif (x1 <= 5.2e+125)
		tmp = Float64(x1 + Float64(t_4 + Float64(x1 + Float64(t_0 + Float64(t_6 + Float64(Float64(x2 * 2.0) * t_1))))));
	else
		tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(4.0 * t_2))));
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	t_0 = x1 * (x1 * x1);
	t_1 = x1 * (x1 * 3.0);
	t_2 = x2 * ((x2 * 2.0) - 3.0);
	t_3 = (x1 * x1) + 1.0;
	t_4 = 3.0 * (((t_1 - (x2 * 2.0)) - x1) / t_3);
	t_5 = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
	t_6 = t_3 * ((6.0 * (x1 * x1)) + ((((((x2 * 2.0) + t_1) - x1) / t_3) - 3.0) * ((x1 * 2.0) * (3.0 + (-1.0 / x1)))));
	t_7 = x1 + (t_4 + (x1 + (4.0 * (x1 * t_2))));
	tmp = 0.0;
	if (x1 <= -5.8e+102)
		tmp = t_5;
	elseif (x1 <= -850.0)
		tmp = x1 + (t_4 + (x1 + (t_0 + ((3.0 * t_1) + t_6))));
	elseif (x1 <= -2.2e-212)
		tmp = t_7;
	elseif (x1 <= 1.95e-238)
		tmp = t_5;
	elseif (x1 <= 185.0)
		tmp = t_7;
	elseif (x1 <= 5.2e+125)
		tmp = x1 + (t_4 + (x1 + (t_0 + (t_6 + ((x2 * 2.0) * t_1)))));
	else
		tmp = x1 + (x1 * (1.0 + (4.0 * t_2)));
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x2 * N[(N[(x2 * 2.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$4 = N[(3.0 * N[(N[(N[(t$95$1 - N[(x2 * 2.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(x1 + N[(N[(x1 * -2.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(t$95$3 * N[(N[(6.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[(N[(N[(x2 * 2.0), $MachinePrecision] + t$95$1), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision] - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(3.0 + N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(x1 + N[(t$95$4 + N[(x1 + N[(4.0 * N[(x1 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.8e+102], t$95$5, If[LessEqual[x1, -850.0], N[(x1 + N[(t$95$4 + N[(x1 + N[(t$95$0 + N[(N[(3.0 * t$95$1), $MachinePrecision] + t$95$6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -2.2e-212], t$95$7, If[LessEqual[x1, 1.95e-238], t$95$5, If[LessEqual[x1, 185.0], t$95$7, If[LessEqual[x1, 5.2e+125], N[(x1 + N[(t$95$4 + N[(x1 + N[(t$95$0 + N[(t$95$6 + N[(N[(x2 * 2.0), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 * N[(1.0 + N[(4.0 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x1 \leq -850:\\
\;\;\;\;x1 + \left(t\_4 + \left(x1 + \left(t\_0 + \left(3 \cdot t\_1 + t\_6\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq -2.2 \cdot 10^{-212}:\\
\;\;\;\;t\_7\\

\mathbf{elif}\;x1 \leq 1.95 \cdot 10^{-238}:\\
\;\;\;\;t\_5\\

\mathbf{elif}\;x1 \leq 185:\\
\;\;\;\;t\_7\\

\mathbf{elif}\;x1 \leq 5.2 \cdot 10^{+125}:\\
\;\;\;\;x1 + \left(t\_4 + \left(x1 + \left(t\_0 + \left(t\_6 + \left(x2 \cdot 2\right) \cdot t\_1\right)\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot t\_2\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if x1 < -5.8000000000000005e102 or -2.20000000000000003e-212 < x1 < 1.9499999999999999e-238

    1. Initial program 42.8%

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

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

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

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

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

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

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

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

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

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

    if -5.8000000000000005e102 < x1 < -850

    1. Initial program 93.9%

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

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

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

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

    if -850 < x1 < -2.20000000000000003e-212 or 1.9499999999999999e-238 < x1 < 185

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

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

    if 185 < x1 < 5.20000000000000006e125

    1. Initial program 99.5%

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

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

      \[\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) \]
    5. Taylor expanded in x1 around 0 73.4%

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

    if 5.20000000000000006e125 < x1

    1. Initial program 12.5%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -5.8 \cdot 10^{+102}:\\ \;\;\;\;x1 + \left(x1 \cdot -2 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\ \mathbf{elif}\;x1 \leq -850:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - x2 \cdot 2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot \left(x1 \cdot \left(x1 \cdot 3\right)\right) + \left(x1 \cdot x1 + 1\right) \cdot \left(6 \cdot \left(x1 \cdot x1\right) + \left(\frac{\left(x2 \cdot 2 + x1 \cdot \left(x1 \cdot 3\right)\right) - x1}{x1 \cdot x1 + 1} - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(3 + \frac{-1}{x1}\right)\right)\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq -2.2 \cdot 10^{-212}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - x2 \cdot 2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + 4 \cdot \left(x1 \cdot \left(x2 \cdot \left(x2 \cdot 2 - 3\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 1.95 \cdot 10^{-238}:\\ \;\;\;\;x1 + \left(x1 \cdot -2 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\ \mathbf{elif}\;x1 \leq 185:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - x2 \cdot 2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + 4 \cdot \left(x1 \cdot \left(x2 \cdot \left(x2 \cdot 2 - 3\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 5.2 \cdot 10^{+125}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - x2 \cdot 2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(\left(x1 \cdot x1 + 1\right) \cdot \left(6 \cdot \left(x1 \cdot x1\right) + \left(\frac{\left(x2 \cdot 2 + x1 \cdot \left(x1 \cdot 3\right)\right) - x1}{x1 \cdot x1 + 1} - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(3 + \frac{-1}{x1}\right)\right)\right) + \left(x2 \cdot 2\right) \cdot \left(x1 \cdot \left(x1 \cdot 3\right)\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot \left(x2 \cdot \left(x2 \cdot 2 - 3\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 70.5% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 \cdot \left(x1 \cdot 3\right)\\ t_1 := x2 \cdot \left(x2 \cdot 2 - 3\right)\\ t_2 := x1 \cdot x1 + 1\\ t_3 := 3 \cdot \frac{\left(t\_0 - x2 \cdot 2\right) - x1}{t\_2}\\ t_4 := x1 + \left(t\_3 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot t\_0 + t\_2 \cdot \left(6 \cdot \left(x1 \cdot x1\right) + \left(\frac{\left(x2 \cdot 2 + t\_0\right) - x1}{t\_2} - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(3 + \frac{-1}{x1}\right)\right)\right)\right)\right)\right)\right)\\ t_5 := x1 + \left(x1 \cdot -2 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\ t_6 := x1 + \left(t\_3 + \left(x1 + 4 \cdot \left(x1 \cdot t\_1\right)\right)\right)\\ \mathbf{if}\;x1 \leq -5.8 \cdot 10^{+102}:\\ \;\;\;\;t\_5\\ \mathbf{elif}\;x1 \leq -900:\\ \;\;\;\;t\_4\\ \mathbf{elif}\;x1 \leq -1.35 \cdot 10^{-209}:\\ \;\;\;\;t\_6\\ \mathbf{elif}\;x1 \leq 4.6 \cdot 10^{-238}:\\ \;\;\;\;t\_5\\ \mathbf{elif}\;x1 \leq 460:\\ \;\;\;\;t\_6\\ \mathbf{elif}\;x1 \leq 1.32 \cdot 10^{+154}:\\ \;\;\;\;t\_4\\ \mathbf{else}:\\ \;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot t\_1\right)\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (* x1 (* x1 3.0)))
        (t_1 (* x2 (- (* x2 2.0) 3.0)))
        (t_2 (+ (* x1 x1) 1.0))
        (t_3 (* 3.0 (/ (- (- t_0 (* x2 2.0)) x1) t_2)))
        (t_4
         (+
          x1
          (+
           t_3
           (+
            x1
            (+
             (* x1 (* x1 x1))
             (+
              (* 3.0 t_0)
              (*
               t_2
               (+
                (* 6.0 (* x1 x1))
                (*
                 (- (/ (- (+ (* x2 2.0) t_0) x1) t_2) 3.0)
                 (* (* x1 2.0) (+ 3.0 (/ -1.0 x1))))))))))))
        (t_5 (+ x1 (+ (* x1 -2.0) (* x2 (- (* x1 -12.0) 6.0)))))
        (t_6 (+ x1 (+ t_3 (+ x1 (* 4.0 (* x1 t_1)))))))
   (if (<= x1 -5.8e+102)
     t_5
     (if (<= x1 -900.0)
       t_4
       (if (<= x1 -1.35e-209)
         t_6
         (if (<= x1 4.6e-238)
           t_5
           (if (<= x1 460.0)
             t_6
             (if (<= x1 1.32e+154)
               t_4
               (+ x1 (* x1 (+ 1.0 (* 4.0 t_1))))))))))))
double code(double x1, double x2) {
	double t_0 = x1 * (x1 * 3.0);
	double t_1 = x2 * ((x2 * 2.0) - 3.0);
	double t_2 = (x1 * x1) + 1.0;
	double t_3 = 3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_2);
	double t_4 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_2 * ((6.0 * (x1 * x1)) + ((((((x2 * 2.0) + t_0) - x1) / t_2) - 3.0) * ((x1 * 2.0) * (3.0 + (-1.0 / x1))))))))));
	double t_5 = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
	double t_6 = x1 + (t_3 + (x1 + (4.0 * (x1 * t_1))));
	double tmp;
	if (x1 <= -5.8e+102) {
		tmp = t_5;
	} else if (x1 <= -900.0) {
		tmp = t_4;
	} else if (x1 <= -1.35e-209) {
		tmp = t_6;
	} else if (x1 <= 4.6e-238) {
		tmp = t_5;
	} else if (x1 <= 460.0) {
		tmp = t_6;
	} else if (x1 <= 1.32e+154) {
		tmp = t_4;
	} else {
		tmp = x1 + (x1 * (1.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) :: tmp
    t_0 = x1 * (x1 * 3.0d0)
    t_1 = x2 * ((x2 * 2.0d0) - 3.0d0)
    t_2 = (x1 * x1) + 1.0d0
    t_3 = 3.0d0 * (((t_0 - (x2 * 2.0d0)) - x1) / t_2)
    t_4 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((3.0d0 * t_0) + (t_2 * ((6.0d0 * (x1 * x1)) + ((((((x2 * 2.0d0) + t_0) - x1) / t_2) - 3.0d0) * ((x1 * 2.0d0) * (3.0d0 + ((-1.0d0) / x1))))))))))
    t_5 = x1 + ((x1 * (-2.0d0)) + (x2 * ((x1 * (-12.0d0)) - 6.0d0)))
    t_6 = x1 + (t_3 + (x1 + (4.0d0 * (x1 * t_1))))
    if (x1 <= (-5.8d+102)) then
        tmp = t_5
    else if (x1 <= (-900.0d0)) then
        tmp = t_4
    else if (x1 <= (-1.35d-209)) then
        tmp = t_6
    else if (x1 <= 4.6d-238) then
        tmp = t_5
    else if (x1 <= 460.0d0) then
        tmp = t_6
    else if (x1 <= 1.32d+154) then
        tmp = t_4
    else
        tmp = x1 + (x1 * (1.0d0 + (4.0d0 * t_1)))
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double t_0 = x1 * (x1 * 3.0);
	double t_1 = x2 * ((x2 * 2.0) - 3.0);
	double t_2 = (x1 * x1) + 1.0;
	double t_3 = 3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_2);
	double t_4 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_2 * ((6.0 * (x1 * x1)) + ((((((x2 * 2.0) + t_0) - x1) / t_2) - 3.0) * ((x1 * 2.0) * (3.0 + (-1.0 / x1))))))))));
	double t_5 = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
	double t_6 = x1 + (t_3 + (x1 + (4.0 * (x1 * t_1))));
	double tmp;
	if (x1 <= -5.8e+102) {
		tmp = t_5;
	} else if (x1 <= -900.0) {
		tmp = t_4;
	} else if (x1 <= -1.35e-209) {
		tmp = t_6;
	} else if (x1 <= 4.6e-238) {
		tmp = t_5;
	} else if (x1 <= 460.0) {
		tmp = t_6;
	} else if (x1 <= 1.32e+154) {
		tmp = t_4;
	} else {
		tmp = x1 + (x1 * (1.0 + (4.0 * t_1)));
	}
	return tmp;
}
def code(x1, x2):
	t_0 = x1 * (x1 * 3.0)
	t_1 = x2 * ((x2 * 2.0) - 3.0)
	t_2 = (x1 * x1) + 1.0
	t_3 = 3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_2)
	t_4 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_2 * ((6.0 * (x1 * x1)) + ((((((x2 * 2.0) + t_0) - x1) / t_2) - 3.0) * ((x1 * 2.0) * (3.0 + (-1.0 / x1))))))))))
	t_5 = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)))
	t_6 = x1 + (t_3 + (x1 + (4.0 * (x1 * t_1))))
	tmp = 0
	if x1 <= -5.8e+102:
		tmp = t_5
	elif x1 <= -900.0:
		tmp = t_4
	elif x1 <= -1.35e-209:
		tmp = t_6
	elif x1 <= 4.6e-238:
		tmp = t_5
	elif x1 <= 460.0:
		tmp = t_6
	elif x1 <= 1.32e+154:
		tmp = t_4
	else:
		tmp = x1 + (x1 * (1.0 + (4.0 * t_1)))
	return tmp
function code(x1, x2)
	t_0 = Float64(x1 * Float64(x1 * 3.0))
	t_1 = Float64(x2 * Float64(Float64(x2 * 2.0) - 3.0))
	t_2 = Float64(Float64(x1 * x1) + 1.0)
	t_3 = Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(x2 * 2.0)) - x1) / t_2))
	t_4 = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(3.0 * t_0) + Float64(t_2 * Float64(Float64(6.0 * Float64(x1 * x1)) + Float64(Float64(Float64(Float64(Float64(Float64(x2 * 2.0) + t_0) - x1) / t_2) - 3.0) * Float64(Float64(x1 * 2.0) * Float64(3.0 + Float64(-1.0 / x1)))))))))))
	t_5 = Float64(x1 + Float64(Float64(x1 * -2.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0))))
	t_6 = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(4.0 * Float64(x1 * t_1)))))
	tmp = 0.0
	if (x1 <= -5.8e+102)
		tmp = t_5;
	elseif (x1 <= -900.0)
		tmp = t_4;
	elseif (x1 <= -1.35e-209)
		tmp = t_6;
	elseif (x1 <= 4.6e-238)
		tmp = t_5;
	elseif (x1 <= 460.0)
		tmp = t_6;
	elseif (x1 <= 1.32e+154)
		tmp = t_4;
	else
		tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(4.0 * t_1))));
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	t_0 = x1 * (x1 * 3.0);
	t_1 = x2 * ((x2 * 2.0) - 3.0);
	t_2 = (x1 * x1) + 1.0;
	t_3 = 3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_2);
	t_4 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_2 * ((6.0 * (x1 * x1)) + ((((((x2 * 2.0) + t_0) - x1) / t_2) - 3.0) * ((x1 * 2.0) * (3.0 + (-1.0 / x1))))))))));
	t_5 = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
	t_6 = x1 + (t_3 + (x1 + (4.0 * (x1 * t_1))));
	tmp = 0.0;
	if (x1 <= -5.8e+102)
		tmp = t_5;
	elseif (x1 <= -900.0)
		tmp = t_4;
	elseif (x1 <= -1.35e-209)
		tmp = t_6;
	elseif (x1 <= 4.6e-238)
		tmp = t_5;
	elseif (x1 <= 460.0)
		tmp = t_6;
	elseif (x1 <= 1.32e+154)
		tmp = t_4;
	else
		tmp = x1 + (x1 * (1.0 + (4.0 * t_1)));
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x2 * N[(N[(x2 * 2.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(3.0 * N[(N[(N[(t$95$0 - N[(x2 * 2.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(t$95$3 + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 * t$95$0), $MachinePrecision] + N[(t$95$2 * N[(N[(6.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[(N[(N[(x2 * 2.0), $MachinePrecision] + t$95$0), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision] - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(3.0 + N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(x1 + N[(N[(x1 * -2.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(x1 + N[(t$95$3 + N[(x1 + N[(4.0 * N[(x1 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.8e+102], t$95$5, If[LessEqual[x1, -900.0], t$95$4, If[LessEqual[x1, -1.35e-209], t$95$6, If[LessEqual[x1, 4.6e-238], t$95$5, If[LessEqual[x1, 460.0], t$95$6, If[LessEqual[x1, 1.32e+154], t$95$4, N[(x1 + N[(x1 * N[(1.0 + N[(4.0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x1 \leq -900:\\
\;\;\;\;t\_4\\

\mathbf{elif}\;x1 \leq -1.35 \cdot 10^{-209}:\\
\;\;\;\;t\_6\\

\mathbf{elif}\;x1 \leq 4.6 \cdot 10^{-238}:\\
\;\;\;\;t\_5\\

\mathbf{elif}\;x1 \leq 460:\\
\;\;\;\;t\_6\\

\mathbf{elif}\;x1 \leq 1.32 \cdot 10^{+154}:\\
\;\;\;\;t\_4\\

\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot t\_1\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x1 < -5.8000000000000005e102 or -1.34999999999999999e-209 < x1 < 4.60000000000000009e-238

    1. Initial program 42.8%

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

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

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

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

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

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

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

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

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

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

    if -5.8000000000000005e102 < x1 < -900 or 460 < x1 < 1.31999999999999998e154

    1. Initial program 97.5%

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

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

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

    if -900 < x1 < -1.34999999999999999e-209 or 4.60000000000000009e-238 < x1 < 460

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

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

    if 1.31999999999999998e154 < x1

    1. Initial program 0.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -5.8 \cdot 10^{+102}:\\ \;\;\;\;x1 + \left(x1 \cdot -2 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\ \mathbf{elif}\;x1 \leq -900:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - x2 \cdot 2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot \left(x1 \cdot \left(x1 \cdot 3\right)\right) + \left(x1 \cdot x1 + 1\right) \cdot \left(6 \cdot \left(x1 \cdot x1\right) + \left(\frac{\left(x2 \cdot 2 + x1 \cdot \left(x1 \cdot 3\right)\right) - x1}{x1 \cdot x1 + 1} - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(3 + \frac{-1}{x1}\right)\right)\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq -1.35 \cdot 10^{-209}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - x2 \cdot 2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + 4 \cdot \left(x1 \cdot \left(x2 \cdot \left(x2 \cdot 2 - 3\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 4.6 \cdot 10^{-238}:\\ \;\;\;\;x1 + \left(x1 \cdot -2 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\ \mathbf{elif}\;x1 \leq 460:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - x2 \cdot 2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + 4 \cdot \left(x1 \cdot \left(x2 \cdot \left(x2 \cdot 2 - 3\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 1.32 \cdot 10^{+154}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - x2 \cdot 2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot \left(x1 \cdot \left(x1 \cdot 3\right)\right) + \left(x1 \cdot x1 + 1\right) \cdot \left(6 \cdot \left(x1 \cdot x1\right) + \left(\frac{\left(x2 \cdot 2 + x1 \cdot \left(x1 \cdot 3\right)\right) - x1}{x1 \cdot x1 + 1} - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(3 + \frac{-1}{x1}\right)\right)\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot \left(x2 \cdot \left(x2 \cdot 2 - 3\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 77.5% accurate, 1.3× speedup?

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

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

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

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


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

    1. Initial program 2.0%

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

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

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

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

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

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

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

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

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

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

    if -5.8000000000000005e102 < x1 < 1.31999999999999998e154

    1. Initial program 98.8%

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

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

    if 1.31999999999999998e154 < x1

    1. Initial program 0.0%

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

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

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

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

Alternative 10: 67.8% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 + \left(x1 \cdot -2 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\ t_1 := x1 \cdot x1 + 1\\ t_2 := x1 \cdot \left(x1 \cdot 3\right)\\ t_3 := 3 \cdot \frac{\left(t\_2 - x2 \cdot 2\right) - x1}{t\_1}\\ t_4 := x2 \cdot 2 - 3\\ t_5 := x2 \cdot t\_4\\ t_6 := x1 + \left(t\_3 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot t\_2 + t\_1 \cdot \left(6 \cdot \left(x1 \cdot x1\right) + t\_4 \cdot \left(\left(x1 \cdot 2\right) \cdot \left(3 + \frac{-1}{x1}\right)\right)\right)\right)\right)\right)\right)\\ t_7 := x1 + \left(t\_3 + \left(x1 + 4 \cdot \left(x1 \cdot t\_5\right)\right)\right)\\ \mathbf{if}\;x1 \leq -5.1 \cdot 10^{+95}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x1 \leq -26000000:\\ \;\;\;\;t\_6\\ \mathbf{elif}\;x1 \leq -3.4 \cdot 10^{-207}:\\ \;\;\;\;t\_7\\ \mathbf{elif}\;x1 \leq 8.5 \cdot 10^{-239}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x1 \leq 460:\\ \;\;\;\;t\_7\\ \mathbf{elif}\;x1 \leq 5.2 \cdot 10^{+125}:\\ \;\;\;\;t\_6\\ \mathbf{else}:\\ \;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot t\_5\right)\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (+ x1 (+ (* x1 -2.0) (* x2 (- (* x1 -12.0) 6.0)))))
        (t_1 (+ (* x1 x1) 1.0))
        (t_2 (* x1 (* x1 3.0)))
        (t_3 (* 3.0 (/ (- (- t_2 (* x2 2.0)) x1) t_1)))
        (t_4 (- (* x2 2.0) 3.0))
        (t_5 (* x2 t_4))
        (t_6
         (+
          x1
          (+
           t_3
           (+
            x1
            (+
             (* x1 (* x1 x1))
             (+
              (* 3.0 t_2)
              (*
               t_1
               (+
                (* 6.0 (* x1 x1))
                (* t_4 (* (* x1 2.0) (+ 3.0 (/ -1.0 x1))))))))))))
        (t_7 (+ x1 (+ t_3 (+ x1 (* 4.0 (* x1 t_5)))))))
   (if (<= x1 -5.1e+95)
     t_0
     (if (<= x1 -26000000.0)
       t_6
       (if (<= x1 -3.4e-207)
         t_7
         (if (<= x1 8.5e-239)
           t_0
           (if (<= x1 460.0)
             t_7
             (if (<= x1 5.2e+125) t_6 (+ x1 (* x1 (+ 1.0 (* 4.0 t_5))))))))))))
double code(double x1, double x2) {
	double t_0 = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
	double t_1 = (x1 * x1) + 1.0;
	double t_2 = x1 * (x1 * 3.0);
	double t_3 = 3.0 * (((t_2 - (x2 * 2.0)) - x1) / t_1);
	double t_4 = (x2 * 2.0) - 3.0;
	double t_5 = x2 * t_4;
	double t_6 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_2) + (t_1 * ((6.0 * (x1 * x1)) + (t_4 * ((x1 * 2.0) * (3.0 + (-1.0 / x1))))))))));
	double t_7 = x1 + (t_3 + (x1 + (4.0 * (x1 * t_5))));
	double tmp;
	if (x1 <= -5.1e+95) {
		tmp = t_0;
	} else if (x1 <= -26000000.0) {
		tmp = t_6;
	} else if (x1 <= -3.4e-207) {
		tmp = t_7;
	} else if (x1 <= 8.5e-239) {
		tmp = t_0;
	} else if (x1 <= 460.0) {
		tmp = t_7;
	} else if (x1 <= 5.2e+125) {
		tmp = t_6;
	} else {
		tmp = x1 + (x1 * (1.0 + (4.0 * t_5)));
	}
	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 * (-2.0d0)) + (x2 * ((x1 * (-12.0d0)) - 6.0d0)))
    t_1 = (x1 * x1) + 1.0d0
    t_2 = x1 * (x1 * 3.0d0)
    t_3 = 3.0d0 * (((t_2 - (x2 * 2.0d0)) - x1) / t_1)
    t_4 = (x2 * 2.0d0) - 3.0d0
    t_5 = x2 * t_4
    t_6 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((3.0d0 * t_2) + (t_1 * ((6.0d0 * (x1 * x1)) + (t_4 * ((x1 * 2.0d0) * (3.0d0 + ((-1.0d0) / x1))))))))))
    t_7 = x1 + (t_3 + (x1 + (4.0d0 * (x1 * t_5))))
    if (x1 <= (-5.1d+95)) then
        tmp = t_0
    else if (x1 <= (-26000000.0d0)) then
        tmp = t_6
    else if (x1 <= (-3.4d-207)) then
        tmp = t_7
    else if (x1 <= 8.5d-239) then
        tmp = t_0
    else if (x1 <= 460.0d0) then
        tmp = t_7
    else if (x1 <= 5.2d+125) then
        tmp = t_6
    else
        tmp = x1 + (x1 * (1.0d0 + (4.0d0 * t_5)))
    end if
    code = tmp
end function
public static double code(double x1, double x2) {
	double t_0 = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
	double t_1 = (x1 * x1) + 1.0;
	double t_2 = x1 * (x1 * 3.0);
	double t_3 = 3.0 * (((t_2 - (x2 * 2.0)) - x1) / t_1);
	double t_4 = (x2 * 2.0) - 3.0;
	double t_5 = x2 * t_4;
	double t_6 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_2) + (t_1 * ((6.0 * (x1 * x1)) + (t_4 * ((x1 * 2.0) * (3.0 + (-1.0 / x1))))))))));
	double t_7 = x1 + (t_3 + (x1 + (4.0 * (x1 * t_5))));
	double tmp;
	if (x1 <= -5.1e+95) {
		tmp = t_0;
	} else if (x1 <= -26000000.0) {
		tmp = t_6;
	} else if (x1 <= -3.4e-207) {
		tmp = t_7;
	} else if (x1 <= 8.5e-239) {
		tmp = t_0;
	} else if (x1 <= 460.0) {
		tmp = t_7;
	} else if (x1 <= 5.2e+125) {
		tmp = t_6;
	} else {
		tmp = x1 + (x1 * (1.0 + (4.0 * t_5)));
	}
	return tmp;
}
def code(x1, x2):
	t_0 = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)))
	t_1 = (x1 * x1) + 1.0
	t_2 = x1 * (x1 * 3.0)
	t_3 = 3.0 * (((t_2 - (x2 * 2.0)) - x1) / t_1)
	t_4 = (x2 * 2.0) - 3.0
	t_5 = x2 * t_4
	t_6 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_2) + (t_1 * ((6.0 * (x1 * x1)) + (t_4 * ((x1 * 2.0) * (3.0 + (-1.0 / x1))))))))))
	t_7 = x1 + (t_3 + (x1 + (4.0 * (x1 * t_5))))
	tmp = 0
	if x1 <= -5.1e+95:
		tmp = t_0
	elif x1 <= -26000000.0:
		tmp = t_6
	elif x1 <= -3.4e-207:
		tmp = t_7
	elif x1 <= 8.5e-239:
		tmp = t_0
	elif x1 <= 460.0:
		tmp = t_7
	elif x1 <= 5.2e+125:
		tmp = t_6
	else:
		tmp = x1 + (x1 * (1.0 + (4.0 * t_5)))
	return tmp
function code(x1, x2)
	t_0 = Float64(x1 + Float64(Float64(x1 * -2.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0))))
	t_1 = Float64(Float64(x1 * x1) + 1.0)
	t_2 = Float64(x1 * Float64(x1 * 3.0))
	t_3 = Float64(3.0 * Float64(Float64(Float64(t_2 - Float64(x2 * 2.0)) - x1) / t_1))
	t_4 = Float64(Float64(x2 * 2.0) - 3.0)
	t_5 = Float64(x2 * t_4)
	t_6 = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(3.0 * t_2) + Float64(t_1 * Float64(Float64(6.0 * Float64(x1 * x1)) + Float64(t_4 * Float64(Float64(x1 * 2.0) * Float64(3.0 + Float64(-1.0 / x1)))))))))))
	t_7 = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(4.0 * Float64(x1 * t_5)))))
	tmp = 0.0
	if (x1 <= -5.1e+95)
		tmp = t_0;
	elseif (x1 <= -26000000.0)
		tmp = t_6;
	elseif (x1 <= -3.4e-207)
		tmp = t_7;
	elseif (x1 <= 8.5e-239)
		tmp = t_0;
	elseif (x1 <= 460.0)
		tmp = t_7;
	elseif (x1 <= 5.2e+125)
		tmp = t_6;
	else
		tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(4.0 * t_5))));
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	t_0 = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
	t_1 = (x1 * x1) + 1.0;
	t_2 = x1 * (x1 * 3.0);
	t_3 = 3.0 * (((t_2 - (x2 * 2.0)) - x1) / t_1);
	t_4 = (x2 * 2.0) - 3.0;
	t_5 = x2 * t_4;
	t_6 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_2) + (t_1 * ((6.0 * (x1 * x1)) + (t_4 * ((x1 * 2.0) * (3.0 + (-1.0 / x1))))))))));
	t_7 = x1 + (t_3 + (x1 + (4.0 * (x1 * t_5))));
	tmp = 0.0;
	if (x1 <= -5.1e+95)
		tmp = t_0;
	elseif (x1 <= -26000000.0)
		tmp = t_6;
	elseif (x1 <= -3.4e-207)
		tmp = t_7;
	elseif (x1 <= 8.5e-239)
		tmp = t_0;
	elseif (x1 <= 460.0)
		tmp = t_7;
	elseif (x1 <= 5.2e+125)
		tmp = t_6;
	else
		tmp = x1 + (x1 * (1.0 + (4.0 * t_5)));
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(N[(x1 * -2.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(3.0 * N[(N[(N[(t$95$2 - N[(x2 * 2.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x2 * 2.0), $MachinePrecision] - 3.0), $MachinePrecision]}, Block[{t$95$5 = N[(x2 * t$95$4), $MachinePrecision]}, Block[{t$95$6 = N[(x1 + N[(t$95$3 + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 * t$95$2), $MachinePrecision] + N[(t$95$1 * N[(N[(6.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(t$95$4 * N[(N[(x1 * 2.0), $MachinePrecision] * N[(3.0 + N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(x1 + N[(t$95$3 + N[(x1 + N[(4.0 * N[(x1 * t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.1e+95], t$95$0, If[LessEqual[x1, -26000000.0], t$95$6, If[LessEqual[x1, -3.4e-207], t$95$7, If[LessEqual[x1, 8.5e-239], t$95$0, If[LessEqual[x1, 460.0], t$95$7, If[LessEqual[x1, 5.2e+125], t$95$6, N[(x1 + N[(x1 * N[(1.0 + N[(4.0 * t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x1 \leq -26000000:\\
\;\;\;\;t\_6\\

\mathbf{elif}\;x1 \leq -3.4 \cdot 10^{-207}:\\
\;\;\;\;t\_7\\

\mathbf{elif}\;x1 \leq 8.5 \cdot 10^{-239}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;x1 \leq 460:\\
\;\;\;\;t\_7\\

\mathbf{elif}\;x1 \leq 5.2 \cdot 10^{+125}:\\
\;\;\;\;t\_6\\

\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot t\_5\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x1 < -5.10000000000000003e95 or -3.39999999999999999e-207 < x1 < 8.49999999999999958e-239

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

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

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

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

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

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

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

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

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

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

    if -5.10000000000000003e95 < x1 < -2.6e7 or 460 < x1 < 5.20000000000000006e125

    1. Initial program 97.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 81.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 74.2%

      \[\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) \]
    5. Taylor expanded in x1 around 0 72.2%

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

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

    if -2.6e7 < x1 < -3.39999999999999999e-207 or 8.49999999999999958e-239 < x1 < 460

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

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

    if 5.20000000000000006e125 < x1

    1. Initial program 12.5%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -5.1 \cdot 10^{+95}:\\ \;\;\;\;x1 + \left(x1 \cdot -2 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\ \mathbf{elif}\;x1 \leq -26000000:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - x2 \cdot 2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot \left(x1 \cdot \left(x1 \cdot 3\right)\right) + \left(x1 \cdot x1 + 1\right) \cdot \left(6 \cdot \left(x1 \cdot x1\right) + \left(x2 \cdot 2 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(3 + \frac{-1}{x1}\right)\right)\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq -3.4 \cdot 10^{-207}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - x2 \cdot 2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + 4 \cdot \left(x1 \cdot \left(x2 \cdot \left(x2 \cdot 2 - 3\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 8.5 \cdot 10^{-239}:\\ \;\;\;\;x1 + \left(x1 \cdot -2 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\ \mathbf{elif}\;x1 \leq 460:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - x2 \cdot 2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + 4 \cdot \left(x1 \cdot \left(x2 \cdot \left(x2 \cdot 2 - 3\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 5.2 \cdot 10^{+125}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - x2 \cdot 2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot \left(x1 \cdot \left(x1 \cdot 3\right)\right) + \left(x1 \cdot x1 + 1\right) \cdot \left(6 \cdot \left(x1 \cdot x1\right) + \left(x2 \cdot 2 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(3 + \frac{-1}{x1}\right)\right)\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot \left(x2 \cdot \left(x2 \cdot 2 - 3\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 58.6% accurate, 2.8× speedup?

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

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

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

\mathbf{elif}\;x1 \leq 6 \cdot 10^{-238}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x1 < -1.35000000000000003e154 or -9e-215 < x1 < 5.9999999999999999e-238

    1. Initial program 47.8%

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

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

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

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

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

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

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

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

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

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

    if -1.35000000000000003e154 < x1 < -9e-215

    1. Initial program 83.3%

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

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

    if 5.9999999999999999e-238 < x1

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 59.3% accurate, 4.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -7.5 \cdot 10^{+94} \lor \neg \left(x1 \leq -1.8 \cdot 10^{-217}\right) \land x1 \leq 2.15 \cdot 10^{-238}:\\
\;\;\;\;x1 + \left(x1 \cdot -2 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x1 < -7.49999999999999978e94 or -1.79999999999999991e-217 < x1 < 2.14999999999999984e-238

    1. Initial program 42.9%

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

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

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

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

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

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

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

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

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

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

    if -7.49999999999999978e94 < x1 < -1.79999999999999991e-217 or 2.14999999999999984e-238 < x1

    1. Initial program 82.4%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -7.5 \cdot 10^{+94} \lor \neg \left(x1 \leq -1.8 \cdot 10^{-217}\right) \land x1 \leq 2.15 \cdot 10^{-238}:\\ \;\;\;\;x1 + \left(x1 \cdot -2 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 \cdot \left(4 \cdot \left(x2 \cdot \left(x2 \cdot 2 - 3\right)\right) + -1\right) + x2 \cdot -6\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 54.0% accurate, 4.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -2.8 \cdot 10^{+94} \lor \neg \left(x1 \leq -1.85 \cdot 10^{-110}\right) \land x1 \leq 1.8 \cdot 10^{-63}:\\
\;\;\;\;x1 + \left(x1 \cdot -2 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x1 < -2.79999999999999998e94 or -1.85000000000000008e-110 < x1 < 1.80000000000000004e-63

    1. Initial program 64.4%

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

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

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

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

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

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

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

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

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

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

    if -2.79999999999999998e94 < x1 < -1.85000000000000008e-110 or 1.80000000000000004e-63 < x1

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -2.8 \cdot 10^{+94} \lor \neg \left(x1 \leq -1.85 \cdot 10^{-110}\right) \land x1 \leq 1.8 \cdot 10^{-63}:\\ \;\;\;\;x1 + \left(x1 \cdot -2 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 \cdot \left(4 \cdot \left(x2 \cdot \left(x2 \cdot 2 - 3\right)\right) + -1\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 46.8% accurate, 5.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x1 < -1.1500000000000001e-118 or 1.44999999999999994e-126 < x1

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

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

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

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

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

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

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

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

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

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

    if -1.1500000000000001e-118 < x1 < 1.44999999999999994e-126

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

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

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

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

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

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

        \[\leadsto \color{blue}{x2 \cdot -6} \]
    9. Simplified72.3%

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

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

Alternative 15: 31.6% accurate, 8.4× speedup?

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

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

\mathbf{elif}\;x2 \leq 7.1 \cdot 10^{-174}:\\
\;\;\;\;-x1\\

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


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

    1. Initial program 68.4%

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

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

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

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

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

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

        \[\leadsto \color{blue}{x2 \cdot -6} \]
    9. Simplified35.3%

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

    if -2.39999999999999987e-122 < x2 < 7.0999999999999999e-174

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-x1} \]
    9. Simplified31.8%

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

    if 7.0999999999999999e-174 < x2

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x2 \leq -2.4 \cdot 10^{-122}:\\ \;\;\;\;x2 \cdot -6\\ \mathbf{elif}\;x2 \leq 7.1 \cdot 10^{-174}:\\ \;\;\;\;-x1\\ \mathbf{else}:\\ \;\;\;\;x1 + x2 \cdot -6\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 31.3% accurate, 9.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -2.8 \cdot 10^{-122} \lor \neg \left(x2 \leq 4.3 \cdot 10^{-175}\right):\\
\;\;\;\;x2 \cdot -6\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x2 < -2.7999999999999999e-122 or 4.29999999999999998e-175 < x2

    1. Initial program 67.8%

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

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

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

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

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

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

        \[\leadsto \color{blue}{x2 \cdot -6} \]
    9. Simplified31.3%

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

    if -2.7999999999999999e-122 < x2 < 4.29999999999999998e-175

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-x1} \]
    9. Simplified31.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x2 \leq -2.8 \cdot 10^{-122} \lor \neg \left(x2 \leq 4.3 \cdot 10^{-175}\right):\\ \;\;\;\;x2 \cdot -6\\ \mathbf{else}:\\ \;\;\;\;-x1\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 13.9% accurate, 63.5× speedup?

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

\\
-x1
\end{array}
Derivation
  1. Initial program 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. Add Preprocessing
  3. Taylor expanded in x1 around 0 46.2%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-x1} \]
  9. Simplified11.2%

    \[\leadsto \color{blue}{-x1} \]
  10. Final simplification11.2%

    \[\leadsto -x1 \]
  11. Add Preprocessing

Alternative 18: 3.3% accurate, 127.0× speedup?

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

\\
x1
\end{array}
Derivation
  1. Initial program 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. Add Preprocessing
  3. Taylor expanded in x1 around 0 46.2%

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

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

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

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

    \[\leadsto \color{blue}{x1} \]
  8. Final simplification3.1%

    \[\leadsto x1 \]
  9. Add Preprocessing

Reproduce

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