\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\begin{array}{l}
\mathbf{if}\;b_2 \leq -1.563718320049384 \cdot 10^{+132}:\\
\;\;\;\;0.5 \cdot \frac{c}{b_2} + \frac{b_2}{a} \cdot -2\\
\mathbf{elif}\;b_2 \leq 1.1872250410793767 \cdot 10^{-70}:\\
\;\;\;\;\frac{\sqrt{b_2 \cdot b_2 - c \cdot a}}{a} - \frac{b_2}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b_2} \cdot -0.5\\
\end{array}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 VAR;
if ((b_2 <= -1.563718320049384e+132)) {
VAR = ((double) (((double) (0.5 * (c / b_2))) + ((double) ((b_2 / a) * -2.0))));
} else {
double VAR_1;
if ((b_2 <= 1.1872250410793767e-70)) {
VAR_1 = ((double) ((((double) sqrt(((double) (((double) (b_2 * b_2)) - ((double) (c * a)))))) / a) - (b_2 / a)));
} else {
VAR_1 = ((double) ((c / b_2) * -0.5));
}
VAR = VAR_1;
}
return VAR;
}



Bits error versus a



Bits error versus b_2



Bits error versus c
Results
if b_2 < -1.56371832004938414e132Initial program 55.3
Simplified55.3
rmApplied div-sub55.3
Taylor expanded around -inf 3.0
Simplified3.0
if -1.56371832004938414e132 < b_2 < 1.18722504107937671e-70Initial program 12.4
Simplified12.4
rmApplied div-sub12.4
if 1.18722504107937671e-70 < b_2 Initial program 53.4
Simplified53.4
Taylor expanded around inf 8.8
Final simplification9.9
herbie shell --seed 2020196
(FPCore (a b_2 c)
:name "quad2p (problem 3.2.1, positive)"
:precision binary64
(/ (+ (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))