\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.718890754336214657908312726050790423755 \cdot 10^{100}:\\
\;\;\;\;\frac{-2 \cdot b}{3 \cdot a}\\
\mathbf{elif}\;b \le 2.915997880138567162583249308597050640656 \cdot 10^{-60}:\\
\;\;\;\;\frac{\sqrt{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} - b} \cdot \sqrt{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} - b}}{3 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1.5 \cdot \frac{a \cdot c}{b}}{3 \cdot a}\\
\end{array}double f(double a, double b, double c) {
double r87264 = b;
double r87265 = -r87264;
double r87266 = r87264 * r87264;
double r87267 = 3.0;
double r87268 = a;
double r87269 = r87267 * r87268;
double r87270 = c;
double r87271 = r87269 * r87270;
double r87272 = r87266 - r87271;
double r87273 = sqrt(r87272);
double r87274 = r87265 + r87273;
double r87275 = r87274 / r87269;
return r87275;
}
double f(double a, double b, double c) {
double r87276 = b;
double r87277 = -1.7188907543362147e+100;
bool r87278 = r87276 <= r87277;
double r87279 = -2.0;
double r87280 = r87279 * r87276;
double r87281 = 3.0;
double r87282 = a;
double r87283 = r87281 * r87282;
double r87284 = r87280 / r87283;
double r87285 = 2.915997880138567e-60;
bool r87286 = r87276 <= r87285;
double r87287 = r87276 * r87276;
double r87288 = c;
double r87289 = r87283 * r87288;
double r87290 = r87287 - r87289;
double r87291 = sqrt(r87290);
double r87292 = r87291 - r87276;
double r87293 = sqrt(r87292);
double r87294 = r87293 * r87293;
double r87295 = r87294 / r87283;
double r87296 = -1.5;
double r87297 = r87282 * r87288;
double r87298 = r87297 / r87276;
double r87299 = r87296 * r87298;
double r87300 = r87299 / r87283;
double r87301 = r87286 ? r87295 : r87300;
double r87302 = r87278 ? r87284 : r87301;
return r87302;
}



Bits error versus a



Bits error versus b



Bits error versus c
Results
if b < -1.7188907543362147e+100Initial program 47.1
Simplified47.1
rmApplied add-cube-cbrt47.2
Applied sqrt-prod47.2
Applied fma-neg47.2
Taylor expanded around -inf 4.1
Simplified4.1
if -1.7188907543362147e+100 < b < 2.915997880138567e-60Initial program 13.9
Simplified13.9
rmApplied add-sqr-sqrt14.3
if 2.915997880138567e-60 < b Initial program 53.9
Simplified53.9
Taylor expanded around inf 19.1
Final simplification14.6
herbie shell --seed 2019323 +o rules:numerics
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a)))