\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 r88281 = b;
double r88282 = -r88281;
double r88283 = r88281 * r88281;
double r88284 = 3.0;
double r88285 = a;
double r88286 = r88284 * r88285;
double r88287 = c;
double r88288 = r88286 * r88287;
double r88289 = r88283 - r88288;
double r88290 = sqrt(r88289);
double r88291 = r88282 + r88290;
double r88292 = r88291 / r88286;
return r88292;
}
double f(double a, double b, double c) {
double r88293 = b;
double r88294 = -r88293;
double r88295 = r88293 * r88293;
double r88296 = 3.0;
double r88297 = a;
double r88298 = r88296 * r88297;
double r88299 = c;
double r88300 = r88298 * r88299;
double r88301 = r88295 - r88300;
double r88302 = sqrt(r88301);
double r88303 = r88294 + r88302;
double r88304 = r88303 / r88298;
double r88305 = -9.495356126792702e-05;
bool r88306 = r88304 <= r88305;
double r88307 = -r88301;
double r88308 = fma(r88293, r88293, r88307);
double r88309 = r88294 - r88302;
double r88310 = r88308 / r88309;
double r88311 = r88310 / r88298;
double r88312 = -2.9602352982670358e-05;
bool r88313 = r88304 <= r88312;
double r88314 = -1.5;
double r88315 = sqrt(r88293);
double r88316 = r88297 / r88315;
double r88317 = r88314 * r88316;
double r88318 = r88299 / r88315;
double r88319 = r88317 * r88318;
double r88320 = r88319 / r88298;
double r88321 = -9.159912416671133e-07;
bool r88322 = r88304 <= r88321;
double r88323 = -0.5;
double r88324 = r88299 / r88293;
double r88325 = r88323 * r88324;
double r88326 = r88322 ? r88311 : r88325;
double r88327 = r88313 ? r88320 : r88326;
double r88328 = r88306 ? r88311 : r88327;
return r88328;
}



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