\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 -4.7297088727929035 \cdot 10^{120}:\\
\;\;\;\;0.5 \cdot \frac{c}{b} - 0.66666666666666663 \cdot \frac{b}{a}\\
\mathbf{elif}\;b \le 4.300666801536262 \cdot 10^{-42}:\\
\;\;\;\;\frac{\frac{\left(-b\right) + \sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)}}{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 temp;
if ((b <= -4.7297088727929035e+120)) {
temp = ((0.5 * (c / b)) - (0.6666666666666666 * (b / a)));
} else {
double temp_1;
if ((b <= 4.300666801536262e-42)) {
temp_1 = (((-b + sqrt(((b * b) - (3.0 * (a * c))))) / 3.0) / a);
} else {
temp_1 = (-0.5 * (c / b));
}
temp = temp_1;
}
return temp;
}



Bits error versus a



Bits error versus b



Bits error versus c
Results
if b < -4.7297088727929035e+120Initial program 52.2
Taylor expanded around -inf 3.8
if -4.7297088727929035e+120 < b < 4.300666801536262e-42Initial program 13.7
rmApplied associate-/r*13.7
rmApplied associate-*l*13.7
if 4.300666801536262e-42 < b Initial program 55.0
Taylor expanded around inf 6.5
Final simplification9.7
herbie shell --seed 2020053 +o rules:numerics
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a)))