Average Error: 44.1 → 0.4
Time: 16.7s
Precision: 64
\[1.1102230246251565404236316680908203125 \cdot 10^{-16} \lt a \lt 9007199254740992 \land 1.1102230246251565404236316680908203125 \cdot 10^{-16} \lt b \lt 9007199254740992 \land 1.1102230246251565404236316680908203125 \cdot 10^{-16} \lt c \lt 9007199254740992\]
\[\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(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right) \cdot \left(3 \cdot a\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(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right) \cdot \left(3 \cdot a\right)}
double f(double a, double b, double c) {
        double r73669 = b;
        double r73670 = -r73669;
        double r73671 = r73669 * r73669;
        double r73672 = 3.0;
        double r73673 = a;
        double r73674 = r73672 * r73673;
        double r73675 = c;
        double r73676 = r73674 * r73675;
        double r73677 = r73671 - r73676;
        double r73678 = sqrt(r73677);
        double r73679 = r73670 + r73678;
        double r73680 = r73679 / r73674;
        return r73680;
}

double f(double a, double b, double c) {
        double r73681 = 3.0;
        double r73682 = a;
        double r73683 = r73681 * r73682;
        double r73684 = c;
        double r73685 = r73683 * r73684;
        double r73686 = b;
        double r73687 = -r73686;
        double r73688 = r73686 * r73686;
        double r73689 = r73688 - r73685;
        double r73690 = sqrt(r73689);
        double r73691 = r73687 - r73690;
        double r73692 = r73691 * r73683;
        double r73693 = r73685 / r73692;
        return r73693;
}

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 44.1

    \[\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-+44.1

    \[\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 + 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 div-inv0.6

    \[\leadsto \frac{\color{blue}{\left(0 + 3 \cdot \left(a \cdot c\right)\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.6

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

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

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

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

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

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

Reproduce

herbie shell --seed 2019326 +o rules:numerics
(FPCore (a b c)
  :name "Cubic critical, medium range"
  :precision binary64
  :pre (and (< 1.11022e-16 a 9.0072e+15) (< 1.11022e-16 b 9.0072e+15) (< 1.11022e-16 c 9.0072e+15))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a)))