\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\frac{1}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}} \cdot \frac{\frac{3 \cdot \left(a \cdot c\right)}{3}}{a}double f(double a, double b, double c) {
double r114895 = b;
double r114896 = -r114895;
double r114897 = r114895 * r114895;
double r114898 = 3.0;
double r114899 = a;
double r114900 = r114898 * r114899;
double r114901 = c;
double r114902 = r114900 * r114901;
double r114903 = r114897 - r114902;
double r114904 = sqrt(r114903);
double r114905 = r114896 + r114904;
double r114906 = r114905 / r114900;
return r114906;
}
double f(double a, double b, double c) {
double r114907 = 1.0;
double r114908 = b;
double r114909 = -r114908;
double r114910 = r114908 * r114908;
double r114911 = 3.0;
double r114912 = a;
double r114913 = r114911 * r114912;
double r114914 = c;
double r114915 = r114913 * r114914;
double r114916 = r114910 - r114915;
double r114917 = sqrt(r114916);
double r114918 = r114909 - r114917;
double r114919 = r114907 / r114918;
double r114920 = r114912 * r114914;
double r114921 = r114911 * r114920;
double r114922 = r114921 / r114911;
double r114923 = r114922 / r114912;
double r114924 = r114919 * r114923;
return r114924;
}



Bits error versus a



Bits error versus b



Bits error versus c
Results
Initial program 28.7
rmApplied flip-+28.7
Simplified0.6
rmApplied associate-/r*0.6
Simplified0.5
rmApplied clear-num0.6
rmApplied *-un-lft-identity0.6
Applied div-inv0.6
Applied add-sqr-sqrt0.6
Applied times-frac0.6
Applied times-frac0.6
Simplified0.6
Simplified0.5
Final simplification0.5
herbie shell --seed 2020021
(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)))