\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 -3.24871045842543306174489604165780381049 \cdot 10^{105}:\\
\;\;\;\;\frac{\mathsf{fma}\left(1.5 \cdot \frac{a}{b}, c, -2 \cdot b\right)}{3 \cdot a}\\
\mathbf{elif}\;b \le 1.206156884192515644391499516147333317583 \cdot 10^{-138}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt[3]{b} \cdot \sqrt[3]{b}, -\sqrt[3]{b}, \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)}{3 \cdot a}\\
\mathbf{elif}\;b \le 8.327899021808038017686023791133232588729 \cdot 10^{148}:\\
\;\;\;\;\frac{\frac{3 \cdot \left(a \cdot c\right) + 0}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}{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 r104468 = b;
double r104469 = -r104468;
double r104470 = r104468 * r104468;
double r104471 = 3.0;
double r104472 = a;
double r104473 = r104471 * r104472;
double r104474 = c;
double r104475 = r104473 * r104474;
double r104476 = r104470 - r104475;
double r104477 = sqrt(r104476);
double r104478 = r104469 + r104477;
double r104479 = r104478 / r104473;
return r104479;
}
double f(double a, double b, double c) {
double r104480 = b;
double r104481 = -3.248710458425433e+105;
bool r104482 = r104480 <= r104481;
double r104483 = 1.5;
double r104484 = a;
double r104485 = r104484 / r104480;
double r104486 = r104483 * r104485;
double r104487 = c;
double r104488 = -2.0;
double r104489 = r104488 * r104480;
double r104490 = fma(r104486, r104487, r104489);
double r104491 = 3.0;
double r104492 = r104491 * r104484;
double r104493 = r104490 / r104492;
double r104494 = 1.2061568841925156e-138;
bool r104495 = r104480 <= r104494;
double r104496 = cbrt(r104480);
double r104497 = r104496 * r104496;
double r104498 = -r104496;
double r104499 = r104480 * r104480;
double r104500 = r104492 * r104487;
double r104501 = r104499 - r104500;
double r104502 = sqrt(r104501);
double r104503 = fma(r104497, r104498, r104502);
double r104504 = r104503 / r104492;
double r104505 = 8.327899021808038e+148;
bool r104506 = r104480 <= r104505;
double r104507 = r104484 * r104487;
double r104508 = r104491 * r104507;
double r104509 = 0.0;
double r104510 = r104508 + r104509;
double r104511 = -r104480;
double r104512 = r104511 - r104502;
double r104513 = r104510 / r104512;
double r104514 = r104513 / r104492;
double r104515 = -1.5;
double r104516 = r104507 / r104480;
double r104517 = r104515 * r104516;
double r104518 = r104517 / r104492;
double r104519 = r104506 ? r104514 : r104518;
double r104520 = r104495 ? r104504 : r104519;
double r104521 = r104482 ? r104493 : r104520;
return r104521;
}



Bits error versus a



Bits error versus b



Bits error versus c
if b < -3.248710458425433e+105Initial program 48.6
rmApplied add-cube-cbrt48.7
Applied distribute-rgt-neg-in48.7
Applied fma-def48.7
Taylor expanded around -inf 11.1
Simplified4.3
if -3.248710458425433e+105 < b < 1.2061568841925156e-138Initial program 11.9
rmApplied add-cube-cbrt12.1
Applied distribute-rgt-neg-in12.1
Applied fma-def12.1
if 1.2061568841925156e-138 < b < 8.327899021808038e+148Initial program 41.2
rmApplied add-exp-log42.6
rmApplied flip-+42.6
Applied log-div64.0
Applied exp-diff64.0
Simplified64.0
Simplified15.7
if 8.327899021808038e+148 < b Initial program 63.3
Taylor expanded around inf 14.1
Final simplification12.2
herbie shell --seed 2019353 +o rules:numerics
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a)))