\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\frac{c \cdot -4}{\left(b + \sqrt{b \cdot b - 4 \cdot \left(c \cdot a\right)}\right) \cdot 2}double code(double a, double b, double c) {
return ((double) (((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) {
return ((double) (((double) (c * -4.0)) / ((double) (((double) (b + ((double) sqrt(((double) (((double) (b * b)) - ((double) (4.0 * ((double) (c * a)))))))))) * 2.0))));
}



Bits error versus a



Bits error versus b



Bits error versus c
Results
Initial program 43.7
Simplified43.7
rmApplied flip--43.7
Simplified0.4
Simplified0.4
rmApplied div-inv0.5
Applied associate-/l*0.5
Simplified0.4
rmApplied associate-/r*0.2
Simplified0.4
Taylor expanded around 0 0.2
Simplified0.2
Final simplification0.2
herbie shell --seed 2020184
(FPCore (a b c)
:name "Quadratic roots, medium range"
:precision binary64
:pre (and (< 1.1102230246251565e-16 a 9007199254740992.0) (< 1.1102230246251565e-16 b 9007199254740992.0) (< 1.1102230246251565e-16 c 9007199254740992.0))
(/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))