\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.9551520595513616 \cdot 10^{118}:\\
\;\;\;\;0.5 \cdot \frac{c}{b} - 0.66666666666666663 \cdot \frac{b}{a}\\
\mathbf{elif}\;b \le -1.53142763806062239 \cdot 10^{-259}:\\
\;\;\;\;\frac{\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3}}{a}\\
\mathbf{elif}\;b \le 5.3300268467023164 \cdot 10^{29}:\\
\;\;\;\;\frac{1 \cdot \frac{3}{\frac{1}{a} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{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 temp;
if ((b <= -5.955152059551362e+118)) {
temp = ((0.5 * (c / b)) - (0.6666666666666666 * (b / a)));
} else {
double temp_1;
if ((b <= -1.5314276380606224e-259)) {
temp_1 = (((-b + sqrt(((b * b) - ((3.0 * a) * c)))) / 3.0) / a);
} else {
double temp_2;
if ((b <= 5.3300268467023164e+29)) {
temp_2 = ((1.0 * (3.0 / ((1.0 / a) * ((-b - sqrt(((b * b) - ((3.0 * a) * c)))) / c)))) / (3.0 * a));
} else {
temp_2 = (-0.5 * (c / b));
}
temp_1 = temp_2;
}
temp = temp_1;
}
return temp;
}



Bits error versus a



Bits error versus b



Bits error versus c
Results
if b < -5.955152059551362e+118Initial program 52.2
Taylor expanded around -inf 3.3
if -5.955152059551362e+118 < b < -1.5314276380606224e-259Initial program 7.9
rmApplied associate-/r*7.9
if -1.5314276380606224e-259 < b < 5.3300268467023164e+29Initial program 26.5
rmApplied flip-+26.6
Simplified16.9
rmApplied *-un-lft-identity16.9
Applied *-un-lft-identity16.9
Applied times-frac16.9
Simplified16.9
Simplified16.9
rmApplied *-un-lft-identity16.9
Applied times-frac14.7
if 5.3300268467023164e+29 < b Initial program 56.7
Taylor expanded around inf 4.8
Final simplification8.1
herbie shell --seed 2020049
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a)))