\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\begin{array}{l}
\mathbf{if}\;b_2 \le -4.93452195172866347 \cdot 10^{-12}:\\
\;\;\;\;\frac{-1}{2} \cdot \frac{c}{b_2}\\
\mathbf{elif}\;b_2 \le 2.8292124432832862 \cdot 10^{65}:\\
\;\;\;\;\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \frac{b_2}{a}\\
\end{array}double code(double a, double b_2, double c) {
return ((-b_2 - sqrt(((b_2 * b_2) - (a * c)))) / a);
}
double code(double a, double b_2, double c) {
double temp;
if ((b_2 <= -4.9345219517286635e-12)) {
temp = (-0.5 * (c / b_2));
} else {
double temp_1;
if ((b_2 <= 2.829212443283286e+65)) {
temp_1 = ((-b_2 - sqrt(((b_2 * b_2) - (a * c)))) / a);
} else {
temp_1 = (-2.0 * (b_2 / a));
}
temp = temp_1;
}
return temp;
}



Bits error versus a



Bits error versus b_2



Bits error versus c
Results
if b_2 < -4.9345219517286635e-12Initial program 55.4
Taylor expanded around -inf 6.2
if -4.9345219517286635e-12 < b_2 < 2.829212443283286e+65Initial program 15.7
rmApplied div-inv15.8
rmApplied un-div-inv15.7
if 2.829212443283286e+65 < b_2 Initial program 40.6
rmApplied div-inv40.6
rmApplied un-div-inv40.6
rmApplied clear-num40.7
Taylor expanded around 0 4.7
Final simplification10.4
herbie shell --seed 2020053 +o rules:numerics
(FPCore (a b_2 c)
:name "NMSE problem 3.2.1"
:precision binary64
(/ (- (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))