\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\begin{array}{l}
\mathbf{if}\;b \leq 0.008556615063999384:\\
\;\;\;\;\frac{\frac{\left(b \cdot b - \left(3 \cdot a\right) \cdot c\right) - b \cdot b}{b + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}{3 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b}\\
\end{array}(FPCore (a b c) :precision binary64 (/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))
(FPCore (a b c)
:precision binary64
(if (<= b 0.008556615063999384)
(/
(/
(- (- (* b b) (* (* 3.0 a) c)) (* b b))
(+ b (sqrt (- (* b b) (* (* 3.0 a) c)))))
(* 3.0 a))
(* -0.5 (/ c b))))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) {
double tmp;
if ((b <= 0.008556615063999384)) {
tmp = ((((double) (((double) (((double) (b * b)) - ((double) (((double) (3.0 * a)) * c)))) - ((double) (b * b)))) / ((double) (b + ((double) sqrt(((double) (((double) (b * b)) - ((double) (((double) (3.0 * a)) * c))))))))) / ((double) (3.0 * a)));
} else {
tmp = ((double) (-0.5 * (c / b)));
}
return tmp;
}



Bits error versus a



Bits error versus b



Bits error versus c
Results
if b < 0.00855661506399938397Initial program 21.0
Simplified21.0
rmApplied flip--_binary6421.1
Simplified20.1
Simplified20.1
if 0.00855661506399938397 < b Initial program 46.7
Simplified46.7
Taylor expanded around inf 9.9
Final simplification11.0
herbie shell --seed 2020205
(FPCore (a b c)
:name "Cubic critical, medium range"
:precision binary64
: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.0 a) c)))) (* 3.0 a)))