\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 -4.11134778664368488 \cdot 10^{95}:\\
\;\;\;\;1 \cdot \left(\frac{c}{b} - \frac{b}{a}\right)\\
\mathbf{elif}\;b \le -2.8254292841125695 \cdot 10^{-206}:\\
\;\;\;\;\frac{1}{\frac{2 \cdot a}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}\\
\mathbf{elif}\;b \le 3.78411745991350346 \cdot 10^{30}:\\
\;\;\;\;\frac{1}{2} \cdot \frac{4}{\frac{1 \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right)}{c}}\\
\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 <= -4.111347786643685e+95)) {
VAR = (1.0 * ((c / b) - (b / a)));
} else {
double VAR_1;
if ((b <= -2.8254292841125695e-206)) {
VAR_1 = (1.0 / ((2.0 * a) / (-b + sqrt(((b * b) - ((4.0 * a) * c))))));
} else {
double VAR_2;
if ((b <= 3.7841174599135035e+30)) {
VAR_2 = ((1.0 / 2.0) * (4.0 / ((1.0 * (-b - sqrt(((b * b) - ((4.0 * a) * c))))) / c)));
} 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 < -4.111347786643685e+95Initial program 45.3
Taylor expanded around -inf 3.3
Simplified3.3
if -4.111347786643685e+95 < b < -2.8254292841125695e-206Initial program 8.3
rmApplied clear-num8.4
if -2.8254292841125695e-206 < b < 3.7841174599135035e+30Initial program 25.6
rmApplied flip-+25.8
Simplified17.1
rmApplied *-un-lft-identity17.1
Applied *-un-lft-identity17.1
Applied times-frac17.1
Applied times-frac17.1
Simplified17.1
Simplified23.4
rmApplied associate-/l*23.5
Simplified11.2
if 3.7841174599135035e+30 < b Initial program 57.0
Taylor expanded around inf 4.4
Final simplification7.2
herbie shell --seed 2020102 +o rules:numerics
(FPCore (a b c)
:name "Quadratic roots, full range"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 4 a) c)))) (* 2 a)))