\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 -5.1391385813739481 \cdot 10^{66}:\\
\;\;\;\;0.5 \cdot \frac{c}{b} - 0.66666666666666663 \cdot \frac{b}{a}\\
\mathbf{elif}\;b \le 3.86815523717705745 \cdot 10^{-95}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-\sqrt[3]{b} \cdot \sqrt[3]{b}, \sqrt[3]{b}, \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)}{3 \cdot 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 <= -5.139138581373948e+66)) {
temp = ((0.5 * (c / b)) - (0.6666666666666666 * (b / a)));
} else {
double temp_1;
if ((b <= 3.8681552371770574e-95)) {
temp_1 = (fma(-(cbrt(b) * cbrt(b)), cbrt(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 < -5.139138581373948e+66Initial program 40.5
Taylor expanded around -inf 4.7
if -5.139138581373948e+66 < b < 3.8681552371770574e-95Initial program 12.9
rmApplied add-cube-cbrt13.1
Applied distribute-lft-neg-in13.1
Applied fma-def13.1
if 3.8681552371770574e-95 < b Initial program 52.5
Taylor expanded around inf 9.2
Final simplification10.0
herbie shell --seed 2020066 +o rules:numerics
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a)))