?

Average Accuracy: 69.0% → 91.4%
Time: 31.6s
Precision: binary64
Cost: 27276

?

\[\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} t_0 := \sqrt[3]{c \cdot -4}\\ t_1 := \sqrt{b \cdot b + -4 \cdot \left(c \cdot a\right)}\\ \mathbf{if}\;b \leq -9 \cdot 10^{+134}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{c}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array}\\ \mathbf{elif}\;b \leq 2.9 \cdot 10^{-172}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{1}{\left(a \cdot -2\right) \cdot \frac{1}{b + \mathsf{hypot}\left(b, t_0 \cdot \sqrt{a \cdot t_0}\right)}}\\ \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 \leq 10^{+140}:\\ \;\;\;\;\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{elif}\;b \geq 0:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \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
 (let* ((t_0 (cbrt (* c -4.0))) (t_1 (sqrt (+ (* b b) (* -4.0 (* c a))))))
   (if (<= b -9e+134)
     (if (>= b 0.0) (/ c b) (/ (- c) b))
     (if (<= b 2.9e-172)
       (if (>= b 0.0)
         (/
          1.0
          (* (* a -2.0) (/ 1.0 (+ b (hypot b (* t_0 (sqrt (* a t_0))))))))
         (* c (/ 2.0 (- (sqrt (fma b b (* a (* c -4.0)))) b))))
       (if (<= b 1e+140)
         (if (>= b 0.0) (/ (- (- b) t_1) (* a 2.0)) (/ (* c 2.0) (- t_1 b)))
         (if (>= b 0.0) (- (/ c b) (/ b a)) (/ 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 t_0 = cbrt((c * -4.0));
	double t_1 = sqrt(((b * b) + (-4.0 * (c * a))));
	double tmp_1;
	if (b <= -9e+134) {
		double tmp_2;
		if (b >= 0.0) {
			tmp_2 = c / b;
		} else {
			tmp_2 = -c / b;
		}
		tmp_1 = tmp_2;
	} else if (b <= 2.9e-172) {
		double tmp_3;
		if (b >= 0.0) {
			tmp_3 = 1.0 / ((a * -2.0) * (1.0 / (b + hypot(b, (t_0 * sqrt((a * t_0)))))));
		} else {
			tmp_3 = c * (2.0 / (sqrt(fma(b, b, (a * (c * -4.0)))) - b));
		}
		tmp_1 = tmp_3;
	} else if (b <= 1e+140) {
		double tmp_4;
		if (b >= 0.0) {
			tmp_4 = (-b - t_1) / (a * 2.0);
		} else {
			tmp_4 = (c * 2.0) / (t_1 - b);
		}
		tmp_1 = tmp_4;
	} else if (b >= 0.0) {
		tmp_1 = (c / b) - (b / a);
	} 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)
	t_0 = cbrt(Float64(c * -4.0))
	t_1 = sqrt(Float64(Float64(b * b) + Float64(-4.0 * Float64(c * a))))
	tmp_1 = 0.0
	if (b <= -9e+134)
		tmp_2 = 0.0
		if (b >= 0.0)
			tmp_2 = Float64(c / b);
		else
			tmp_2 = Float64(Float64(-c) / b);
		end
		tmp_1 = tmp_2;
	elseif (b <= 2.9e-172)
		tmp_3 = 0.0
		if (b >= 0.0)
			tmp_3 = Float64(1.0 / Float64(Float64(a * -2.0) * Float64(1.0 / Float64(b + hypot(b, Float64(t_0 * sqrt(Float64(a * t_0))))))));
		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 <= 1e+140)
		tmp_4 = 0.0
		if (b >= 0.0)
			tmp_4 = Float64(Float64(Float64(-b) - t_1) / Float64(a * 2.0));
		else
			tmp_4 = Float64(Float64(c * 2.0) / Float64(t_1 - b));
		end
		tmp_1 = tmp_4;
	elseif (b >= 0.0)
		tmp_1 = Float64(Float64(c / b) - Float64(b / a));
	else
		tmp_1 = 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_] := Block[{t$95$0 = N[Power[N[(c * -4.0), $MachinePrecision], 1/3], $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(N[(b * b), $MachinePrecision] + N[(-4.0 * N[(c * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[b, -9e+134], If[GreaterEqual[b, 0.0], N[(c / b), $MachinePrecision], N[((-c) / b), $MachinePrecision]], If[LessEqual[b, 2.9e-172], If[GreaterEqual[b, 0.0], N[(1.0 / N[(N[(a * -2.0), $MachinePrecision] * N[(1.0 / N[(b + N[Sqrt[b ^ 2 + N[(t$95$0 * N[Sqrt[N[(a * t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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[LessEqual[b, 1e+140], If[GreaterEqual[b, 0.0], N[(N[((-b) - t$95$1), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(c * 2.0), $MachinePrecision] / N[(t$95$1 - b), $MachinePrecision]), $MachinePrecision]], If[GreaterEqual[b, 0.0], N[(N[(c / b), $MachinePrecision] - N[(b / a), $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}
t_0 := \sqrt[3]{c \cdot -4}\\
t_1 := \sqrt{b \cdot b + -4 \cdot \left(c \cdot a\right)}\\
\mathbf{if}\;b \leq -9 \cdot 10^{+134}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\frac{c}{b}\\

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


\end{array}\\

\mathbf{elif}\;b \leq 2.9 \cdot 10^{-172}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\frac{1}{\left(a \cdot -2\right) \cdot \frac{1}{b + \mathsf{hypot}\left(b, t_0 \cdot \sqrt{a \cdot t_0}\right)}}\\

\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 \leq 10^{+140}:\\
\;\;\;\;\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{elif}\;b \geq 0:\\
\;\;\;\;\frac{c}{b} - \frac{b}{a}\\

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


\end{array}

Error?

Derivation?

  1. Split input into 4 regimes
  2. if b < -8.9999999999999995e134

    1. Initial program 45.7%

      \[\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 91.6%

      \[\leadsto \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}{\color{blue}{\left(-b\right) + \left(2 \cdot \frac{c \cdot a}{b} + -1 \cdot b\right)}}\\ \end{array} \]
    3. Simplified97.8%

      \[\leadsto \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}{\color{blue}{\left(-b\right) + \mathsf{fma}\left(2, \frac{c}{\frac{b}{a}}, -b\right)}}\\ \end{array} \]
      Proof

      [Start]91.6

      \[ \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) + \left(2 \cdot \frac{c \cdot a}{b} + -1 \cdot b\right)}\\ \end{array} \]

      fma-def [=>]91.6

      \[ \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}{\color{blue}{\left(-b\right) + \mathsf{fma}\left(2, \frac{c \cdot a}{b}, -1 \cdot b\right)}}\\ \end{array} \]

      associate-/l* [=>]97.8

      \[ \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) + \color{blue}{\mathsf{fma}\left(2, \frac{c}{\frac{b}{a}}, -1 \cdot b\right)}}\\ \end{array} \]

      mul-1-neg [=>]97.8

      \[ \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) + \mathsf{fma}\left(2, \frac{c}{\frac{b}{a}}, -b\right)}\\ \end{array} \]
    4. Taylor expanded in b around inf 97.8%

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

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

      [Start]97.8

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

      +-commutative [=>]97.8

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

      *-commutative [=>]97.8

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

      fma-def [=>]97.8

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

      associate-/l* [=>]97.8

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

      associate-*r/ [=>]97.8

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{c}{b}\\ \mathbf{else}:\\ \;\;\;\;-1 \cdot \frac{c}{b}\\ \end{array} \]
    8. Simplified97.7%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{c}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
      Proof

      [Start]97.7

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{c}{b}\\ \mathbf{else}:\\ \;\;\;\;-1 \cdot \frac{c}{b}\\ \end{array} \]

      associate-*r/ [=>]97.7

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{c}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1 \cdot c}{b}\\ \end{array} \]

      neg-mul-1 [<=]97.7

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{c}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]

    if -8.9999999999999995e134 < b < 2.89999999999999997e-172

    1. Initial program 83.8%

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

      \[\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]83.8

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{\frac{1}{\left(a \cdot -2\right) \cdot \frac{1}{b + \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \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} \]
      Proof

      [Start]83.7

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

      clear-num [=>]83.7

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{\frac{1}{\frac{a}{-0.5}}} \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} \]

      associate-*l/ [=>]83.7

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{1}{\left(a \cdot -2\right) \cdot \frac{1}{b + \mathsf{hypot}\left(b, \color{blue}{e^{\log \left(a \cdot \left(c \cdot -4\right)\right) \cdot 0.5}}\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]84.7

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{1}{\left(a \cdot -2\right) \cdot \frac{1}{b + \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \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} \]

      pow1/2 [=>]84.7

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{1}{\left(a \cdot -2\right) \cdot \frac{1}{b + \mathsf{hypot}\left(b, \color{blue}{{\left(a \cdot \left(c \cdot -4\right)\right)}^{0.5}}\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-to-exp [=>]83.8

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{1}{\left(a \cdot -2\right) \cdot \frac{1}{b + \mathsf{hypot}\left(b, \color{blue}{e^{\log \left(a \cdot \left(c \cdot -4\right)\right) \cdot 0.5}}\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-rr87.0%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{1}{\left(a \cdot -2\right) \cdot \frac{1}{b + \mathsf{hypot}\left(b, \color{blue}{\sqrt[3]{c \cdot -4} \cdot \sqrt{a \cdot \sqrt[3]{c \cdot -4}}}\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]83.8

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

      exp-to-pow [=>]84.7

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{1}{\left(a \cdot -2\right) \cdot \frac{1}{b + \mathsf{hypot}\left(b, \color{blue}{{\left(a \cdot \left(c \cdot -4\right)\right)}^{0.5}}\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 [=>]84.7

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{1}{\left(a \cdot -2\right) \cdot \frac{1}{b + \mathsf{hypot}\left(b, \color{blue}{\sqrt{a \cdot \left(c \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 [=>]84.7

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{1}{\left(a \cdot -2\right) \cdot \frac{1}{b + \mathsf{hypot}\left(b, \sqrt{\color{blue}{\left(c \cdot -4\right) \cdot a}}\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 [=>]84.6

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{1}{\left(a \cdot -2\right) \cdot \frac{1}{b + \mathsf{hypot}\left(b, \sqrt{\color{blue}{\left(\left(\sqrt[3]{c \cdot -4} \cdot \sqrt[3]{c \cdot -4}\right) \cdot \sqrt[3]{c \cdot -4}\right)} \cdot a}\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* [=>]84.6

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{1}{\left(a \cdot -2\right) \cdot \frac{1}{b + \mathsf{hypot}\left(b, \sqrt{\color{blue}{\left(\sqrt[3]{c \cdot -4} \cdot \sqrt[3]{c \cdot -4}\right) \cdot \left(\sqrt[3]{c \cdot -4} \cdot a\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 [=>]87.0

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{1}{\left(a \cdot -2\right) \cdot \frac{1}{b + \mathsf{hypot}\left(b, \color{blue}{\sqrt{\sqrt[3]{c \cdot -4} \cdot \sqrt[3]{c \cdot -4}} \cdot \sqrt{\sqrt[3]{c \cdot -4} \cdot a}}\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 [=>]78.1

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{1}{\left(a \cdot -2\right) \cdot \frac{1}{b + \mathsf{hypot}\left(b, \color{blue}{\left(\sqrt{\sqrt[3]{c \cdot -4}} \cdot \sqrt{\sqrt[3]{c \cdot -4}}\right)} \cdot \sqrt{\sqrt[3]{c \cdot -4} \cdot a}\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 [<=]87.0

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{1}{\left(a \cdot -2\right) \cdot \frac{1}{b + \mathsf{hypot}\left(b, \color{blue}{\sqrt[3]{c \cdot -4}} \cdot \sqrt{\sqrt[3]{c \cdot -4} \cdot a}\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 [=>]87.0

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{1}{\left(a \cdot -2\right) \cdot \frac{1}{b + \mathsf{hypot}\left(b, \sqrt[3]{c \cdot -4} \cdot \sqrt{\color{blue}{a \cdot \sqrt[3]{c \cdot -4}}}\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 2.89999999999999997e-172 < b < 1.00000000000000006e140

    1. Initial program 91.3%

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

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

      [Start]91.3

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

      associate-*l* [=>]91.4

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - \color{blue}{4 \cdot \left(a \cdot c\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 [=>]91.4

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

      *-commutative [=>]91.4

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

      associate-*l* [=>]91.4

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

    if 1.00000000000000006e140 < b

    1. Initial program 8.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 8.4%

      \[\leadsto \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}{\color{blue}{\left(-b\right) + \left(2 \cdot \frac{c \cdot a}{b} + -1 \cdot b\right)}}\\ \end{array} \]
    3. Simplified8.4%

      \[\leadsto \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}{\color{blue}{\left(-b\right) + \mathsf{fma}\left(2, \frac{c}{\frac{b}{a}}, -b\right)}}\\ \end{array} \]
      Proof

      [Start]8.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) + \left(2 \cdot \frac{c \cdot a}{b} + -1 \cdot b\right)}\\ \end{array} \]

      fma-def [=>]8.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}{\color{blue}{\left(-b\right) + \mathsf{fma}\left(2, \frac{c \cdot a}{b}, -1 \cdot b\right)}}\\ \end{array} \]

      associate-/l* [=>]8.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) + \color{blue}{\mathsf{fma}\left(2, \frac{c}{\frac{b}{a}}, -1 \cdot b\right)}}\\ \end{array} \]

      mul-1-neg [=>]8.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) + \mathsf{fma}\left(2, \frac{c}{\frac{b}{a}}, -b\right)}\\ \end{array} \]
    4. Taylor expanded in c around inf 8.4%

      \[\leadsto \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{b}{a}\\ \end{array} \]
    5. Taylor expanded in b around inf 96.4%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{\frac{c}{b} + -1 \cdot \frac{b}{a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{a}\\ \end{array} \]
    6. Simplified96.4%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{\frac{c}{b} - \frac{b}{a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{a}\\ \end{array} \]
      Proof

      [Start]96.4

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

      mul-1-neg [=>]96.4

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

      unsub-neg [=>]96.4

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{\frac{c}{b} - \frac{b}{a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{a}\\ \end{array} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification91.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -9 \cdot 10^{+134}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{c}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array}\\ \mathbf{elif}\;b \leq 2.9 \cdot 10^{-172}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{1}{\left(a \cdot -2\right) \cdot \frac{1}{b + \mathsf{hypot}\left(b, \sqrt[3]{c \cdot -4} \cdot \sqrt{a \cdot \sqrt[3]{c \cdot -4}}\right)}}\\ \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 \leq 10^{+140}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b + -4 \cdot \left(c \cdot a\right)}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot 2}{\sqrt{b \cdot b + -4 \cdot \left(c \cdot a\right)} - b}\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{a}\\ \end{array} \]

Alternatives

Alternative 1
Accuracy89.2%
Cost38052
\[\begin{array}{l} t_0 := \sqrt{b \cdot b + -4 \cdot \left(c \cdot a\right)}\\ t_1 := \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{a}\\ \end{array}\\ t_2 := \sqrt{b \cdot b + c \cdot \left(a \cdot -4\right)}\\ t_3 := \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - t_2}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot 2}{t_2 - b}\\ \end{array}\\ \mathbf{if}\;t_3 \leq -\infty:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_3 \leq -5 \cdot 10^{-244}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - t_0}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot 2}{t_0 - b}\\ \end{array}\\ \mathbf{elif}\;t_3 \leq 0:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{c}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot 2}{2 \cdot \left(\frac{c}{b} \cdot a - b\right)}\\ \end{array}\\ \mathbf{elif}\;t_3 \leq 2 \cdot 10^{+305}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 2
Accuracy89.1%
Cost38052
\[\begin{array}{l} t_0 := \sqrt{b \cdot b + -4 \cdot \left(c \cdot a\right)}\\ t_1 := \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{a}\\ \end{array}\\ t_2 := \sqrt{b \cdot b + c \cdot \left(a \cdot -4\right)}\\ t_3 := \frac{\left(-b\right) - t_2}{a \cdot 2}\\ t_4 := \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot 2}{t_2 - b}\\ \end{array}\\ \mathbf{if}\;t_4 \leq -\infty:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_4 \leq -5 \cdot 10^{-213}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - t_0}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot 2}{t_0 - b}\\ \end{array}\\ \mathbf{elif}\;t_4 \leq 0:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot 2}{\mathsf{fma}\left(2, \frac{c}{\frac{b}{a}}, -b\right) - b}\\ \end{array}\\ \mathbf{elif}\;t_4 \leq 2 \cdot 10^{+305}:\\ \;\;\;\;t_4\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 3
Accuracy88.9%
Cost38052
\[\begin{array}{l} t_0 := -4 \cdot \left(c \cdot a\right)\\ 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}\\ t_4 := \sqrt{b \cdot b + t_0}\\ \mathbf{if}\;t_3 \leq -5 \cdot 10^{+248}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;-\frac{b + b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;{\left(\left(b + \sqrt{\mathsf{fma}\left(b, b, t_0\right)}\right) \cdot \frac{0.5}{c}\right)}^{-1}\\ \end{array}\\ \mathbf{elif}\;t_3 \leq -5 \cdot 10^{-213}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - t_4}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot 2}{t_4 - b}\\ \end{array}\\ \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\right) - b}\\ \end{array}\\ \mathbf{elif}\;t_3 \leq 2 \cdot 10^{+305}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\frac{-b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{a}\\ \end{array} \]
Alternative 4
Accuracy89.0%
Cost38052
\[\begin{array}{l} t_0 := -4 \cdot \left(c \cdot a\right)\\ t_1 := \mathsf{fma}\left(b, b, t_0\right)\\ t_2 := \sqrt{b \cdot b + c \cdot \left(a \cdot -4\right)}\\ t_3 := \frac{\left(-b\right) - t_2}{a \cdot 2}\\ t_4 := \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot 2}{t_2 - b}\\ \end{array}\\ \mathbf{if}\;t_4 \leq -2 \cdot 10^{+232}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;-\frac{b + b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;{\left(\left(b + \sqrt{t_1}\right) \cdot \frac{0.5}{c}\right)}^{-1}\\ \end{array}\\ \mathbf{elif}\;t_4 \leq -1 \cdot 10^{-243}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - {\left({t_1}^{0.25}\right)}^{2}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot 2}{\sqrt{b \cdot b + t_0} - b}\\ \end{array}\\ \mathbf{elif}\;t_4 \leq 0:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot 2}{\mathsf{fma}\left(2, \frac{c}{\frac{b}{a}}, -b\right) - b}\\ \end{array}\\ \mathbf{elif}\;t_4 \leq 2 \cdot 10^{+305}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\frac{-b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{a}\\ \end{array} \]
Alternative 5
Accuracy91.4%
Cost27148
\[\begin{array}{l} t_0 := \sqrt{b \cdot b + -4 \cdot \left(c \cdot a\right)}\\ \mathbf{if}\;b \leq -4.5 \cdot 10^{+133}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{c}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array}\\ \mathbf{elif}\;b \leq 2.9 \cdot 10^{-172}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{1}{\left(a \cdot -2\right) \cdot \frac{1}{b + \mathsf{hypot}\left(b, \sqrt[3]{a} \cdot \sqrt{\left(c \cdot -4\right) \cdot \sqrt[3]{a}}\right)}}\\ \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 \leq 2.45 \cdot 10^{+138}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - t_0}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot 2}{t_0 - b}\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{a}\\ \end{array} \]
Alternative 6
Accuracy90.0%
Cost7820
\[\begin{array}{l} t_0 := \sqrt{b \cdot b + -4 \cdot \left(c \cdot a\right)}\\ \mathbf{if}\;b \leq -2.15 \cdot 10^{+153}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{c}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array}\\ \mathbf{elif}\;b \leq 2.3 \cdot 10^{+141}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - t_0}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot 2}{t_0 - b}\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{a}\\ \end{array} \]
Alternative 7
Accuracy77.1%
Cost7624
\[\begin{array}{l} \mathbf{if}\;b \leq -1 \cdot 10^{+154}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{c}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;-\frac{b + b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot 2}{\sqrt{b \cdot b + -4 \cdot \left(c \cdot a\right)} - b}\\ \end{array} \]
Alternative 8
Accuracy65.0%
Cost7428
\[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\mathsf{fma}\left(b, -2, a \cdot \frac{2}{\frac{b}{c}}\right)}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot 2}{\mathsf{fma}\left(2, \frac{c}{\frac{b}{a}}, -b\right) - b}\\ \end{array} \]
Alternative 9
Accuracy64.7%
Cost644
\[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;-\frac{b + b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
Alternative 10
Accuracy64.8%
Cost520
\[\begin{array}{l} \mathbf{if}\;b \leq -3.8 \cdot 10^{-239}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{c}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\frac{-b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{a}\\ \end{array} \]
Alternative 11
Accuracy38.0%
Cost388
\[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{c}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
Alternative 12
Accuracy3.5%
Cost324
\[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{c}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{a}\\ \end{array} \]

Error

Reproduce?

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