\begin{array}{l}
\mathbf{if}\;b \ge 0.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 \le -1.2226693456193597 \cdot 10^{93}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \ge 0.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}{2 \cdot \left(\left(\sqrt[3]{\frac{a}{\sqrt[3]{b} \cdot \sqrt[3]{b}}} \cdot \sqrt[3]{\frac{a}{\sqrt[3]{b} \cdot \sqrt[3]{b}}}\right) \cdot \left(\sqrt[3]{\frac{a}{\sqrt[3]{b} \cdot \sqrt[3]{b}}} \cdot \frac{c}{\sqrt[3]{b}}\right)\right) - 2 \cdot b}\\
\end{array}\\
\mathbf{elif}\;b \le 7.0423614716856544 \cdot 10^{82}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \ge 0.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(\sqrt[3]{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}} \cdot \sqrt[3]{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\right) \cdot \sqrt[3]{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}\\
\end{array}\\
\mathbf{elif}\;b \ge 0.0:\\
\;\;\;\;\frac{\left(-b\right) - \left(b - 2 \cdot \frac{a \cdot c}{b}\right)}{2 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 \cdot c}{2 \cdot \frac{a \cdot c}{b} - 2 \cdot b}\\
\end{array}double code(double a, double b, double c) {
double VAR;
if ((b >= 0.0)) {
VAR = ((-b - sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a));
} else {
VAR = ((2.0 * c) / (-b + sqrt(((b * b) - ((4.0 * a) * c)))));
}
return VAR;
}
double code(double a, double b, double c) {
double VAR;
if ((b <= -1.2226693456193597e+93)) {
double VAR_1;
if ((b >= 0.0)) {
VAR_1 = ((-b - sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a));
} else {
VAR_1 = ((2.0 * c) / ((2.0 * ((cbrt((a / (cbrt(b) * cbrt(b)))) * cbrt((a / (cbrt(b) * cbrt(b))))) * (cbrt((a / (cbrt(b) * cbrt(b)))) * (c / cbrt(b))))) - (2.0 * b)));
}
VAR = VAR_1;
} else {
double VAR_2;
if ((b <= 7.042361471685654e+82)) {
double VAR_3;
if ((b >= 0.0)) {
VAR_3 = ((-b - sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a));
} else {
VAR_3 = ((2.0 * c) / ((cbrt((-b + sqrt(((b * b) - ((4.0 * a) * c))))) * cbrt((-b + sqrt(((b * b) - ((4.0 * a) * c)))))) * cbrt((-b + sqrt(((b * b) - ((4.0 * a) * c)))))));
}
VAR_2 = VAR_3;
} else {
double VAR_4;
if ((b >= 0.0)) {
VAR_4 = ((-b - (b - (2.0 * ((a * c) / b)))) / (2.0 * a));
} else {
VAR_4 = ((2.0 * c) / ((2.0 * ((a * c) / b)) - (2.0 * b)));
}
VAR_2 = VAR_4;
}
VAR = VAR_2;
}
return VAR;
}



Bits error versus a



Bits error versus b



Bits error versus c
Results
if b < -1.2226693456193597e+93Initial program 29.7
Taylor expanded around -inf 6.0
rmApplied add-cube-cbrt6.0
Applied times-frac2.8
rmApplied add-cube-cbrt2.8
Applied associate-*l*2.8
if -1.2226693456193597e+93 < b < 7.042361471685654e+82Initial program 8.9
rmApplied add-cube-cbrt9.4
if 7.042361471685654e+82 < b Initial program 41.9
Taylor expanded around -inf 41.9
Taylor expanded around inf 9.0
Final simplification7.7
herbie shell --seed 2020079
(FPCore (a b c)
:name "jeff quadratic root 1"
:precision binary64
(if (>= b 0.0) (/ (- (- b) (sqrt (- (* b b) (* (* 4 a) c)))) (* 2 a)) (/ (* 2 c) (+ (- b) (sqrt (- (* b b) (* (* 4 a) c)))))))