\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\begin{array}{l}
\mathbf{if}\;b_2 \le -8.4337507597836401 \cdot 10^{100}:\\
\;\;\;\;\frac{1}{2} \cdot \frac{c}{b_2} - 2 \cdot \frac{b_2}{a}\\
\mathbf{elif}\;b_2 \le 5.8079427617522165 \cdot 10^{-116}:\\
\;\;\;\;\left(\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}\right) \cdot \frac{1}{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 <= -8.43375075978364e+100)) {
VAR = ((0.5 * (c / b_2)) - (2.0 * (b_2 / a)));
} else {
double VAR_1;
if ((b_2 <= 5.807942761752216e-116)) {
VAR_1 = ((-b_2 + sqrt(((b_2 * b_2) - (a * c)))) * (1.0 / 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 < -8.43375075978364e+100Initial program 44.7
Taylor expanded around -inf 3.3
if -8.43375075978364e+100 < b_2 < 5.807942761752216e-116Initial program 11.9
rmApplied div-inv12.0
if 5.807942761752216e-116 < b_2 Initial program 50.7
Taylor expanded around inf 11.5
Final simplification10.5
herbie shell --seed 2020091 +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))