\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 1.56521935484509956 \cdot 10^{-141}:\\
\;\;\;\;\frac{1}{3 \cdot \frac{a}{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}\\
\mathbf{elif}\;b \le 3.6089274779684431 \cdot 10^{61}:\\
\;\;\;\;\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 <= 1.5652193548450996e-141)) {
VAR_1 = (1.0 / (3.0 * (a / (-b + sqrt(((b * b) - ((3.0 * a) * c)))))));
} else {
double VAR_2;
if ((b <= 3.608927477968443e+61)) {
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 < 1.5652193548450996e-141Initial program 10.8
rmApplied clear-num10.9
rmApplied *-un-lft-identity10.9
Applied times-frac10.9
Simplified10.9
if 1.5652193548450996e-141 < b < 3.608927477968443e+61Initial program 38.1
rmApplied flip-+38.1
Simplified17.0
if 3.608927477968443e+61 < b Initial program 57.9
Taylor expanded around inf 3.1
Final simplification9.0
herbie shell --seed 2020105
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a)))