\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\begin{array}{l}
\mathbf{if}\;b_2 \le -1.31077813786680896 \cdot 10^{45}:\\
\;\;\;\;\frac{1}{2} \cdot \frac{c}{b_2} - 2 \cdot \frac{b_2}{a}\\
\mathbf{elif}\;b_2 \le -5.2661082096237964 \cdot 10^{-239}:\\
\;\;\;\;\frac{1}{\frac{a}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}\\
\mathbf{elif}\;b_2 \le 2947728123750.7354:\\
\;\;\;\;\frac{1}{\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{c}}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{2} \cdot \frac{c}{b_2}\\
\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 <= -1.310778137866809e+45)) {
VAR = ((double) (((double) (0.5 * ((double) (c / b_2)))) - ((double) (2.0 * ((double) (b_2 / a))))));
} else {
double VAR_1;
if ((b_2 <= -5.266108209623796e-239)) {
VAR_1 = ((double) (1.0 / ((double) (a / ((double) (((double) sqrt(((double) (((double) (b_2 * b_2)) - ((double) (a * c)))))) - b_2))))));
} else {
double VAR_2;
if ((b_2 <= 2947728123750.7354)) {
VAR_2 = ((double) (1.0 / ((double) (((double) (((double) -(b_2)) - ((double) sqrt(((double) (((double) (b_2 * b_2)) - ((double) (a * c)))))))) / c))));
} else {
VAR_2 = ((double) (-0.5 * ((double) (c / b_2))));
}
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 < -1.310778137866809e+45Initial program 37.3
Taylor expanded around -inf 6.1
if -1.310778137866809e+45 < b_2 < -5.266108209623796e-239Initial program 8.5
rmApplied clear-num8.7
Simplified8.7
if -5.266108209623796e-239 < b_2 < 2947728123750.7354Initial program 25.1
rmApplied flip-+25.2
Simplified17.1
rmApplied *-un-lft-identity17.1
Applied associate-/r*17.1
Simplified13.9
rmApplied clear-num13.9
Simplified10.9
if 2947728123750.7354 < b_2 Initial program 56.5
Taylor expanded around inf 5.1
Final simplification7.6
herbie shell --seed 2020121 +o rules:numerics
(FPCore (a b_2 c)
:name "quad2p (problem 3.2.1, positive)"
:precision binary64
(/ (+ (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))