\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\begin{array}{l}
\mathbf{if}\;b_2 \le -2.7863758169125638 \cdot 10^{138}:\\
\;\;\;\;\frac{1}{2} \cdot \frac{c}{b_2} - 2 \cdot \frac{b_2}{a}\\
\mathbf{elif}\;b_2 \le 1.5867531188831042 \cdot 10^{-76}:\\
\;\;\;\;\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{2} \cdot \frac{c}{b_2}\\
\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 VAR;
if ((b_2 <= -2.7863758169125638e+138)) {
VAR = ((0.5 * (c / b_2)) - (2.0 * (b_2 / a)));
} else {
double VAR_1;
if ((b_2 <= 1.5867531188831042e-76)) {
VAR_1 = ((-b_2 + sqrt(((b_2 * b_2) - (a * c)))) / a);
} else {
VAR_1 = (-0.5 * (c / b_2));
}
VAR = VAR_1;
}
return VAR;
}



Bits error versus a



Bits error versus b_2



Bits error versus c
Results
if b_2 < -2.7863758169125638e+138Initial program 58.6
Taylor expanded around -inf 2.6
if -2.7863758169125638e+138 < b_2 < 1.5867531188831042e-76Initial program 12.1
if 1.5867531188831042e-76 < b_2 Initial program 53.8
Taylor expanded around inf 8.8
Final simplification9.6
herbie shell --seed 2020078 +o rules:numerics
(FPCore (a b_2 c)
:name "quad2p (problem 3.2.1, positive)"
:precision binary64
(/ (+ (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))