\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\frac{\frac{\frac{a \cdot c}{3}}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}{a} \cdot 3double f(double a, double b, double c) {
double r119913 = b;
double r119914 = -r119913;
double r119915 = r119913 * r119913;
double r119916 = 3.0;
double r119917 = a;
double r119918 = r119916 * r119917;
double r119919 = c;
double r119920 = r119918 * r119919;
double r119921 = r119915 - r119920;
double r119922 = sqrt(r119921);
double r119923 = r119914 + r119922;
double r119924 = r119923 / r119918;
return r119924;
}
double f(double a, double b, double c) {
double r119925 = a;
double r119926 = c;
double r119927 = r119925 * r119926;
double r119928 = 3.0;
double r119929 = r119927 / r119928;
double r119930 = b;
double r119931 = -r119930;
double r119932 = r119930 * r119930;
double r119933 = r119928 * r119925;
double r119934 = r119933 * r119926;
double r119935 = r119932 - r119934;
double r119936 = sqrt(r119935);
double r119937 = r119931 - r119936;
double r119938 = r119929 / r119937;
double r119939 = r119938 / r119925;
double r119940 = r119939 * r119928;
return r119940;
}



Bits error versus a



Bits error versus b



Bits error versus c
Results
Initial program 28.4
rmApplied flip-+28.4
Simplified0.6
rmApplied div-inv0.6
Applied times-frac0.6
Simplified0.6
rmApplied *-un-lft-identity0.6
Applied times-frac0.5
Applied associate-*l*0.6
rmApplied associate-*r/0.6
Simplified0.6
Final simplification0.6
herbie shell --seed 2019318
(FPCore (a b c)
:name "Cubic critical, narrow range"
:precision binary64
:pre (and (< 1.05367121277235087e-8 a 94906265.6242515594) (< 1.05367121277235087e-8 b 94906265.6242515594) (< 1.05367121277235087e-8 c 94906265.6242515594))
(/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a)))