\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\frac{1}{\frac{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{c}}double f(double a, double b, double c) {
double r70322 = b;
double r70323 = -r70322;
double r70324 = r70322 * r70322;
double r70325 = 3.0;
double r70326 = a;
double r70327 = r70325 * r70326;
double r70328 = c;
double r70329 = r70327 * r70328;
double r70330 = r70324 - r70329;
double r70331 = sqrt(r70330);
double r70332 = r70323 + r70331;
double r70333 = r70332 / r70327;
return r70333;
}
double f(double a, double b, double c) {
double r70334 = 1.0;
double r70335 = b;
double r70336 = -r70335;
double r70337 = r70335 * r70335;
double r70338 = 3.0;
double r70339 = a;
double r70340 = r70338 * r70339;
double r70341 = c;
double r70342 = r70340 * r70341;
double r70343 = r70337 - r70342;
double r70344 = sqrt(r70343);
double r70345 = r70336 - r70344;
double r70346 = r70345 / r70341;
double r70347 = r70334 / r70346;
return r70347;
}



Bits error versus a



Bits error versus b



Bits error versus c
Results
Initial program 28.6
rmApplied flip-+28.6
Simplified0.6
rmApplied clear-num0.6
Simplified0.5
rmApplied *-un-lft-identity0.5
Applied times-frac0.6
Applied *-un-lft-identity0.6
Applied times-frac0.5
Applied associate-/l*0.5
Simplified0.5
rmApplied clear-num0.5
Simplified0.4
Final simplification0.4
herbie shell --seed 2019325 +o rules:numerics
(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)))