\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\begin{array}{l}
\mathbf{if}\;b_2 \le -1.88909646695332609 \cdot 10^{-61}:\\
\;\;\;\;\frac{1}{2} \cdot \frac{c}{b_2} - 2 \cdot \frac{b_2}{a}\\
\mathbf{elif}\;b_2 \le 1.61619933633238581 \cdot 10^{68}:\\
\;\;\;\;\frac{1}{\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{c}}\\
\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 temp;
if ((b_2 <= -1.889096466953326e-61)) {
temp = ((0.5 * (c / b_2)) - (2.0 * (b_2 / a)));
} else {
double temp_1;
if ((b_2 <= 1.6161993363323858e+68)) {
temp_1 = (1.0 / ((-b_2 - sqrt(((b_2 * b_2) - (a * c)))) / c));
} else {
temp_1 = (-0.5 * (c / b_2));
}
temp = temp_1;
}
return temp;
}



Bits error versus a



Bits error versus b_2



Bits error versus c
Results
if b_2 < -1.889096466953326e-61Initial program 28.1
Taylor expanded around -inf 10.9
if -1.889096466953326e-61 < b_2 < 1.6161993363323858e+68Initial program 23.4
rmApplied flip-+27.0
Simplified17.9
rmApplied *-un-lft-identity17.9
Applied associate-/r*17.9
Simplified16.3
rmApplied *-un-lft-identity16.3
Applied *-un-lft-identity16.3
Applied times-frac16.3
Applied associate-/l*16.3
Simplified13.2
if 1.6161993363323858e+68 < b_2 Initial program 58.0
Taylor expanded around inf 3.0
Final simplification9.7
herbie shell --seed 2020058 +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))