\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 -3.04454871109868448 \cdot 10^{153}:\\
\;\;\;\;1 \cdot \left(\frac{c}{b} - \frac{b}{a}\right)\\
\mathbf{elif}\;b \le 2.953170968414131 \cdot 10^{-109}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{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 <= -3.0445487110986845e+153)) {
VAR = (1.0 * ((c / b) - (b / a)));
} else {
double VAR_1;
if ((b <= 2.953170968414131e-109)) {
VAR_1 = ((sqrt(((b * b) - ((4.0 * a) * c))) - b) / (2.0 * a));
} else {
VAR_1 = (-1.0 * (c / b));
}
VAR = VAR_1;
}
return VAR;
}



Bits error versus a



Bits error versus b



Bits error versus c
Results
if b < -3.0445487110986845e+153Initial program 63.6
Taylor expanded around -inf 2.0
Simplified2.0
if -3.0445487110986845e+153 < b < 2.953170968414131e-109Initial program 11.2
rmApplied div-inv11.4
rmApplied associate-*r/11.2
Simplified11.2
if 2.953170968414131e-109 < b Initial program 51.1
Taylor expanded around inf 11.0
Final simplification10.2
herbie shell --seed 2020091 +o rules:numerics
(FPCore (a b c)
:name "Quadratic roots, full range"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 4 a) c)))) (* 2 a)))