\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 - c \cdot \left(3 \cdot a\right)}}double f(double a, double b, double c) {
double r2536346 = b;
double r2536347 = -r2536346;
double r2536348 = r2536346 * r2536346;
double r2536349 = 3.0;
double r2536350 = a;
double r2536351 = r2536349 * r2536350;
double r2536352 = c;
double r2536353 = r2536351 * r2536352;
double r2536354 = r2536348 - r2536353;
double r2536355 = sqrt(r2536354);
double r2536356 = r2536347 + r2536355;
double r2536357 = r2536356 / r2536351;
return r2536357;
}
double f(double a, double b, double c) {
double r2536358 = c;
double r2536359 = b;
double r2536360 = -r2536359;
double r2536361 = r2536359 * r2536359;
double r2536362 = 3.0;
double r2536363 = a;
double r2536364 = r2536362 * r2536363;
double r2536365 = r2536358 * r2536364;
double r2536366 = r2536361 - r2536365;
double r2536367 = sqrt(r2536366);
double r2536368 = r2536360 - r2536367;
double r2536369 = r2536358 / r2536368;
return r2536369;
}



Bits error versus a



Bits error versus b



Bits error versus c
Results
Initial program 43.9
rmApplied flip-+43.9
Simplified0.4
rmApplied clear-num0.5
Simplified0.5
rmApplied *-un-lft-identity0.5
Applied *-un-lft-identity0.5
Applied distribute-rgt-neg-in0.5
Applied distribute-lft-out--0.5
Applied times-frac0.5
Applied associate-/r*0.5
Simplified0.4
rmApplied associate-/r/0.2
Applied associate-/l*0.2
Simplified0.2
Final simplification0.2
herbie shell --seed 2019143 +o rules:numerics
(FPCore (a b c)
:name "Cubic critical, medium range"
:pre (and (< 1.1102230246251565e-16 a 9007199254740992.0) (< 1.1102230246251565e-16 b 9007199254740992.0) (< 1.1102230246251565e-16 c 9007199254740992.0))
(/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a)))