\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\begin{array}{l}
\mathbf{if}\;b_2 \leq -1.646116191344108 \cdot 10^{+138}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b_2}\\
\mathbf{elif}\;b_2 \leq 5.128238380962619 \cdot 10^{-281}:\\
\;\;\;\;\frac{c}{\sqrt{b_2 \cdot b_2 - c \cdot a} - b_2}\\
\mathbf{elif}\;b_2 \leq 5.867327981356101 \cdot 10^{+60}:\\
\;\;\;\;\frac{1}{\frac{a}{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - c \cdot a}}}\\
\mathbf{else}:\\
\;\;\;\;-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.646116191344108e+138)
(* -0.5 (/ c b_2))
(if (<= b_2 5.128238380962619e-281)
(/ c (- (sqrt (- (* b_2 b_2) (* c a))) b_2))
(if (<= b_2 5.867327981356101e+60)
(/ 1.0 (/ a (- (- b_2) (sqrt (- (* b_2 b_2) (* c a))))))
(* -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.646116191344108e+138) {
tmp = -0.5 * (c / b_2);
} else if (b_2 <= 5.128238380962619e-281) {
tmp = c / (sqrt((b_2 * b_2) - (c * a)) - b_2);
} else if (b_2 <= 5.867327981356101e+60) {
tmp = 1.0 / (a / (-b_2 - sqrt((b_2 * b_2) - (c * a))));
} else {
tmp = -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.64611619134410798e138Initial program 62.6
Taylor expanded around -inf 1.5
if -1.64611619134410798e138 < b_2 < 5.1282383809626191e-281Initial program 32.9
rmApplied clear-num_binary6432.9
rmApplied flip--_binary6433.0
Applied associate-/r/_binary6433.0
Applied associate-/r*_binary6433.0
Simplified14.8
Taylor expanded around 0 8.3
if 5.1282383809626191e-281 < b_2 < 5.86732798135610082e60Initial program 9.3
rmApplied clear-num_binary649.5
if 5.86732798135610082e60 < b_2 Initial program 40.8
rmApplied clear-num_binary6440.9
Taylor expanded around 0 4.1
Final simplification6.5
herbie shell --seed 2020275
(FPCore (a b_2 c)
:name "quad2m (problem 3.2.1, negative)"
:precision binary64
(/ (- (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))