\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\begin{array}{l}
\mathbf{if}\;b_2 \leq -9.328589537535776 \cdot 10^{+153}:\\
\;\;\;\;\frac{\left(0.5 \cdot \left(c \cdot \frac{a}{b_2}\right) - b_2\right) - b_2}{a}\\
\mathbf{elif}\;b_2 \leq 1.5195718135839158 \cdot 10^{-43}:\\
\;\;\;\;\frac{\sqrt{b_2 \cdot b_2 - c \cdot a} - b_2}{a}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b_2}\\
\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 -9.328589537535776e+153)
(/ (- (- (* 0.5 (* c (/ a b_2))) b_2) b_2) a)
(if (<= b_2 1.5195718135839158e-43)
(/ (- (sqrt (- (* b_2 b_2) (* c a))) b_2) a)
(* -0.5 (/ c b_2)))))double code(double a, double b_2, double c) {
return (((double) (((double) -(b_2)) + ((double) sqrt(((double) (((double) (b_2 * b_2)) - ((double) (a * c)))))))) / a);
}
double code(double a, double b_2, double c) {
double tmp;
if ((b_2 <= -9.328589537535776e+153)) {
tmp = (((double) (((double) (((double) (0.5 * ((double) (c * (a / b_2))))) - b_2)) - b_2)) / a);
} else {
double tmp_1;
if ((b_2 <= 1.5195718135839158e-43)) {
tmp_1 = (((double) (((double) sqrt(((double) (((double) (b_2 * b_2)) - ((double) (c * a)))))) - b_2)) / a);
} else {
tmp_1 = ((double) (-0.5 * (c / b_2)));
}
tmp = tmp_1;
}
return tmp;
}



Bits error versus a



Bits error versus b_2



Bits error versus c
Results
if b_2 < -9.32858953753577638e153Initial program Error: 64.0 bits
SimplifiedError: 64.0 bits
Taylor expanded around -inf Error: 11.8 bits
SimplifiedError: 2.6 bits
if -9.32858953753577638e153 < b_2 < 1.51957181358391582e-43Initial program Error: 13.1 bits
SimplifiedError: 13.1 bits
if 1.51957181358391582e-43 < b_2 Initial program Error: 54.0 bits
SimplifiedError: 54.0 bits
Taylor expanded around inf Error: 8.1 bits
Final simplificationError: 10.1 bits
herbie shell --seed 2020203
(FPCore (a b_2 c)
:name "quad2p (problem 3.2.1, positive)"
:precision binary64
(/ (+ (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))