\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(-b\right) + \left(3 \cdot a\right) \cdot \left(-\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) + ((3.0 * a) * -sqrt(((b * b) - ((3.0 * a) * c))))));
}



Bits error versus a



Bits error versus b



Bits error versus c
Results
Initial program 28.4
rmApplied flip-+28.4
Simplified0.6
rmApplied associate-*r*0.4
rmApplied div-inv0.5
Applied associate-/l*0.5
Simplified0.4
rmApplied sub-neg0.4
Applied distribute-lft-in0.4
Final simplification0.4
herbie shell --seed 2020092
(FPCore (a b c)
:name "Cubic critical, 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) (* (* 3 a) c)))) (* 3 a)))