\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}4 \cdot \frac{-c}{\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) (4.0 * ((double) (((double) -(c)) / ((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 52.6
Simplified52.6
rmApplied flip--52.6
Simplified0.4
Simplified0.4
rmApplied div-inv0.4
Applied associate-/l*0.5
Simplified0.4
rmApplied sub0-neg0.4
Applied distribute-frac-neg0.4
Simplified0.3
rmApplied div-inv0.3
Simplified0.1
Final simplification0.1
herbie shell --seed 2020184
(FPCore (a b c)
:name "Quadratic roots, wide range"
:precision binary64
:pre (and (< 4.930380657631324e-32 a 2.028240960365167e+31) (< 4.930380657631324e-32 b 2.028240960365167e+31) (< 4.930380657631324e-32 c 2.028240960365167e+31))
(/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))