Average Error: 44.4 → 0.4
Time: 5.5s
Precision: 64
\[1.11022 \cdot 10^{-16} \lt a \lt 9.0072 \cdot 10^{15} \land 1.11022 \cdot 10^{-16} \lt b \lt 9.0072 \cdot 10^{15} \land 1.11022 \cdot 10^{-16} \lt c \lt 9.0072 \cdot 10^{15}\]
\[\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(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(3 \cdot a\right) \cdot c}}}{3 \cdot a}
double f(double a, double b, double c) {
        double r90777 = b;
        double r90778 = -r90777;
        double r90779 = r90777 * r90777;
        double r90780 = 3.0;
        double r90781 = a;
        double r90782 = r90780 * r90781;
        double r90783 = c;
        double r90784 = r90782 * r90783;
        double r90785 = r90779 - r90784;
        double r90786 = sqrt(r90785);
        double r90787 = r90778 + r90786;
        double r90788 = r90787 / r90782;
        return r90788;
}

double f(double a, double b, double c) {
        double r90789 = b;
        double r90790 = 2.0;
        double r90791 = pow(r90789, r90790);
        double r90792 = r90791 - r90791;
        double r90793 = 3.0;
        double r90794 = a;
        double r90795 = r90793 * r90794;
        double r90796 = c;
        double r90797 = r90795 * r90796;
        double r90798 = r90792 + r90797;
        double r90799 = -r90789;
        double r90800 = r90789 * r90789;
        double r90801 = r90800 - r90797;
        double r90802 = sqrt(r90801);
        double r90803 = r90799 - r90802;
        double r90804 = r90798 / r90803;
        double r90805 = r90804 / r90795;
        return r90805;
}

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

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

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

Reproduce

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