\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\begin{array}{l}
\mathbf{if}\;b_2 \leq -1.9668071883221095 \cdot 10^{+93}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b_2}\\
\mathbf{elif}\;b_2 \leq -4.470994545983059 \cdot 10^{-292}:\\
\;\;\;\;\frac{1}{\frac{\sqrt{b_2 \cdot b_2 - c \cdot a} - b_2}{c}}\\
\mathbf{elif}\;b_2 \leq 1.3162613383615781 \cdot 10^{+131}:\\
\;\;\;\;\frac{-b_2}{a} - \frac{\sqrt{b_2 \cdot b_2 - c \cdot a}}{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.9668071883221095e+93)
(* -0.5 (/ c b_2))
(if (<= b_2 -4.470994545983059e-292)
(/ 1.0 (/ (- (sqrt (- (* b_2 b_2) (* c a))) b_2) c))
(if (<= b_2 1.3162613383615781e+131)
(- (/ (- b_2) a) (/ (sqrt (- (* b_2 b_2) (* c a))) 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.9668071883221095e+93) {
tmp = -0.5 * (c / b_2);
} else if (b_2 <= -4.470994545983059e-292) {
tmp = 1.0 / ((sqrt((b_2 * b_2) - (c * a)) - b_2) / c);
} else if (b_2 <= 1.3162613383615781e+131) {
tmp = (-b_2 / a) - (sqrt((b_2 * b_2) - (c * a)) / 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.9668071883221095e93Initial program 58.6
Taylor expanded around -inf 3.0
if -1.9668071883221095e93 < b_2 < -4.470994545983059e-292Initial program 32.4
rmApplied flip--_binary6432.4
Simplified16.2
Simplified16.2
rmApplied clear-num_binary6416.3
Simplified8.9
if -4.470994545983059e-292 < b_2 < 1.3162613383615781e131Initial program 9.4
rmApplied div-sub_binary649.4
if 1.3162613383615781e131 < b_2 Initial program 56.1
Taylor expanded around inf 3.5
Final simplification7.0
herbie shell --seed 2020220
(FPCore (a b_2 c)
:name "quad2m (problem 3.2.1, negative)"
:precision binary64
(/ (- (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))