\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\frac{c}{\left(-b\right) - \sqrt{b \cdot b - 3 \cdot \left(c \cdot a\right)}}double code(double a, double b, double c) {
return (((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 (c / ((double) (((double) -(b)) - ((double) sqrt(((double) (((double) (b * b)) - ((double) (3.0 * ((double) (c * a)))))))))));
}



Bits error versus a



Bits error versus b



Bits error versus c
Results
Initial program Error: 28.9 bits
rmApplied flip-+Error: 29.0 bits
SimplifiedError: 0.6 bits
SimplifiedError: 0.6 bits
rmApplied clear-numError: 0.6 bits
SimplifiedError: 0.5 bits
rmApplied div-invError: 0.5 bits
SimplifiedError: 0.3 bits
Final simplificationError: 0.3 bits
herbie shell --seed 2020200
(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)))