\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\frac{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)}}, \sqrt{\sqrt{\left(\sqrt[3]{{\left(\left(\mathsf{fma}\left(-3, a \cdot c, b \cdot b\right) \cdot \mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)\right) \cdot \mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)\right)}^{\frac{1}{3}}} \cdot \sqrt[3]{{\left(\left(\mathsf{fma}\left(-3, a \cdot c, b \cdot b\right) \cdot \mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)\right) \cdot \mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)\right)}^{\frac{1}{3}}}\right) \cdot \sqrt[3]{{\left(\left(\mathsf{fma}\left(-3, a \cdot c, b \cdot b\right) \cdot \mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)\right) \cdot \mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)\right)}^{\frac{1}{3}}}}}, -b\right)}{a \cdot 3}double f(double a, double b, double c) {
double r2010897 = b;
double r2010898 = -r2010897;
double r2010899 = r2010897 * r2010897;
double r2010900 = 3.0;
double r2010901 = a;
double r2010902 = r2010900 * r2010901;
double r2010903 = c;
double r2010904 = r2010902 * r2010903;
double r2010905 = r2010899 - r2010904;
double r2010906 = sqrt(r2010905);
double r2010907 = r2010898 + r2010906;
double r2010908 = r2010907 / r2010902;
return r2010908;
}
double f(double a, double b, double c) {
double r2010909 = -3.0;
double r2010910 = a;
double r2010911 = c;
double r2010912 = r2010910 * r2010911;
double r2010913 = b;
double r2010914 = r2010913 * r2010913;
double r2010915 = fma(r2010909, r2010912, r2010914);
double r2010916 = sqrt(r2010915);
double r2010917 = sqrt(r2010916);
double r2010918 = r2010915 * r2010915;
double r2010919 = r2010918 * r2010915;
double r2010920 = 0.3333333333333333;
double r2010921 = pow(r2010919, r2010920);
double r2010922 = cbrt(r2010921);
double r2010923 = r2010922 * r2010922;
double r2010924 = r2010923 * r2010922;
double r2010925 = sqrt(r2010924);
double r2010926 = sqrt(r2010925);
double r2010927 = -r2010913;
double r2010928 = fma(r2010917, r2010926, r2010927);
double r2010929 = 3.0;
double r2010930 = r2010910 * r2010929;
double r2010931 = r2010928 / r2010930;
return r2010931;
}



Bits error versus a



Bits error versus b



Bits error versus c
Initial program 44.0
Simplified44.0
rmApplied add-sqr-sqrt44.0
Applied sqrt-prod44.0
Applied fma-neg43.4
rmApplied add-cbrt-cube43.4
rmApplied pow1/343.1
rmApplied add-cube-cbrt43.0
Final simplification43.0
herbie shell --seed 2019155 +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)))