\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\begin{array}{l}
\mathbf{if}\;b \le -2.21751057489784995 \cdot 10^{59}:\\
\;\;\;\;0.5 \cdot \frac{c}{b} - 0.66666666666666663 \cdot \frac{b}{a}\\
\mathbf{elif}\;b \le 1.4297233981116778 \cdot 10^{-84}:\\
\;\;\;\;\frac{\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3}}{a}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b}\\
\end{array}double code(double a, double b, double c) {
return ((-b + sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a));
}
double code(double a, double b, double c) {
double VAR;
if ((b <= -2.21751057489785e+59)) {
VAR = ((0.5 * (c / b)) - (0.6666666666666666 * (b / a)));
} else {
double VAR_1;
if ((b <= 1.4297233981116778e-84)) {
VAR_1 = (((-b + sqrt(((b * b) - ((3.0 * a) * c)))) / 3.0) / a);
} else {
VAR_1 = (-0.5 * (c / b));
}
VAR = VAR_1;
}
return VAR;
}



Bits error versus a



Bits error versus b



Bits error versus c
Results
if b < -2.21751057489785e+59Initial program 39.0
Taylor expanded around -inf 5.6
if -2.21751057489785e+59 < b < 1.4297233981116778e-84Initial program 14.0
rmApplied associate-/r*14.0
if 1.4297233981116778e-84 < b Initial program 52.2
Taylor expanded around inf 9.6
Final simplification10.7
herbie shell --seed 2020092
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a)))