\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\begin{array}{l}
\mathbf{if}\;b_2 \leq -3.8798701851956607 \cdot 10^{+152}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b_2}\\
\mathbf{elif}\;b_2 \leq 1.1572280819884499 \cdot 10^{-223}:\\
\;\;\;\;\frac{c}{\sqrt{b_2 \cdot b_2 - c \cdot a} - b_2}\\
\mathbf{elif}\;b_2 \leq 2.8280021351513358 \cdot 10^{+97}:\\
\;\;\;\;\left(b_2 + \sqrt{b_2 \cdot b_2 - c \cdot a}\right) \cdot \frac{-1}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b_2} \cdot 0.5 - 2 \cdot \frac{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 -3.8798701851956607e+152)
(* -0.5 (/ c b_2))
(if (<= b_2 1.1572280819884499e-223)
(/ c (- (sqrt (- (* b_2 b_2) (* c a))) b_2))
(if (<= b_2 2.8280021351513358e+97)
(* (+ b_2 (sqrt (- (* b_2 b_2) (* c a)))) (/ -1.0 a))
(- (* (/ c b_2) 0.5) (* 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 <= -3.8798701851956607e+152) {
tmp = -0.5 * (c / b_2);
} else if (b_2 <= 1.1572280819884499e-223) {
tmp = c / (sqrt((b_2 * b_2) - (c * a)) - b_2);
} else if (b_2 <= 2.8280021351513358e+97) {
tmp = (b_2 + sqrt((b_2 * b_2) - (c * a))) * (-1.0 / a);
} else {
tmp = ((c / b_2) * 0.5) - (2.0 * (b_2 / a));
}
return tmp;
}



Bits error versus a



Bits error versus b_2



Bits error versus c
Results
if b_2 < -3.8798701851956607e152Initial program 63.8
Taylor expanded around -inf 1.9
if -3.8798701851956607e152 < b_2 < 1.1572280819884499e-223Initial program 31.7
rmApplied flip--_binary6431.7
Simplified15.5
Simplified15.5
rmApplied clear-num_binary6415.7
Simplified9.2
rmApplied *-un-lft-identity_binary649.2
Applied *-un-lft-identity_binary649.2
Applied times-frac_binary649.2
Applied add-sqr-sqrt_binary649.2
Applied times-frac_binary649.2
Simplified9.2
Simplified8.7
if 1.1572280819884499e-223 < b_2 < 2.82800213515133576e97Initial program 7.6
rmApplied div-inv_binary647.7
if 2.82800213515133576e97 < b_2 Initial program 46.7
Taylor expanded around inf 3.7
Final simplification6.5
herbie shell --seed 2020277
(FPCore (a b_2 c)
:name "quad2m (problem 3.2.1, negative)"
:precision binary64
(/ (- (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))