Average Error: 28.6 → 0.5
Time: 5.6s
Precision: 64
\[1.05367121277235087 \cdot 10^{-8} \lt a \lt 94906265.6242515594 \land 1.05367121277235087 \cdot 10^{-8} \lt b \lt 94906265.6242515594 \land 1.05367121277235087 \cdot 10^{-8} \lt c \lt 94906265.6242515594\]
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
\[\frac{\left({b}^{2} - {b}^{2}\right) + \left(3 \cdot a\right) \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}} \cdot \frac{1}{3 \cdot a}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\frac{\left({b}^{2} - {b}^{2}\right) + \left(3 \cdot a\right) \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}} \cdot \frac{1}{3 \cdot a}
double f(double a, double b, double c) {
        double r101402 = b;
        double r101403 = -r101402;
        double r101404 = r101402 * r101402;
        double r101405 = 3.0;
        double r101406 = a;
        double r101407 = r101405 * r101406;
        double r101408 = c;
        double r101409 = r101407 * r101408;
        double r101410 = r101404 - r101409;
        double r101411 = sqrt(r101410);
        double r101412 = r101403 + r101411;
        double r101413 = r101412 / r101407;
        return r101413;
}

double f(double a, double b, double c) {
        double r101414 = b;
        double r101415 = 2.0;
        double r101416 = pow(r101414, r101415);
        double r101417 = r101416 - r101416;
        double r101418 = 3.0;
        double r101419 = a;
        double r101420 = r101418 * r101419;
        double r101421 = c;
        double r101422 = r101420 * r101421;
        double r101423 = r101417 + r101422;
        double r101424 = -r101414;
        double r101425 = r101414 * r101414;
        double r101426 = r101425 - r101422;
        double r101427 = sqrt(r101426);
        double r101428 = r101424 - r101427;
        double r101429 = r101423 / r101428;
        double r101430 = 1.0;
        double r101431 = r101430 / r101420;
        double r101432 = r101429 * r101431;
        return r101432;
}

Error

Bits error versus a

Bits error versus b

Bits error versus c

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 28.6

    \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
  2. Using strategy rm
  3. Applied flip-+28.6

    \[\leadsto \frac{\color{blue}{\frac{\left(-b\right) \cdot \left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} \cdot \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}}{3 \cdot a}\]
  4. Simplified0.6

    \[\leadsto \frac{\frac{\color{blue}{\left({b}^{2} - {b}^{2}\right) + 3 \cdot \left(a \cdot c\right)}}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}{3 \cdot a}\]
  5. Using strategy rm
  6. Applied associate-*r*0.5

    \[\leadsto \frac{\frac{\left({b}^{2} - {b}^{2}\right) + \color{blue}{\left(3 \cdot a\right) \cdot c}}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}{3 \cdot a}\]
  7. Using strategy rm
  8. Applied div-inv0.5

    \[\leadsto \color{blue}{\frac{\left({b}^{2} - {b}^{2}\right) + \left(3 \cdot a\right) \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}} \cdot \frac{1}{3 \cdot a}}\]
  9. Final simplification0.5

    \[\leadsto \frac{\left({b}^{2} - {b}^{2}\right) + \left(3 \cdot a\right) \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}} \cdot \frac{1}{3 \cdot a}\]

Reproduce

herbie shell --seed 2020057 
(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)))