\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\begin{array}{l}
\mathbf{if}\;b \le -1.5396067403637575 \cdot 10^{153}:\\
\;\;\;\;1 \cdot \left(\frac{c}{b} - \frac{b}{a}\right)\\
\mathbf{elif}\;b \le 4.98046573207493813 \cdot 10^{-179}:\\
\;\;\;\;\frac{1}{\frac{2 \cdot a}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}\\
\mathbf{elif}\;b \le 2.5096626454411 \cdot 10^{56}:\\
\;\;\;\;\frac{\frac{0 + 4 \cdot \left(a \cdot c\right)}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}{2 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;-1 \cdot \frac{c}{b}\\
\end{array}double code(double a, double b, double c) {
return ((-b + sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a));
}
double code(double a, double b, double c) {
double VAR;
if ((b <= -1.5396067403637575e+153)) {
VAR = (1.0 * ((c / b) - (b / a)));
} else {
double VAR_1;
if ((b <= 4.980465732074938e-179)) {
VAR_1 = (1.0 / ((2.0 * a) / (-b + sqrt(((b * b) - ((4.0 * a) * c))))));
} else {
double VAR_2;
if ((b <= 2.5096626454411205e+56)) {
VAR_2 = (((0.0 + (4.0 * (a * c))) / (-b - sqrt(((b * b) - ((4.0 * a) * c))))) / (2.0 * a));
} else {
VAR_2 = (-1.0 * (c / b));
}
VAR_1 = VAR_2;
}
VAR = VAR_1;
}
return VAR;
}



Bits error versus a



Bits error versus b



Bits error versus c
Results
if b < -1.5396067403637575e+153Initial program 63.1
Taylor expanded around -inf 2.3
Simplified2.3
if -1.5396067403637575e+153 < b < 4.980465732074938e-179Initial program 10.3
rmApplied clear-num10.4
if 4.980465732074938e-179 < b < 2.5096626454411205e+56Initial program 35.3
rmApplied flip-+35.4
Simplified17.1
if 2.5096626454411205e+56 < b Initial program 57.5
Taylor expanded around inf 3.4
Final simplification8.9
herbie shell --seed 2020105 +o rules:numerics
(FPCore (a b c)
:name "Quadratic roots, full range"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 4 a) c)))) (* 2 a)))