\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\begin{array}{l}
\mathbf{if}\;b_2 \leq -1.95155870856424 \cdot 10^{+129}:\\
\;\;\;\;0.5 \cdot \frac{c}{b_2} + b_2 \cdot \frac{-2}{a}\\
\mathbf{elif}\;b_2 \leq -2.8405866436241524 \cdot 10^{-198}:\\
\;\;\;\;\frac{\sqrt{b_2 \cdot b_2 - c \cdot a} - b_2}{a}\\
\mathbf{elif}\;b_2 \leq 1.9930311221408239 \cdot 10^{+59}:\\
\;\;\;\;\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) -(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.95155870856424e+129)) {
VAR = ((double) (((double) (0.5 * (c / b_2))) + ((double) (b_2 * (-2.0 / a)))));
} else {
double VAR_1;
if ((b_2 <= -2.8405866436241524e-198)) {
VAR_1 = (((double) (((double) sqrt(((double) (((double) (b_2 * b_2)) - ((double) (c * a)))))) - b_2)) / a);
} else {
double VAR_2;
if ((b_2 <= 1.9930311221408239e+59)) {
VAR_2 = (((double) -(c)) / ((double) (b_2 + ((double) sqrt(((double) (((double) (b_2 * b_2)) - ((double) (c * a)))))))));
} else {
VAR_2 = (((double) -(c)) / ((double) (b_2 + ((double) (b_2 + ((double) (a * (-0.5 / (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 < -1.95155870856424e129Initial program 56.1
Simplified56.1
Taylor expanded around -inf 2.6
Simplified2.8
if -1.95155870856424e129 < b_2 < -2.8405866436241524e-198Initial program 7.2
Simplified7.2
if -2.8405866436241524e-198 < b_2 < 1.99303112214082389e59Initial program 27.1
Simplified27.1
rmApplied flip--27.2
Simplified16.8
Simplified16.8
rmApplied distribute-rgt-neg-out16.8
Applied distribute-frac-neg16.8
Applied distribute-frac-neg16.8
Simplified10.3
if 1.99303112214082389e59 < b_2 Initial program 57.9
Simplified57.9
rmApplied flip--57.9
Simplified30.4
Simplified30.4
rmApplied distribute-rgt-neg-out30.4
Applied distribute-frac-neg30.4
Applied distribute-frac-neg30.4
Simplified27.1
Taylor expanded around inf 8.0
Simplified3.8
Final simplification6.7
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))