\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.86885461377155539 \cdot 10^{112}:\\
\;\;\;\;0.5 \cdot \frac{c}{b} - 0.66666666666666663 \cdot \frac{b}{a}\\
\mathbf{elif}\;b \le -1.3555670582517698 \cdot 10^{-255}:\\
\;\;\;\;\frac{\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3}}{a}\\
\mathbf{elif}\;b \le 3.269447855984649 \cdot 10^{65}:\\
\;\;\;\;\frac{-a \cdot \frac{c}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}{-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 <= -2.8688546137715554e+112)) {
temp = ((0.5 * (c / b)) - (0.6666666666666666 * (b / a)));
} else {
double temp_1;
if ((b <= -1.3555670582517698e-255)) {
temp_1 = (((-b + sqrt(((b * b) - ((3.0 * a) * c)))) / 3.0) / a);
} else {
double temp_2;
if ((b <= 3.2694478559846486e+65)) {
temp_2 = (-(a * (c / (-b - sqrt(((b * b) - ((3.0 * a) * c)))))) / -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 < -2.8688546137715554e+112Initial program 50.4
Taylor expanded around -inf 4.3
if -2.8688546137715554e+112 < b < -1.3555670582517698e-255Initial program 8.0
rmApplied associate-/r*8.0
if -1.3555670582517698e-255 < b < 3.2694478559846486e+65Initial program 28.8
rmApplied flip-+28.8
Simplified16.2
rmApplied associate-/r*16.2
Simplified16.2
rmApplied frac-2neg16.2
Simplified16.1
rmApplied *-un-lft-identity16.1
Applied times-frac13.7
Simplified13.7
if 3.2694478559846486e+65 < b Initial program 57.8
Taylor expanded around inf 3.1
Final simplification7.8
herbie shell --seed 2020058
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a)))