\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.5482564668283562 \cdot 10^{-112}:\\
\;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\\
\mathbf{elif}\;b \le 8.28272902225294789 \cdot 10^{102}:\\
\;\;\;\;\frac{\frac{1 \cdot \left(\left({b}^{2} - {b}^{2}\right) + 3 \cdot \left(a \cdot c\right)\right)}{3 \cdot a}}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}\\
\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.548256466828356e-112)) {
VAR_1 = ((-b + sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a));
} else {
double VAR_2;
if ((b <= 8.282729022252948e+102)) {
VAR_2 = (((1.0 * ((pow(b, 2.0) - pow(b, 2.0)) + (3.0 * (a * c)))) / (3.0 * a)) / (-b - sqrt(((b * b) - ((3.0 * a) * c)))));
} 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.548256466828356e-112Initial program 11.3
if 2.548256466828356e-112 < b < 8.282729022252948e+102Initial program 41.9
rmApplied clear-num41.9
rmApplied *-un-lft-identity41.9
Applied times-frac41.9
Simplified41.9
rmApplied associate-/r*41.9
rmApplied flip-+41.9
Applied associate-/r/42.0
Applied associate-/r*41.9
Simplified14.6
if 8.282729022252948e+102 < b Initial program 60.1
Taylor expanded around inf 2.3
Final simplification8.8
herbie shell --seed 2020078
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a)))