\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\begin{array}{l}
\mathbf{if}\;b_2 \leq -5.0970974227683685 \cdot 10^{+85}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b_2}\\
\mathbf{elif}\;b_2 \leq 2.508993614835235 \cdot 10^{-240}:\\
\;\;\;\;\frac{c}{\sqrt{b_2 \cdot b_2 - c \cdot a} - b_2}\\
\mathbf{elif}\;b_2 \leq 1.6213649525072984 \cdot 10^{+98}:\\
\;\;\;\;\left(b_2 + \sqrt{b_2 \cdot b_2 - c \cdot a}\right) \cdot \frac{-1}{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 -5.0970974227683685e+85)
(* -0.5 (/ c b_2))
(if (<= b_2 2.508993614835235e-240)
(/ c (- (sqrt (- (* b_2 b_2) (* c a))) b_2))
(if (<= b_2 1.6213649525072984e+98)
(* (+ b_2 (sqrt (- (* b_2 b_2) (* c a)))) (/ -1.0 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 <= -5.0970974227683685e+85) {
tmp = -0.5 * (c / b_2);
} else if (b_2 <= 2.508993614835235e-240) {
tmp = c / (sqrt((b_2 * b_2) - (c * a)) - b_2);
} else if (b_2 <= 1.6213649525072984e+98) {
tmp = (b_2 + sqrt((b_2 * b_2) - (c * a))) * (-1.0 / 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 < -5.09709742276836848e85Initial program 58.4
Taylor expanded around -inf 2.8
if -5.09709742276836848e85 < b_2 < 2.5089936148352349e-240Initial program 29.9
rmApplied flip--_binary6430.0
Simplified16.4
Simplified16.4
rmApplied *-un-lft-identity_binary6416.4
Applied *-un-lft-identity_binary6416.4
Applied times-frac_binary6416.4
Simplified16.4
Simplified9.4
if 2.5089936148352349e-240 < b_2 < 1.62136495250729838e98Initial program 8.0
rmApplied div-inv_binary648.1
if 1.62136495250729838e98 < b_2 Initial program 48.0
rmApplied flip--_binary6462.8
Simplified62.0
Simplified62.0
Taylor expanded around 0 5.0
Final simplification6.7
herbie shell --seed 2020281
(FPCore (a b_2 c)
:name "quad2m (problem 3.2.1, negative)"
:precision binary64
(/ (- (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))