\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\begin{array}{l}
\mathbf{if}\;b_2 \le -2.427668844436332 \cdot 10^{79}:\\
\;\;\;\;\frac{1}{2} \cdot \frac{c}{b_2} - 2 \cdot \frac{b_2}{a}\\
\mathbf{elif}\;b_2 \le -1.6070331019441596 \cdot 10^{-304}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt[3]{-b_2} \cdot \sqrt[3]{-b_2}, \sqrt[3]{-b_2}, \sqrt{b_2 \cdot b_2 - a \cdot c}\right)}{a}\\
\mathbf{elif}\;b_2 \le 5.6742922648294223 \cdot 10^{63}:\\
\;\;\;\;1 \cdot \frac{c}{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \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.4276688444363324e+79)) {
temp = ((0.5 * (c / b_2)) - (2.0 * (b_2 / a)));
} else {
double temp_1;
if ((b_2 <= -1.6070331019441596e-304)) {
temp_1 = (fma((cbrt(-b_2) * cbrt(-b_2)), cbrt(-b_2), sqrt(((b_2 * b_2) - (a * c)))) / a);
} else {
double temp_2;
if ((b_2 <= 5.674292264829422e+63)) {
temp_2 = (1.0 * (c / (-b_2 - sqrt(((b_2 * b_2) - (a * 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 < -2.4276688444363324e+79Initial program 43.9
Taylor expanded around -inf 4.6
if -2.4276688444363324e+79 < b_2 < -1.6070331019441596e-304Initial program 8.8
rmApplied add-cube-cbrt9.1
Applied fma-def9.1
if -1.6070331019441596e-304 < b_2 < 5.674292264829422e+63Initial program 29.4
rmApplied flip-+29.5
Simplified15.7
rmApplied clear-num15.8
Simplified15.5
rmApplied clear-num15.5
Simplified9.1
rmApplied div-inv9.1
Simplified8.7
if 5.674292264829422e+63 < b_2 Initial program 57.3
Taylor expanded around inf 3.5
Final simplification6.7
herbie shell --seed 2020057 +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))