\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\begin{array}{l}
\mathbf{if}\;b_2 \leq -2.746806209943982 \cdot 10^{+150}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b_2}\\
\mathbf{elif}\;b_2 \leq 1.4772792552103187 \cdot 10^{-257}:\\
\;\;\;\;\frac{1}{\frac{\sqrt{b_2 \cdot b_2 - c \cdot a} - b_2}{c}}\\
\mathbf{elif}\;b_2 \leq 7.36932297436956 \cdot 10^{+143}:\\
\;\;\;\;\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 -2.746806209943982e+150)
(* -0.5 (/ c b_2))
(if (<= b_2 1.4772792552103187e-257)
(/ 1.0 (/ (- (sqrt (- (* b_2 b_2) (* c a))) b_2) c))
(if (<= b_2 7.36932297436956e+143)
(* (+ 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 <= -2.746806209943982e+150) {
tmp = -0.5 * (c / b_2);
} else if (b_2 <= 1.4772792552103187e-257) {
tmp = 1.0 / ((sqrt((b_2 * b_2) - (c * a)) - b_2) / c);
} else if (b_2 <= 7.36932297436956e+143) {
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 < -2.7468062099439819e150Initial program 63.6
Taylor expanded around -inf 1.6
if -2.7468062099439819e150 < b_2 < 1.4772792552103187e-257Initial program 32.2
rmApplied flip--_binary6432.2
Simplified14.8
Simplified14.8
rmApplied clear-num_binary6415.0
Simplified8.6
if 1.4772792552103187e-257 < b_2 < 7.3693229743695601e143Initial program 8.3
rmApplied div-inv_binary648.5
if 7.3693229743695601e143 < b_2 Initial program 60.8
rmApplied flip--_binary6464.0
Simplified62.8
Simplified62.8
Taylor expanded around 0 2.7
Final simplification6.6
herbie shell --seed 2020299
(FPCore (a b_2 c)
:name "quad2m (problem 3.2.1, negative)"
:precision binary64
(/ (- (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))