Average Error: 28.5 → 0.5
Time: 5.5s
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{1 \cdot \left(a \cdot c\right)}{a} \cdot \frac{1}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\frac{1 \cdot \left(a \cdot c\right)}{a} \cdot \frac{1}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}
double f(double a, double b, double c) {
        double r95373 = b;
        double r95374 = -r95373;
        double r95375 = r95373 * r95373;
        double r95376 = 3.0;
        double r95377 = a;
        double r95378 = r95376 * r95377;
        double r95379 = c;
        double r95380 = r95378 * r95379;
        double r95381 = r95375 - r95380;
        double r95382 = sqrt(r95381);
        double r95383 = r95374 + r95382;
        double r95384 = r95383 / r95378;
        return r95384;
}

double f(double a, double b, double c) {
        double r95385 = 1.0;
        double r95386 = a;
        double r95387 = c;
        double r95388 = r95386 * r95387;
        double r95389 = r95385 * r95388;
        double r95390 = r95389 / r95386;
        double r95391 = b;
        double r95392 = -r95391;
        double r95393 = r95391 * r95391;
        double r95394 = 3.0;
        double r95395 = r95394 * r95386;
        double r95396 = r95395 * r95387;
        double r95397 = r95393 - r95396;
        double r95398 = sqrt(r95397);
        double r95399 = r95392 - r95398;
        double r95400 = r95385 / r95399;
        double r95401 = r95390 * r95400;
        return r95401;
}

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.5

    \[\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.5

    \[\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 *-un-lft-identity0.6

    \[\leadsto \frac{\frac{\left({b}^{2} - {b}^{2}\right) + 3 \cdot \left(a \cdot c\right)}{\color{blue}{1 \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)}}}{3 \cdot a}\]
  7. Applied *-un-lft-identity0.6

    \[\leadsto \frac{\frac{\color{blue}{1 \cdot \left(\left({b}^{2} - {b}^{2}\right) + 3 \cdot \left(a \cdot c\right)\right)}}{1 \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)}}{3 \cdot a}\]
  8. Applied times-frac0.6

    \[\leadsto \frac{\color{blue}{\frac{1}{1} \cdot \frac{\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}\]
  9. Applied times-frac0.6

    \[\leadsto \color{blue}{\frac{\frac{1}{1}}{3} \cdot \frac{\frac{\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}}}{a}}\]
  10. Simplified0.6

    \[\leadsto \color{blue}{\frac{1}{3}} \cdot \frac{\frac{\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}}}{a}\]
  11. Simplified0.6

    \[\leadsto \frac{1}{3} \cdot \color{blue}{\frac{\frac{3 \cdot \left(a \cdot c\right)}{a}}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}\]
  12. Using strategy rm
  13. Applied div-inv0.6

    \[\leadsto \frac{1}{3} \cdot \color{blue}{\left(\frac{3 \cdot \left(a \cdot c\right)}{a} \cdot \frac{1}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}\right)}\]
  14. Applied associate-*r*0.6

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

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

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

Reproduce

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