\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}
\begin{array}{l}
\mathbf{if}\;b_2 \leq -4.917316187737568 \cdot 10^{-47}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b_2}\\
\mathbf{elif}\;b_2 \leq 3.320266855890801 \cdot 10^{+92}:\\
\;\;\;\;\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - c \cdot a}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(-b_2\right) - b_2}{a}\\
\end{array}
(FPCore (a b_2 c) :precision binary64 (/ (- (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))
(FPCore (a b_2 c)
:precision binary64
(if (<= b_2 -4.917316187737568e-47)
(* -0.5 (/ c b_2))
(if (<= b_2 3.320266855890801e+92)
(/ (- (- b_2) (sqrt (- (* b_2 b_2) (* c a)))) a)
(/ (- (- b_2) b_2) a))))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 tmp;
if (b_2 <= -4.917316187737568e-47) {
tmp = -0.5 * (c / b_2);
} else if (b_2 <= 3.320266855890801e+92) {
tmp = (-b_2 - sqrt(((b_2 * b_2) - (c * a)))) / a;
} else {
tmp = (-b_2 - b_2) / a;
}
return tmp;
}



Bits error versus a



Bits error versus b_2



Bits error versus c
Results
if b_2 < -4.9173161877375679e-47Initial program 54.3
Taylor expanded in b_2 around -inf 7.5
if -4.9173161877375679e-47 < b_2 < 3.32026685589080118e92Initial program 14.2
Applied egg-rr14.2
if 3.32026685589080118e92 < b_2 Initial program 45.9
Taylor expanded in b_2 around inf 4.2
Final simplification10.1
herbie shell --seed 2022130
(FPCore (a b_2 c)
:name "quad2m (problem 3.2.1, negative)"
:precision binary64
(/ (- (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))