Average Error: 29.1 → 0.3
Time: 17.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{c}{\left(-b\right) - \sqrt{\frac{\left(-\left(\left(3 \cdot a\right) \cdot c\right) \cdot \left(\left(3 \cdot a\right) \cdot c\right)\right) + {b}^{4}}{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{c}{\left(-b\right) - \sqrt{\frac{\left(-\left(\left(3 \cdot a\right) \cdot c\right) \cdot \left(\left(3 \cdot a\right) \cdot c\right)\right) + {b}^{4}}{b \cdot b + \left(3 \cdot a\right) \cdot c}}}
double f(double a, double b, double c) {
        double r64299 = b;
        double r64300 = -r64299;
        double r64301 = r64299 * r64299;
        double r64302 = 3.0;
        double r64303 = a;
        double r64304 = r64302 * r64303;
        double r64305 = c;
        double r64306 = r64304 * r64305;
        double r64307 = r64301 - r64306;
        double r64308 = sqrt(r64307);
        double r64309 = r64300 + r64308;
        double r64310 = r64309 / r64304;
        return r64310;
}

double f(double a, double b, double c) {
        double r64311 = c;
        double r64312 = b;
        double r64313 = -r64312;
        double r64314 = 3.0;
        double r64315 = a;
        double r64316 = r64314 * r64315;
        double r64317 = r64316 * r64311;
        double r64318 = r64317 * r64317;
        double r64319 = -r64318;
        double r64320 = 4.0;
        double r64321 = pow(r64312, r64320);
        double r64322 = r64319 + r64321;
        double r64323 = r64312 * r64312;
        double r64324 = r64323 + r64317;
        double r64325 = r64322 / r64324;
        double r64326 = sqrt(r64325);
        double r64327 = r64313 - r64326;
        double r64328 = r64311 / r64327;
        return r64328;
}

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 29.1

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

    \[\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 flip--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) \cdot \left(b \cdot b\right) - \left(\left(3 \cdot a\right) \cdot c\right) \cdot \left(\left(3 \cdot a\right) \cdot c\right)}{b \cdot b + \left(3 \cdot a\right) \cdot c}}}}}{a}\]
  10. Simplified0.5

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

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

Reproduce

herbie shell --seed 2019298 
(FPCore (a b c)
  :name "Cubic critical, narrow range"
  :precision binary64
  :pre (and (< 1.05367121277235087e-8 a 94906265.6242515594) (< 1.05367121277235087e-8 b 94906265.6242515594) (< 1.05367121277235087e-8 c 94906265.6242515594))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a)))