\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\begin{array}{l}
\mathbf{if}\;b_2 \le -5.9551520595513616 \cdot 10^{118}:\\
\;\;\;\;\frac{1}{2} \cdot \frac{c}{b_2} - 2 \cdot \frac{b_2}{a}\\
\mathbf{elif}\;b_2 \le -6.79526900931122647 \cdot 10^{-245}:\\
\;\;\;\;\frac{1}{\frac{a}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}\\
\mathbf{elif}\;b_2 \le 5.34931179548294658 \cdot 10^{30}:\\
\;\;\;\;\frac{1}{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}} \cdot \frac{1}{\frac{1}{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 <= -5.955152059551362e+118)) {
temp = ((0.5 * (c / b_2)) - (2.0 * (b_2 / a)));
} else {
double temp_1;
if ((b_2 <= -6.7952690093112265e-245)) {
temp_1 = (1.0 / (a / (sqrt(((b_2 * b_2) - (a * c))) - b_2)));
} else {
double temp_2;
if ((b_2 <= 5.349311795482947e+30)) {
temp_2 = ((1.0 / (-b_2 - sqrt(((b_2 * b_2) - (a * c))))) * (1.0 / (1.0 / c)));
} else {
temp_2 = (-0.5 * (c / b_2));
}
temp_1 = temp_2;
}
temp = temp_1;
}
return temp;
}



Bits error versus a



Bits error versus b_2



Bits error versus c
Results
if b_2 < -5.955152059551362e+118Initial program 52.1
Taylor expanded around -inf 2.9
if -5.955152059551362e+118 < b_2 < -6.7952690093112265e-245Initial program 7.5
rmApplied clear-num7.7
Simplified7.7
if -6.7952690093112265e-245 < b_2 < 5.349311795482947e+30Initial program 26.2
rmApplied flip-+26.3
Simplified16.5
rmApplied *-un-lft-identity16.5
Applied associate-/r*16.5
Simplified14.3
rmApplied add-sqr-sqrt39.6
Applied div-inv39.6
Applied add-sqr-sqrt39.5
Applied times-frac39.8
Applied times-frac39.3
Simplified39.2
Simplified10.5
if 5.349311795482947e+30 < b_2 Initial program 56.7
Taylor expanded around inf 4.8
Final simplification6.9
herbie shell --seed 2020049
(FPCore (a b_2 c)
:name "quad2p (problem 3.2.1, positive)"
:precision binary64
(/ (+ (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))