Rosa's FloatVsDoubleBenchmark

Percentage Accurate: 70.5% → 99.4%
Time: 54.6s
Alternatives: 21
Speedup: 1.4×

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 21 alternatives:

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

Initial Program: 70.5% 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.4% accurate, 0.1× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\right)\\


\end{array}
\end{array}
Derivation
    &prev;&pcontext;&pcontext2;&ctx;
  1. Add Preprocessing

Alternative 2: 99.2% accurate, 0.2× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\right)\\


\end{array}
\end{array}
Derivation
    &prev;&pcontext;&pcontext2;&ctx;
  1. Add Preprocessing

Alternative 3: 99.2% accurate, 0.5× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\right)\\


\end{array}
\end{array}
Derivation
    &prev;&pcontext;&pcontext2;&ctx;
  1. Add Preprocessing

Alternative 4: 96.0% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;x1 \leq -145:\\
\;\;\;\;x1 + \left(\left(x1 + \left(\left(t_2 \cdot \left(t_6 \cdot \left(t_3 - 3\right) + t_4\right) + t_5\right) + t_7\right)\right) + 9\right)\\

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

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
    &prev;&pcontext;&pcontext2;&ctx;
  1. Add Preprocessing

Alternative 5: 96.7% accurate, 1.1× speedup?

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

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

\mathbf{elif}\;x1 \leq -145:\\
\;\;\;\;x1 + \left(\left(x1 + \left(\left(t_2 \cdot \left(t_6 \cdot \left(t_3 - 3\right) + t_4\right) + t_5\right) + t_7\right)\right) + 9\right)\\

\mathbf{elif}\;x1 \leq 1.1 \cdot 10^{+45}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_2} + \left(x1 + \left(t_7 + \left(t_5 + t_2 \cdot \left(t_4 + t_6 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
    &prev;&pcontext;&pcontext2;&ctx;
  1. Add Preprocessing

Alternative 6: 96.0% accurate, 1.1× speedup?

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

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

\mathbf{elif}\;x1 \leq -145:\\
\;\;\;\;x1 + \left(\left(x1 + \left(\left(t_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_4\right) \cdot \left(t_4 - 3\right) + t_5\right) + t_6\right) + t_3\right)\right) + 9\right)\\

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

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
    &prev;&pcontext;&pcontext2;&ctx;
  1. Add Preprocessing

Alternative 7: 75.9% accurate, 1.1× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
    &prev;&pcontext;&pcontext2;&ctx;
  1. Add Preprocessing

Alternative 8: 73.0% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;x1 \leq 16200:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_4 - 2 \cdot x2\right) - x1}{t_2} + \left(x1 + \left(t_3 + \left(t_7 + t_2 \cdot \left(t_6 + t_1 \cdot t_0\right)\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 1.32 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(9 + \left(x1 + \left(t_3 + \left(t_7 + t_2 \cdot \left(t_6 + 12 \cdot \frac{x2}{x1}\right)\right)\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
    &prev;&pcontext;&pcontext2;&ctx;
  1. Add Preprocessing

Alternative 9: 72.4% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;x1 \leq 106000:\\
\;\;\;\;x1 + \left(t_3 + \left(x1 + \left(t_7 + \left(t_0 \cdot \left(t_6 + t_8 \cdot \left(\left(x1 \cdot 2\right) \cdot t_1\right)\right) + t_2 \cdot t_1\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 1.32 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(9 + \left(x1 + \left(t_7 + \left(t_5 + t_0 \cdot \left(t_6 + 12 \cdot \frac{x2}{x1}\right)\right)\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
    &prev;&pcontext;&pcontext2;&ctx;
  1. Add Preprocessing

Alternative 10: 73.1% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;x1 \leq 39000:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_2 - 2 \cdot x2\right) - x1}{t_0} + \left(x1 + \left(t_1 + \left(t_0 \cdot \left(t_4 + t_8 \cdot t_7\right) + t_2 \cdot t_6\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 1.32 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(9 + \left(x1 + \left(t_1 + \left(t_5 + t_0 \cdot \left(t_4 + 12 \cdot \frac{x2}{x1}\right)\right)\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
    &prev;&pcontext;&pcontext2;&ctx;
  1. Add Preprocessing

Alternative 11: 73.0% accurate, 1.4× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
    &prev;&pcontext;&pcontext2;&ctx;
  1. Add Preprocessing

Alternative 12: 73.0% accurate, 1.4× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
    &prev;&pcontext;&pcontext2;&ctx;
  1. Add Preprocessing

Alternative 13: 68.6% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x2 \cdot \left(2 \cdot x2 - 3\right)\\ t_1 := 4 \cdot \left(x1 \cdot t_0\right)\\ t_2 := x1 \cdot x1 + 1\\ t_3 := x1 \cdot \left(x1 \cdot x1\right)\\ t_4 := x1 \cdot \left(x1 \cdot 3\right)\\ t_5 := \frac{\left(t_4 + 2 \cdot x2\right) - x1}{t_2}\\ t_6 := 3 \cdot \frac{\left(t_4 - 2 \cdot x2\right) - x1}{t_2}\\ t_7 := t_4 \cdot t_5\\ t_8 := x1 + \left(9 + \left(x1 + \left(t_3 + \left(t_7 + t_2 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(t_5 \cdot 4 - 6\right) + 12 \cdot \frac{x2}{x1}\right)\right)\right)\right)\right)\\ \mathbf{if}\;x1 \leq -680:\\ \;\;\;\;t_8\\ \mathbf{elif}\;x1 \leq -8.5 \cdot 10^{-165}:\\ \;\;\;\;x1 + \left(t_6 + \left(x1 + \left(t_3 + \left(t_7 + t_2 \cdot t_1\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 1.08 \cdot 10^{-181}:\\ \;\;\;\;x1 + \left(t_6 + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot -3\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 21500:\\ \;\;\;\;x1 + \left(t_6 + \left(x1 + t_1\right)\right)\\ \mathbf{elif}\;x1 \leq 1.32 \cdot 10^{+154}:\\ \;\;\;\;t_8\\ \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 (- (* 2.0 x2) 3.0)))
        (t_1 (* 4.0 (* x1 t_0)))
        (t_2 (+ (* x1 x1) 1.0))
        (t_3 (* x1 (* x1 x1)))
        (t_4 (* x1 (* x1 3.0)))
        (t_5 (/ (- (+ t_4 (* 2.0 x2)) x1) t_2))
        (t_6 (* 3.0 (/ (- (- t_4 (* 2.0 x2)) x1) t_2)))
        (t_7 (* t_4 t_5))
        (t_8
         (+
          x1
          (+
           9.0
           (+
            x1
            (+
             t_3
             (+
              t_7
              (*
               t_2
               (+ (* (* x1 x1) (- (* t_5 4.0) 6.0)) (* 12.0 (/ x2 x1)))))))))))
   (if (<= x1 -680.0)
     t_8
     (if (<= x1 -8.5e-165)
       (+ x1 (+ t_6 (+ x1 (+ t_3 (+ t_7 (* t_2 t_1))))))
       (if (<= x1 1.08e-181)
         (+ x1 (+ t_6 (+ x1 (* 4.0 (* x2 (* x1 -3.0))))))
         (if (<= x1 21500.0)
           (+ x1 (+ t_6 (+ x1 t_1)))
           (if (<= x1 1.32e+154) t_8 (+ x1 (* x1 (+ 1.0 (* 4.0 t_0)))))))))))
double code(double x1, double x2) {
	double t_0 = x2 * ((2.0 * x2) - 3.0);
	double t_1 = 4.0 * (x1 * t_0);
	double t_2 = (x1 * x1) + 1.0;
	double t_3 = x1 * (x1 * x1);
	double t_4 = x1 * (x1 * 3.0);
	double t_5 = ((t_4 + (2.0 * x2)) - x1) / t_2;
	double t_6 = 3.0 * (((t_4 - (2.0 * x2)) - x1) / t_2);
	double t_7 = t_4 * t_5;
	double t_8 = x1 + (9.0 + (x1 + (t_3 + (t_7 + (t_2 * (((x1 * x1) * ((t_5 * 4.0) - 6.0)) + (12.0 * (x2 / x1))))))));
	double tmp;
	if (x1 <= -680.0) {
		tmp = t_8;
	} else if (x1 <= -8.5e-165) {
		tmp = x1 + (t_6 + (x1 + (t_3 + (t_7 + (t_2 * t_1)))));
	} else if (x1 <= 1.08e-181) {
		tmp = x1 + (t_6 + (x1 + (4.0 * (x2 * (x1 * -3.0)))));
	} else if (x1 <= 21500.0) {
		tmp = x1 + (t_6 + (x1 + t_1));
	} else if (x1 <= 1.32e+154) {
		tmp = t_8;
	} 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) :: t_5
    real(8) :: t_6
    real(8) :: t_7
    real(8) :: t_8
    real(8) :: tmp
    t_0 = x2 * ((2.0d0 * x2) - 3.0d0)
    t_1 = 4.0d0 * (x1 * t_0)
    t_2 = (x1 * x1) + 1.0d0
    t_3 = x1 * (x1 * x1)
    t_4 = x1 * (x1 * 3.0d0)
    t_5 = ((t_4 + (2.0d0 * x2)) - x1) / t_2
    t_6 = 3.0d0 * (((t_4 - (2.0d0 * x2)) - x1) / t_2)
    t_7 = t_4 * t_5
    t_8 = x1 + (9.0d0 + (x1 + (t_3 + (t_7 + (t_2 * (((x1 * x1) * ((t_5 * 4.0d0) - 6.0d0)) + (12.0d0 * (x2 / x1))))))))
    if (x1 <= (-680.0d0)) then
        tmp = t_8
    else if (x1 <= (-8.5d-165)) then
        tmp = x1 + (t_6 + (x1 + (t_3 + (t_7 + (t_2 * t_1)))))
    else if (x1 <= 1.08d-181) then
        tmp = x1 + (t_6 + (x1 + (4.0d0 * (x2 * (x1 * (-3.0d0))))))
    else if (x1 <= 21500.0d0) then
        tmp = x1 + (t_6 + (x1 + t_1))
    else if (x1 <= 1.32d+154) then
        tmp = t_8
    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 * ((2.0 * x2) - 3.0);
	double t_1 = 4.0 * (x1 * t_0);
	double t_2 = (x1 * x1) + 1.0;
	double t_3 = x1 * (x1 * x1);
	double t_4 = x1 * (x1 * 3.0);
	double t_5 = ((t_4 + (2.0 * x2)) - x1) / t_2;
	double t_6 = 3.0 * (((t_4 - (2.0 * x2)) - x1) / t_2);
	double t_7 = t_4 * t_5;
	double t_8 = x1 + (9.0 + (x1 + (t_3 + (t_7 + (t_2 * (((x1 * x1) * ((t_5 * 4.0) - 6.0)) + (12.0 * (x2 / x1))))))));
	double tmp;
	if (x1 <= -680.0) {
		tmp = t_8;
	} else if (x1 <= -8.5e-165) {
		tmp = x1 + (t_6 + (x1 + (t_3 + (t_7 + (t_2 * t_1)))));
	} else if (x1 <= 1.08e-181) {
		tmp = x1 + (t_6 + (x1 + (4.0 * (x2 * (x1 * -3.0)))));
	} else if (x1 <= 21500.0) {
		tmp = x1 + (t_6 + (x1 + t_1));
	} else if (x1 <= 1.32e+154) {
		tmp = t_8;
	} else {
		tmp = x1 + (x1 * (1.0 + (4.0 * t_0)));
	}
	return tmp;
}
def code(x1, x2):
	t_0 = x2 * ((2.0 * x2) - 3.0)
	t_1 = 4.0 * (x1 * t_0)
	t_2 = (x1 * x1) + 1.0
	t_3 = x1 * (x1 * x1)
	t_4 = x1 * (x1 * 3.0)
	t_5 = ((t_4 + (2.0 * x2)) - x1) / t_2
	t_6 = 3.0 * (((t_4 - (2.0 * x2)) - x1) / t_2)
	t_7 = t_4 * t_5
	t_8 = x1 + (9.0 + (x1 + (t_3 + (t_7 + (t_2 * (((x1 * x1) * ((t_5 * 4.0) - 6.0)) + (12.0 * (x2 / x1))))))))
	tmp = 0
	if x1 <= -680.0:
		tmp = t_8
	elif x1 <= -8.5e-165:
		tmp = x1 + (t_6 + (x1 + (t_3 + (t_7 + (t_2 * t_1)))))
	elif x1 <= 1.08e-181:
		tmp = x1 + (t_6 + (x1 + (4.0 * (x2 * (x1 * -3.0)))))
	elif x1 <= 21500.0:
		tmp = x1 + (t_6 + (x1 + t_1))
	elif x1 <= 1.32e+154:
		tmp = t_8
	else:
		tmp = x1 + (x1 * (1.0 + (4.0 * t_0)))
	return tmp
function code(x1, x2)
	t_0 = Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))
	t_1 = Float64(4.0 * Float64(x1 * t_0))
	t_2 = Float64(Float64(x1 * x1) + 1.0)
	t_3 = Float64(x1 * Float64(x1 * x1))
	t_4 = Float64(x1 * Float64(x1 * 3.0))
	t_5 = Float64(Float64(Float64(t_4 + Float64(2.0 * x2)) - x1) / t_2)
	t_6 = Float64(3.0 * Float64(Float64(Float64(t_4 - Float64(2.0 * x2)) - x1) / t_2))
	t_7 = Float64(t_4 * t_5)
	t_8 = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(t_3 + Float64(t_7 + Float64(t_2 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(t_5 * 4.0) - 6.0)) + Float64(12.0 * Float64(x2 / x1)))))))))
	tmp = 0.0
	if (x1 <= -680.0)
		tmp = t_8;
	elseif (x1 <= -8.5e-165)
		tmp = Float64(x1 + Float64(t_6 + Float64(x1 + Float64(t_3 + Float64(t_7 + Float64(t_2 * t_1))))));
	elseif (x1 <= 1.08e-181)
		tmp = Float64(x1 + Float64(t_6 + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * -3.0))))));
	elseif (x1 <= 21500.0)
		tmp = Float64(x1 + Float64(t_6 + Float64(x1 + t_1)));
	elseif (x1 <= 1.32e+154)
		tmp = t_8;
	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 * ((2.0 * x2) - 3.0);
	t_1 = 4.0 * (x1 * t_0);
	t_2 = (x1 * x1) + 1.0;
	t_3 = x1 * (x1 * x1);
	t_4 = x1 * (x1 * 3.0);
	t_5 = ((t_4 + (2.0 * x2)) - x1) / t_2;
	t_6 = 3.0 * (((t_4 - (2.0 * x2)) - x1) / t_2);
	t_7 = t_4 * t_5;
	t_8 = x1 + (9.0 + (x1 + (t_3 + (t_7 + (t_2 * (((x1 * x1) * ((t_5 * 4.0) - 6.0)) + (12.0 * (x2 / x1))))))));
	tmp = 0.0;
	if (x1 <= -680.0)
		tmp = t_8;
	elseif (x1 <= -8.5e-165)
		tmp = x1 + (t_6 + (x1 + (t_3 + (t_7 + (t_2 * t_1)))));
	elseif (x1 <= 1.08e-181)
		tmp = x1 + (t_6 + (x1 + (4.0 * (x2 * (x1 * -3.0)))));
	elseif (x1 <= 21500.0)
		tmp = x1 + (t_6 + (x1 + t_1));
	elseif (x1 <= 1.32e+154)
		tmp = t_8;
	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[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(4.0 * N[(x1 * t$95$0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(t$95$4 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$6 = N[(3.0 * N[(N[(N[(t$95$4 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(t$95$4 * t$95$5), $MachinePrecision]}, Block[{t$95$8 = N[(x1 + N[(9.0 + N[(x1 + N[(t$95$3 + N[(t$95$7 + N[(t$95$2 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$5 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(12.0 * N[(x2 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -680.0], t$95$8, If[LessEqual[x1, -8.5e-165], N[(x1 + N[(t$95$6 + N[(x1 + N[(t$95$3 + N[(t$95$7 + N[(t$95$2 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.08e-181], N[(x1 + N[(t$95$6 + N[(x1 + N[(4.0 * N[(x2 * N[(x1 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 21500.0], N[(x1 + N[(t$95$6 + N[(x1 + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.32e+154], t$95$8, 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(2 \cdot x2 - 3\right)\\
t_1 := 4 \cdot \left(x1 \cdot t_0\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := x1 \cdot \left(x1 \cdot x1\right)\\
t_4 := x1 \cdot \left(x1 \cdot 3\right)\\
t_5 := \frac{\left(t_4 + 2 \cdot x2\right) - x1}{t_2}\\
t_6 := 3 \cdot \frac{\left(t_4 - 2 \cdot x2\right) - x1}{t_2}\\
t_7 := t_4 \cdot t_5\\
t_8 := x1 + \left(9 + \left(x1 + \left(t_3 + \left(t_7 + t_2 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(t_5 \cdot 4 - 6\right) + 12 \cdot \frac{x2}{x1}\right)\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -680:\\
\;\;\;\;t_8\\

\mathbf{elif}\;x1 \leq -8.5 \cdot 10^{-165}:\\
\;\;\;\;x1 + \left(t_6 + \left(x1 + \left(t_3 + \left(t_7 + t_2 \cdot t_1\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 1.08 \cdot 10^{-181}:\\
\;\;\;\;x1 + \left(t_6 + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot -3\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 21500:\\
\;\;\;\;x1 + \left(t_6 + \left(x1 + t_1\right)\right)\\

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

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


\end{array}
\end{array}
Derivation
    &prev;&pcontext;&pcontext2;&ctx;
  1. Add Preprocessing

Alternative 14: 66.6% accurate, 1.7× 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 := x1 + \left(9 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_1 \cdot \left(2 \cdot x2\right) + t_0 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(\frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_0} \cdot 4 - 6\right) + \left(x1 \cdot 2 + -2 \cdot \left(x2 \cdot 4 - 3\right)\right)\right)\right)\right)\right)\right)\\ t_4 := x2 \cdot \left(2 \cdot x2 - 3\right)\\ t_5 := 4 \cdot t_4\\ \mathbf{if}\;x1 \leq -1.56 \cdot 10^{+21}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x1 \leq -9 \cdot 10^{-165}:\\ \;\;\;\;x1 + \left(x1 \cdot \left(t_5 - 2\right) + x2 \cdot -6\right)\\ \mathbf{elif}\;x1 \leq 5.6 \cdot 10^{-182}:\\ \;\;\;\;x1 + \left(t_2 + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot -3\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 1100000:\\ \;\;\;\;x1 + \left(t_2 + \left(x1 + 4 \cdot \left(x1 \cdot t_4\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 9.2 \cdot 10^{+153}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;x1 + x1 \cdot \left(1 + t_5\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
         (+
          x1
          (+
           9.0
           (+
            x1
            (+
             (* x1 (* x1 x1))
             (+
              (* t_1 (* 2.0 x2))
              (*
               t_0
               (+
                (* (* x1 x1) (- (* (/ (- (+ t_1 (* 2.0 x2)) x1) t_0) 4.0) 6.0))
                (+ (* x1 2.0) (* -2.0 (- (* x2 4.0) 3.0)))))))))))
        (t_4 (* x2 (- (* 2.0 x2) 3.0)))
        (t_5 (* 4.0 t_4)))
   (if (<= x1 -1.56e+21)
     t_3
     (if (<= x1 -9e-165)
       (+ x1 (+ (* x1 (- t_5 2.0)) (* x2 -6.0)))
       (if (<= x1 5.6e-182)
         (+ x1 (+ t_2 (+ x1 (* 4.0 (* x2 (* x1 -3.0))))))
         (if (<= x1 1100000.0)
           (+ x1 (+ t_2 (+ x1 (* 4.0 (* x1 t_4)))))
           (if (<= x1 9.2e+153) t_3 (+ x1 (* x1 (+ 1.0 t_5))))))))))
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 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (2.0 * x2)) + (t_0 * (((x1 * x1) * (((((t_1 + (2.0 * x2)) - x1) / t_0) * 4.0) - 6.0)) + ((x1 * 2.0) + (-2.0 * ((x2 * 4.0) - 3.0)))))))));
	double t_4 = x2 * ((2.0 * x2) - 3.0);
	double t_5 = 4.0 * t_4;
	double tmp;
	if (x1 <= -1.56e+21) {
		tmp = t_3;
	} else if (x1 <= -9e-165) {
		tmp = x1 + ((x1 * (t_5 - 2.0)) + (x2 * -6.0));
	} else if (x1 <= 5.6e-182) {
		tmp = x1 + (t_2 + (x1 + (4.0 * (x2 * (x1 * -3.0)))));
	} else if (x1 <= 1100000.0) {
		tmp = x1 + (t_2 + (x1 + (4.0 * (x1 * t_4))));
	} else if (x1 <= 9.2e+153) {
		tmp = t_3;
	} else {
		tmp = x1 + (x1 * (1.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 = x1 * (x1 * 3.0d0)
    t_2 = 3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_0)
    t_3 = x1 + (9.0d0 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (2.0d0 * x2)) + (t_0 * (((x1 * x1) * (((((t_1 + (2.0d0 * x2)) - x1) / t_0) * 4.0d0) - 6.0d0)) + ((x1 * 2.0d0) + ((-2.0d0) * ((x2 * 4.0d0) - 3.0d0)))))))))
    t_4 = x2 * ((2.0d0 * x2) - 3.0d0)
    t_5 = 4.0d0 * t_4
    if (x1 <= (-1.56d+21)) then
        tmp = t_3
    else if (x1 <= (-9d-165)) then
        tmp = x1 + ((x1 * (t_5 - 2.0d0)) + (x2 * (-6.0d0)))
    else if (x1 <= 5.6d-182) then
        tmp = x1 + (t_2 + (x1 + (4.0d0 * (x2 * (x1 * (-3.0d0))))))
    else if (x1 <= 1100000.0d0) then
        tmp = x1 + (t_2 + (x1 + (4.0d0 * (x1 * t_4))))
    else if (x1 <= 9.2d+153) then
        tmp = t_3
    else
        tmp = x1 + (x1 * (1.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 = x1 * (x1 * 3.0);
	double t_2 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0);
	double t_3 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (2.0 * x2)) + (t_0 * (((x1 * x1) * (((((t_1 + (2.0 * x2)) - x1) / t_0) * 4.0) - 6.0)) + ((x1 * 2.0) + (-2.0 * ((x2 * 4.0) - 3.0)))))))));
	double t_4 = x2 * ((2.0 * x2) - 3.0);
	double t_5 = 4.0 * t_4;
	double tmp;
	if (x1 <= -1.56e+21) {
		tmp = t_3;
	} else if (x1 <= -9e-165) {
		tmp = x1 + ((x1 * (t_5 - 2.0)) + (x2 * -6.0));
	} else if (x1 <= 5.6e-182) {
		tmp = x1 + (t_2 + (x1 + (4.0 * (x2 * (x1 * -3.0)))));
	} else if (x1 <= 1100000.0) {
		tmp = x1 + (t_2 + (x1 + (4.0 * (x1 * t_4))));
	} else if (x1 <= 9.2e+153) {
		tmp = t_3;
	} else {
		tmp = x1 + (x1 * (1.0 + t_5));
	}
	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 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (2.0 * x2)) + (t_0 * (((x1 * x1) * (((((t_1 + (2.0 * x2)) - x1) / t_0) * 4.0) - 6.0)) + ((x1 * 2.0) + (-2.0 * ((x2 * 4.0) - 3.0)))))))))
	t_4 = x2 * ((2.0 * x2) - 3.0)
	t_5 = 4.0 * t_4
	tmp = 0
	if x1 <= -1.56e+21:
		tmp = t_3
	elif x1 <= -9e-165:
		tmp = x1 + ((x1 * (t_5 - 2.0)) + (x2 * -6.0))
	elif x1 <= 5.6e-182:
		tmp = x1 + (t_2 + (x1 + (4.0 * (x2 * (x1 * -3.0)))))
	elif x1 <= 1100000.0:
		tmp = x1 + (t_2 + (x1 + (4.0 * (x1 * t_4))))
	elif x1 <= 9.2e+153:
		tmp = t_3
	else:
		tmp = x1 + (x1 * (1.0 + t_5))
	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(x1 + Float64(9.0 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_1 * Float64(2.0 * x2)) + Float64(t_0 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_0) * 4.0) - 6.0)) + Float64(Float64(x1 * 2.0) + Float64(-2.0 * Float64(Float64(x2 * 4.0) - 3.0))))))))))
	t_4 = Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))
	t_5 = Float64(4.0 * t_4)
	tmp = 0.0
	if (x1 <= -1.56e+21)
		tmp = t_3;
	elseif (x1 <= -9e-165)
		tmp = Float64(x1 + Float64(Float64(x1 * Float64(t_5 - 2.0)) + Float64(x2 * -6.0)));
	elseif (x1 <= 5.6e-182)
		tmp = Float64(x1 + Float64(t_2 + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * -3.0))))));
	elseif (x1 <= 1100000.0)
		tmp = Float64(x1 + Float64(t_2 + Float64(x1 + Float64(4.0 * Float64(x1 * t_4)))));
	elseif (x1 <= 9.2e+153)
		tmp = t_3;
	else
		tmp = Float64(x1 + Float64(x1 * Float64(1.0 + t_5)));
	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 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (2.0 * x2)) + (t_0 * (((x1 * x1) * (((((t_1 + (2.0 * x2)) - x1) / t_0) * 4.0) - 6.0)) + ((x1 * 2.0) + (-2.0 * ((x2 * 4.0) - 3.0)))))))));
	t_4 = x2 * ((2.0 * x2) - 3.0);
	t_5 = 4.0 * t_4;
	tmp = 0.0;
	if (x1 <= -1.56e+21)
		tmp = t_3;
	elseif (x1 <= -9e-165)
		tmp = x1 + ((x1 * (t_5 - 2.0)) + (x2 * -6.0));
	elseif (x1 <= 5.6e-182)
		tmp = x1 + (t_2 + (x1 + (4.0 * (x2 * (x1 * -3.0)))));
	elseif (x1 <= 1100000.0)
		tmp = x1 + (t_2 + (x1 + (4.0 * (x1 * t_4))));
	elseif (x1 <= 9.2e+153)
		tmp = t_3;
	else
		tmp = x1 + (x1 * (1.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[(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[(x1 + N[(9.0 + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision] * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * 2.0), $MachinePrecision] + N[(-2.0 * N[(N[(x2 * 4.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(4.0 * t$95$4), $MachinePrecision]}, If[LessEqual[x1, -1.56e+21], t$95$3, If[LessEqual[x1, -9e-165], N[(x1 + N[(N[(x1 * N[(t$95$5 - 2.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5.6e-182], N[(x1 + N[(t$95$2 + N[(x1 + N[(4.0 * N[(x2 * N[(x1 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1100000.0], N[(x1 + N[(t$95$2 + N[(x1 + N[(4.0 * N[(x1 * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 9.2e+153], t$95$3, N[(x1 + N[(x1 * N[(1.0 + t$95$5), $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 := x1 + \left(9 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_1 \cdot \left(2 \cdot x2\right) + t_0 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(\frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_0} \cdot 4 - 6\right) + \left(x1 \cdot 2 + -2 \cdot \left(x2 \cdot 4 - 3\right)\right)\right)\right)\right)\right)\right)\\
t_4 := x2 \cdot \left(2 \cdot x2 - 3\right)\\
t_5 := 4 \cdot t_4\\
\mathbf{if}\;x1 \leq -1.56 \cdot 10^{+21}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;x1 \leq -9 \cdot 10^{-165}:\\
\;\;\;\;x1 + \left(x1 \cdot \left(t_5 - 2\right) + x2 \cdot -6\right)\\

\mathbf{elif}\;x1 \leq 5.6 \cdot 10^{-182}:\\
\;\;\;\;x1 + \left(t_2 + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot -3\right)\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 1100000:\\
\;\;\;\;x1 + \left(t_2 + \left(x1 + 4 \cdot \left(x1 \cdot t_4\right)\right)\right)\\

\mathbf{elif}\;x1 \leq 9.2 \cdot 10^{+153}:\\
\;\;\;\;t_3\\

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


\end{array}
\end{array}
Derivation
    &prev;&pcontext;&pcontext2;&ctx;
  1. Add Preprocessing

Alternative 15: 56.4% accurate, 3.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -8.5 \cdot 10^{-165} \lor \neg \left(x1 \leq 2.4 \cdot 10^{-182}\right):\\
\;\;\;\;x1 + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right) + x2 \cdot -6\right)\\

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


\end{array}
\end{array}
Derivation
    &prev;&pcontext;&pcontext2;&ctx;
  1. Add Preprocessing

Alternative 16: 39.5% accurate, 6.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -4.4 \cdot 10^{-97} \lor \neg \left(x1 \leq 9.5 \cdot 10^{-67}\right):\\
\;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
    &prev;&pcontext;&pcontext2;&ctx;
  1. Add Preprocessing

Alternative 17: 39.8% accurate, 6.6× speedup?

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

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

\mathbf{elif}\;x1 \leq 3.6 \cdot 10^{-69}:\\
\;\;\;\;x2 \cdot -6\\

\mathbf{else}:\\
\;\;\;\;x1 + t_0\\


\end{array}
\end{array}
Derivation
    &prev;&pcontext;&pcontext2;&ctx;
  1. Add Preprocessing

Alternative 18: 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
    &prev;&pcontext;&pcontext2;&ctx;
  1. Add Preprocessing

Alternative 19: 25.7% accurate, 25.4× speedup?

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

\\
x1 + x2 \cdot -6
\end{array}
Derivation
    &prev;&pcontext;&pcontext2;&ctx;
  1. Add Preprocessing

Alternative 20: 25.5% accurate, 42.3× speedup?

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

\\
x2 \cdot -6
\end{array}
Derivation
    &prev;&pcontext;&pcontext2;&ctx;
  1. Add Preprocessing

Alternative 21: 3.2% accurate, 127.0× speedup?

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

\\
x1
\end{array}
Derivation
    &prev;&pcontext;&pcontext2;&ctx;
  1. Add Preprocessing

Reproduce

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