Average Error: 28.9 → 0.5
Time: 6.0s
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{\frac{\frac{3 \cdot \left(a \cdot c\right)}{3}}{\left(-b\right) - \sqrt{\frac{{\left(b \cdot b\right)}^{3} - {\left(\left(3 \cdot a\right) \cdot c\right)}^{3}}{\left(\left(3 \cdot a\right) \cdot c\right) \cdot \left(\left(3 \cdot a\right) \cdot c + {b}^{2}\right) + \left(b \cdot b\right) \cdot \left(b \cdot b\right)}}}}{a}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\frac{\frac{\frac{3 \cdot \left(a \cdot c\right)}{3}}{\left(-b\right) - \sqrt{\frac{{\left(b \cdot b\right)}^{3} - {\left(\left(3 \cdot a\right) \cdot c\right)}^{3}}{\left(\left(3 \cdot a\right) \cdot c\right) \cdot \left(\left(3 \cdot a\right) \cdot c + {b}^{2}\right) + \left(b \cdot b\right) \cdot \left(b \cdot b\right)}}}}{a}
double f(double a, double b, double c) {
        double r94919 = b;
        double r94920 = -r94919;
        double r94921 = r94919 * r94919;
        double r94922 = 3.0;
        double r94923 = a;
        double r94924 = r94922 * r94923;
        double r94925 = c;
        double r94926 = r94924 * r94925;
        double r94927 = r94921 - r94926;
        double r94928 = sqrt(r94927);
        double r94929 = r94920 + r94928;
        double r94930 = r94929 / r94924;
        return r94930;
}

double f(double a, double b, double c) {
        double r94931 = 3.0;
        double r94932 = a;
        double r94933 = c;
        double r94934 = r94932 * r94933;
        double r94935 = r94931 * r94934;
        double r94936 = r94935 / r94931;
        double r94937 = b;
        double r94938 = -r94937;
        double r94939 = r94937 * r94937;
        double r94940 = 3.0;
        double r94941 = pow(r94939, r94940);
        double r94942 = r94931 * r94932;
        double r94943 = r94942 * r94933;
        double r94944 = pow(r94943, r94940);
        double r94945 = r94941 - r94944;
        double r94946 = 2.0;
        double r94947 = pow(r94937, r94946);
        double r94948 = r94943 + r94947;
        double r94949 = r94943 * r94948;
        double r94950 = r94939 * r94939;
        double r94951 = r94949 + r94950;
        double r94952 = r94945 / r94951;
        double r94953 = sqrt(r94952);
        double r94954 = r94938 - r94953;
        double r94955 = r94936 / r94954;
        double r94956 = r94955 / r94932;
        return r94956;
}

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

    \[\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-+29.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.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 flip3--0.5

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

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

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

Reproduce

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