\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\begin{array}{l}
\mathbf{if}\;b_2 \le -2.76334344440099942 \cdot 10^{-73}:\\
\;\;\;\;\frac{1}{2} \cdot \frac{c}{b_2} - 2 \cdot \frac{b_2}{a}\\
\mathbf{elif}\;b_2 \le 8.4035980910933213 \cdot 10^{118}:\\
\;\;\;\;\frac{1}{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}} \cdot 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 <= -2.7633434444009994e-73)) {
temp = ((0.5 * (c / b_2)) - (2.0 * (b_2 / a)));
} else {
double temp_1;
if ((b_2 <= 8.403598091093321e+118)) {
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 < -2.7633434444009994e-73Initial program 26.7
Taylor expanded around -inf 10.8
if -2.7633434444009994e-73 < b_2 < 8.403598091093321e+118Initial program 26.8
rmApplied flip-+29.6
Simplified17.9
rmApplied *-un-lft-identity17.9
Applied associate-/r*17.9
Simplified16.7
rmApplied add-cube-cbrt17.4
Applied div-inv17.4
Applied add-cube-cbrt16.7
Applied times-frac16.9
Applied times-frac13.7
Simplified13.7
Taylor expanded around 0 12.4
if 8.403598091093321e+118 < b_2 Initial program 60.8
Taylor expanded around inf 1.6
Final simplification9.7
herbie shell --seed 2020066
(FPCore (a b_2 c)
:name "quad2p (problem 3.2.1, positive)"
:precision binary64
(/ (+ (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))