\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 r80233 = b;
double r80234 = -r80233;
double r80235 = r80233 * r80233;
double r80236 = 3.0;
double r80237 = a;
double r80238 = r80236 * r80237;
double r80239 = c;
double r80240 = r80238 * r80239;
double r80241 = r80235 - r80240;
double r80242 = sqrt(r80241);
double r80243 = r80234 + r80242;
double r80244 = r80243 / r80238;
return r80244;
}
double f(double a, double b, double c) {
double r80245 = b;
double r80246 = -1.7188907543362147e+100;
bool r80247 = r80245 <= r80246;
double r80248 = -2.0;
double r80249 = r80248 * r80245;
double r80250 = 3.0;
double r80251 = a;
double r80252 = r80250 * r80251;
double r80253 = r80249 / r80252;
double r80254 = 2.915997880138567e-60;
bool r80255 = r80245 <= r80254;
double r80256 = r80245 * r80245;
double r80257 = c;
double r80258 = r80252 * r80257;
double r80259 = r80256 - r80258;
double r80260 = sqrt(r80259);
double r80261 = r80260 - r80245;
double r80262 = sqrt(r80261);
double r80263 = r80262 * r80262;
double r80264 = r80263 / r80252;
double r80265 = -1.5;
double r80266 = r80251 * r80257;
double r80267 = r80266 / r80245;
double r80268 = r80265 * r80267;
double r80269 = r80268 / r80252;
double r80270 = r80255 ? r80264 : r80269;
double r80271 = r80247 ? r80253 : r80270;
return r80271;
}



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)))