\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\frac{-c}{b + \sqrt{\frac{{b}^{4} - 3 \cdot \left(3 \cdot \left(a \cdot \left(a \cdot \left(c \cdot c\right)\right)\right)\right)}{3 \cdot \left(c \cdot a\right) + b \cdot b}}}double code(double a, double b, double c) {
return ((double) (((double) (((double) -(b)) + ((double) sqrt(((double) (((double) (b * b)) - ((double) (((double) (3.0 * a)) * c)))))))) / ((double) (3.0 * a))));
}
double code(double a, double b, double c) {
return ((double) (((double) -(c)) / ((double) (b + ((double) sqrt(((double) (((double) (((double) pow(b, 4.0)) - ((double) (3.0 * ((double) (3.0 * ((double) (a * ((double) (a * ((double) (c * c)))))))))))) / ((double) (((double) (3.0 * ((double) (c * a)))) + ((double) (b * b))))))))))));
}



Bits error versus a



Bits error versus b



Bits error versus c
Results
Initial program 28.5
Simplified28.5
rmApplied flip--28.5
Simplified0.6
Simplified0.6
rmApplied sub0-neg0.6
Applied distribute-frac-neg0.6
Applied distribute-frac-neg0.6
Simplified0.3
rmApplied flip--0.3
Simplified0.3
Simplified0.3
Final simplification0.3
herbie shell --seed 2020184
(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.0 a) c)))) (* 3.0 a)))