\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 -9.5975400610846271 \cdot 10^{115}:\\
\;\;\;\;0.5 \cdot \frac{c}{b} - 0.66666666666666663 \cdot \frac{b}{a}\\
\mathbf{elif}\;b \le 1.3424876507599846 \cdot 10^{-93}:\\
\;\;\;\;\frac{\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{a}}{3}\\
\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 <= -9.597540061084627e+115)) {
VAR = ((0.5 * (c / b)) - (0.6666666666666666 * (b / a)));
} else {
double VAR_1;
if ((b <= 1.3424876507599846e-93)) {
VAR_1 = (((-b + sqrt(((b * b) - ((3.0 * a) * c)))) / a) / 3.0);
} else {
VAR_1 = (-0.5 * (c / b));
}
VAR = VAR_1;
}
return VAR;
}



Bits error versus a



Bits error versus b



Bits error versus c
Results
if b < -9.597540061084627e+115Initial program 48.8
Taylor expanded around -inf 3.6
if -9.597540061084627e+115 < b < 1.3424876507599846e-93Initial program 12.6
rmApplied *-un-lft-identity12.6
Applied times-frac12.7
rmApplied associate-*l/12.7
Simplified12.7
if 1.3424876507599846e-93 < b Initial program 52.1
Taylor expanded around inf 10.4
Final simplification10.4
herbie shell --seed 2020100
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a)))