\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\begin{array}{l}
\mathbf{if}\;b_2 \le -1.5961406266953245 \cdot 10^{-58}:\\
\;\;\;\;\frac{-1}{2} \cdot \frac{c}{b_2}\\
\mathbf{elif}\;b_2 \le 3.1115579814291686 \cdot 10^{+29}:\\
\;\;\;\;\frac{1}{\frac{a}{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - c \cdot a}}}\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \frac{b_2}{a}\\
\end{array}double f(double a, double b_2, double c) {
double r595765 = b_2;
double r595766 = -r595765;
double r595767 = r595765 * r595765;
double r595768 = a;
double r595769 = c;
double r595770 = r595768 * r595769;
double r595771 = r595767 - r595770;
double r595772 = sqrt(r595771);
double r595773 = r595766 - r595772;
double r595774 = r595773 / r595768;
return r595774;
}
double f(double a, double b_2, double c) {
double r595775 = b_2;
double r595776 = -1.5961406266953245e-58;
bool r595777 = r595775 <= r595776;
double r595778 = -0.5;
double r595779 = c;
double r595780 = r595779 / r595775;
double r595781 = r595778 * r595780;
double r595782 = 3.1115579814291686e+29;
bool r595783 = r595775 <= r595782;
double r595784 = 1.0;
double r595785 = a;
double r595786 = -r595775;
double r595787 = r595775 * r595775;
double r595788 = r595779 * r595785;
double r595789 = r595787 - r595788;
double r595790 = sqrt(r595789);
double r595791 = r595786 - r595790;
double r595792 = r595785 / r595791;
double r595793 = r595784 / r595792;
double r595794 = -2.0;
double r595795 = r595775 / r595785;
double r595796 = r595794 * r595795;
double r595797 = r595783 ? r595793 : r595796;
double r595798 = r595777 ? r595781 : r595797;
return r595798;
}



Bits error versus a



Bits error versus b_2



Bits error versus c
Results
if b_2 < -1.5961406266953245e-58Initial program 53.4
Taylor expanded around -inf 53.4
Simplified53.4
Taylor expanded around -inf 8.1
if -1.5961406266953245e-58 < b_2 < 3.1115579814291686e+29Initial program 14.7
Taylor expanded around -inf 14.7
Simplified14.7
rmApplied *-un-lft-identity14.7
Applied associate-/l*14.8
if 3.1115579814291686e+29 < b_2 Initial program 34.4
Taylor expanded around -inf 34.4
Simplified34.4
rmApplied *-un-lft-identity34.4
Applied associate-/l*34.5
Taylor expanded around 0 6.5
Final simplification10.5
herbie shell --seed 2019134 +o rules:numerics
(FPCore (a b_2 c)
:name "quad2m (problem 3.2.1, negative)"
(/ (- (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))