\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\begin{array}{l}
\mathbf{if}\;b_2 \le -2.37749702272254886 \cdot 10^{101}:\\
\;\;\;\;\frac{1}{2} \cdot \frac{c}{b_2} - 2 \cdot \frac{b_2}{a}\\
\mathbf{elif}\;b_2 \le 1.9238883452280037 \cdot 10^{-130}:\\
\;\;\;\;\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} + \left(-b_2\right)}{a}\\
\mathbf{elif}\;b_2 \le 4.01993084419163312 \cdot 10^{109}:\\
\;\;\;\;\frac{\frac{0 + a \cdot c}{\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 temp;
if ((b_2 <= -2.377497022722549e+101)) {
temp = ((0.5 * (c / b_2)) - (2.0 * (b_2 / a)));
} else {
double temp_1;
if ((b_2 <= 1.9238883452280037e-130)) {
temp_1 = ((sqrt(((b_2 * b_2) - (a * c))) + -b_2) / a);
} else {
double temp_2;
if ((b_2 <= 4.019930844191633e+109)) {
temp_2 = (((0.0 + (a * c)) / (-b_2 - sqrt(((b_2 * b_2) - (a * c))))) / a);
} 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 < -2.377497022722549e+101Initial program 47.1
Taylor expanded around -inf 3.6
if -2.377497022722549e+101 < b_2 < 1.9238883452280037e-130Initial program 11.9
rmApplied +-commutative11.9
if 1.9238883452280037e-130 < b_2 < 4.019930844191633e+109Initial program 40.3
rmApplied flip-+40.3
Simplified15.5
if 4.019930844191633e+109 < b_2 Initial program 59.9
Taylor expanded around inf 2.4
Final simplification9.2
herbie shell --seed 2020060 +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))