\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.7863758169125638 \cdot 10^{138}:\\
\;\;\;\;0.5 \cdot \frac{c}{b} - 0.66666666666666663 \cdot \frac{b}{a}\\
\mathbf{elif}\;b \le 2.5643996228054395 \cdot 10^{-134}:\\
\;\;\;\;\frac{\frac{1}{\sqrt[3]{3} \cdot \sqrt[3]{3}}}{\frac{a}{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}} \cdot \sqrt[3]{3}}\\
\mathbf{elif}\;b \le 7.7470557689106299 \cdot 10^{72}:\\
\;\;\;\;\frac{\frac{0 + 3 \cdot \left(a \cdot c\right)}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}{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 VAR;
if ((b <= -2.7863758169125638e+138)) {
VAR = ((0.5 * (c / b)) - (0.6666666666666666 * (b / a)));
} else {
double VAR_1;
if ((b <= 2.5643996228054395e-134)) {
VAR_1 = ((1.0 / (cbrt(3.0) * cbrt(3.0))) / ((a / (-b + sqrt(((b * b) - ((3.0 * a) * c))))) * cbrt(3.0)));
} else {
double VAR_2;
if ((b <= 7.74705576891063e+72)) {
VAR_2 = (((0.0 + (3.0 * (a * c))) / (-b - sqrt(((b * b) - ((3.0 * a) * c))))) / (3.0 * a));
} else {
VAR_2 = (-0.5 * (c / b));
}
VAR_1 = VAR_2;
}
VAR = VAR_1;
}
return VAR;
}



Bits error versus a



Bits error versus b



Bits error versus c
Results
if b < -2.7863758169125638e+138Initial program 58.6
Taylor expanded around -inf 3.0
if -2.7863758169125638e+138 < b < 2.5643996228054395e-134Initial program 10.8
rmApplied clear-num10.9
rmApplied *-un-lft-identity10.9
Applied times-frac10.9
Simplified10.9
rmApplied associate-/r*10.9
rmApplied add-cube-cbrt10.9
Applied *-un-lft-identity10.9
Applied times-frac11.1
Applied associate-/l*11.0
Simplified10.9
if 2.5643996228054395e-134 < b < 7.74705576891063e+72Initial program 39.3
rmApplied flip-+39.3
Simplified17.1
if 7.74705576891063e+72 < b Initial program 58.4
Taylor expanded around inf 3.2
Final simplification9.0
herbie shell --seed 2020078 +o rules:numerics
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a)))