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 r55766 = b;
        double r55767 = -r55766;
        double r55768 = r55766 * r55766;
        double r55769 = 3.0;
        double r55770 = a;
        double r55771 = r55769 * r55770;
        double r55772 = c;
        double r55773 = r55771 * r55772;
        double r55774 = r55768 - r55773;
        double r55775 = sqrt(r55774);
        double r55776 = r55767 + r55775;
        double r55777 = r55776 / r55771;
        return r55777;
}

double f(double a, double b, double c) {
        double r55778 = 3.0;
        double r55779 = a;
        double r55780 = r55778 * r55779;
        double r55781 = r55780 / r55780;
        double r55782 = c;
        double r55783 = 1.0;
        double r55784 = b;
        double r55785 = -r55784;
        double r55786 = r55784 * r55784;
        double r55787 = r55780 * r55782;
        double r55788 = r55786 - r55787;
        double r55789 = sqrt(r55788);
        double r55790 = r55785 - r55789;
        double r55791 = r55783 / r55790;
        double r55792 = r55782 * r55791;
        double r55793 = r55781 * r55792;
        return r55793;
}

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