Average Error: 28.7 → 0.4
Time: 21.4s
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{\left(3 \cdot a\right) \cdot c}{-\left(\left(3 \cdot a\right) \cdot \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} + \left(3 \cdot a\right) \cdot b\right)}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\frac{\left(3 \cdot a\right) \cdot c}{-\left(\left(3 \cdot a\right) \cdot \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} + \left(3 \cdot a\right) \cdot b\right)}
double f(double a, double b, double c) {
        double r58904 = b;
        double r58905 = -r58904;
        double r58906 = r58904 * r58904;
        double r58907 = 3.0;
        double r58908 = a;
        double r58909 = r58907 * r58908;
        double r58910 = c;
        double r58911 = r58909 * r58910;
        double r58912 = r58906 - r58911;
        double r58913 = sqrt(r58912);
        double r58914 = r58905 + r58913;
        double r58915 = r58914 / r58909;
        return r58915;
}

double f(double a, double b, double c) {
        double r58916 = 3.0;
        double r58917 = a;
        double r58918 = r58916 * r58917;
        double r58919 = c;
        double r58920 = r58918 * r58919;
        double r58921 = b;
        double r58922 = r58921 * r58921;
        double r58923 = r58922 - r58920;
        double r58924 = sqrt(r58923);
        double r58925 = r58918 * r58924;
        double r58926 = r58918 * r58921;
        double r58927 = r58925 + r58926;
        double r58928 = -r58927;
        double r58929 = r58920 / r58928;
        return r58929;
}

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

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

    \[\leadsto \frac{\color{blue}{\left(0 + \left(3 \cdot a\right) \cdot c\right) \cdot \frac{1}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}}{3 \cdot a}\]
  7. Applied associate-/l*0.5

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

    \[\leadsto \frac{0 + \left(3 \cdot a\right) \cdot c}{\color{blue}{\left(3 \cdot a\right) \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)}}\]
  9. Using strategy rm
  10. Applied sub-neg0.4

    \[\leadsto \frac{0 + \left(3 \cdot a\right) \cdot c}{\left(3 \cdot a\right) \cdot \color{blue}{\left(\left(-b\right) + \left(-\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)\right)}}\]
  11. Applied distribute-lft-in0.4

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

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

Reproduce

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