\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 -1.25150514925533034 \cdot 10^{154}:\\
\;\;\;\;0.5 \cdot \frac{c}{b} - 0.66666666666666663 \cdot \frac{b}{a}\\
\mathbf{elif}\;b \le 3.88341583816825246 \cdot 10^{-129}:\\
\;\;\;\;\frac{\frac{\left(-b\right) + \sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)}}{3}}{a}\\
\mathbf{elif}\;b \le 4.04873413931206024 \cdot 10^{54}:\\
\;\;\;\;\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 <= -1.2515051492553303e+154)) {
VAR = ((0.5 * (c / b)) - (0.6666666666666666 * (b / a)));
} else {
double VAR_1;
if ((b <= 3.8834158381682525e-129)) {
VAR_1 = (((-b + sqrt(((b * b) - (3.0 * (a * c))))) / 3.0) / a);
} else {
double VAR_2;
if ((b <= 4.04873413931206e+54)) {
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 < -1.2515051492553303e+154Initial program 64.0
Taylor expanded around -inf 3.0
if -1.2515051492553303e+154 < b < 3.8834158381682525e-129Initial program 11.1
rmApplied associate-/r*11.1
rmApplied associate-*l*11.1
if 3.8834158381682525e-129 < b < 4.04873413931206e+54Initial program 38.9
rmApplied flip-+38.9
Simplified16.8
if 4.04873413931206e+54 < b Initial program 57.4
Taylor expanded around inf 3.5
Final simplification9.0
herbie shell --seed 2020105 +o rules:numerics
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a)))