Average Error: 28.7 → 0.5
Time: 7.8s
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}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}} \cdot \frac{\frac{3 \cdot \left(a \cdot c\right)}{3}}{a}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\frac{1}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}} \cdot \frac{\frac{3 \cdot \left(a \cdot c\right)}{3}}{a}
double f(double a, double b, double c) {
        double r114895 = b;
        double r114896 = -r114895;
        double r114897 = r114895 * r114895;
        double r114898 = 3.0;
        double r114899 = a;
        double r114900 = r114898 * r114899;
        double r114901 = c;
        double r114902 = r114900 * r114901;
        double r114903 = r114897 - r114902;
        double r114904 = sqrt(r114903);
        double r114905 = r114896 + r114904;
        double r114906 = r114905 / r114900;
        return r114906;
}

double f(double a, double b, double c) {
        double r114907 = 1.0;
        double r114908 = b;
        double r114909 = -r114908;
        double r114910 = r114908 * r114908;
        double r114911 = 3.0;
        double r114912 = a;
        double r114913 = r114911 * r114912;
        double r114914 = c;
        double r114915 = r114913 * r114914;
        double r114916 = r114910 - r114915;
        double r114917 = sqrt(r114916);
        double r114918 = r114909 - r114917;
        double r114919 = r114907 / r114918;
        double r114920 = r114912 * r114914;
        double r114921 = r114911 * r114920;
        double r114922 = r114921 / r114911;
        double r114923 = r114922 / r114912;
        double r114924 = r114919 * r114923;
        return r114924;
}

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

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

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

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

    \[\leadsto \frac{\color{blue}{\frac{\frac{3 \cdot \left(a \cdot c\right)}{3}}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}}{a}\]
  8. Using strategy rm
  9. 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}}{\frac{3 \cdot \left(a \cdot c\right)}{3}}}}}{a}\]
  10. Using strategy rm
  11. Applied *-un-lft-identity0.6

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

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

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

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

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

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

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

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

Reproduce

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