Average Error: 28.6 → 0.5
Time: 6.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{1 \cdot \left(a \cdot c\right)}{\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{1 \cdot \left(a \cdot c\right)}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}{a}
double f(double a, double b, double c) {
        double r143330 = b;
        double r143331 = -r143330;
        double r143332 = r143330 * r143330;
        double r143333 = 3.0;
        double r143334 = a;
        double r143335 = r143333 * r143334;
        double r143336 = c;
        double r143337 = r143335 * r143336;
        double r143338 = r143332 - r143337;
        double r143339 = sqrt(r143338);
        double r143340 = r143331 + r143339;
        double r143341 = r143340 / r143335;
        return r143341;
}

double f(double a, double b, double c) {
        double r143342 = 1.0;
        double r143343 = a;
        double r143344 = c;
        double r143345 = r143343 * r143344;
        double r143346 = r143342 * r143345;
        double r143347 = b;
        double r143348 = -r143347;
        double r143349 = r143347 * r143347;
        double r143350 = 3.0;
        double r143351 = r143350 * r143343;
        double r143352 = r143351 * r143344;
        double r143353 = r143349 - r143352;
        double r143354 = sqrt(r143353);
        double r143355 = r143348 - r143354;
        double r143356 = r143346 / r143355;
        double r143357 = r143356 / r143343;
        return r143357;
}

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}{\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. Taylor expanded around 0 0.5

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

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

Reproduce

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