\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{1.5 \cdot \frac{a \cdot c}{b} - 2 \cdot b}{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 r104589 = b;
double r104590 = -r104589;
double r104591 = r104589 * r104589;
double r104592 = 3.0;
double r104593 = a;
double r104594 = r104592 * r104593;
double r104595 = c;
double r104596 = r104594 * r104595;
double r104597 = r104591 - r104596;
double r104598 = sqrt(r104597);
double r104599 = r104590 + r104598;
double r104600 = r104599 / r104594;
return r104600;
}
double f(double a, double b, double c) {
double r104601 = b;
double r104602 = -3.248710458425433e+105;
bool r104603 = r104601 <= r104602;
double r104604 = 1.5;
double r104605 = a;
double r104606 = c;
double r104607 = r104605 * r104606;
double r104608 = r104607 / r104601;
double r104609 = r104604 * r104608;
double r104610 = 2.0;
double r104611 = r104610 * r104601;
double r104612 = r104609 - r104611;
double r104613 = 3.0;
double r104614 = r104613 * r104605;
double r104615 = r104612 / r104614;
double r104616 = 1.2061568841925156e-138;
bool r104617 = r104601 <= r104616;
double r104618 = -r104601;
double r104619 = cbrt(r104618);
double r104620 = r104619 * r104619;
double r104621 = r104601 * r104601;
double r104622 = r104614 * r104606;
double r104623 = r104621 - r104622;
double r104624 = sqrt(r104623);
double r104625 = fma(r104620, r104619, r104624);
double r104626 = r104625 / r104614;
double r104627 = 8.327899021808038e+148;
bool r104628 = r104601 <= r104627;
double r104629 = r104613 * r104607;
double r104630 = 0.0;
double r104631 = r104629 + r104630;
double r104632 = r104618 - r104624;
double r104633 = r104631 / r104632;
double r104634 = r104633 / r104614;
double r104635 = -1.5;
double r104636 = r104635 * r104608;
double r104637 = r104636 / r104614;
double r104638 = r104628 ? r104634 : r104637;
double r104639 = r104617 ? r104626 : r104638;
double r104640 = r104603 ? r104615 : r104639;
return r104640;
}



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 fma-def48.7
Taylor expanded around -inf 11.1
if -3.248710458425433e+105 < b < 1.2061568841925156e-138Initial program 11.9
rmApplied add-cube-cbrt12.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
rmApplied add-exp-log63.3
Taylor expanded around inf 14.1
Final simplification13.3
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)))