\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.35463732932135993 \cdot 10^{154}:\\
\;\;\;\;\frac{2 \cdot \frac{a \cdot c}{b} - 2 \cdot b}{2 \cdot a}\\
\mathbf{elif}\;b \le 1.9146441501386442 \cdot 10^{-213}:\\
\;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\\
\mathbf{elif}\;b \le 1.1588673707323962 \cdot 10^{152}:\\
\;\;\;\;\frac{1}{\frac{0.5}{c} \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{2 \cdot a}{4 \cdot \left(a \cdot c\right)} \cdot \left(2 \cdot \frac{a \cdot c}{b} - 2 \cdot b\right)}\\
\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.35463732932136e+154)) {
VAR = (((2.0 * ((a * c) / b)) - (2.0 * b)) / (2.0 * a));
} else {
double VAR_1;
if ((b <= 1.9146441501386442e-213)) {
VAR_1 = ((-b + sqrt(((b * b) - (4.0 * (a * c))))) / (2.0 * a));
} else {
double VAR_2;
if ((b <= 1.1588673707323962e+152)) {
VAR_2 = (1.0 / ((0.5 / c) * (-b - sqrt(((b * b) - ((4.0 * a) * c))))));
} else {
VAR_2 = (1.0 / (((2.0 * a) / (4.0 * (a * c))) * ((2.0 * ((a * c) / b)) - (2.0 * 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.35463732932136e+154Initial program 64.0
Taylor expanded around -inf 11.6
if -1.35463732932136e+154 < b < 1.9146441501386442e-213Initial program 9.4
rmApplied associate-*l*9.4
if 1.9146441501386442e-213 < b < 1.1588673707323962e+152Initial program 38.4
rmApplied flip-+38.4
Simplified16.1
rmApplied clear-num16.3
Simplified14.3
Taylor expanded around 0 6.9
if 1.1588673707323962e+152 < b Initial program 63.7
rmApplied flip-+63.7
Simplified38.1
rmApplied clear-num38.1
Simplified38.0
Taylor expanded around inf 8.2
Final simplification8.7
herbie shell --seed 2020103
(FPCore (a b c)
:name "Quadratic roots, full range"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 4 a) c)))) (* 2 a)))