Average Error: 28.6 → 0.3
Time: 17.5s
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{\left(3 \cdot a\right) \cdot c}{3 \cdot a}}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\frac{\frac{\left(3 \cdot a\right) \cdot c}{3 \cdot a}}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}
double f(double a, double b, double c) {
        double r72053 = b;
        double r72054 = -r72053;
        double r72055 = r72053 * r72053;
        double r72056 = 3.0;
        double r72057 = a;
        double r72058 = r72056 * r72057;
        double r72059 = c;
        double r72060 = r72058 * r72059;
        double r72061 = r72055 - r72060;
        double r72062 = sqrt(r72061);
        double r72063 = r72054 + r72062;
        double r72064 = r72063 / r72058;
        return r72064;
}

double f(double a, double b, double c) {
        double r72065 = 3.0;
        double r72066 = a;
        double r72067 = r72065 * r72066;
        double r72068 = c;
        double r72069 = r72067 * r72068;
        double r72070 = r72069 / r72067;
        double r72071 = b;
        double r72072 = -r72071;
        double r72073 = r72071 * r72071;
        double r72074 = r72073 - r72069;
        double r72075 = sqrt(r72074);
        double r72076 = r72072 - r72075;
        double r72077 = r72070 / r72076;
        return r72077;
}

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 \color{blue}{\frac{0 + 3 \cdot \left(a \cdot c\right)}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}} \cdot \frac{1}{3 \cdot a}}\]
  7. Using strategy rm
  8. Applied associate-*l/0.6

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

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

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

Reproduce

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