\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\frac{\frac{c}{3 \cdot a}}{\frac{\frac{1}{3 \cdot a}}{\frac{1}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}}double f(double a, double b, double c) {
double r93046 = b;
double r93047 = -r93046;
double r93048 = r93046 * r93046;
double r93049 = 3.0;
double r93050 = a;
double r93051 = r93049 * r93050;
double r93052 = c;
double r93053 = r93051 * r93052;
double r93054 = r93048 - r93053;
double r93055 = sqrt(r93054);
double r93056 = r93047 + r93055;
double r93057 = r93056 / r93051;
return r93057;
}
double f(double a, double b, double c) {
double r93058 = c;
double r93059 = 3.0;
double r93060 = a;
double r93061 = r93059 * r93060;
double r93062 = r93058 / r93061;
double r93063 = 1.0;
double r93064 = r93063 / r93061;
double r93065 = b;
double r93066 = -r93065;
double r93067 = r93065 * r93065;
double r93068 = r93061 * r93058;
double r93069 = r93067 - r93068;
double r93070 = sqrt(r93069);
double r93071 = r93066 - r93070;
double r93072 = r93063 / r93071;
double r93073 = r93064 / r93072;
double r93074 = r93062 / r93073;
return r93074;
}



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.4
Applied associate-/r*0.4
Simplified0.4
rmApplied div-inv0.5
Applied div-inv0.5
Applied times-frac0.6
Applied associate-/r*0.6
Simplified0.6
Final simplification0.6
herbie shell --seed 2019326
(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)))