\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\begin{array}{l}
\mathbf{if}\;b \leq 323.9434679801967:\\
\;\;\;\;\frac{\frac{b \cdot b - \left(b \cdot b + 4 \cdot \left(a \cdot c\right)\right)}{b + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}}{a \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;-1 \cdot \frac{c}{b}\\
\end{array}double code(double a, double b, double c) {
return (((double) (((double) -(b)) + ((double) sqrt(((double) (((double) (b * b)) - ((double) (((double) (4.0 * a)) * c)))))))) / ((double) (2.0 * a)));
}
double code(double a, double b, double c) {
double VAR;
if ((b <= 323.9434679801967)) {
VAR = ((((double) (((double) (b * b)) - ((double) (((double) (b * b)) + ((double) (4.0 * ((double) (a * c)))))))) / ((double) (b + ((double) sqrt(((double) (((double) (b * b)) - ((double) (4.0 * ((double) (a * c))))))))))) / ((double) (a * 2.0)));
} else {
VAR = ((double) (-1.0 * (c / b)));
}
return VAR;
}



Bits error versus a



Bits error versus b



Bits error versus c
Results
if b < 323.94346798019671Initial program 16.5
Simplified16.5
rmApplied flip--16.5
Simplified15.6
Simplified15.6
if 323.94346798019671 < b Initial program 35.1
Simplified35.1
Taylor expanded around inf 17.2
Final simplification16.6
herbie shell --seed 2020199
(FPCore (a b c)
:name "Quadratic roots, narrow range"
:precision binary64
:pre (and (< 1.0536712127723509e-08 a 94906265.62425156) (< 1.0536712127723509e-08 b 94906265.62425156) (< 1.0536712127723509e-08 c 94906265.62425156))
(/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))