\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}
\begin{array}{l}
\mathbf{if}\;b_2 \leq -7.176929411205444 \cdot 10^{-59}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b_2}\\
\mathbf{elif}\;b_2 \leq 2.4564051867231585 \cdot 10^{+74}:\\
\;\;\;\;\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - c \cdot a}}{a}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(0.5, \frac{c}{b_2}, -2 \cdot \frac{b_2}{a}\right)\\
\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 -7.176929411205444e-59)
(* -0.5 (/ c b_2))
(if (<= b_2 2.4564051867231585e+74)
(/ (- (- b_2) (sqrt (- (* b_2 b_2) (* c a)))) a)
(fma 0.5 (/ c b_2) (* -2.0 (/ 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 <= -7.176929411205444e-59) {
tmp = -0.5 * (c / b_2);
} else if (b_2 <= 2.4564051867231585e+74) {
tmp = (-b_2 - sqrt((b_2 * b_2) - (c * a))) / a;
} else {
tmp = fma(0.5, (c / b_2), (-2.0 * (b_2 / a)));
}
return tmp;
}



Bits error versus a



Bits error versus b_2



Bits error versus c
if b_2 < -7.176929411205444e-59Initial program 53.6
Taylor expanded in b_2 around -inf 9.0
if -7.176929411205444e-59 < b_2 < 2.45640518672315846e74Initial program 14.2
if 2.45640518672315846e74 < b_2 Initial program 41.3
Taylor expanded in b_2 around inf 4.2
Simplified4.2
Final simplification10.4
herbie shell --seed 2021224
(FPCore (a b_2 c)
:name "quad2m (problem 3.2.1, negative)"
:precision binary64
(/ (- (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))