Average Error: 28.3 → 0.3
Time: 18.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{1 \cdot c}{\left(-b\right) - \sqrt{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{1 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}
double f(double a, double b, double c) {
        double r97604 = b;
        double r97605 = -r97604;
        double r97606 = r97604 * r97604;
        double r97607 = 3.0;
        double r97608 = a;
        double r97609 = r97607 * r97608;
        double r97610 = c;
        double r97611 = r97609 * r97610;
        double r97612 = r97606 - r97611;
        double r97613 = sqrt(r97612);
        double r97614 = r97605 + r97613;
        double r97615 = r97614 / r97609;
        return r97615;
}

double f(double a, double b, double c) {
        double r97616 = 1.0;
        double r97617 = c;
        double r97618 = r97616 * r97617;
        double r97619 = b;
        double r97620 = -r97619;
        double r97621 = r97619 * r97619;
        double r97622 = 3.0;
        double r97623 = a;
        double r97624 = r97622 * r97623;
        double r97625 = r97624 * r97617;
        double r97626 = r97621 - r97625;
        double r97627 = sqrt(r97626);
        double r97628 = r97620 - r97627;
        double r97629 = r97618 / r97628;
        return r97629;
}

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

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

    \[\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 frac-2neg0.6

    \[\leadsto \color{blue}{\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 \cdot a}}\]
  7. Simplified0.4

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

    \[\leadsto \frac{\frac{-\left(3 \cdot a\right) \cdot c}{\color{blue}{1 \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)}}}{-3 \cdot a}\]
  10. Applied distribute-rgt-neg-in0.4

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

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

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

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

Reproduce

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