Average Error: 28.7 → 0.4
Time: 19.3s
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{3 \cdot a}{3 \cdot a} \cdot \left(c \cdot \frac{1}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}\right)\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\frac{3 \cdot a}{3 \cdot a} \cdot \left(c \cdot \frac{1}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}\right)
double f(double a, double b, double c) {
        double r78526 = b;
        double r78527 = -r78526;
        double r78528 = r78526 * r78526;
        double r78529 = 3.0;
        double r78530 = a;
        double r78531 = r78529 * r78530;
        double r78532 = c;
        double r78533 = r78531 * r78532;
        double r78534 = r78528 - r78533;
        double r78535 = sqrt(r78534);
        double r78536 = r78527 + r78535;
        double r78537 = r78536 / r78531;
        return r78537;
}

double f(double a, double b, double c) {
        double r78538 = 3.0;
        double r78539 = a;
        double r78540 = r78538 * r78539;
        double r78541 = r78540 / r78540;
        double r78542 = c;
        double r78543 = 1.0;
        double r78544 = b;
        double r78545 = -r78544;
        double r78546 = r78544 * r78544;
        double r78547 = r78540 * r78542;
        double r78548 = r78546 - r78547;
        double r78549 = sqrt(r78548);
        double r78550 = r78545 - r78549;
        double r78551 = r78543 / r78550;
        double r78552 = r78542 * r78551;
        double r78553 = r78541 * r78552;
        return r78553;
}

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

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

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

    \[\leadsto \frac{\frac{\color{blue}{0 + c \cdot \left(3 \cdot a\right)}}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}{3 \cdot a}\]
  5. Using strategy rm
  6. Applied clear-num0.5

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

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

    \[\leadsto \frac{1}{\color{blue}{1 \cdot \frac{3 \cdot a}{\frac{\left(3 \cdot a\right) \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}}}\]
  10. Applied add-cube-cbrt0.5

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

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

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

    \[\leadsto 1 \cdot \color{blue}{\left(\frac{3 \cdot a}{3 \cdot a} \cdot \frac{c}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}\right)}\]
  14. Using strategy rm
  15. Applied div-inv0.4

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

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

Reproduce

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