\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.18949344457911549 \cdot 10^{154}:\\
\;\;\;\;\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) + \left(2 \cdot \frac{a \cdot c}{b} - b\right)}\\
\end{array}\\
\mathbf{elif}\;b \le 4.464513229872 \cdot 10^{-311}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \ge 0.0:\\
\;\;\;\;\frac{\frac{4 \cdot \left(a \cdot c\right)}{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - 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}\\
\mathbf{elif}\;b \le 3.78411745991350346 \cdot 10^{30}:\\
\;\;\;\;\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) + \left(2 \cdot \frac{a \cdot c}{b} - b\right)}\\
\end{array}\\
\mathbf{elif}\;b \ge 0.0:\\
\;\;\;\;1 \cdot \left(\frac{c}{b} - \frac{b}{a}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{2 \cdot c}{\frac{0 + 4 \cdot \left(a \cdot c\right)}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}\\
\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.1894934445791155e+154)) {
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) / (-b + ((2.0 * ((a * c) / b)) - b)));
}
VAR = VAR_1;
} else {
double VAR_2;
if ((b <= 4.464513229872e-311)) {
double VAR_3;
if ((b >= 0.0)) {
VAR_3 = (((4.0 * (a * c)) / (sqrt(((b * b) - ((4.0 * a) * c))) - b)) / (2.0 * a));
} else {
VAR_3 = ((2.0 * c) / (-b + sqrt(((b * b) - ((4.0 * a) * c)))));
}
VAR_2 = VAR_3;
} else {
double VAR_4;
if ((b <= 3.7841174599135035e+30)) {
double VAR_5;
if ((b >= 0.0)) {
VAR_5 = ((-b - sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a));
} else {
VAR_5 = ((2.0 * c) / (-b + ((2.0 * ((a * c) / b)) - b)));
}
VAR_4 = VAR_5;
} else {
double VAR_6;
if ((b >= 0.0)) {
VAR_6 = (1.0 * ((c / b) - (b / a)));
} else {
VAR_6 = ((2.0 * c) / ((0.0 + (4.0 * (a * c))) / (-b - sqrt(((b * b) - ((4.0 * a) * c))))));
}
VAR_4 = VAR_6;
}
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.1894934445791155e+154 or 4.464513229872e-311 < b < 3.7841174599135035e+30Initial program 22.3
Taylor expanded around -inf 8.5
if -1.1894934445791155e+154 < b < 4.464513229872e-311Initial program 8.2
rmApplied flip--8.2
Simplified8.2
Simplified8.2
if 3.7841174599135035e+30 < b Initial program 35.0
Taylor expanded around inf 11.0
Taylor expanded around 0 5.9
Simplified5.9
rmApplied flip-+5.9
Simplified5.9
Final simplification7.8
herbie shell --seed 2020102
(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)))))))