\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 r61559 = b;
double r61560 = -r61559;
double r61561 = r61559 * r61559;
double r61562 = 3.0;
double r61563 = a;
double r61564 = r61562 * r61563;
double r61565 = c;
double r61566 = r61564 * r61565;
double r61567 = r61561 - r61566;
double r61568 = sqrt(r61567);
double r61569 = r61560 + r61568;
double r61570 = r61569 / r61564;
return r61570;
}
double f(double a, double b, double c) {
double r61571 = 1.0;
double r61572 = b;
double r61573 = -r61572;
double r61574 = r61572 * r61572;
double r61575 = 3.0;
double r61576 = a;
double r61577 = r61575 * r61576;
double r61578 = c;
double r61579 = r61577 * r61578;
double r61580 = r61574 - r61579;
double r61581 = sqrt(r61580);
double r61582 = r61573 - r61581;
double r61583 = r61582 / r61578;
double r61584 = r61571 / r61583;
return r61584;
}



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 add-sqr-sqrt0.6
Applied times-frac0.5
Applied associate-/l*0.5
Simplified0.5
rmApplied div-inv0.5
Applied associate-/l*0.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)))