\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.7201296316436681 \cdot 10^{98}:\\
\;\;\;\;\frac{1.5 \cdot \frac{a \cdot c}{b} - 2 \cdot b}{3 \cdot a}\\
\mathbf{elif}\;b \le -5.5917199964036573 \cdot 10^{-179}:\\
\;\;\;\;\frac{\left(-b\right) + \sqrt{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}} \cdot \sqrt{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}{3 \cdot a}\\
\mathbf{elif}\;b \le 1.1612125867005037 \cdot 10^{127}:\\
\;\;\;\;\frac{c}{1} \cdot \frac{1}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{1}{c} \cdot \left(1.5 \cdot \frac{a \cdot c}{b} - 2 \cdot b\right)}\\
\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.720129631643668e+98)) {
VAR = (((1.5 * ((a * c) / b)) - (2.0 * b)) / (3.0 * a));
} else {
double VAR_1;
if ((b <= -5.591719996403657e-179)) {
VAR_1 = ((-b + (sqrt(sqrt(((b * b) - ((3.0 * a) * c)))) * sqrt(sqrt(((b * b) - ((3.0 * a) * c)))))) / (3.0 * a));
} else {
double VAR_2;
if ((b <= 1.1612125867005037e+127)) {
VAR_2 = ((c / 1.0) * (1.0 / (-b - sqrt(((b * b) - ((3.0 * a) * c))))));
} else {
VAR_2 = (1.0 / ((1.0 / c) * ((1.5 * ((a * c) / b)) - (2.0 * 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.720129631643668e+98Initial program 46.3
Taylor expanded around -inf 10.0
if -2.720129631643668e+98 < b < -5.591719996403657e-179Initial program 7.4
rmApplied add-sqr-sqrt7.4
Applied sqrt-prod7.6
if -5.591719996403657e-179 < b < 1.1612125867005037e+127Initial program 30.5
rmApplied flip-+30.7
Simplified16.4
rmApplied clear-num16.6
Simplified15.6
Taylor expanded around 0 10.2
rmApplied add-cube-cbrt10.2
Applied times-frac10.0
Simplified9.9
Simplified9.9
if 1.1612125867005037e+127 < b Initial program 61.6
rmApplied flip-+61.6
Simplified35.4
rmApplied clear-num35.4
Simplified34.5
Taylor expanded around 0 34.1
Taylor expanded around inf 7.4
Final simplification8.9
herbie shell --seed 2020102
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a)))