\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\frac{c}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}double f(double a, double b, double c) {
double r81082 = b;
double r81083 = -r81082;
double r81084 = r81082 * r81082;
double r81085 = 3.0;
double r81086 = a;
double r81087 = r81085 * r81086;
double r81088 = c;
double r81089 = r81087 * r81088;
double r81090 = r81084 - r81089;
double r81091 = sqrt(r81090);
double r81092 = r81083 + r81091;
double r81093 = r81092 / r81087;
return r81093;
}
double f(double a, double b, double c) {
double r81094 = c;
double r81095 = b;
double r81096 = -r81095;
double r81097 = r81095 * r81095;
double r81098 = 3.0;
double r81099 = a;
double r81100 = r81098 * r81099;
double r81101 = r81100 * r81094;
double r81102 = r81097 - r81101;
double r81103 = sqrt(r81102);
double r81104 = r81096 - r81103;
double r81105 = r81094 / r81104;
return r81105;
}



Bits error versus a



Bits error versus b



Bits error versus c
Results
Initial program 43.6
rmApplied flip-+43.6
Simplified0.5
rmApplied clear-num0.6
Simplified0.5
rmApplied *-un-lft-identity0.5
Applied add-cube-cbrt0.5
Applied times-frac0.5
Applied associate-/l*0.5
Simplified0.3
rmApplied div-inv0.3
Simplified0.2
Final simplification0.2
herbie shell --seed 2019323 +o rules:numerics
(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)))