\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 2007.413650500031:\\
\;\;\;\;\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}:\\
\;\;\;\;\frac{\left(a \cdot c\right) \cdot -2}{a \cdot \left(b \cdot 2\right)}\\
\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 <= 2007.413650500031)) {
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) (((double) (a * c)) * -2.0)) / ((double) (a * ((double) (b * 2.0)))));
}
return VAR;
}



Bits error versus a



Bits error versus b



Bits error versus c
Results
if b < 2007.4136505000311Initial program Error: 17.3 bits
SimplifiedError: 17.3 bits
rmApplied flip--Error: 17.3 bits
SimplifiedError: 16.3 bits
SimplifiedError: 16.3 bits
if 2007.4136505000311 < b Initial program Error: 37.3 bits
SimplifiedError: 37.3 bits
Taylor expanded around inf Error: 15.6 bits
SimplifiedError: 15.6 bits
rmApplied associate-*l/Error: 15.6 bits
Applied associate-*r/Error: 15.6 bits
Applied associate-/l/Error: 15.6 bits
SimplifiedError: 15.6 bits
Final simplificationError: 15.9 bits
herbie shell --seed 2020200
(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)))