\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\begin{array}{l}
\mathbf{if}\;b_2 \leq -1.6789469445050963 \cdot 10^{+129}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b_2}\\
\mathbf{elif}\;b_2 \leq 4.255395119723271 \cdot 10^{-216}:\\
\;\;\;\;\frac{c}{\sqrt{b_2 \cdot b_2 - c \cdot a} - b_2}\\
\mathbf{elif}\;b_2 \leq 3.1539236019571927 \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 -1.6789469445050963e+129)
(* -0.5 (/ c b_2))
(if (<= b_2 4.255395119723271e-216)
(/ c (- (sqrt (- (* b_2 b_2) (* c a))) b_2))
(if (<= b_2 3.1539236019571927e+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 <= -1.6789469445050963e+129) {
tmp = -0.5 * (c / b_2);
} else if (b_2 <= 4.255395119723271e-216) {
tmp = c / (sqrt((b_2 * b_2) - (c * a)) - b_2);
} else if (b_2 <= 3.1539236019571927e+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 < -1.6789469445050963e129Initial program 61.3
Taylor expanded around -inf 2.2
if -1.6789469445050963e129 < b_2 < 4.2553951197232713e-216Initial program 30.4
rmApplied flip--_binary6430.5
Simplified15.8
Simplified15.8
rmApplied clear-num_binary6416.0
Simplified9.6
rmApplied *-un-lft-identity_binary649.6
Applied *-un-lft-identity_binary649.6
Applied times-frac_binary649.6
Applied add-sqr-sqrt_binary649.6
Applied times-frac_binary649.6
Simplified9.6
Simplified9.2
if 4.2553951197232713e-216 < b_2 < 3.1539236019571927e97Initial program 7.4
rmApplied div-inv_binary647.6
if 3.1539236019571927e97 < 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))