\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 -8.176952505904844 \cdot 10^{94}:\\
\;\;\;\;0.5 \cdot \frac{c}{b} - 0.66666666666666663 \cdot \frac{b}{a}\\
\mathbf{elif}\;b \le 1.76145822117380694 \cdot 10^{-90}:\\
\;\;\;\;\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 <= -8.176952505904844e+94)) {
VAR = ((0.5 * (c / b)) - (0.6666666666666666 * (b / a)));
} else {
double VAR_1;
if ((b <= 1.761458221173807e-90)) {
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 < -8.176952505904844e+94Initial program 45.5
Taylor expanded around -inf 4.3
if -8.176952505904844e+94 < b < 1.761458221173807e-90Initial program 13.2
rmApplied associate-/r*13.3
if 1.761458221173807e-90 < b Initial program 52.1
Taylor expanded around inf 9.9
Final simplification10.5
herbie shell --seed 2020079 +o rules:numerics
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a)))