\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 -2.3044033969831823 \cdot 10^{153}:\\
\;\;\;\;1 \cdot \left(\frac{c}{b} - \frac{b}{a}\right)\\
\mathbf{elif}\;b \le 1.9238883452280037 \cdot 10^{-130}:\\
\;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\
\mathbf{elif}\;b \le 4.01993084419163312 \cdot 10^{109}:\\
\;\;\;\;\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 temp;
if ((b <= -2.3044033969831823e+153)) {
temp = (1.0 * ((c / b) - (b / a)));
} else {
double temp_1;
if ((b <= 1.9238883452280037e-130)) {
temp_1 = ((-b + sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a));
} else {
double temp_2;
if ((b <= 4.019930844191633e+109)) {
temp_2 = (((0.0 + (4.0 * (a * c))) / (-b - sqrt(((b * b) - ((4.0 * a) * c))))) / (2.0 * a));
} else {
temp_2 = (-1.0 * (c / b));
}
temp_1 = temp_2;
}
temp = temp_1;
}
return temp;
}



Bits error versus a



Bits error versus b



Bits error versus c
Results
if b < -2.3044033969831823e+153Initial program 63.5
Taylor expanded around -inf 2.0
Simplified2.0
if -2.3044033969831823e+153 < b < 1.9238883452280037e-130Initial program 11.3
rmApplied associate-/r*11.3
rmApplied div-inv11.3
Applied associate-/l*11.3
Simplified11.3
if 1.9238883452280037e-130 < b < 4.019930844191633e+109Initial program 40.3
rmApplied flip-+40.3
Simplified15.5
if 4.019930844191633e+109 < b Initial program 59.9
Taylor expanded around inf 2.4
Final simplification9.2
herbie shell --seed 2020060 +o rules:numerics
(FPCore (a b c)
:name "Quadratic roots, full range"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 4 a) c)))) (* 2 a)))