Average Error: 28.6 → 0.6
Time: 11.6s
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{\frac{\frac{\left(3 \cdot a\right) \cdot c}{3}}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}{a}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\frac{\frac{\frac{\left(3 \cdot a\right) \cdot c}{3}}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}{a}
double f(double a, double b, double c) {
        double r95830 = b;
        double r95831 = -r95830;
        double r95832 = r95830 * r95830;
        double r95833 = 3.0;
        double r95834 = a;
        double r95835 = r95833 * r95834;
        double r95836 = c;
        double r95837 = r95835 * r95836;
        double r95838 = r95832 - r95837;
        double r95839 = sqrt(r95838);
        double r95840 = r95831 + r95839;
        double r95841 = r95840 / r95835;
        return r95841;
}

double f(double a, double b, double c) {
        double r95842 = 3.0;
        double r95843 = a;
        double r95844 = r95842 * r95843;
        double r95845 = c;
        double r95846 = r95844 * r95845;
        double r95847 = r95846 / r95842;
        double r95848 = b;
        double r95849 = -r95848;
        double r95850 = r95848 * r95848;
        double r95851 = r95850 - r95846;
        double r95852 = sqrt(r95851);
        double r95853 = r95849 - r95852;
        double r95854 = r95847 / r95853;
        double r95855 = r95854 / r95843;
        return r95855;
}

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 div-inv0.6

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

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

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

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

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

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

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

Reproduce

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