\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\begin{array}{l}
\mathbf{if}\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \le -9.4953561267927016 \cdot 10^{-5}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(b, b, -\left(b \cdot b - \left(3 \cdot a\right) \cdot c\right)\right)}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}{3 \cdot a}\\
\mathbf{elif}\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \le -2.96023529826703576 \cdot 10^{-5}:\\
\;\;\;\;\frac{\left(-1.5 \cdot \frac{a}{\sqrt{b}}\right) \cdot \frac{c}{\sqrt{b}}}{3 \cdot a}\\
\mathbf{elif}\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \le -9.1599124166711329 \cdot 10^{-7}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(b, b, -\left(b \cdot b - \left(3 \cdot a\right) \cdot c\right)\right)}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}{3 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b}\\
\end{array}double f(double a, double b, double c) {
double r89834 = b;
double r89835 = -r89834;
double r89836 = r89834 * r89834;
double r89837 = 3.0;
double r89838 = a;
double r89839 = r89837 * r89838;
double r89840 = c;
double r89841 = r89839 * r89840;
double r89842 = r89836 - r89841;
double r89843 = sqrt(r89842);
double r89844 = r89835 + r89843;
double r89845 = r89844 / r89839;
return r89845;
}
double f(double a, double b, double c) {
double r89846 = b;
double r89847 = -r89846;
double r89848 = r89846 * r89846;
double r89849 = 3.0;
double r89850 = a;
double r89851 = r89849 * r89850;
double r89852 = c;
double r89853 = r89851 * r89852;
double r89854 = r89848 - r89853;
double r89855 = sqrt(r89854);
double r89856 = r89847 + r89855;
double r89857 = r89856 / r89851;
double r89858 = -9.495356126792702e-05;
bool r89859 = r89857 <= r89858;
double r89860 = -r89854;
double r89861 = fma(r89846, r89846, r89860);
double r89862 = r89847 - r89855;
double r89863 = r89861 / r89862;
double r89864 = r89863 / r89851;
double r89865 = -2.9602352982670358e-05;
bool r89866 = r89857 <= r89865;
double r89867 = -1.5;
double r89868 = sqrt(r89846);
double r89869 = r89850 / r89868;
double r89870 = r89867 * r89869;
double r89871 = r89852 / r89868;
double r89872 = r89870 * r89871;
double r89873 = r89872 / r89851;
double r89874 = -9.159912416671133e-07;
bool r89875 = r89857 <= r89874;
double r89876 = -0.5;
double r89877 = r89852 / r89846;
double r89878 = r89876 * r89877;
double r89879 = r89875 ? r89864 : r89878;
double r89880 = r89866 ? r89873 : r89879;
double r89881 = r89859 ? r89864 : r89880;
return r89881;
}



Bits error versus a



Bits error versus b



Bits error versus c
if (/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)) < -9.495356126792702e-05 or -2.9602352982670358e-05 < (/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)) < -9.159912416671133e-07Initial program 17.8
rmApplied flip-+17.8
Simplified17.0
if -9.495356126792702e-05 < (/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)) < -2.9602352982670358e-05Initial program 22.6
Taylor expanded around inf 26.6
rmApplied add-sqr-sqrt26.6
Applied times-frac26.6
Applied associate-*r*26.6
if -9.159912416671133e-07 < (/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)) Initial program 42.4
Taylor expanded around inf 11.5
Final simplification15.0
herbie shell --seed 2020060 +o rules:numerics
(FPCore (a b c)
:name "Cubic critical, narrow range"
:precision binary64
:pre (and (< 1.0536712127723509e-08 a 94906265.62425156) (< 1.0536712127723509e-08 b 94906265.62425156) (< 1.0536712127723509e-08 c 94906265.62425156))
(/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a)))