?

Average Accuracy: 69.3% → 88.6%
Time: 24.9s
Precision: binary64
Cost: 58404

?

\[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \end{array} \]
\[\begin{array}{l} t_0 := \mathsf{fma}\left(a \cdot -4, c, 4 \cdot \left(c \cdot a\right)\right)\\ t_1 := \left(-b\right) - b\\ t_2 := c \cdot \left(a \cdot -4\right)\\ t_3 := \sqrt{b \cdot b + t_2}\\ t_4 := \frac{t_3 - b}{2 \cdot a}\\ t_5 := \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{\mathsf{fma}\left(b, b, t_2\right) + \left(t_0 + t_0\right)}}\\ \mathbf{else}:\\ \;\;\;\;t_4\\ \end{array}\\ t_6 := \frac{2 \cdot c}{\left(-b\right) - t_3}\\ t_7 := \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;t_6\\ \mathbf{else}:\\ \;\;\;\;t_4\\ \end{array}\\ t_8 := \frac{a}{\frac{b}{c}}\\ \mathbf{if}\;t_7 \leq -1 \cdot 10^{+178}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;t_6\\ \mathbf{else}:\\ \;\;\;\;\frac{t_1}{2 \cdot a}\\ \end{array}\\ \mathbf{elif}\;t_7 \leq -4 \cdot 10^{-238}:\\ \;\;\;\;t_5\\ \mathbf{elif}\;t_7 \leq 0:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(2 \cdot t_8 - b\right) - b}\\ \mathbf{else}:\\ \;\;\;\;\frac{t_8 - b}{a}\\ \end{array}\\ \mathbf{elif}\;t_7 \leq 10^{+251}:\\ \;\;\;\;t_5\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{t_1}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (>= b 0.0)
   (/ (* 2.0 c) (- (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))))
   (/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a))))
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (fma (* a -4.0) c (* 4.0 (* c a))))
        (t_1 (- (- b) b))
        (t_2 (* c (* a -4.0)))
        (t_3 (sqrt (+ (* b b) t_2)))
        (t_4 (/ (- t_3 b) (* 2.0 a)))
        (t_5
         (if (>= b 0.0)
           (/ (* 2.0 c) (- (- b) (sqrt (+ (fma b b t_2) (+ t_0 t_0)))))
           t_4))
        (t_6 (/ (* 2.0 c) (- (- b) t_3)))
        (t_7 (if (>= b 0.0) t_6 t_4))
        (t_8 (/ a (/ b c))))
   (if (<= t_7 -1e+178)
     (if (>= b 0.0) t_6 (/ t_1 (* 2.0 a)))
     (if (<= t_7 -4e-238)
       t_5
       (if (<= t_7 0.0)
         (if (>= b 0.0) (/ (* 2.0 c) (- (- (* 2.0 t_8) b) b)) (/ (- t_8 b) a))
         (if (<= t_7 1e+251)
           t_5
           (if (>= b 0.0) (/ (* 2.0 c) t_1) (- (/ c b) (/ b a)))))))))
double code(double a, double b, double c) {
	double tmp;
	if (b >= 0.0) {
		tmp = (2.0 * c) / (-b - sqrt(((b * b) - ((4.0 * a) * c))));
	} else {
		tmp = (-b + sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a);
	}
	return tmp;
}
double code(double a, double b, double c) {
	double t_0 = fma((a * -4.0), c, (4.0 * (c * a)));
	double t_1 = -b - b;
	double t_2 = c * (a * -4.0);
	double t_3 = sqrt(((b * b) + t_2));
	double t_4 = (t_3 - b) / (2.0 * a);
	double tmp;
	if (b >= 0.0) {
		tmp = (2.0 * c) / (-b - sqrt((fma(b, b, t_2) + (t_0 + t_0))));
	} else {
		tmp = t_4;
	}
	double t_5 = tmp;
	double t_6 = (2.0 * c) / (-b - t_3);
	double tmp_1;
	if (b >= 0.0) {
		tmp_1 = t_6;
	} else {
		tmp_1 = t_4;
	}
	double t_7 = tmp_1;
	double t_8 = a / (b / c);
	double tmp_3;
	if (t_7 <= -1e+178) {
		double tmp_4;
		if (b >= 0.0) {
			tmp_4 = t_6;
		} else {
			tmp_4 = t_1 / (2.0 * a);
		}
		tmp_3 = tmp_4;
	} else if (t_7 <= -4e-238) {
		tmp_3 = t_5;
	} else if (t_7 <= 0.0) {
		double tmp_5;
		if (b >= 0.0) {
			tmp_5 = (2.0 * c) / (((2.0 * t_8) - b) - b);
		} else {
			tmp_5 = (t_8 - b) / a;
		}
		tmp_3 = tmp_5;
	} else if (t_7 <= 1e+251) {
		tmp_3 = t_5;
	} else if (b >= 0.0) {
		tmp_3 = (2.0 * c) / t_1;
	} else {
		tmp_3 = (c / b) - (b / a);
	}
	return tmp_3;
}
function code(a, b, c)
	tmp = 0.0
	if (b >= 0.0)
		tmp = Float64(Float64(2.0 * c) / Float64(Float64(-b) - sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c)))));
	else
		tmp = Float64(Float64(Float64(-b) + sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c)))) / Float64(2.0 * a));
	end
	return tmp
end
function code(a, b, c)
	t_0 = fma(Float64(a * -4.0), c, Float64(4.0 * Float64(c * a)))
	t_1 = Float64(Float64(-b) - b)
	t_2 = Float64(c * Float64(a * -4.0))
	t_3 = sqrt(Float64(Float64(b * b) + t_2))
	t_4 = Float64(Float64(t_3 - b) / Float64(2.0 * a))
	tmp = 0.0
	if (b >= 0.0)
		tmp = Float64(Float64(2.0 * c) / Float64(Float64(-b) - sqrt(Float64(fma(b, b, t_2) + Float64(t_0 + t_0)))));
	else
		tmp = t_4;
	end
	t_5 = tmp
	t_6 = Float64(Float64(2.0 * c) / Float64(Float64(-b) - t_3))
	tmp_1 = 0.0
	if (b >= 0.0)
		tmp_1 = t_6;
	else
		tmp_1 = t_4;
	end
	t_7 = tmp_1
	t_8 = Float64(a / Float64(b / c))
	tmp_3 = 0.0
	if (t_7 <= -1e+178)
		tmp_4 = 0.0
		if (b >= 0.0)
			tmp_4 = t_6;
		else
			tmp_4 = Float64(t_1 / Float64(2.0 * a));
		end
		tmp_3 = tmp_4;
	elseif (t_7 <= -4e-238)
		tmp_3 = t_5;
	elseif (t_7 <= 0.0)
		tmp_5 = 0.0
		if (b >= 0.0)
			tmp_5 = Float64(Float64(2.0 * c) / Float64(Float64(Float64(2.0 * t_8) - b) - b));
		else
			tmp_5 = Float64(Float64(t_8 - b) / a);
		end
		tmp_3 = tmp_5;
	elseif (t_7 <= 1e+251)
		tmp_3 = t_5;
	elseif (b >= 0.0)
		tmp_3 = Float64(Float64(2.0 * c) / t_1);
	else
		tmp_3 = Float64(Float64(c / b) - Float64(b / a));
	end
	return tmp_3
end
code[a_, b_, c_] := If[GreaterEqual[b, 0.0], 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], 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]]
code[a_, b_, c_] := Block[{t$95$0 = N[(N[(a * -4.0), $MachinePrecision] * c + N[(4.0 * N[(c * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[((-b) - b), $MachinePrecision]}, Block[{t$95$2 = N[(c * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(N[(b * b), $MachinePrecision] + t$95$2), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(N[(t$95$3 - b), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = If[GreaterEqual[b, 0.0], N[(N[(2.0 * c), $MachinePrecision] / N[((-b) - N[Sqrt[N[(N[(b * b + t$95$2), $MachinePrecision] + N[(t$95$0 + t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$4]}, Block[{t$95$6 = N[(N[(2.0 * c), $MachinePrecision] / N[((-b) - t$95$3), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = If[GreaterEqual[b, 0.0], t$95$6, t$95$4]}, Block[{t$95$8 = N[(a / N[(b / c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$7, -1e+178], If[GreaterEqual[b, 0.0], t$95$6, N[(t$95$1 / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]], If[LessEqual[t$95$7, -4e-238], t$95$5, If[LessEqual[t$95$7, 0.0], If[GreaterEqual[b, 0.0], N[(N[(2.0 * c), $MachinePrecision] / N[(N[(N[(2.0 * t$95$8), $MachinePrecision] - b), $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$8 - b), $MachinePrecision] / a), $MachinePrecision]], If[LessEqual[t$95$7, 1e+251], t$95$5, If[GreaterEqual[b, 0.0], N[(N[(2.0 * c), $MachinePrecision] / t$95$1), $MachinePrecision], N[(N[(c / b), $MachinePrecision] - N[(b / a), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]]]
\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\

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


\end{array}
\begin{array}{l}
t_0 := \mathsf{fma}\left(a \cdot -4, c, 4 \cdot \left(c \cdot a\right)\right)\\
t_1 := \left(-b\right) - b\\
t_2 := c \cdot \left(a \cdot -4\right)\\
t_3 := \sqrt{b \cdot b + t_2}\\
t_4 := \frac{t_3 - b}{2 \cdot a}\\
t_5 := \begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{\mathsf{fma}\left(b, b, t_2\right) + \left(t_0 + t_0\right)}}\\

\mathbf{else}:\\
\;\;\;\;t_4\\


\end{array}\\
t_6 := \frac{2 \cdot c}{\left(-b\right) - t_3}\\
t_7 := \begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;t_6\\

\mathbf{else}:\\
\;\;\;\;t_4\\


\end{array}\\
t_8 := \frac{a}{\frac{b}{c}}\\
\mathbf{if}\;t_7 \leq -1 \cdot 10^{+178}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;t_6\\

\mathbf{else}:\\
\;\;\;\;\frac{t_1}{2 \cdot a}\\


\end{array}\\

\mathbf{elif}\;t_7 \leq -4 \cdot 10^{-238}:\\
\;\;\;\;t_5\\

\mathbf{elif}\;t_7 \leq 0:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(2 \cdot t_8 - b\right) - b}\\

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


\end{array}\\

\mathbf{elif}\;t_7 \leq 10^{+251}:\\
\;\;\;\;t_5\\

\mathbf{elif}\;b \geq 0:\\
\;\;\;\;\frac{2 \cdot c}{t_1}\\

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


\end{array}

Error?

Derivation?

  1. Split input into 4 regimes
  2. if (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c))))) (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))) (*.f64 2 a))) < -1.0000000000000001e178

    1. Initial program 36.2%

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

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

    if -1.0000000000000001e178 < (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c))))) (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))) (*.f64 2 a))) < -4e-238 or -0.0 < (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c))))) (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))) (*.f64 2 a))) < 1e251

    1. Initial program 95.3%

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

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

      [Start]95.3

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

      add-cube-cbrt [=>]95.1

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

      cbrt-prod [=>]95.1

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

      *-commutative [=>]95.1

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

      prod-diff [=>]95.1

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

    if -4e-238 < (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c))))) (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))) (*.f64 2 a))) < -0.0

    1. Initial program 46.0%

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

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

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

      [Start]45.2

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

      fma-def [=>]45.2

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

      associate-/l* [=>]45.1

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

      *-commutative [=>]45.1

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

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

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

      [Start]80.9

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

      associate-/l* [=>]83.7

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

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

      [Start]83.7

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

      div-inv [=>]83.7

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

      *-commutative [=>]83.7

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

      fma-udef [=>]83.7

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

      +-commutative [=>]83.7

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

      distribute-lft-in [=>]83.7

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

      associate-/r* [=>]83.7

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

      metadata-eval [=>]83.7

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

      associate-/r* [=>]83.7

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

      metadata-eval [=>]83.7

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

      *-commutative [=>]83.7

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

      div-inv [=>]83.7

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

      clear-num [<=]83.7

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

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

      [Start]83.7

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

      distribute-lft-out [=>]83.7

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

      +-commutative [<=]83.7

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

      *-commutative [=>]83.7

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

      fma-udef [<=]83.7

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

      associate-*l/ [=>]83.7

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \left(b + -2 \cdot \frac{c}{\frac{b}{a}}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{0.5 \cdot \mathsf{fma}\left(2, c \cdot \frac{a}{b}, b \cdot -2\right)}{a}\\ \end{array} \]
    8. Taylor expanded in c around 0 80.9%

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

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

      [Start]80.9

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

      *-commutative [=>]80.9

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

      associate-/l* [=>]83.8

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

    if 1e251 < (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c))))) (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))) (*.f64 2 a)))

    1. Initial program 13.8%

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

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

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

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

      [Start]76.8

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

      mul-1-neg [=>]76.8

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

      unsub-neg [=>]76.8

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b + c \cdot \left(a \cdot -4\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -4\right)} - b}{2 \cdot a}\\ \end{array} \leq -1 \cdot 10^{+178}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b + c \cdot \left(a \cdot -4\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) - b}{2 \cdot a}\\ \end{array}\\ \mathbf{elif}\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b + c \cdot \left(a \cdot -4\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -4\right)} - b}{2 \cdot a}\\ \end{array} \leq -4 \cdot 10^{-238}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right) + \left(\mathsf{fma}\left(a \cdot -4, c, 4 \cdot \left(c \cdot a\right)\right) + \mathsf{fma}\left(a \cdot -4, c, 4 \cdot \left(c \cdot a\right)\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -4\right)} - b}{2 \cdot a}\\ \end{array}\\ \mathbf{elif}\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b + c \cdot \left(a \cdot -4\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -4\right)} - b}{2 \cdot a}\\ \end{array} \leq 0:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(2 \cdot \frac{a}{\frac{b}{c}} - b\right) - b}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{a}{\frac{b}{c}} - b}{a}\\ \end{array}\\ \mathbf{elif}\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b + c \cdot \left(a \cdot -4\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -4\right)} - b}{2 \cdot a}\\ \end{array} \leq 10^{+251}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right) + \left(\mathsf{fma}\left(a \cdot -4, c, 4 \cdot \left(c \cdot a\right)\right) + \mathsf{fma}\left(a \cdot -4, c, 4 \cdot \left(c \cdot a\right)\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -4\right)} - b}{2 \cdot a}\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - b}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \end{array} \]

Alternatives

Alternative 1
Accuracy89.3%
Cost38052
\[\begin{array}{l} t_0 := \frac{a}{\frac{b}{c}}\\ t_1 := \sqrt{b \cdot b + c \cdot \left(a \cdot -4\right)}\\ t_2 := \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - t_1}\\ \mathbf{else}:\\ \;\;\;\;\frac{t_1 - b}{2 \cdot a}\\ \end{array}\\ \mathbf{if}\;t_2 \leq -\infty:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-b}{a}\\ \end{array}\\ \mathbf{elif}\;t_2 \leq -4 \cdot 10^{-238}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_2 \leq 0:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(2 \cdot t_0 - b\right) - b}\\ \mathbf{else}:\\ \;\;\;\;\frac{t_0 - b}{a}\\ \end{array}\\ \mathbf{elif}\;t_2 \leq 10^{+251}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - b}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \end{array} \]
Alternative 2
Accuracy79.3%
Cost7760
\[\begin{array}{l} t_0 := \frac{c}{\frac{b}{a}}\\ t_1 := \sqrt{c \cdot \left(a \cdot -4\right)}\\ \mathbf{if}\;b \leq -3 \cdot 10^{-27}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \end{array}\\ \mathbf{elif}\;b \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - b}\\ \mathbf{else}:\\ \;\;\;\;\frac{t_1 - b}{2 \cdot a}\\ \end{array}\\ \mathbf{elif}\;b \leq 1.7 \cdot 10^{-44}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - t_1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(2, t_0, b \cdot -2\right)}{2 \cdot a}\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(2 \cdot t_0 - b\right) - b}\\ \mathbf{else}:\\ \;\;\;\;\frac{a}{b} \cdot \frac{c}{a} - \frac{b}{a}\\ \end{array} \]
Alternative 3
Accuracy84.6%
Cost7760
\[\begin{array}{l} t_0 := c \cdot \left(a \cdot -4\right)\\ t_1 := \frac{c}{\frac{b}{a}}\\ \mathbf{if}\;b \leq -2 \cdot 10^{+153}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-c}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{a}{\frac{b}{c}} - b}{a}\\ \end{array}\\ \mathbf{elif}\;b \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - b}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{b \cdot b + t_0} - b}{2 \cdot a}\\ \end{array}\\ \mathbf{elif}\;b \leq 4.2 \cdot 10^{-44}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{t_0}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(2, t_1, b \cdot -2\right)}{2 \cdot a}\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(2 \cdot t_1 - b\right) - b}\\ \mathbf{else}:\\ \;\;\;\;\frac{a}{b} \cdot \frac{c}{a} - \frac{b}{a}\\ \end{array} \]
Alternative 4
Accuracy71.9%
Cost7368
\[\begin{array}{l} \mathbf{if}\;b \leq -3.5 \cdot 10^{-26}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - b}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{c \cdot \left(a \cdot -4\right)} - b}{2 \cdot a}\\ \end{array} \]
Alternative 5
Accuracy65.0%
Cost1092
\[\begin{array}{l} t_0 := \frac{a}{\frac{b}{c}}\\ \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(2 \cdot t_0 - b\right) - b}\\ \mathbf{else}:\\ \;\;\;\;\frac{t_0 - b}{a}\\ \end{array} \]
Alternative 6
Accuracy65.1%
Cost1092
\[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(2 \cdot \frac{c}{\frac{b}{a}} - b\right) - b}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{a}{\frac{b}{c}} - b}{a}\\ \end{array} \]
Alternative 7
Accuracy64.8%
Cost644
\[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - b}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \end{array} \]
Alternative 8
Accuracy30.3%
Cost580
\[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \end{array} \]
Alternative 9
Accuracy30.3%
Cost388
\[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-b}{a}\\ \end{array} \]
Alternative 10
Accuracy3.5%
Cost324
\[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b}\\ \end{array} \]

Error

Reproduce?

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