Rosa's FloatVsDoubleBenchmark

?

Percentage Accurate: 70.1% → 99.7%
Time: 36.7s
Precision: binary64
Cost: 61769

?

\[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
\[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(x1, x1 \cdot 3, \mathsf{fma}\left(2, x2, -x1\right)\right)\\ \mathbf{if}\;x1 \leq -5 \cdot 10^{+153} \lor \neg \left(x1 \leq 5 \cdot 10^{+153}\right):\\ \;\;\;\;x1 + \mathsf{fma}\left(3, x1 \cdot \left(x1 \cdot 3\right) - x1, x1\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \mathsf{fma}\left(3, -2 \cdot x2 - x1, \mathsf{fma}\left(x1, x1 \cdot 9, \mathsf{fma}\left(x1, x1, 1\right) \cdot \left(x1 + \left(x1 \cdot \left(x1 \cdot -6\right) + \frac{t_0}{\mathsf{fma}\left(x1, x1, 1\right)} \cdot \left(x1 \cdot \left(-6 + \frac{t_0}{\frac{\mathsf{fma}\left(x1, x1, 1\right)}{2}}\right) + \left(x1 \cdot x1\right) \cdot 4\right)\right)\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (x1 x2)
 :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))))))
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (fma x1 (* x1 3.0) (fma 2.0 x2 (- x1)))))
   (if (or (<= x1 -5e+153) (not (<= x1 5e+153)))
     (+ x1 (fma 3.0 (- (* x1 (* x1 3.0)) x1) x1))
     (+
      x1
      (fma
       3.0
       (- (* -2.0 x2) x1)
       (fma
        x1
        (* x1 9.0)
        (*
         (fma x1 x1 1.0)
         (+
          x1
          (+
           (* x1 (* x1 -6.0))
           (*
            (/ t_0 (fma x1 x1 1.0))
            (+
             (* x1 (+ -6.0 (/ t_0 (/ (fma x1 x1 1.0) 2.0))))
             (* (* x1 x1) 4.0))))))))))))
double code(double x1, double x2) {
	return 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))));
}
double code(double x1, double x2) {
	double t_0 = fma(x1, (x1 * 3.0), fma(2.0, x2, -x1));
	double tmp;
	if ((x1 <= -5e+153) || !(x1 <= 5e+153)) {
		tmp = x1 + fma(3.0, ((x1 * (x1 * 3.0)) - x1), x1);
	} else {
		tmp = x1 + fma(3.0, ((-2.0 * x2) - x1), fma(x1, (x1 * 9.0), (fma(x1, x1, 1.0) * (x1 + ((x1 * (x1 * -6.0)) + ((t_0 / fma(x1, x1, 1.0)) * ((x1 * (-6.0 + (t_0 / (fma(x1, x1, 1.0) / 2.0)))) + ((x1 * x1) * 4.0))))))));
	}
	return tmp;
}
function code(x1, x2)
	return Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * Float64(Float64(Float64(Float64(Float64(3.0 * x1) * x1) + Float64(2.0 * x2)) - x1) / Float64(Float64(x1 * x1) + 1.0))) * Float64(Float64(Float64(Float64(Float64(Float64(3.0 * x1) * x1) + Float64(2.0 * x2)) - x1) / Float64(Float64(x1 * x1) + 1.0)) - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * Float64(Float64(Float64(Float64(Float64(3.0 * x1) * x1) + Float64(2.0 * x2)) - x1) / Float64(Float64(x1 * x1) + 1.0))) - 6.0))) * Float64(Float64(x1 * x1) + 1.0)) + Float64(Float64(Float64(3.0 * x1) * x1) * Float64(Float64(Float64(Float64(Float64(3.0 * x1) * x1) + Float64(2.0 * x2)) - x1) / Float64(Float64(x1 * x1) + 1.0)))) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(Float64(Float64(3.0 * x1) * x1) - Float64(2.0 * x2)) - x1) / Float64(Float64(x1 * x1) + 1.0)))))
end
function code(x1, x2)
	t_0 = fma(x1, Float64(x1 * 3.0), fma(2.0, x2, Float64(-x1)))
	tmp = 0.0
	if ((x1 <= -5e+153) || !(x1 <= 5e+153))
		tmp = Float64(x1 + fma(3.0, Float64(Float64(x1 * Float64(x1 * 3.0)) - x1), x1));
	else
		tmp = Float64(x1 + fma(3.0, Float64(Float64(-2.0 * x2) - x1), fma(x1, Float64(x1 * 9.0), Float64(fma(x1, x1, 1.0) * Float64(x1 + Float64(Float64(x1 * Float64(x1 * -6.0)) + Float64(Float64(t_0 / fma(x1, x1, 1.0)) * Float64(Float64(x1 * Float64(-6.0 + Float64(t_0 / Float64(fma(x1, x1, 1.0) / 2.0)))) + Float64(Float64(x1 * x1) * 4.0)))))))));
	end
	return tmp
end
code[x1_, x2_] := N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * N[(N[(N[(N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision] + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[(N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision] + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * N[(N[(N[(N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision] + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision] * N[(N[(N[(N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision] + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision] - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision] + N[(2.0 * x2 + (-x1)), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[x1, -5e+153], N[Not[LessEqual[x1, 5e+153]], $MachinePrecision]], N[(x1 + N[(3.0 * N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] + x1), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(3.0 * N[(N[(-2.0 * x2), $MachinePrecision] - x1), $MachinePrecision] + N[(x1 * N[(x1 * 9.0), $MachinePrecision] + N[(N[(x1 * x1 + 1.0), $MachinePrecision] * N[(x1 + N[(N[(x1 * N[(x1 * -6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$0 / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] * N[(N[(x1 * N[(-6.0 + N[(t$95$0 / N[(N[(x1 * x1 + 1.0), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right)
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(x1, x1 \cdot 3, \mathsf{fma}\left(2, x2, -x1\right)\right)\\
\mathbf{if}\;x1 \leq -5 \cdot 10^{+153} \lor \neg \left(x1 \leq 5 \cdot 10^{+153}\right):\\
\;\;\;\;x1 + \mathsf{fma}\left(3, x1 \cdot \left(x1 \cdot 3\right) - x1, x1\right)\\

\mathbf{else}:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, -2 \cdot x2 - x1, \mathsf{fma}\left(x1, x1 \cdot 9, \mathsf{fma}\left(x1, x1, 1\right) \cdot \left(x1 + \left(x1 \cdot \left(x1 \cdot -6\right) + \frac{t_0}{\mathsf{fma}\left(x1, x1, 1\right)} \cdot \left(x1 \cdot \left(-6 + \frac{t_0}{\frac{\mathsf{fma}\left(x1, x1, 1\right)}{2}}\right) + \left(x1 \cdot x1\right) \cdot 4\right)\right)\right)\right)\right)\\


\end{array}
\end{array}

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.

Herbie found 23 alternatives:

AlternativeAccuracySpeedup

Accuracy vs Speed

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.

Bogosity?

Bogosity

Derivation?

  1. Split input into 2 regimes
  2. if x1 < -5.00000000000000018e153 or 5.00000000000000018e153 < x1

    1. Initial program 0.0%

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

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

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

      \[\leadsto x1 + \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right) + x1\right) + 3 \cdot \color{blue}{\left(\mathsf{fma}\left(x1 \cdot x1, 2 \cdot x2 + 3, x2 \cdot -2\right) - x1\right)}\right) \]
      Step-by-step derivation

      [Start]66.0%

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

      +-commutative [=>]66.0%

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

      neg-mul-1 [<=]66.0%

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

      unsub-neg [=>]66.0%

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

      +-commutative [=>]66.0%

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

      *-commutative [=>]66.0%

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

      fma-def [=>]66.0%

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

      unpow2 [=>]66.0%

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

      cancel-sign-sub-inv [=>]66.0%

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

      metadata-eval [=>]66.0%

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

      +-commutative [=>]66.0%

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

      *-commutative [=>]66.0%

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

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

      [Start]66.0%

      \[ x1 + \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right) + x1\right) + 3 \cdot \left(\mathsf{fma}\left(x1 \cdot x1, 2 \cdot x2 + 3, x2 \cdot -2\right) - x1\right)\right) \]

      *-un-lft-identity [=>]66.0%

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

      fma-def [=>]66.0%

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

      fma-neg [=>]66.0%

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

      metadata-eval [=>]66.0%

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

      fma-def [=>]66.0%

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

      \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(3, \mathsf{fma}\left(x1 \cdot x1, \mathsf{fma}\left(2, x2, 3\right), x2 \cdot -2\right) - x1, \mathsf{fma}\left(x2 \cdot 4, x1 \cdot \mathsf{fma}\left(2, x2, -3\right), x1\right)\right)} \]
      Step-by-step derivation

      [Start]66.0%

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

      *-lft-identity [=>]66.0%

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

      +-commutative [=>]66.0%

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

      fma-def [=>]66.0%

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

      fma-udef [=>]66.0%

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

      associate-*r* [=>]66.0%

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

      fma-def [=>]66.0%

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

      *-commutative [=>]66.0%

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

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

      \[\leadsto x1 + \color{blue}{\mathsf{fma}\left(3, x1 \cdot \left(x1 \cdot 3\right) - x1, x1\right)} \]
      Step-by-step derivation

      [Start]100.0%

      \[ x1 + \left(x1 + 3 \cdot \left(3 \cdot {x1}^{2} - x1\right)\right) \]

      +-commutative [=>]100.0%

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

      fma-def [=>]100.0%

      \[ x1 + \color{blue}{\mathsf{fma}\left(3, 3 \cdot {x1}^{2} - x1, x1\right)} \]

      *-commutative [=>]100.0%

      \[ x1 + \mathsf{fma}\left(3, \color{blue}{{x1}^{2} \cdot 3} - x1, x1\right) \]

      unpow2 [=>]100.0%

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

      associate-*l* [=>]100.0%

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

    if -5.00000000000000018e153 < x1 < 5.00000000000000018e153

    1. Initial program 89.5%

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

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

      [Start]89.5%

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

      +-commutative [=>]89.5%

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

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

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

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

      [Start]99.7%

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

      +-commutative [=>]99.7%

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

      neg-mul-1 [<=]99.7%

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

      unsub-neg [=>]99.7%

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

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

Alternatives

Alternative 1
Accuracy99.7%
Cost61769
\[\begin{array}{l} t_0 := \mathsf{fma}\left(x1, x1 \cdot 3, \mathsf{fma}\left(2, x2, -x1\right)\right)\\ \mathbf{if}\;x1 \leq -5 \cdot 10^{+153} \lor \neg \left(x1 \leq 5 \cdot 10^{+153}\right):\\ \;\;\;\;x1 + \mathsf{fma}\left(3, x1 \cdot \left(x1 \cdot 3\right) - x1, x1\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \mathsf{fma}\left(3, -2 \cdot x2 - x1, \mathsf{fma}\left(x1, x1 \cdot 9, \mathsf{fma}\left(x1, x1, 1\right) \cdot \left(x1 + \left(x1 \cdot \left(x1 \cdot -6\right) + \frac{t_0}{\mathsf{fma}\left(x1, x1, 1\right)} \cdot \left(x1 \cdot \left(-6 + \frac{t_0}{\frac{\mathsf{fma}\left(x1, x1, 1\right)}{2}}\right) + \left(x1 \cdot x1\right) \cdot 4\right)\right)\right)\right)\right)\\ \end{array} \]
Alternative 2
Accuracy98.0%
Cost8524
\[\begin{array}{l} t_0 := 1 + x1 \cdot x1\\ t_1 := x1 \cdot \left(x1 \cdot 3\right)\\ t_2 := \frac{\left(t_1 + x2 \cdot 2\right) - x1}{t_0}\\ t_3 := x1 + \mathsf{fma}\left(3, t_1 - x1, x1\right)\\ \mathbf{if}\;x1 \leq -7.1 \cdot 10^{+183}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x1 \leq -5.6 \cdot 10^{+102}:\\ \;\;\;\;x1 + \left(\left(x1 + 8 \cdot \left(x2 \cdot \left(x1 \cdot x2 - x2 \cdot {x1}^{3}\right)\right)\right) + 3 \cdot \left(-2 \cdot x2\right)\right)\\ \mathbf{elif}\;x1 \leq 4 \cdot 10^{+153}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(t_1 - x2 \cdot 2\right) - x1}{t_0} + \left(x1 + \left(\left(t_0 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t_2 - 6\right)\right) + t_1 \cdot t_2\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \]
Alternative 3
Accuracy99.1%
Cost8524
\[\begin{array}{l} t_0 := x1 \cdot \left(x1 \cdot 3\right)\\ t_1 := x1 + \mathsf{fma}\left(3, t_0 - x1, x1\right)\\ t_2 := 1 + x1 \cdot x1\\ t_3 := 3 \cdot \frac{\left(t_0 - x2 \cdot 2\right) - x1}{t_2}\\ t_4 := \frac{\left(t_0 + x2 \cdot 2\right) - x1}{t_2}\\ \mathbf{if}\;x1 \leq -1 \cdot 10^{+154}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x1 \leq -2 \cdot 10^{+104}:\\ \;\;\;\;x1 + \left(\left(x1 + {x1}^{4} \cdot 6\right) + t_3\right)\\ \mathbf{elif}\;x1 \leq 4 \cdot 10^{+153}:\\ \;\;\;\;x1 + \left(t_3 + \left(x1 + \left(\left(t_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_4\right) \cdot \left(t_4 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t_4 - 6\right)\right) + t_0 \cdot t_4\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 4
Accuracy97.1%
Cost8072
\[\begin{array}{l} t_0 := x1 \cdot \left(x1 \cdot 3\right)\\ t_1 := x1 + \mathsf{fma}\left(3, t_0 - x1, x1\right)\\ t_2 := 1 + x1 \cdot x1\\ t_3 := \frac{\left(t_0 + x2 \cdot 2\right) - x1}{t_2}\\ \mathbf{if}\;x1 \leq -7.1 \cdot 10^{+183}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x1 \leq -5.6 \cdot 10^{+102}:\\ \;\;\;\;x1 + \left(\left(x1 + 8 \cdot \left(x2 \cdot \left(x1 \cdot x2 - x2 \cdot {x1}^{3}\right)\right)\right) + 3 \cdot \left(-2 \cdot x2\right)\right)\\ \mathbf{elif}\;x1 \leq 4 \cdot 10^{+153}:\\ \;\;\;\;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(4 \cdot t_3 - 6\right)\right) + t_0 \cdot t_3\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \left(-2 \cdot x2 - x1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 5
Accuracy96.8%
Cost7816
\[\begin{array}{l} t_0 := 1 + x1 \cdot x1\\ t_1 := x1 \cdot \left(x1 \cdot 3\right)\\ t_2 := x1 + \mathsf{fma}\left(3, t_1 - x1, x1\right)\\ t_3 := \frac{\left(t_1 + x2 \cdot 2\right) - x1}{t_0}\\ \mathbf{if}\;x1 \leq -3.2 \cdot 10^{+181}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x1 \leq -3.7 \cdot 10^{+104}:\\ \;\;\;\;x1 + \left(3 \cdot \left(-2 \cdot x2\right) + \left(x1 - 8 \cdot \left({x1}^{3} \cdot \left(x2 \cdot x2\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 4 \cdot 10^{+153}:\\ \;\;\;\;x1 + \left(\left(x1 + \left(\left(t_0 \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(4 \cdot t_3 - 6\right)\right) + t_1 \cdot t_3\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \left(-2 \cdot x2 - x1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 6
Accuracy94.8%
Cost7625
\[\begin{array}{l} t_0 := 1 + x1 \cdot x1\\ t_1 := x1 \cdot \left(x1 \cdot 3\right)\\ t_2 := \frac{\left(t_1 + x2 \cdot 2\right) - x1}{t_0}\\ \mathbf{if}\;x1 \leq -1.05 \cdot 10^{+103} \lor \neg \left(x1 \leq 4 \cdot 10^{+153}\right):\\ \;\;\;\;x1 + \mathsf{fma}\left(3, t_1 - x1, x1\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(\left(x1 + \left(\left(t_0 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t_2 - 6\right)\right) + t_1 \cdot t_2\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \left(-2 \cdot x2 - x1\right)\right)\\ \end{array} \]
Alternative 7
Accuracy85.8%
Cost7369
\[\begin{array}{l} t_0 := 1 + x1 \cdot x1\\ t_1 := x1 \cdot \left(x1 \cdot 3\right)\\ t_2 := \frac{\left(t_1 + x2 \cdot 2\right) - x1}{t_0}\\ \mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102} \lor \neg \left(x1 \leq 4.5 \cdot 10^{+153}\right):\\ \;\;\;\;x1 + 3 \cdot \left(\left(x1 \cdot x1\right) \cdot \mathsf{fma}\left(2, x2, 3\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(3 \cdot \left(-2 \cdot x2 - x1\right) + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot t_1 + t_0 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(4 \cdot t_2 - 6\right) + \left(t_2 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(x2 \cdot 2 - x1\right)\right)\right)\right)\right)\right)\right)\\ \end{array} \]
Alternative 8
Accuracy87.5%
Cost7369
\[\begin{array}{l} t_0 := x1 \cdot \left(x1 \cdot 3\right)\\ t_1 := 1 + x1 \cdot x1\\ t_2 := \frac{\left(t_0 + x2 \cdot 2\right) - x1}{t_1}\\ \mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102} \lor \neg \left(x1 \leq 1.35 \cdot 10^{+154}\right):\\ \;\;\;\;x1 + 3 \cdot \left(\left(x1 \cdot x1\right) \cdot \mathsf{fma}\left(2, x2, 3\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(t_0 - x2 \cdot 2\right) - x1}{t_1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_0 \cdot t_2 + t_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\ \end{array} \]
Alternative 9
Accuracy89.1%
Cost7369
\[\begin{array}{l} t_0 := x1 \cdot \left(x1 \cdot 3\right)\\ t_1 := 1 + x1 \cdot x1\\ t_2 := \frac{\left(t_0 + x2 \cdot 2\right) - x1}{t_1}\\ \mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102} \lor \neg \left(x1 \leq 1.35 \cdot 10^{+154}\right):\\ \;\;\;\;x1 + 3 \cdot \left(\left(x1 \cdot x1\right) \cdot \mathsf{fma}\left(2, x2, 3\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(t_0 - x2 \cdot 2\right) - x1}{t_1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t_2 - 6\right)\right) + 3 \cdot t_0\right)\right)\right)\right)\\ \end{array} \]
Alternative 10
Accuracy94.8%
Cost7369
\[\begin{array}{l} t_0 := 1 + x1 \cdot x1\\ t_1 := x1 \cdot \left(x1 \cdot 3\right)\\ t_2 := \frac{\left(t_1 + x2 \cdot 2\right) - x1}{t_0}\\ \mathbf{if}\;x1 \leq -6.8 \cdot 10^{+103} \lor \neg \left(x1 \leq 4 \cdot 10^{+153}\right):\\ \;\;\;\;x1 + \mathsf{fma}\left(3, t_1 - x1, x1\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(t_1 - x2 \cdot 2\right) - x1}{t_0} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_0 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t_2 - 6\right)\right) + 3 \cdot t_1\right)\right)\right)\right)\\ \end{array} \]
Alternative 11
Accuracy75.3%
Cost5832
\[\begin{array}{l} t_0 := 1 + x1 \cdot x1\\ t_1 := x1 \cdot \left(x1 \cdot 3\right)\\ t_2 := \frac{\left(t_1 + x2 \cdot 2\right) - x1}{t_0}\\ \mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\ \;\;\;\;x1 + \left(x1 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\ \mathbf{elif}\;x1 \leq 8 \cdot 10^{+153}:\\ \;\;\;\;x1 + \left(3 \cdot \left(-2 \cdot x2 - x1\right) + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot t_1 + t_0 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(4 \cdot t_2 - 6\right) + \left(t_2 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(x2 \cdot 2 - x1\right)\right)\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(3 \cdot \left(-2 \cdot x2\right) + \left(x1 + 8 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\\ \end{array} \]
Alternative 12
Accuracy74.3%
Cost5448
\[\begin{array}{l} t_0 := x1 \cdot \left(x1 \cdot 3\right)\\ t_1 := 1 + x1 \cdot x1\\ \mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\ \;\;\;\;x1 + \left(x1 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\ \mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;x1 + \left(3 \cdot \frac{\left(t_0 - x2 \cdot 2\right) - x1}{t_1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot t_0 + t_1 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(t_0 + x2 \cdot 2\right) - x1}{t_1} - 6\right) + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(x2 \cdot 2 - 3\right)\right)\right)\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(3 \cdot \left(-2 \cdot x2\right) + \left(x1 + 8 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\\ \end{array} \]
Alternative 13
Accuracy75.0%
Cost5200
\[\begin{array}{l} t_0 := x1 \cdot \left(x1 \cdot 3\right)\\ t_1 := 1 + x1 \cdot x1\\ t_2 := 3 \cdot \frac{\left(t_0 - x2 \cdot 2\right) - x1}{t_1}\\ t_3 := x1 + \left(t_2 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot t_0 + t_1 \cdot \left(x1 \cdot 2 + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(t_0 + x2 \cdot 2\right) - x1}{t_1} - 6\right)\right)\right)\right)\right)\right)\\ \mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\ \;\;\;\;x1 + \left(x1 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\ \mathbf{elif}\;x1 \leq -32000:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x1 \leq 1.95 \cdot 10^{+26}:\\ \;\;\;\;x1 + \left(t_2 + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(x2 \cdot 2 - 3\right)\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(3 \cdot \left(-2 \cdot x2\right) + \left(x1 + 8 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\\ \end{array} \]
Alternative 14
Accuracy63.0%
Cost1604
\[\begin{array}{l} \mathbf{if}\;x1 \leq -3.7 \cdot 10^{+104}:\\ \;\;\;\;x1 + \left(x1 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(x2 \cdot 2 - 3\right)\right)\right)\right) + \left(x1 \cdot -3 + x2 \cdot -6\right)\right)\\ \end{array} \]
Alternative 15
Accuracy63.0%
Cost1604
\[\begin{array}{l} \mathbf{if}\;x1 \leq -1.15 \cdot 10^{+105}:\\ \;\;\;\;x1 + \left(x1 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(3 \cdot \left(-2 \cdot x2 - x1\right) + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(x2 \cdot 2 - 3\right)\right)\right)\right)\right)\\ \end{array} \]
Alternative 16
Accuracy42.6%
Cost1352
\[\begin{array}{l} \mathbf{if}\;x1 \leq -2.6 \cdot 10^{+57}:\\ \;\;\;\;x1 + \left(x1 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\ \mathbf{elif}\;x1 \leq -7 \cdot 10^{-110}:\\ \;\;\;\;x1 + \left(9 + x1 \cdot \left(1 + 4 \cdot \left(x2 \cdot \left(x2 \cdot 2 - 3\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 1.6 \cdot 10^{-140}:\\ \;\;\;\;x1 + x2 \cdot -6\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x2 \cdot x2\right) \cdot \left(x1 \cdot 8\right)\\ \end{array} \]
Alternative 17
Accuracy57.5%
Cost1348
\[\begin{array}{l} \mathbf{if}\;x1 \leq -1.05 \cdot 10^{+105}:\\ \;\;\;\;x1 + \left(x1 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(x2 \cdot 2 - 3\right)\right) - 2\right)\right)\\ \end{array} \]
Alternative 18
Accuracy46.3%
Cost1220
\[\begin{array}{l} \mathbf{if}\;x1 \leq -3.8 \cdot 10^{+73}:\\ \;\;\;\;x1 + \left(x1 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(3 \cdot \left(-2 \cdot x2\right) + \left(x1 + 8 \cdot \left(x1 \cdot \left(x2 \cdot x2\right)\right)\right)\right)\\ \end{array} \]
Alternative 19
Accuracy52.0%
Cost1220
\[\begin{array}{l} \mathbf{if}\;x1 \leq -9.8 \cdot 10^{+73}:\\ \;\;\;\;x1 + \left(x1 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(3 \cdot \left(-2 \cdot x2\right) + \left(x1 + 8 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\\ \end{array} \]
Alternative 20
Accuracy42.5%
Cost973
\[\begin{array}{l} \mathbf{if}\;x1 \leq -3.8 \cdot 10^{+72}:\\ \;\;\;\;x1 + \left(x1 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\ \mathbf{elif}\;x1 \leq -4.4 \cdot 10^{-111} \lor \neg \left(x1 \leq 1.6 \cdot 10^{-140}\right):\\ \;\;\;\;x1 + \left(x2 \cdot x2\right) \cdot \left(x1 \cdot 8\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + x2 \cdot -6\\ \end{array} \]
Alternative 21
Accuracy37.7%
Cost841
\[\begin{array}{l} \mathbf{if}\;x2 \leq -2.3 \cdot 10^{+96} \lor \neg \left(x2 \leq 1.75 \cdot 10^{+134}\right):\\ \;\;\;\;x1 + \left(x2 \cdot x2\right) \cdot \left(x1 \cdot 8\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + x2 \cdot -6\\ \end{array} \]
Alternative 22
Accuracy26.5%
Cost320
\[x1 + x2 \cdot -6 \]
Alternative 23
Accuracy3.3%
Cost192
\[x1 + x1 \]

Reproduce?

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