Rosa's FloatVsDoubleBenchmark

Percentage Accurate: 69.8% → 99.5%
Time: 1.0min
Alternatives: 20
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 20 alternatives:

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

Initial Program: 69.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.5% accurate, 0.1× speedup?

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

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

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


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

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

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

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

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

      \[\leadsto x1 + \color{blue}{x2 \cdot -6} \]
    7. Step-by-step derivation
      1. add-cbrt-cube43.1%

        \[\leadsto \color{blue}{\sqrt[3]{\left(\left(x1 + x2 \cdot -6\right) \cdot \left(x1 + x2 \cdot -6\right)\right) \cdot \left(x1 + x2 \cdot -6\right)}} \]
      2. pow1/3100.0%

        \[\leadsto \color{blue}{{\left(\left(\left(x1 + x2 \cdot -6\right) \cdot \left(x1 + x2 \cdot -6\right)\right) \cdot \left(x1 + x2 \cdot -6\right)\right)}^{0.3333333333333333}} \]
      3. pow3100.0%

        \[\leadsto {\color{blue}{\left({\left(x1 + x2 \cdot -6\right)}^{3}\right)}}^{0.3333333333333333} \]
      4. +-commutative100.0%

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

        \[\leadsto {\left({\color{blue}{\left(\mathsf{fma}\left(x2, -6, x1\right)\right)}}^{3}\right)}^{0.3333333333333333} \]
    8. Applied egg-rr100.0%

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

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

Alternative 2: 99.3% accurate, 0.1× speedup?

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

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

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


\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. 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 +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 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.0%

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

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

      \[\leadsto x1 + \color{blue}{x2 \cdot -6} \]
    7. Step-by-step derivation
      1. add-cbrt-cube43.1%

        \[\leadsto \color{blue}{\sqrt[3]{\left(\left(x1 + x2 \cdot -6\right) \cdot \left(x1 + x2 \cdot -6\right)\right) \cdot \left(x1 + x2 \cdot -6\right)}} \]
      2. pow1/3100.0%

        \[\leadsto \color{blue}{{\left(\left(\left(x1 + x2 \cdot -6\right) \cdot \left(x1 + x2 \cdot -6\right)\right) \cdot \left(x1 + x2 \cdot -6\right)\right)}^{0.3333333333333333}} \]
      3. pow3100.0%

        \[\leadsto {\color{blue}{\left({\left(x1 + x2 \cdot -6\right)}^{3}\right)}}^{0.3333333333333333} \]
      4. +-commutative100.0%

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

        \[\leadsto {\left({\color{blue}{\left(\mathsf{fma}\left(x2, -6, x1\right)\right)}}^{3}\right)}^{0.3333333333333333} \]
    8. Applied egg-rr100.0%

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

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

Alternative 3: 99.3% accurate, 0.3× speedup?

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

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

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


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

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

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

      \[\leadsto x1 + \color{blue}{x2 \cdot -6} \]
    7. Step-by-step derivation
      1. add-cbrt-cube43.1%

        \[\leadsto \color{blue}{\sqrt[3]{\left(\left(x1 + x2 \cdot -6\right) \cdot \left(x1 + x2 \cdot -6\right)\right) \cdot \left(x1 + x2 \cdot -6\right)}} \]
      2. pow1/3100.0%

        \[\leadsto \color{blue}{{\left(\left(\left(x1 + x2 \cdot -6\right) \cdot \left(x1 + x2 \cdot -6\right)\right) \cdot \left(x1 + x2 \cdot -6\right)\right)}^{0.3333333333333333}} \]
      3. pow3100.0%

        \[\leadsto {\color{blue}{\left({\left(x1 + x2 \cdot -6\right)}^{3}\right)}}^{0.3333333333333333} \]
      4. +-commutative100.0%

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

        \[\leadsto {\left({\color{blue}{\left(\mathsf{fma}\left(x2, -6, x1\right)\right)}}^{3}\right)}^{0.3333333333333333} \]
    8. Applied egg-rr100.0%

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

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

Alternative 4: 86.4% accurate, 0.5× speedup?

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

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

      \[\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 simplification90.0%

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

Alternative 5: 75.8% accurate, 0.5× speedup?

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

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

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


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

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

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

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

Alternative 6: 91.4% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;x1 \leq -8.8 \cdot 10^{+49}:\\
\;\;\;\;x1 + \left(t_4 + \left(x1 + 6 \cdot {x1}^{4}\right)\right)\\

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

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


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

    1. Initial program 0.0%

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

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

    if -1.31999999999999998e154 < x1 < -8.8000000000000003e49

    1. Initial program 59.4%

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

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

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

      \[\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 -8.8000000000000003e49 < x1 < 1e104

    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 1e104 < x1

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

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

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

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

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

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

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

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

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

        \[\leadsto x1 + \left(\left(4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right) + x1\right) + 3 \cdot \mathsf{fma}\left(x2, -2, \left(\color{blue}{{x1}^{2}} \cdot x1 + {x1}^{2} \cdot \left(3 - -2 \cdot x2\right)\right) - x1\right)\right) \]
      9. distribute-lft-out97.4%

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

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

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

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

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

Alternative 7: 78.7% accurate, 0.9× speedup?

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

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

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

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


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

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

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

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

      \[\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 -8.8000000000000003e49 < x1 < 1.35000000000000003e154

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

    if 1.35000000000000003e154 < x1

    1. Initial program 0.0%

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

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

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

Alternative 8: 67.6% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 \cdot x1 + 1\\ t_1 := x2 \cdot \left(3 - 2 \cdot x2\right)\\ t_2 := x1 \cdot \left(x1 \cdot 3\right)\\ t_3 := 3 \cdot \frac{\left(t_2 - 2 \cdot x2\right) - x1}{t_0}\\ t_4 := x1 + \left(t_3 - \left(\left(\left(t_0 \cdot \left(\frac{1}{x1} \cdot \left(\left(x1 \cdot 2\right) \cdot \left(3 + \frac{-1}{x1}\right)\right) + \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot \frac{x1 - \left(t_2 + 2 \cdot x2\right)}{t_0}\right)\right) - 3 \cdot t_2\right) - x1 \cdot \left(x1 \cdot x1\right)\right) - x1\right)\right)\\ \mathbf{if}\;x1 \leq -8 \cdot 10^{+19}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;x1 \leq -1.6 \cdot 10^{-207}:\\ \;\;\;\;x1 + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right) + x2 \cdot -6\right)\\ \mathbf{elif}\;x1 \leq 1.25 \cdot 10^{-244}:\\ \;\;\;\;x2 \cdot -6 - x1\\ \mathbf{elif}\;x1 \leq 2100000000:\\ \;\;\;\;x1 + \left(t_3 + \left(x1 - 4 \cdot \left(x1 \cdot t_1\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 1.35 \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) 1.0))
        (t_1 (* x2 (- 3.0 (* 2.0 x2))))
        (t_2 (* x1 (* x1 3.0)))
        (t_3 (* 3.0 (/ (- (- t_2 (* 2.0 x2)) x1) t_0)))
        (t_4
         (+
          x1
          (-
           t_3
           (-
            (-
             (-
              (*
               t_0
               (+
                (* (/ 1.0 x1) (* (* x1 2.0) (+ 3.0 (/ -1.0 x1))))
                (*
                 (* x1 x1)
                 (+ 6.0 (* 4.0 (/ (- x1 (+ t_2 (* 2.0 x2))) t_0))))))
              (* 3.0 t_2))
             (* x1 (* x1 x1)))
            x1)))))
   (if (<= x1 -8e+19)
     t_4
     (if (<= x1 -1.6e-207)
       (+ x1 (+ (* x1 (- (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) 2.0)) (* x2 -6.0)))
       (if (<= x1 1.25e-244)
         (- (* x2 -6.0) x1)
         (if (<= x1 2100000000.0)
           (+ x1 (+ t_3 (- x1 (* 4.0 (* x1 t_1)))))
           (if (<= x1 1.35e+154) t_4 (+ x1 (* x1 (- 1.0 (* 4.0 t_1)))))))))))
double code(double x1, double x2) {
	double t_0 = (x1 * x1) + 1.0;
	double t_1 = x2 * (3.0 - (2.0 * x2));
	double t_2 = x1 * (x1 * 3.0);
	double t_3 = 3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0);
	double t_4 = x1 + (t_3 - ((((t_0 * (((1.0 / x1) * ((x1 * 2.0) * (3.0 + (-1.0 / x1)))) + ((x1 * x1) * (6.0 + (4.0 * ((x1 - (t_2 + (2.0 * x2))) / t_0)))))) - (3.0 * t_2)) - (x1 * (x1 * x1))) - x1));
	double tmp;
	if (x1 <= -8e+19) {
		tmp = t_4;
	} else if (x1 <= -1.6e-207) {
		tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0));
	} else if (x1 <= 1.25e-244) {
		tmp = (x2 * -6.0) - x1;
	} else if (x1 <= 2100000000.0) {
		tmp = x1 + (t_3 + (x1 - (4.0 * (x1 * t_1))));
	} else if (x1 <= 1.35e+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) :: tmp
    t_0 = (x1 * x1) + 1.0d0
    t_1 = x2 * (3.0d0 - (2.0d0 * x2))
    t_2 = x1 * (x1 * 3.0d0)
    t_3 = 3.0d0 * (((t_2 - (2.0d0 * x2)) - x1) / t_0)
    t_4 = x1 + (t_3 - ((((t_0 * (((1.0d0 / x1) * ((x1 * 2.0d0) * (3.0d0 + ((-1.0d0) / x1)))) + ((x1 * x1) * (6.0d0 + (4.0d0 * ((x1 - (t_2 + (2.0d0 * x2))) / t_0)))))) - (3.0d0 * t_2)) - (x1 * (x1 * x1))) - x1))
    if (x1 <= (-8d+19)) then
        tmp = t_4
    else if (x1 <= (-1.6d-207)) then
        tmp = x1 + ((x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) - 2.0d0)) + (x2 * (-6.0d0)))
    else if (x1 <= 1.25d-244) then
        tmp = (x2 * (-6.0d0)) - x1
    else if (x1 <= 2100000000.0d0) then
        tmp = x1 + (t_3 + (x1 - (4.0d0 * (x1 * t_1))))
    else if (x1 <= 1.35d+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) + 1.0;
	double t_1 = x2 * (3.0 - (2.0 * x2));
	double t_2 = x1 * (x1 * 3.0);
	double t_3 = 3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0);
	double t_4 = x1 + (t_3 - ((((t_0 * (((1.0 / x1) * ((x1 * 2.0) * (3.0 + (-1.0 / x1)))) + ((x1 * x1) * (6.0 + (4.0 * ((x1 - (t_2 + (2.0 * x2))) / t_0)))))) - (3.0 * t_2)) - (x1 * (x1 * x1))) - x1));
	double tmp;
	if (x1 <= -8e+19) {
		tmp = t_4;
	} else if (x1 <= -1.6e-207) {
		tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0));
	} else if (x1 <= 1.25e-244) {
		tmp = (x2 * -6.0) - x1;
	} else if (x1 <= 2100000000.0) {
		tmp = x1 + (t_3 + (x1 - (4.0 * (x1 * t_1))));
	} else if (x1 <= 1.35e+154) {
		tmp = t_4;
	} else {
		tmp = x1 + (x1 * (1.0 - (4.0 * t_1)));
	}
	return tmp;
}
def code(x1, x2):
	t_0 = (x1 * x1) + 1.0
	t_1 = x2 * (3.0 - (2.0 * x2))
	t_2 = x1 * (x1 * 3.0)
	t_3 = 3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)
	t_4 = x1 + (t_3 - ((((t_0 * (((1.0 / x1) * ((x1 * 2.0) * (3.0 + (-1.0 / x1)))) + ((x1 * x1) * (6.0 + (4.0 * ((x1 - (t_2 + (2.0 * x2))) / t_0)))))) - (3.0 * t_2)) - (x1 * (x1 * x1))) - x1))
	tmp = 0
	if x1 <= -8e+19:
		tmp = t_4
	elif x1 <= -1.6e-207:
		tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0))
	elif x1 <= 1.25e-244:
		tmp = (x2 * -6.0) - x1
	elif x1 <= 2100000000.0:
		tmp = x1 + (t_3 + (x1 - (4.0 * (x1 * t_1))))
	elif x1 <= 1.35e+154:
		tmp = t_4
	else:
		tmp = x1 + (x1 * (1.0 - (4.0 * t_1)))
	return tmp
function code(x1, x2)
	t_0 = Float64(Float64(x1 * x1) + 1.0)
	t_1 = Float64(x2 * Float64(3.0 - Float64(2.0 * x2)))
	t_2 = Float64(x1 * Float64(x1 * 3.0))
	t_3 = Float64(3.0 * Float64(Float64(Float64(t_2 - Float64(2.0 * x2)) - x1) / t_0))
	t_4 = Float64(x1 + Float64(t_3 - Float64(Float64(Float64(Float64(t_0 * Float64(Float64(Float64(1.0 / x1) * Float64(Float64(x1 * 2.0) * Float64(3.0 + Float64(-1.0 / x1)))) + Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * Float64(Float64(x1 - Float64(t_2 + Float64(2.0 * x2))) / t_0)))))) - Float64(3.0 * t_2)) - Float64(x1 * Float64(x1 * x1))) - x1)))
	tmp = 0.0
	if (x1 <= -8e+19)
		tmp = t_4;
	elseif (x1 <= -1.6e-207)
		tmp = Float64(x1 + Float64(Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 2.0)) + Float64(x2 * -6.0)));
	elseif (x1 <= 1.25e-244)
		tmp = Float64(Float64(x2 * -6.0) - x1);
	elseif (x1 <= 2100000000.0)
		tmp = Float64(x1 + Float64(t_3 + Float64(x1 - Float64(4.0 * Float64(x1 * t_1)))));
	elseif (x1 <= 1.35e+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) + 1.0;
	t_1 = x2 * (3.0 - (2.0 * x2));
	t_2 = x1 * (x1 * 3.0);
	t_3 = 3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0);
	t_4 = x1 + (t_3 - ((((t_0 * (((1.0 / x1) * ((x1 * 2.0) * (3.0 + (-1.0 / x1)))) + ((x1 * x1) * (6.0 + (4.0 * ((x1 - (t_2 + (2.0 * x2))) / t_0)))))) - (3.0 * t_2)) - (x1 * (x1 * x1))) - x1));
	tmp = 0.0;
	if (x1 <= -8e+19)
		tmp = t_4;
	elseif (x1 <= -1.6e-207)
		tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0));
	elseif (x1 <= 1.25e-244)
		tmp = (x2 * -6.0) - x1;
	elseif (x1 <= 2100000000.0)
		tmp = x1 + (t_3 + (x1 - (4.0 * (x1 * t_1))));
	elseif (x1 <= 1.35e+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[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(3.0 * N[(N[(N[(t$95$2 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(t$95$3 - N[(N[(N[(N[(t$95$0 * N[(N[(N[(1.0 / x1), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(3.0 + N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * N[(N[(x1 - N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(3.0 * t$95$2), $MachinePrecision]), $MachinePrecision] - N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -8e+19], t$95$4, If[LessEqual[x1, -1.6e-207], N[(x1 + N[(N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.25e-244], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision], If[LessEqual[x1, 2100000000.0], N[(x1 + N[(t$95$3 + N[(x1 - N[(4.0 * N[(x1 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+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 x1 + 1\\
t_1 := x2 \cdot \left(3 - 2 \cdot x2\right)\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := 3 \cdot \frac{\left(t_2 - 2 \cdot x2\right) - x1}{t_0}\\
t_4 := x1 + \left(t_3 - \left(\left(\left(t_0 \cdot \left(\frac{1}{x1} \cdot \left(\left(x1 \cdot 2\right) \cdot \left(3 + \frac{-1}{x1}\right)\right) + \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot \frac{x1 - \left(t_2 + 2 \cdot x2\right)}{t_0}\right)\right) - 3 \cdot t_2\right) - x1 \cdot \left(x1 \cdot x1\right)\right) - x1\right)\right)\\
\mathbf{if}\;x1 \leq -8 \cdot 10^{+19}:\\
\;\;\;\;t_4\\

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

\mathbf{elif}\;x1 \leq 1.25 \cdot 10^{-244}:\\
\;\;\;\;x2 \cdot -6 - x1\\

\mathbf{elif}\;x1 \leq 2100000000:\\
\;\;\;\;x1 + \left(t_3 + \left(x1 - 4 \cdot \left(x1 \cdot t_1\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 1.35 \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 5 regimes
  2. if x1 < -8e19 or 2.1e9 < x1 < 1.35000000000000003e154

    1. Initial program 57.3%

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

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

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

    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 87.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 0 87.9%

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

    if -1.6000000000000002e-207 < x1 < 1.24999999999999999e-244

    1. Initial program 99.3%

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

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

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

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

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

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

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

      \[\leadsto x1 + \color{blue}{\left(-6 \cdot x2 + x1 \cdot \left(8 \cdot {x2}^{2} - 2\right)\right)} \]
    7. Taylor expanded in x2 around 0 97.5%

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

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

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

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

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

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

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

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

    if 1.24999999999999999e-244 < x1 < 2.1e9

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

    if 1.35000000000000003e154 < x1

    1. Initial program 0.0%

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

      \[\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 simplification71.8%

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

Alternative 9: 66.2% accurate, 1.2× speedup?

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

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

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

\mathbf{elif}\;x1 \leq 1.6 \cdot 10^{-243}:\\
\;\;\;\;x2 \cdot -6 - x1\\

\mathbf{elif}\;x1 \leq 25000000000:\\
\;\;\;\;x1 + \left(t_3 + \left(x1 - 4 \cdot \left(x1 \cdot t_0\right)\right)\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if x1 < -3.6e19 or 2.5e10 < x1 < 1.35000000000000003e154

    1. Initial program 57.3%

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

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

      \[\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 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 -3.6e19 < x1 < -7.4000000000000004e-208

    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 87.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 0 87.9%

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

    if -7.4000000000000004e-208 < x1 < 1.5999999999999999e-243

    1. Initial program 99.3%

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

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

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

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

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

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

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

      \[\leadsto x1 + \color{blue}{\left(-6 \cdot x2 + x1 \cdot \left(8 \cdot {x2}^{2} - 2\right)\right)} \]
    7. Taylor expanded in x2 around 0 97.5%

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

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

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

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

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

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

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

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

    if 1.5999999999999999e-243 < x1 < 2.5e10

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

    if 1.35000000000000003e154 < x1

    1. Initial program 0.0%

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

      \[\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 simplification69.6%

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

Alternative 10: 75.7% accurate, 1.2× speedup?

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

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

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


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

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

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

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

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

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

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

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

    if 1.35000000000000003e154 < x1

    1. Initial program 0.0%

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

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

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

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

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

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


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

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

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

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

    1. Initial program 0.0%

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

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

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

Alternative 12: 64.8% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x1 \cdot x1 + 1\\ t_1 := 2 \cdot x2 - 3\\ t_2 := x1 \cdot \left(x1 \cdot 3\right)\\ t_3 := 3 \cdot \frac{\left(t_2 - 2 \cdot x2\right) - x1}{t_0}\\ t_4 := x1 + \left(t_3 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot t_2 + t_0 \cdot \left(\left(x1 \cdot x1\right) \cdot 6 + t_1 \cdot \left(\left(x1 \cdot 2\right) \cdot \left(3 + \frac{-1}{x1}\right)\right)\right)\right)\right)\right)\right)\\ t_5 := x2 \cdot \left(3 - 2 \cdot x2\right)\\ \mathbf{if}\;x1 \leq -2.4 \cdot 10^{+36}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;x1 \leq -3.8 \cdot 10^{-205}:\\ \;\;\;\;x1 + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot t_1\right) - 2\right) + x2 \cdot -6\right)\\ \mathbf{elif}\;x1 \leq 1.85 \cdot 10^{-244}:\\ \;\;\;\;x2 \cdot -6 - x1\\ \mathbf{elif}\;x1 \leq 380000000:\\ \;\;\;\;x1 + \left(t_3 + \left(x1 - 4 \cdot \left(x1 \cdot t_5\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;t_4\\ \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) 1.0))
        (t_1 (- (* 2.0 x2) 3.0))
        (t_2 (* x1 (* x1 3.0)))
        (t_3 (* 3.0 (/ (- (- t_2 (* 2.0 x2)) x1) t_0)))
        (t_4
         (+
          x1
          (+
           t_3
           (+
            x1
            (+
             (* x1 (* x1 x1))
             (+
              (* 3.0 t_2)
              (*
               t_0
               (+
                (* (* x1 x1) 6.0)
                (* t_1 (* (* x1 2.0) (+ 3.0 (/ -1.0 x1))))))))))))
        (t_5 (* x2 (- 3.0 (* 2.0 x2)))))
   (if (<= x1 -2.4e+36)
     t_4
     (if (<= x1 -3.8e-205)
       (+ x1 (+ (* x1 (- (* 4.0 (* x2 t_1)) 2.0)) (* x2 -6.0)))
       (if (<= x1 1.85e-244)
         (- (* x2 -6.0) x1)
         (if (<= x1 380000000.0)
           (+ x1 (+ t_3 (- x1 (* 4.0 (* x1 t_5)))))
           (if (<= x1 1.35e+154) t_4 (+ x1 (* x1 (- 1.0 (* 4.0 t_5)))))))))))
double code(double x1, double x2) {
	double t_0 = (x1 * x1) + 1.0;
	double t_1 = (2.0 * x2) - 3.0;
	double t_2 = x1 * (x1 * 3.0);
	double t_3 = 3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0);
	double t_4 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_2) + (t_0 * (((x1 * x1) * 6.0) + (t_1 * ((x1 * 2.0) * (3.0 + (-1.0 / x1))))))))));
	double t_5 = x2 * (3.0 - (2.0 * x2));
	double tmp;
	if (x1 <= -2.4e+36) {
		tmp = t_4;
	} else if (x1 <= -3.8e-205) {
		tmp = x1 + ((x1 * ((4.0 * (x2 * t_1)) - 2.0)) + (x2 * -6.0));
	} else if (x1 <= 1.85e-244) {
		tmp = (x2 * -6.0) - x1;
	} else if (x1 <= 380000000.0) {
		tmp = x1 + (t_3 + (x1 - (4.0 * (x1 * t_5))));
	} else if (x1 <= 1.35e+154) {
		tmp = t_4;
	} 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) :: tmp
    t_0 = (x1 * x1) + 1.0d0
    t_1 = (2.0d0 * x2) - 3.0d0
    t_2 = x1 * (x1 * 3.0d0)
    t_3 = 3.0d0 * (((t_2 - (2.0d0 * x2)) - x1) / t_0)
    t_4 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((3.0d0 * t_2) + (t_0 * (((x1 * x1) * 6.0d0) + (t_1 * ((x1 * 2.0d0) * (3.0d0 + ((-1.0d0) / x1))))))))))
    t_5 = x2 * (3.0d0 - (2.0d0 * x2))
    if (x1 <= (-2.4d+36)) then
        tmp = t_4
    else if (x1 <= (-3.8d-205)) then
        tmp = x1 + ((x1 * ((4.0d0 * (x2 * t_1)) - 2.0d0)) + (x2 * (-6.0d0)))
    else if (x1 <= 1.85d-244) then
        tmp = (x2 * (-6.0d0)) - x1
    else if (x1 <= 380000000.0d0) then
        tmp = x1 + (t_3 + (x1 - (4.0d0 * (x1 * t_5))))
    else if (x1 <= 1.35d+154) then
        tmp = t_4
    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) + 1.0;
	double t_1 = (2.0 * x2) - 3.0;
	double t_2 = x1 * (x1 * 3.0);
	double t_3 = 3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0);
	double t_4 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_2) + (t_0 * (((x1 * x1) * 6.0) + (t_1 * ((x1 * 2.0) * (3.0 + (-1.0 / x1))))))))));
	double t_5 = x2 * (3.0 - (2.0 * x2));
	double tmp;
	if (x1 <= -2.4e+36) {
		tmp = t_4;
	} else if (x1 <= -3.8e-205) {
		tmp = x1 + ((x1 * ((4.0 * (x2 * t_1)) - 2.0)) + (x2 * -6.0));
	} else if (x1 <= 1.85e-244) {
		tmp = (x2 * -6.0) - x1;
	} else if (x1 <= 380000000.0) {
		tmp = x1 + (t_3 + (x1 - (4.0 * (x1 * t_5))));
	} else if (x1 <= 1.35e+154) {
		tmp = t_4;
	} else {
		tmp = x1 + (x1 * (1.0 - (4.0 * t_5)));
	}
	return tmp;
}
def code(x1, x2):
	t_0 = (x1 * x1) + 1.0
	t_1 = (2.0 * x2) - 3.0
	t_2 = x1 * (x1 * 3.0)
	t_3 = 3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)
	t_4 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_2) + (t_0 * (((x1 * x1) * 6.0) + (t_1 * ((x1 * 2.0) * (3.0 + (-1.0 / x1))))))))))
	t_5 = x2 * (3.0 - (2.0 * x2))
	tmp = 0
	if x1 <= -2.4e+36:
		tmp = t_4
	elif x1 <= -3.8e-205:
		tmp = x1 + ((x1 * ((4.0 * (x2 * t_1)) - 2.0)) + (x2 * -6.0))
	elif x1 <= 1.85e-244:
		tmp = (x2 * -6.0) - x1
	elif x1 <= 380000000.0:
		tmp = x1 + (t_3 + (x1 - (4.0 * (x1 * t_5))))
	elif x1 <= 1.35e+154:
		tmp = t_4
	else:
		tmp = x1 + (x1 * (1.0 - (4.0 * t_5)))
	return tmp
function code(x1, x2)
	t_0 = Float64(Float64(x1 * x1) + 1.0)
	t_1 = Float64(Float64(2.0 * x2) - 3.0)
	t_2 = Float64(x1 * Float64(x1 * 3.0))
	t_3 = Float64(3.0 * Float64(Float64(Float64(t_2 - Float64(2.0 * x2)) - x1) / t_0))
	t_4 = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(3.0 * t_2) + Float64(t_0 * Float64(Float64(Float64(x1 * x1) * 6.0) + Float64(t_1 * Float64(Float64(x1 * 2.0) * Float64(3.0 + Float64(-1.0 / x1)))))))))))
	t_5 = Float64(x2 * Float64(3.0 - Float64(2.0 * x2)))
	tmp = 0.0
	if (x1 <= -2.4e+36)
		tmp = t_4;
	elseif (x1 <= -3.8e-205)
		tmp = Float64(x1 + Float64(Float64(x1 * Float64(Float64(4.0 * Float64(x2 * t_1)) - 2.0)) + Float64(x2 * -6.0)));
	elseif (x1 <= 1.85e-244)
		tmp = Float64(Float64(x2 * -6.0) - x1);
	elseif (x1 <= 380000000.0)
		tmp = Float64(x1 + Float64(t_3 + Float64(x1 - Float64(4.0 * Float64(x1 * t_5)))));
	elseif (x1 <= 1.35e+154)
		tmp = t_4;
	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) + 1.0;
	t_1 = (2.0 * x2) - 3.0;
	t_2 = x1 * (x1 * 3.0);
	t_3 = 3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0);
	t_4 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_2) + (t_0 * (((x1 * x1) * 6.0) + (t_1 * ((x1 * 2.0) * (3.0 + (-1.0 / x1))))))))));
	t_5 = x2 * (3.0 - (2.0 * x2));
	tmp = 0.0;
	if (x1 <= -2.4e+36)
		tmp = t_4;
	elseif (x1 <= -3.8e-205)
		tmp = x1 + ((x1 * ((4.0 * (x2 * t_1)) - 2.0)) + (x2 * -6.0));
	elseif (x1 <= 1.85e-244)
		tmp = (x2 * -6.0) - x1;
	elseif (x1 <= 380000000.0)
		tmp = x1 + (t_3 + (x1 - (4.0 * (x1 * t_5))));
	elseif (x1 <= 1.35e+154)
		tmp = t_4;
	else
		tmp = x1 + (x1 * (1.0 - (4.0 * t_5)));
	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[(N[(2.0 * x2), $MachinePrecision] - 3.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[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $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$2), $MachinePrecision] + N[(t$95$0 * N[(N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision] + N[(t$95$1 * 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[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -2.4e+36], t$95$4, If[LessEqual[x1, -3.8e-205], N[(x1 + N[(N[(x1 * N[(N[(4.0 * N[(x2 * t$95$1), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.85e-244], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision], If[LessEqual[x1, 380000000.0], N[(x1 + N[(t$95$3 + N[(x1 - N[(4.0 * N[(x1 * t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], t$95$4, 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 \cdot x1 + 1\\
t_1 := 2 \cdot x2 - 3\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := 3 \cdot \frac{\left(t_2 - 2 \cdot x2\right) - x1}{t_0}\\
t_4 := x1 + \left(t_3 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot t_2 + t_0 \cdot \left(\left(x1 \cdot x1\right) \cdot 6 + t_1 \cdot \left(\left(x1 \cdot 2\right) \cdot \left(3 + \frac{-1}{x1}\right)\right)\right)\right)\right)\right)\right)\\
t_5 := x2 \cdot \left(3 - 2 \cdot x2\right)\\
\mathbf{if}\;x1 \leq -2.4 \cdot 10^{+36}:\\
\;\;\;\;t_4\\

\mathbf{elif}\;x1 \leq -3.8 \cdot 10^{-205}:\\
\;\;\;\;x1 + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot t_1\right) - 2\right) + x2 \cdot -6\right)\\

\mathbf{elif}\;x1 \leq 1.85 \cdot 10^{-244}:\\
\;\;\;\;x2 \cdot -6 - x1\\

\mathbf{elif}\;x1 \leq 380000000:\\
\;\;\;\;x1 + \left(t_3 + \left(x1 - 4 \cdot \left(x1 \cdot t_5\right)\right)\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if x1 < -2.39999999999999992e36 or 3.8e8 < x1 < 1.35000000000000003e154

    1. Initial program 56.3%

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

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

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

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

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

    if -2.39999999999999992e36 < x1 < -3.79999999999999992e-205

    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 0 84.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 84.8%

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

    if -3.79999999999999992e-205 < x1 < 1.8500000000000001e-244

    1. Initial program 99.3%

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

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

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

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

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

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

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

      \[\leadsto x1 + \color{blue}{\left(-6 \cdot x2 + x1 \cdot \left(8 \cdot {x2}^{2} - 2\right)\right)} \]
    7. Taylor expanded in x2 around 0 97.5%

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

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

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

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

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

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

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

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

    if 1.8500000000000001e-244 < x1 < 3.8e8

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

    if 1.35000000000000003e154 < x1

    1. Initial program 0.0%

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

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

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

Alternative 13: 49.9% accurate, 4.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -1.08 \cdot 10^{+25}:\\
\;\;\;\;x1 + \left(x1 - x2 \cdot \left(6 - x1 \cdot -12\right)\right)\\

\mathbf{elif}\;x1 \leq -5.8 \cdot 10^{-56} \lor \neg \left(x1 \leq 1.8 \cdot 10^{-59}\right):\\
\;\;\;\;x1 + x1 \cdot \left(1 - 4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right)\\

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


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

    1. Initial program 24.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 0.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. Step-by-step derivation
      1. add-cube-cbrt0.3%

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

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

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

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

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

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

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

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

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

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

    if -1.08e25 < x1 < -5.79999999999999982e-56 or 1.8e-59 < x1

    1. Initial program 72.5%

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

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

    if -5.79999999999999982e-56 < x1 < 1.8e-59

    1. Initial program 99.4%

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

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

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

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

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

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

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

      \[\leadsto x1 + \color{blue}{\left(-6 \cdot x2 + x1 \cdot \left(8 \cdot {x2}^{2} - 2\right)\right)} \]
    7. Taylor expanded in x2 around 0 80.3%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \leq -1.08 \cdot 10^{+25}:\\ \;\;\;\;x1 + \left(x1 - x2 \cdot \left(6 - x1 \cdot -12\right)\right)\\ \mathbf{elif}\;x1 \leq -5.8 \cdot 10^{-56} \lor \neg \left(x1 \leq 1.8 \cdot 10^{-59}\right):\\ \;\;\;\;x1 + x1 \cdot \left(1 - 4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x2 \cdot -6 - x1\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 54.5% accurate, 6.7× speedup?

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

\\
x1 + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right) + x2 \cdot -6\right)
\end{array}
Derivation
  1. Initial program 74.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 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 54.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. Final simplification54.3%

    \[\leadsto x1 + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right) + x2 \cdot -6\right) \]
  6. Add Preprocessing

Alternative 15: 41.8% accurate, 7.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq 1.9:\\
\;\;\;\;x2 \cdot -6 - x1\\

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


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

    1. Initial program 79.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 x2 around inf 64.1%

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

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

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

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

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

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

      \[\leadsto x1 + \color{blue}{\left(-6 \cdot x2 + x1 \cdot \left(8 \cdot {x2}^{2} - 2\right)\right)} \]
    7. Taylor expanded in x2 around 0 49.9%

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

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

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

        \[\leadsto \color{blue}{x2 \cdot -6 + \left(-2 \cdot x1 + x1\right)} \]
      4. distribute-lft1-in50.0%

        \[\leadsto x2 \cdot -6 + \color{blue}{\left(-2 + 1\right) \cdot x1} \]
      5. metadata-eval50.0%

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

        \[\leadsto x2 \cdot -6 + \color{blue}{\left(-x1\right)} \]
    9. Simplified50.0%

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

    if 1.8999999999999999 < x1

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 16: 31.9% accurate, 8.4× speedup?

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

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

\mathbf{elif}\;x2 \leq 1.46 \cdot 10^{-92}:\\
\;\;\;\;-x1\\

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


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

    1. Initial program 68.5%

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

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

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

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

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

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

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

    if -4.99999999999999968e-149 < x2 < 1.45999999999999995e-92

    1. Initial program 76.3%

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

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

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

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

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

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

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

      \[\leadsto x1 + \color{blue}{\left(-6 \cdot x2 + x1 \cdot \left(8 \cdot {x2}^{2} - 2\right)\right)} \]
    7. Taylor expanded in x2 around 0 36.0%

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

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

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

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

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

    if 1.45999999999999995e-92 < x2

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

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

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

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

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

Alternative 17: 31.6% accurate, 9.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x2 \leq -4.5 \cdot 10^{-149} \lor \neg \left(x2 \leq 1.46 \cdot 10^{-92}\right):\\ \;\;\;\;x2 \cdot -6\\ \mathbf{else}:\\ \;\;\;\;-x1\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :precision binary64
 (if (or (<= x2 -4.5e-149) (not (<= x2 1.46e-92))) (* x2 -6.0) (- x1)))
double code(double x1, double x2) {
	double tmp;
	if ((x2 <= -4.5e-149) || !(x2 <= 1.46e-92)) {
		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 <= (-4.5d-149)) .or. (.not. (x2 <= 1.46d-92))) 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 <= -4.5e-149) || !(x2 <= 1.46e-92)) {
		tmp = x2 * -6.0;
	} else {
		tmp = -x1;
	}
	return tmp;
}
def code(x1, x2):
	tmp = 0
	if (x2 <= -4.5e-149) or not (x2 <= 1.46e-92):
		tmp = x2 * -6.0
	else:
		tmp = -x1
	return tmp
function code(x1, x2)
	tmp = 0.0
	if ((x2 <= -4.5e-149) || !(x2 <= 1.46e-92))
		tmp = Float64(x2 * -6.0);
	else
		tmp = Float64(-x1);
	end
	return tmp
end
function tmp_2 = code(x1, x2)
	tmp = 0.0;
	if ((x2 <= -4.5e-149) || ~((x2 <= 1.46e-92)))
		tmp = x2 * -6.0;
	else
		tmp = -x1;
	end
	tmp_2 = tmp;
end
code[x1_, x2_] := If[Or[LessEqual[x2, -4.5e-149], N[Not[LessEqual[x2, 1.46e-92]], $MachinePrecision]], N[(x2 * -6.0), $MachinePrecision], (-x1)]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -4.5 \cdot 10^{-149} \lor \neg \left(x2 \leq 1.46 \cdot 10^{-92}\right):\\
\;\;\;\;x2 \cdot -6\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x2 < -4.4999999999999998e-149 or 1.45999999999999995e-92 < x2

    1. Initial program 73.3%

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

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

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

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

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

        \[\leadsto \color{blue}{x2 \cdot -6} \]
    9. Simplified28.7%

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

    if -4.4999999999999998e-149 < x2 < 1.45999999999999995e-92

    1. Initial program 76.3%

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

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

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

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

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

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

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

      \[\leadsto x1 + \color{blue}{\left(-6 \cdot x2 + x1 \cdot \left(8 \cdot {x2}^{2} - 2\right)\right)} \]
    7. Taylor expanded in x2 around 0 36.0%

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

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

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

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

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

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

Alternative 18: 38.3% accurate, 25.4× speedup?

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

\\
x2 \cdot -6 - x1
\end{array}
Derivation
  1. Initial program 74.2%

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

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

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

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

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

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

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

    \[\leadsto x1 + \color{blue}{\left(-6 \cdot x2 + x1 \cdot \left(8 \cdot {x2}^{2} - 2\right)\right)} \]
  7. Taylor expanded in x2 around 0 36.5%

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{x2 \cdot -6 + \left(-x1\right)} \]
  10. Final simplification36.5%

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

Alternative 19: 14.0% 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 74.2%

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

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

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

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

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

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

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

    \[\leadsto x1 + \color{blue}{\left(-6 \cdot x2 + x1 \cdot \left(8 \cdot {x2}^{2} - 2\right)\right)} \]
  7. Taylor expanded in x2 around 0 13.6%

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

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

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

      \[\leadsto \color{blue}{-x1} \]
  9. Simplified13.6%

    \[\leadsto \color{blue}{-x1} \]
  10. Final simplification13.6%

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

Alternative 20: 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 74.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 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 24.9%

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

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

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

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

    \[\leadsto x1 \]
  9. Add Preprocessing

Reproduce

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