\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\frac{\left(-3 \cdot a\right) \cdot \frac{c}{\sqrt{\mathsf{fma}\left(c, -3 \cdot a, b \cdot b\right)} + b}}{3 \cdot a}double f(double a, double b, double c) {
double r103731 = b;
double r103732 = -r103731;
double r103733 = r103731 * r103731;
double r103734 = 3.0;
double r103735 = a;
double r103736 = r103734 * r103735;
double r103737 = c;
double r103738 = r103736 * r103737;
double r103739 = r103733 - r103738;
double r103740 = sqrt(r103739);
double r103741 = r103732 + r103740;
double r103742 = r103741 / r103736;
return r103742;
}
double f(double a, double b, double c) {
double r103743 = -3.0;
double r103744 = a;
double r103745 = r103743 * r103744;
double r103746 = c;
double r103747 = 3.0;
double r103748 = r103747 * r103744;
double r103749 = -r103748;
double r103750 = b;
double r103751 = r103750 * r103750;
double r103752 = fma(r103746, r103749, r103751);
double r103753 = sqrt(r103752);
double r103754 = r103753 + r103750;
double r103755 = r103746 / r103754;
double r103756 = r103745 * r103755;
double r103757 = r103756 / r103748;
return r103757;
}



Bits error versus a



Bits error versus b



Bits error versus c
Initial program 28.8
Simplified28.8
rmApplied flip--28.8
Simplified0.6
Simplified0.6
Taylor expanded around 0 0.6
Simplified0.5
rmApplied *-un-lft-identity0.5
Applied times-frac0.3
Simplified0.3
Simplified0.3
Final simplification0.3
herbie shell --seed 2019195 +o rules:numerics
(FPCore (a b c)
:name "Cubic critical, narrow range"
: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.0 a) c)))) (* 3.0 a)))