\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.540658906187422 \cdot 10^{-306}:\\
\;\;\;\;\frac{\frac{1}{3}}{a} \cdot \left(\sqrt{\mathsf{fma}\left(c, \left(-3 \cdot a\right), \left(b \cdot b\right)\right)} - b\right)\\
\mathbf{elif}\;b \le 1.1954432159183648 \cdot 10^{+151}:\\
\;\;\;\;\frac{-c}{b + \sqrt{\mathsf{fma}\left(c, \left(-3 \cdot a\right), \left(b \cdot b\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{1}{3}}{a} \cdot \mathsf{fma}\left(c, \left(-3 \cdot a\right), 0\right)}{b + b}\\
\end{array}double f(double a, double b, double c, double __attribute__((unused)) d) {
double r3950802 = b;
double r3950803 = -r3950802;
double r3950804 = r3950802 * r3950802;
double r3950805 = 3.0;
double r3950806 = a;
double r3950807 = r3950805 * r3950806;
double r3950808 = c;
double r3950809 = r3950807 * r3950808;
double r3950810 = r3950804 - r3950809;
double r3950811 = sqrt(r3950810);
double r3950812 = r3950803 + r3950811;
double r3950813 = r3950812 / r3950807;
return r3950813;
}
double f(double a, double b, double c, double __attribute__((unused)) d) {
double r3950814 = b;
double r3950815 = 3.540658906187422e-306;
bool r3950816 = r3950814 <= r3950815;
double r3950817 = 0.3333333333333333;
double r3950818 = a;
double r3950819 = r3950817 / r3950818;
double r3950820 = c;
double r3950821 = -3.0;
double r3950822 = r3950821 * r3950818;
double r3950823 = r3950814 * r3950814;
double r3950824 = fma(r3950820, r3950822, r3950823);
double r3950825 = sqrt(r3950824);
double r3950826 = r3950825 - r3950814;
double r3950827 = r3950819 * r3950826;
double r3950828 = 1.1954432159183648e+151;
bool r3950829 = r3950814 <= r3950828;
double r3950830 = -r3950820;
double r3950831 = r3950814 + r3950825;
double r3950832 = r3950830 / r3950831;
double r3950833 = 0.0;
double r3950834 = fma(r3950820, r3950822, r3950833);
double r3950835 = r3950819 * r3950834;
double r3950836 = r3950814 + r3950814;
double r3950837 = r3950835 / r3950836;
double r3950838 = r3950829 ? r3950832 : r3950837;
double r3950839 = r3950816 ? r3950827 : r3950838;
return r3950839;
}



Bits error versus a



Bits error versus b



Bits error versus c



Bits error versus d
if b < 3.540658906187422e-306Initial program 20.9
Simplified20.9
rmApplied div-inv20.9
Simplified21.0
rmApplied div-inv21.1
Taylor expanded around inf 21.0
if 3.540658906187422e-306 < b < 1.1954432159183648e+151Initial program 34.7
Simplified34.7
rmApplied div-inv34.7
Simplified34.7
rmApplied div-inv34.8
rmApplied flip--34.8
Applied associate-*l/34.9
Simplified14.9
Taylor expanded around 0 8.5
Simplified8.5
if 1.1954432159183648e+151 < b Initial program 62.5
Simplified62.6
rmApplied div-inv62.6
Simplified62.6
rmApplied div-inv62.6
rmApplied flip--62.6
Applied associate-*l/62.6
Simplified38.0
Taylor expanded around 0 6.9
Final simplification13.8
herbie shell --seed 2019133 +o rules:numerics
(FPCore (a b c d)
:name "Cubic critical"
(/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a)))