\begin{array}{l}
\mathbf{if}\;b \ge 0.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}
\mathbf{if}\;b \le -5.7956926409099789 \cdot 10^{153}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \ge 0.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) + \left(2 \cdot \frac{a \cdot c}{b} - b\right)}{2 \cdot a}\\
\end{array}\\
\mathbf{elif}\;b \le 4.591188790043355 \cdot 10^{-310}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \ge 0.0:\\
\;\;\;\;\frac{2 \cdot c}{\frac{\mathsf{fma}\left(4 \cdot c, a, 0\right)}{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\
\end{array}\\
\mathbf{elif}\;b \le 6.78594296272638531 \cdot 10^{101}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \ge 0.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) + \left(2 \cdot \frac{a \cdot c}{b} - b\right)}{2 \cdot a}\\
\end{array}\\
\mathbf{elif}\;b \ge 0.0:\\
\;\;\;\;\frac{2 \cdot c}{2 \cdot \frac{a}{\frac{b}{c}} - 2 \cdot b}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(-b\right) + \sqrt{\frac{\mathsf{fma}\left(-\left(4 \cdot a\right) \cdot \left(4 \cdot a\right), c \cdot c, {b}^{4}\right)}{\mathsf{fma}\left(b, b, \left(4 \cdot a\right) \cdot c\right)}}}{2 \cdot a}\\
\end{array}double code(double a, double b, double c) {
double VAR;
if ((b >= 0.0)) {
VAR = ((2.0 * c) / (-b - sqrt(((b * b) - ((4.0 * a) * c)))));
} else {
VAR = ((-b + sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a));
}
return VAR;
}
double code(double a, double b, double c) {
double VAR;
if ((b <= -5.795692640909979e+153)) {
double VAR_1;
if ((b >= 0.0)) {
VAR_1 = ((2.0 * c) / (-b - sqrt(((b * b) - ((4.0 * a) * c)))));
} else {
VAR_1 = ((-b + ((2.0 * ((a * c) / b)) - b)) / (2.0 * a));
}
VAR = VAR_1;
} else {
double VAR_2;
if ((b <= 4.59118879004335e-310)) {
double VAR_3;
if ((b >= 0.0)) {
VAR_3 = ((2.0 * c) / (fma((4.0 * c), a, 0.0) / (sqrt(((b * b) - ((4.0 * a) * c))) - b)));
} else {
VAR_3 = ((-b + sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a));
}
VAR_2 = VAR_3;
} else {
double VAR_4;
if ((b <= 6.785942962726385e+101)) {
double VAR_5;
if ((b >= 0.0)) {
VAR_5 = ((2.0 * c) / (-b - sqrt(((b * b) - ((4.0 * a) * c)))));
} else {
VAR_5 = ((-b + ((2.0 * ((a * c) / b)) - b)) / (2.0 * a));
}
VAR_4 = VAR_5;
} else {
double VAR_6;
if ((b >= 0.0)) {
VAR_6 = ((2.0 * c) / ((2.0 * (a / (b / c))) - (2.0 * b)));
} else {
VAR_6 = ((-b + sqrt((fma(-((4.0 * a) * (4.0 * a)), (c * c), pow(b, 4.0)) / fma(b, b, ((4.0 * a) * c))))) / (2.0 * a));
}
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 < -5.795692640909979e+153 or 4.59118879004335e-310 < b < 6.785942962726385e+101Initial program 23.2
Taylor expanded around -inf 9.6
if -5.795692640909979e+153 < b < 4.59118879004335e-310Initial program 8.0
rmApplied flip--8.0
Simplified8.0
Simplified8.0
if 6.785942962726385e+101 < b Initial program 30.5
Taylor expanded around inf 6.3
rmApplied associate-/l*2.3
rmApplied flip--2.3
Simplified2.3
Simplified2.3
Final simplification7.3
herbie shell --seed 2020078 +o rules:numerics
(FPCore (a b c)
:name "jeff quadratic root 2"
:precision binary64
(if (>= b 0.0) (/ (* 2 c) (- (- b) (sqrt (- (* b b) (* (* 4 a) c))))) (/ (+ (- b) (sqrt (- (* b b) (* (* 4 a) c)))) (* 2 a))))