\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\begin{array}{l}
\mathbf{if}\;b_2 \le -3.8900654094429814 \cdot 10^{+133}:\\
\;\;\;\;0.5 \cdot \frac{c}{b_2} + b_2 \cdot \frac{-2}{a}\\
\mathbf{elif}\;b_2 \le -7.883473021605369 \cdot 10^{-300}:\\
\;\;\;\;\frac{\sqrt{b_2 \cdot b_2 - c \cdot a}}{a} - \frac{b_2}{a}\\
\mathbf{elif}\;b_2 \le 1.0729035470079235 \cdot 10^{+71}:\\
\;\;\;\;\frac{-c}{b_2 + \sqrt{b_2 \cdot b_2 - c \cdot a}}\\
\mathbf{else}:\\
\;\;\;\;\frac{-c}{b_2 + \left(b_2 + a \cdot \frac{-0.5}{\frac{b_2}{c}}\right)}\\
\end{array}double code(double a, double b_2, double c) {
return ((double) (((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 <= -3.8900654094429814e+133)) {
VAR = ((double) (((double) (0.5 * ((double) (c / b_2)))) + ((double) (b_2 * ((double) (-2.0 / a))))));
} else {
double VAR_1;
if ((b_2 <= -7.883473021605369e-300)) {
VAR_1 = ((double) (((double) (((double) sqrt(((double) (((double) (b_2 * b_2)) - ((double) (c * a)))))) / a)) - ((double) (b_2 / a))));
} else {
double VAR_2;
if ((b_2 <= 1.0729035470079235e+71)) {
VAR_2 = ((double) (((double) -(c)) / ((double) (b_2 + ((double) sqrt(((double) (((double) (b_2 * b_2)) - ((double) (c * a))))))))));
} else {
VAR_2 = ((double) (((double) -(c)) / ((double) (b_2 + ((double) (b_2 + ((double) (a * ((double) (-0.5 / ((double) (b_2 / c))))))))))));
}
VAR_1 = VAR_2;
}
VAR = VAR_1;
}
return VAR;
}



Bits error versus a



Bits error versus b_2



Bits error versus c
Results
if b_2 < -3.89006540944298138e133Initial program 57.0
Simplified57.0
Taylor expanded around -inf 2.5
Simplified2.8
if -3.89006540944298138e133 < b_2 < -7.8834730216053692e-300Initial program 9.3
Simplified9.3
rmApplied div-sub9.3
if -7.8834730216053692e-300 < b_2 < 1.07290354700792347e71Initial program 31.0
Simplified31.0
rmApplied flip--31.0
Simplified16.5
Simplified16.5
rmApplied sub0-neg16.5
Applied distribute-frac-neg16.5
Applied distribute-frac-neg16.5
Simplified9.2
if 1.07290354700792347e71 < b_2 Initial program 57.3
Simplified57.3
rmApplied flip--57.3
Simplified30.1
Simplified30.1
rmApplied sub0-neg30.1
Applied distribute-frac-neg30.1
Applied distribute-frac-neg30.1
Simplified27.1
Taylor expanded around inf 7.0
Simplified3.2
Final simplification6.8
herbie shell --seed 2020184
(FPCore (a b_2 c)
:name "quad2p (problem 3.2.1, positive)"
:precision binary64
(/ (+ (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))