\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\frac{\left({b}^{2} - {b}^{2}\right) + \left(3 \cdot a\right) \cdot c}{\left(3 \cdot a\right) \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)}double code(double a, double b, double c) {
return ((-b + sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a));
}
double code(double a, double b, double c) {
return (((pow(b, 2.0) - pow(b, 2.0)) + ((3.0 * a) * c)) / ((3.0 * a) * (-b - sqrt(((b * b) - ((3.0 * a) * c))))));
}



Bits error versus a



Bits error versus b



Bits error versus c
Results
Initial program 43.7
rmApplied flip-+43.7
Simplified0.5
rmApplied associate-*r*0.4
rmApplied div-inv0.5
Applied associate-/l*0.5
Simplified0.4
Final simplification0.4
herbie shell --seed 2020057
(FPCore (a b c)
:name "Cubic critical, medium range"
:precision binary64
:pre (and (< 1.11022e-16 a 9.0072e+15) (< 1.11022e-16 b 9.0072e+15) (< 1.11022e-16 c 9.0072e+15))
(/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a)))