Average Error: 28.9 → 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{\left({b}^{2} - {b}^{2}\right) + \left(3 \cdot a\right) \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(\sqrt[3]{\left(3 \cdot a\right) \cdot c} \cdot \sqrt[3]{\left(3 \cdot a\right) \cdot c}\right) \cdot \sqrt[3]{\left(3 \cdot a\right) \cdot c}}}}{3 \cdot a}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\frac{\frac{\left({b}^{2} - {b}^{2}\right) + \left(3 \cdot a\right) \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(\sqrt[3]{\left(3 \cdot a\right) \cdot c} \cdot \sqrt[3]{\left(3 \cdot a\right) \cdot c}\right) \cdot \sqrt[3]{\left(3 \cdot a\right) \cdot c}}}}{3 \cdot a}
double f(double a, double b, double c) {
        double r104101 = b;
        double r104102 = -r104101;
        double r104103 = r104101 * r104101;
        double r104104 = 3.0;
        double r104105 = a;
        double r104106 = r104104 * r104105;
        double r104107 = c;
        double r104108 = r104106 * r104107;
        double r104109 = r104103 - r104108;
        double r104110 = sqrt(r104109);
        double r104111 = r104102 + r104110;
        double r104112 = r104111 / r104106;
        return r104112;
}

double f(double a, double b, double c) {
        double r104113 = b;
        double r104114 = 2.0;
        double r104115 = pow(r104113, r104114);
        double r104116 = r104115 - r104115;
        double r104117 = 3.0;
        double r104118 = a;
        double r104119 = r104117 * r104118;
        double r104120 = c;
        double r104121 = r104119 * r104120;
        double r104122 = r104116 + r104121;
        double r104123 = -r104113;
        double r104124 = r104113 * r104113;
        double r104125 = cbrt(r104121);
        double r104126 = r104125 * r104125;
        double r104127 = r104126 * r104125;
        double r104128 = r104124 - r104127;
        double r104129 = sqrt(r104128);
        double r104130 = r104123 - r104129;
        double r104131 = r104122 / r104130;
        double r104132 = r104131 / r104119;
        return r104132;
}

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

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

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

    \[\leadsto \frac{\frac{\left({b}^{2} - {b}^{2}\right) + \color{blue}{\left(3 \cdot a\right) \cdot c}}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}{3 \cdot a}\]
  7. Using strategy rm
  8. Applied add-cube-cbrt0.5

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

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

Reproduce

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