\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}
\begin{array}{l}
\mathbf{if}\;b_2 \leq -1.5343846642293365 \cdot 10^{-36}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b_2}\\
\mathbf{elif}\;b_2 \leq 5.039495121971627 \cdot 10^{+140}:\\
\;\;\;\;\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 -1.5343846642293365e-36)
(* -0.5 (/ c b_2))
(if (<= b_2 5.039495121971627e+140)
(/ (- (- 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 <= -1.5343846642293365e-36) {
tmp = -0.5 * (c / b_2);
} else if (b_2 <= 5.039495121971627e+140) {
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 < -1.53438466422933652e-36Initial program 54.4
Taylor expanded in b_2 around -inf 7.6
if -1.53438466422933652e-36 < b_2 < 5.0394951219716266e140Initial program 12.8
Applied *-un-lft-identity_binary6412.8
Applied sqrt-prod_binary6412.8
if 5.0394951219716266e140 < b_2 Initial program 59.4
Taylor expanded in b_2 around inf 2.5
Simplified2.5
Final simplification9.7
herbie shell --seed 2022067
(FPCore (a b_2 c)
:name "quad2m (problem 3.2.1, negative)"
:precision binary64
(/ (- (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))