Average Error: 28.6 → 0.4
Time: 17.8s
Precision: 64
\[1.053671212772350866701172186984739043147 \cdot 10^{-8} \lt a \lt 94906265.62425155937671661376953125 \land 1.053671212772350866701172186984739043147 \cdot 10^{-8} \lt b \lt 94906265.62425155937671661376953125 \land 1.053671212772350866701172186984739043147 \cdot 10^{-8} \lt c \lt 94906265.62425155937671661376953125\]
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
\[\frac{1}{\frac{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{c}}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\frac{1}{\frac{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{c}}
double f(double a, double b, double c) {
        double r70322 = b;
        double r70323 = -r70322;
        double r70324 = r70322 * r70322;
        double r70325 = 3.0;
        double r70326 = a;
        double r70327 = r70325 * r70326;
        double r70328 = c;
        double r70329 = r70327 * r70328;
        double r70330 = r70324 - r70329;
        double r70331 = sqrt(r70330);
        double r70332 = r70323 + r70331;
        double r70333 = r70332 / r70327;
        return r70333;
}

double f(double a, double b, double c) {
        double r70334 = 1.0;
        double r70335 = b;
        double r70336 = -r70335;
        double r70337 = r70335 * r70335;
        double r70338 = 3.0;
        double r70339 = a;
        double r70340 = r70338 * r70339;
        double r70341 = c;
        double r70342 = r70340 * r70341;
        double r70343 = r70337 - r70342;
        double r70344 = sqrt(r70343);
        double r70345 = r70336 - r70344;
        double r70346 = r70345 / r70341;
        double r70347 = r70334 / r70346;
        return r70347;
}

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}{0 + 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 clear-num0.6

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

    \[\leadsto \frac{\frac{1}{\color{blue}{\frac{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{\left(3 \cdot a\right) \cdot c}}}}{3 \cdot a}\]
  8. Using strategy rm
  9. Applied *-un-lft-identity0.5

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

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

    \[\leadsto \frac{\frac{\color{blue}{1 \cdot 1}}{\frac{1}{3 \cdot a} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{c}}}{3 \cdot a}\]
  12. Applied times-frac0.5

    \[\leadsto \frac{\color{blue}{\frac{1}{\frac{1}{3 \cdot a}} \cdot \frac{1}{\frac{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{c}}}}{3 \cdot a}\]
  13. Applied associate-/l*0.5

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

    \[\leadsto \frac{\frac{1}{\frac{1}{3 \cdot a}}}{\color{blue}{\frac{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{c} \cdot \left(3 \cdot a\right)}}\]
  15. Using strategy rm
  16. Applied clear-num0.5

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

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

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

Reproduce

herbie shell --seed 2019325 +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)))