Average Error: 44.0 → 0.3
Time: 19.9s
Precision: 64
\[1.1102230246251565404236316680908203125 \cdot 10^{-16} \lt a \lt 9007199254740992 \land 1.1102230246251565404236316680908203125 \cdot 10^{-16} \lt b \lt 9007199254740992 \land 1.1102230246251565404236316680908203125 \cdot 10^{-16} \lt c \lt 9007199254740992\]
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
\[\frac{\frac{c}{\left(-\sqrt{b \cdot b - a \cdot \left(3 \cdot c\right)}\right) - b} \cdot 3}{3}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\frac{\frac{c}{\left(-\sqrt{b \cdot b - a \cdot \left(3 \cdot c\right)}\right) - b} \cdot 3}{3}
double f(double a, double b, double c) {
        double r135839 = b;
        double r135840 = -r135839;
        double r135841 = r135839 * r135839;
        double r135842 = 3.0;
        double r135843 = a;
        double r135844 = r135842 * r135843;
        double r135845 = c;
        double r135846 = r135844 * r135845;
        double r135847 = r135841 - r135846;
        double r135848 = sqrt(r135847);
        double r135849 = r135840 + r135848;
        double r135850 = r135849 / r135844;
        return r135850;
}

double f(double a, double b, double c) {
        double r135851 = c;
        double r135852 = b;
        double r135853 = r135852 * r135852;
        double r135854 = a;
        double r135855 = 3.0;
        double r135856 = r135855 * r135851;
        double r135857 = r135854 * r135856;
        double r135858 = r135853 - r135857;
        double r135859 = sqrt(r135858);
        double r135860 = -r135859;
        double r135861 = r135860 - r135852;
        double r135862 = r135851 / r135861;
        double r135863 = r135862 * r135855;
        double r135864 = r135863 / r135855;
        return r135864;
}

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 44.0

    \[\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-+44.0

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto 3 \cdot \color{blue}{\frac{\frac{c}{-\left(\sqrt{b \cdot b - 3 \cdot \left(c \cdot a\right)} + b\right)} \cdot \frac{a}{3}}{a}}\]
  18. Using strategy rm
  19. Applied pow10.5

    \[\leadsto 3 \cdot \color{blue}{{\left(\frac{\frac{c}{-\left(\sqrt{b \cdot b - 3 \cdot \left(c \cdot a\right)} + b\right)} \cdot \frac{a}{3}}{a}\right)}^{1}}\]
  20. Applied pow10.5

    \[\leadsto \color{blue}{{3}^{1}} \cdot {\left(\frac{\frac{c}{-\left(\sqrt{b \cdot b - 3 \cdot \left(c \cdot a\right)} + b\right)} \cdot \frac{a}{3}}{a}\right)}^{1}\]
  21. Applied pow-prod-down0.5

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

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

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

Reproduce

herbie shell --seed 2019196 
(FPCore (a b c)
  :name "Cubic critical, medium range"
  :pre (and (< 1.1102230246251565e-16 a 9007199254740992.0) (< 1.1102230246251565e-16 b 9007199254740992.0) (< 1.1102230246251565e-16 c 9007199254740992.0))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))