?

Average Accuracy: 69.3% → 88.5%
Time: 26.8s
Precision: binary64
Cost: 26828

?

\[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array} \]
\[\begin{array}{l} \mathbf{if}\;b \leq -3.8 \cdot 10^{+128}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(\frac{c \cdot 2}{\frac{b}{a}} - b\right) - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot 2}{\mathsf{fma}\left(2, \frac{c}{\frac{b}{a}}, b \cdot -2\right)}\\ \end{array}\\ \mathbf{elif}\;b \leq 1.95 \cdot 10^{+29}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\left(b + \mathsf{hypot}\left(b, {\left(\sqrt[3]{a \cdot -4} \cdot \sqrt[3]{c}\right)}^{1.5}\right)\right) \cdot \frac{-0.5}{a}\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)} - b}\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\frac{-\left(b + b\right)}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-b}{a}\\ \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (>= b 0.0)
   (/ (- (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a))
   (/ (* 2.0 c) (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))))))
(FPCore (a b c)
 :precision binary64
 (if (<= b -3.8e+128)
   (if (>= b 0.0)
     (/ (- (- (/ (* c 2.0) (/ b a)) b) b) (* a 2.0))
     (/ (* c 2.0) (fma 2.0 (/ c (/ b a)) (* b -2.0))))
   (if (<= b 1.95e+29)
     (if (>= b 0.0)
       (* (+ b (hypot b (pow (* (cbrt (* a -4.0)) (cbrt c)) 1.5))) (/ -0.5 a))
       (* c (/ 2.0 (- (sqrt (fma b b (* a (* c -4.0)))) b))))
     (if (>= b 0.0) (/ (- (+ b b)) (* a 2.0)) (/ (- b) a)))))
double code(double a, double b, double c) {
	double tmp;
	if (b >= 0.0) {
		tmp = (-b - sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a);
	} else {
		tmp = (2.0 * c) / (-b + sqrt(((b * b) - ((4.0 * a) * c))));
	}
	return tmp;
}
double code(double a, double b, double c) {
	double tmp_1;
	if (b <= -3.8e+128) {
		double tmp_2;
		if (b >= 0.0) {
			tmp_2 = ((((c * 2.0) / (b / a)) - b) - b) / (a * 2.0);
		} else {
			tmp_2 = (c * 2.0) / fma(2.0, (c / (b / a)), (b * -2.0));
		}
		tmp_1 = tmp_2;
	} else if (b <= 1.95e+29) {
		double tmp_3;
		if (b >= 0.0) {
			tmp_3 = (b + hypot(b, pow((cbrt((a * -4.0)) * cbrt(c)), 1.5))) * (-0.5 / a);
		} else {
			tmp_3 = c * (2.0 / (sqrt(fma(b, b, (a * (c * -4.0)))) - b));
		}
		tmp_1 = tmp_3;
	} else if (b >= 0.0) {
		tmp_1 = -(b + b) / (a * 2.0);
	} else {
		tmp_1 = -b / a;
	}
	return tmp_1;
}
function code(a, b, c)
	tmp = 0.0
	if (b >= 0.0)
		tmp = Float64(Float64(Float64(-b) - sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c)))) / Float64(2.0 * a));
	else
		tmp = Float64(Float64(2.0 * c) / Float64(Float64(-b) + sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c)))));
	end
	return tmp
end
function code(a, b, c)
	tmp_1 = 0.0
	if (b <= -3.8e+128)
		tmp_2 = 0.0
		if (b >= 0.0)
			tmp_2 = Float64(Float64(Float64(Float64(Float64(c * 2.0) / Float64(b / a)) - b) - b) / Float64(a * 2.0));
		else
			tmp_2 = Float64(Float64(c * 2.0) / fma(2.0, Float64(c / Float64(b / a)), Float64(b * -2.0)));
		end
		tmp_1 = tmp_2;
	elseif (b <= 1.95e+29)
		tmp_3 = 0.0
		if (b >= 0.0)
			tmp_3 = Float64(Float64(b + hypot(b, (Float64(cbrt(Float64(a * -4.0)) * cbrt(c)) ^ 1.5))) * Float64(-0.5 / a));
		else
			tmp_3 = Float64(c * Float64(2.0 / Float64(sqrt(fma(b, b, Float64(a * Float64(c * -4.0)))) - b)));
		end
		tmp_1 = tmp_3;
	elseif (b >= 0.0)
		tmp_1 = Float64(Float64(-Float64(b + b)) / Float64(a * 2.0));
	else
		tmp_1 = Float64(Float64(-b) / a);
	end
	return tmp_1
end
code[a_, b_, c_] := If[GreaterEqual[b, 0.0], N[(N[((-b) - N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(4.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * c), $MachinePrecision] / N[((-b) + N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(4.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
code[a_, b_, c_] := If[LessEqual[b, -3.8e+128], If[GreaterEqual[b, 0.0], N[(N[(N[(N[(N[(c * 2.0), $MachinePrecision] / N[(b / a), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(c * 2.0), $MachinePrecision] / N[(2.0 * N[(c / N[(b / a), $MachinePrecision]), $MachinePrecision] + N[(b * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], If[LessEqual[b, 1.95e+29], If[GreaterEqual[b, 0.0], N[(N[(b + N[Sqrt[b ^ 2 + N[Power[N[(N[Power[N[(a * -4.0), $MachinePrecision], 1/3], $MachinePrecision] * N[Power[c, 1/3], $MachinePrecision]), $MachinePrecision], 1.5], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] * N[(-0.5 / a), $MachinePrecision]), $MachinePrecision], N[(c * N[(2.0 / N[(N[Sqrt[N[(b * b + N[(a * N[(c * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], If[GreaterEqual[b, 0.0], N[((-N[(b + b), $MachinePrecision]) / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[((-b) / a), $MachinePrecision]]]]
\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\

\mathbf{else}:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\


\end{array}
\begin{array}{l}
\mathbf{if}\;b \leq -3.8 \cdot 10^{+128}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\frac{\left(\frac{c \cdot 2}{\frac{b}{a}} - b\right) - b}{a \cdot 2}\\

\mathbf{else}:\\
\;\;\;\;\frac{c \cdot 2}{\mathsf{fma}\left(2, \frac{c}{\frac{b}{a}}, b \cdot -2\right)}\\


\end{array}\\

\mathbf{elif}\;b \leq 1.95 \cdot 10^{+29}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\left(b + \mathsf{hypot}\left(b, {\left(\sqrt[3]{a \cdot -4} \cdot \sqrt[3]{c}\right)}^{1.5}\right)\right) \cdot \frac{-0.5}{a}\\

\mathbf{else}:\\
\;\;\;\;c \cdot \frac{2}{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)} - b}\\


\end{array}\\

\mathbf{elif}\;b \geq 0:\\
\;\;\;\;\frac{-\left(b + b\right)}{a \cdot 2}\\

\mathbf{else}:\\
\;\;\;\;\frac{-b}{a}\\


\end{array}

Error?

Derivation?

  1. Split input into 3 regimes
  2. if b < -3.7999999999999999e128

    1. Initial program 46.4%

      \[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array} \]
    2. Taylor expanded in b around inf 46.4%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - \color{blue}{\left(b + -2 \cdot \frac{c \cdot a}{b}\right)}}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array} \]
    3. Simplified46.4%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - \color{blue}{\left(b + \frac{c \cdot -2}{\frac{b}{a}}\right)}}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array} \]
      Proof

      [Start]46.4

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - \left(b + -2 \cdot \frac{c \cdot a}{b}\right)}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array} \]

      *-commutative [=>]46.4

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - \left(b + \color{blue}{\frac{c \cdot a}{b} \cdot -2}\right)}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array} \]

      associate-/l* [=>]46.4

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - \left(b + \color{blue}{\frac{c}{\frac{b}{a}}} \cdot -2\right)}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array} \]

      associate-*l/ [=>]46.4

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - \left(b + \color{blue}{\frac{c \cdot -2}{\frac{b}{a}}}\right)}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array} \]
    4. Taylor expanded in b around -inf 90.1%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - \left(b + \frac{c \cdot -2}{\frac{b}{a}}\right)}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\color{blue}{\frac{2 \cdot c}{2 \cdot \frac{c \cdot a}{b} + -2 \cdot b}}\\ \end{array} \]
    5. Simplified96.6%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - \left(b + \frac{c \cdot -2}{\frac{b}{a}}\right)}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\color{blue}{\frac{2 \cdot c}{\mathsf{fma}\left(2, \frac{c}{\frac{b}{a}}, b \cdot -2\right)}}\\ \end{array} \]
      Proof

      [Start]90.1

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - \left(b + \frac{c \cdot -2}{\frac{b}{a}}\right)}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \frac{c \cdot a}{b} + -2 \cdot b}\\ \end{array} \]

      fma-def [=>]90.1

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - \left(b + \frac{c \cdot -2}{\frac{b}{a}}\right)}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\color{blue}{\frac{2 \cdot c}{\mathsf{fma}\left(2, \frac{c \cdot a}{b}, -2 \cdot b\right)}}\\ \end{array} \]

      associate-/l* [=>]96.6

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - \left(b + \frac{c \cdot -2}{\frac{b}{a}}\right)}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\color{blue}{\mathsf{fma}\left(2, \frac{c}{\frac{b}{a}}, -2 \cdot b\right)}}\\ \end{array} \]

      *-commutative [=>]96.6

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - \left(b + \frac{c \cdot -2}{\frac{b}{a}}\right)}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\mathsf{fma}\left(2, \frac{c}{\frac{b}{a}}, b \cdot -2\right)}\\ \end{array} \]

    if -3.7999999999999999e128 < b < 1.94999999999999984e29

    1. Initial program 86.1%

      \[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array} \]
    2. Simplified85.9%

      \[\leadsto \color{blue}{\begin{array}{l} \color{blue}{\mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)} - b}\\ } \end{array}} \]
      Proof

      [Start]86.1

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array} \]
    3. Applied egg-rr68.1%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \color{blue}{\left(e^{\mathsf{log1p}\left(\mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -4\right)}\right)\right)} - 1\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)} - b}\\ \end{array} \]
      Proof

      [Start]85.9

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)} - b}\\ \end{array} \]

      expm1-log1p-u [=>]84.9

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)}\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)} - b}\\ \end{array} \]

      expm1-udef [=>]70.3

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \color{blue}{\left(e^{\mathsf{log1p}\left(\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)}\right)} - 1\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)} - b}\\ \end{array} \]

      fma-udef [=>]70.3

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \left(e^{\mathsf{log1p}\left(\sqrt{\color{blue}{b \cdot b + a \cdot \left(c \cdot -4\right)}}\right)} - 1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)} - b}\\ \end{array} \]

      add-sqr-sqrt [=>]68.1

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \left(e^{\mathsf{log1p}\left(\sqrt{b \cdot b + \color{blue}{\sqrt{a \cdot \left(c \cdot -4\right)} \cdot \sqrt{a \cdot \left(c \cdot -4\right)}}}\right)} - 1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)} - b}\\ \end{array} \]

      hypot-def [=>]68.1

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \left(e^{\mathsf{log1p}\left(\color{blue}{\mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -4\right)}\right)}\right)} - 1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)} - b}\\ \end{array} \]
    4. Simplified82.5%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \color{blue}{\mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -4\right)}\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)} - b}\\ \end{array} \]
      Proof

      [Start]68.1

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \left(e^{\mathsf{log1p}\left(\mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -4\right)}\right)\right)} - 1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)} - b}\\ \end{array} \]

      expm1-def [=>]81.6

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -4\right)}\right)\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)} - b}\\ \end{array} \]

      expm1-log1p [=>]82.5

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \color{blue}{\mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -4\right)}\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)} - b}\\ \end{array} \]

      associate-*r* [=>]82.5

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \mathsf{hypot}\left(b, \sqrt{\color{blue}{\left(a \cdot c\right) \cdot -4}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)} - b}\\ \end{array} \]

      *-commutative [<=]82.5

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \mathsf{hypot}\left(b, \sqrt{\color{blue}{\left(c \cdot a\right)} \cdot -4}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)} - b}\\ \end{array} \]

      associate-*l* [=>]82.5

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \mathsf{hypot}\left(b, \sqrt{\color{blue}{c \cdot \left(a \cdot -4\right)}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)} - b}\\ \end{array} \]
    5. Applied egg-rr82.3%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \mathsf{hypot}\left(b, \color{blue}{\sqrt{{\left(\sqrt[3]{c \cdot \left(a \cdot -4\right)}\right)}^{2}} \cdot \sqrt{\sqrt[3]{c \cdot \left(a \cdot -4\right)}}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)} - b}\\ \end{array} \]
      Proof

      [Start]82.5

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -4\right)}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)} - b}\\ \end{array} \]

      add-cube-cbrt [=>]82.4

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \mathsf{hypot}\left(b, \sqrt{\color{blue}{\left(\sqrt[3]{c \cdot \left(a \cdot -4\right)} \cdot \sqrt[3]{c \cdot \left(a \cdot -4\right)}\right) \cdot \sqrt[3]{c \cdot \left(a \cdot -4\right)}}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)} - b}\\ \end{array} \]

      sqrt-prod [=>]82.3

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \mathsf{hypot}\left(b, \color{blue}{\sqrt{\sqrt[3]{c \cdot \left(a \cdot -4\right)} \cdot \sqrt[3]{c \cdot \left(a \cdot -4\right)}} \cdot \sqrt{\sqrt[3]{c \cdot \left(a \cdot -4\right)}}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)} - b}\\ \end{array} \]

      pow2 [=>]82.3

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \mathsf{hypot}\left(b, \sqrt{\color{blue}{{\left(\sqrt[3]{c \cdot \left(a \cdot -4\right)}\right)}^{2}}} \cdot \sqrt{\sqrt[3]{c \cdot \left(a \cdot -4\right)}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)} - b}\\ \end{array} \]
    6. Simplified82.4%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \mathsf{hypot}\left(b, \color{blue}{{\left(\sqrt[3]{c \cdot \left(a \cdot -4\right)}\right)}^{1.5}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)} - b}\\ \end{array} \]
      Proof

      [Start]82.3

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \mathsf{hypot}\left(b, \sqrt{{\left(\sqrt[3]{c \cdot \left(a \cdot -4\right)}\right)}^{2}} \cdot \sqrt{\sqrt[3]{c \cdot \left(a \cdot -4\right)}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)} - b}\\ \end{array} \]

      *-commutative [=>]82.3

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \mathsf{hypot}\left(b, \color{blue}{\sqrt{\sqrt[3]{c \cdot \left(a \cdot -4\right)}} \cdot \sqrt{{\left(\sqrt[3]{c \cdot \left(a \cdot -4\right)}\right)}^{2}}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)} - b}\\ \end{array} \]

      unpow1/2 [<=]82.3

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \mathsf{hypot}\left(b, \color{blue}{{\left(\sqrt[3]{c \cdot \left(a \cdot -4\right)}\right)}^{0.5}} \cdot \sqrt{{\left(\sqrt[3]{c \cdot \left(a \cdot -4\right)}\right)}^{2}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)} - b}\\ \end{array} \]

      sqr-pow [=>]82.3

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \mathsf{hypot}\left(b, {\left(\sqrt[3]{c \cdot \left(a \cdot -4\right)}\right)}^{0.5} \cdot \sqrt{\color{blue}{{\left(\sqrt[3]{c \cdot \left(a \cdot -4\right)}\right)}^{\left(\frac{2}{2}\right)} \cdot {\left(\sqrt[3]{c \cdot \left(a \cdot -4\right)}\right)}^{\left(\frac{2}{2}\right)}}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)} - b}\\ \end{array} \]

      rem-sqrt-square [=>]82.3

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \mathsf{hypot}\left(b, {\left(\sqrt[3]{c \cdot \left(a \cdot -4\right)}\right)}^{0.5} \cdot \color{blue}{\left|{\left(\sqrt[3]{c \cdot \left(a \cdot -4\right)}\right)}^{\left(\frac{2}{2}\right)}\right|}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)} - b}\\ \end{array} \]

      metadata-eval [=>]82.3

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \mathsf{hypot}\left(b, {\left(\sqrt[3]{c \cdot \left(a \cdot -4\right)}\right)}^{0.5} \cdot \left|{\left(\sqrt[3]{c \cdot \left(a \cdot -4\right)}\right)}^{\color{blue}{1}}\right|\right)\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)} - b}\\ \end{array} \]

      metadata-eval [<=]82.3

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \mathsf{hypot}\left(b, {\left(\sqrt[3]{c \cdot \left(a \cdot -4\right)}\right)}^{0.5} \cdot \left|{\left(\sqrt[3]{c \cdot \left(a \cdot -4\right)}\right)}^{\color{blue}{\left(2 \cdot 0.5\right)}}\right|\right)\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)} - b}\\ \end{array} \]

      pow-sqr [<=]82.3

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \mathsf{hypot}\left(b, {\left(\sqrt[3]{c \cdot \left(a \cdot -4\right)}\right)}^{0.5} \cdot \left|\color{blue}{{\left(\sqrt[3]{c \cdot \left(a \cdot -4\right)}\right)}^{0.5} \cdot {\left(\sqrt[3]{c \cdot \left(a \cdot -4\right)}\right)}^{0.5}}\right|\right)\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)} - b}\\ \end{array} \]

      fabs-sqr [=>]82.3

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \mathsf{hypot}\left(b, {\left(\sqrt[3]{c \cdot \left(a \cdot -4\right)}\right)}^{0.5} \cdot \color{blue}{\left({\left(\sqrt[3]{c \cdot \left(a \cdot -4\right)}\right)}^{0.5} \cdot {\left(\sqrt[3]{c \cdot \left(a \cdot -4\right)}\right)}^{0.5}\right)}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)} - b}\\ \end{array} \]

      pow-sqr [=>]82.3

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \mathsf{hypot}\left(b, {\left(\sqrt[3]{c \cdot \left(a \cdot -4\right)}\right)}^{0.5} \cdot \color{blue}{{\left(\sqrt[3]{c \cdot \left(a \cdot -4\right)}\right)}^{\left(2 \cdot 0.5\right)}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)} - b}\\ \end{array} \]

      metadata-eval [=>]82.3

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \mathsf{hypot}\left(b, {\left(\sqrt[3]{c \cdot \left(a \cdot -4\right)}\right)}^{0.5} \cdot {\left(\sqrt[3]{c \cdot \left(a \cdot -4\right)}\right)}^{\color{blue}{1}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)} - b}\\ \end{array} \]

      unpow1 [=>]82.3

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \mathsf{hypot}\left(b, {\left(\sqrt[3]{c \cdot \left(a \cdot -4\right)}\right)}^{0.5} \cdot \color{blue}{\sqrt[3]{c \cdot \left(a \cdot -4\right)}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)} - b}\\ \end{array} \]

      pow-plus [=>]82.4

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \mathsf{hypot}\left(b, \color{blue}{{\left(\sqrt[3]{c \cdot \left(a \cdot -4\right)}\right)}^{\left(0.5 + 1\right)}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)} - b}\\ \end{array} \]

      metadata-eval [=>]82.4

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \mathsf{hypot}\left(b, {\left(\sqrt[3]{c \cdot \left(a \cdot -4\right)}\right)}^{\color{blue}{1.5}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)} - b}\\ \end{array} \]
    7. Applied egg-rr85.0%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \mathsf{hypot}\left(b, {\color{blue}{\left(\sqrt[3]{a \cdot -4} \cdot \sqrt[3]{c}\right)}}^{1.5}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)} - b}\\ \end{array} \]
      Proof

      [Start]82.4

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \mathsf{hypot}\left(b, {\left(\sqrt[3]{c \cdot \left(a \cdot -4\right)}\right)}^{1.5}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)} - b}\\ \end{array} \]

      cbrt-prod [=>]85.0

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \mathsf{hypot}\left(b, {\color{blue}{\left(\sqrt[3]{c} \cdot \sqrt[3]{a \cdot -4}\right)}}^{1.5}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)} - b}\\ \end{array} \]

      *-commutative [=>]85.0

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \mathsf{hypot}\left(b, {\color{blue}{\left(\sqrt[3]{a \cdot -4} \cdot \sqrt[3]{c}\right)}}^{1.5}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)} - b}\\ \end{array} \]

    if 1.94999999999999984e29 < b

    1. Initial program 45.5%

      \[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array} \]
    2. Taylor expanded in b around inf 90.2%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - \color{blue}{b}}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array} \]
    3. Taylor expanded in c around 0 90.2%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - b}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;-1 \cdot \frac{b}{a}\\ \end{array} \]
    4. Simplified90.2%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - b}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-b}{a}\\ \end{array} \]
      Proof

      [Start]90.2

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - b}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;-1 \cdot \frac{b}{a}\\ \end{array} \]

      mul-1-neg [=>]90.2

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - b}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;-\frac{b}{a}\\ \end{array} \]

      distribute-neg-frac [=>]90.2

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - b}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-b}{a}\\ \end{array} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification88.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -3.8 \cdot 10^{+128}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(\frac{c \cdot 2}{\frac{b}{a}} - b\right) - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot 2}{\mathsf{fma}\left(2, \frac{c}{\frac{b}{a}}, b \cdot -2\right)}\\ \end{array}\\ \mathbf{elif}\;b \leq 1.95 \cdot 10^{+29}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\left(b + \mathsf{hypot}\left(b, {\left(\sqrt[3]{a \cdot -4} \cdot \sqrt[3]{c}\right)}^{1.5}\right)\right) \cdot \frac{-0.5}{a}\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)} - b}\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\frac{-\left(b + b\right)}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-b}{a}\\ \end{array} \]

Alternatives

Alternative 1
Accuracy87.8%
Cost38052
\[\begin{array}{l} t_0 := \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-\left(b + b\right)}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-b}{a}\\ \end{array}\\ t_1 := \sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)}\\ t_2 := \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - t_1}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot 2}{t_1 - b}\\ \end{array}\\ \mathbf{if}\;t_2 \leq -\infty:\\ \;\;\;\;t_0\\ \mathbf{elif}\;t_2 \leq -2 \cdot 10^{-235}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_2 \leq 0:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(\frac{c \cdot 2}{\frac{b}{a}} - b\right) - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot 2}{\mathsf{fma}\left(2, \frac{c}{\frac{b}{a}}, b \cdot -2\right)}\\ \end{array}\\ \mathbf{elif}\;t_2 \leq 5 \cdot 10^{+205}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 2
Accuracy87.5%
Cost38052
\[\begin{array}{l} t_0 := \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-\left(b + b\right)}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-b}{a}\\ \end{array}\\ t_1 := \sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)}\\ t_2 := \frac{\left(-b\right) - t_1}{a \cdot 2}\\ t_3 := \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot 2}{t_1 - b}\\ \end{array}\\ \mathbf{if}\;t_3 \leq -\infty:\\ \;\;\;\;t_0\\ \mathbf{elif}\;t_3 \leq -2 \cdot 10^{-175}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t_3 \leq 0:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot 2}{\mathsf{fma}\left(2, \frac{c}{\frac{b}{a}}, b \cdot -2\right)}\\ \end{array}\\ \mathbf{elif}\;t_3 \leq 5 \cdot 10^{+205}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 3
Accuracy77.3%
Cost7756
\[\begin{array}{l} \mathbf{if}\;b \leq -5.5 \cdot 10^{+154}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(\frac{c \cdot 2}{\frac{b}{a}} - b\right) - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot 2}{\mathsf{fma}\left(2, \frac{c}{\frac{b}{a}}, b \cdot -2\right)}\\ \end{array}\\ \mathbf{elif}\;b \leq -1.05 \cdot 10^{-174}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{0.5}{a} \cdot \left(b + b\right) + \frac{0.5}{a} \cdot \left(\left(c \cdot 2\right) \cdot \frac{a}{b}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot 2}{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} - b}\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\frac{-\left(b + b\right)}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\left(b - \sqrt{c \cdot \left(a \cdot -4\right)}\right) \cdot \frac{2}{a \cdot 4}\\ \end{array} \]
Alternative 4
Accuracy77.4%
Cost7624
\[\begin{array}{l} \mathbf{if}\;b \leq -5.5 \cdot 10^{+154}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(\frac{c \cdot 2}{\frac{b}{a}} - b\right) - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot 2}{\mathsf{fma}\left(2, \frac{c}{\frac{b}{a}}, b \cdot -2\right)}\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\frac{-\left(b + b\right)}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot 2}{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} - b}\\ \end{array} \]
Alternative 5
Accuracy72.4%
Cost7496
\[\begin{array}{l} \mathbf{if}\;b \leq -1.2 \cdot 10^{-87}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(\frac{c \cdot 2}{\frac{b}{a}} - b\right) - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot 2}{\mathsf{fma}\left(2, \frac{c}{\frac{b}{a}}, b \cdot -2\right)}\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\frac{-\left(b + b\right)}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-2}{\frac{b - \sqrt{a \cdot \left(c \cdot -4\right)}}{c}}\\ \end{array} \]
Alternative 6
Accuracy71.7%
Cost7368
\[\begin{array}{l} t_0 := \frac{-\left(b + b\right)}{a \cdot 2}\\ \mathbf{if}\;b \leq -4.4 \cdot 10^{-97}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot 2}{b \cdot -2}\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{b + \sqrt{c \cdot \left(a \cdot -4\right)}}\\ \end{array} \]
Alternative 7
Accuracy72.2%
Cost7368
\[\begin{array}{l} t_0 := \frac{-\left(b + b\right)}{a \cdot 2}\\ \mathbf{if}\;b \leq -2.1 \cdot 10^{-87}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot 2}{b \cdot -2}\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{-2}{\frac{b - \sqrt{a \cdot \left(c \cdot -4\right)}}{c}}\\ \end{array} \]
Alternative 8
Accuracy29.3%
Cost644
\[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-\left(b + b\right)}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-b}{a}\\ \end{array} \]
Alternative 9
Accuracy64.7%
Cost644
\[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-\left(b + b\right)}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot 2}{b \cdot -2}\\ \end{array} \]

Error

Reproduce?

herbie shell --seed 2023138 
(FPCore (a b c)
  :name "jeff quadratic root 1"
  :precision binary64
  (if (>= b 0.0) (/ (- (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)) (/ (* 2.0 c) (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))))))