Average Error: 43.6 → 0.4
Time: 6.9s
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{1 \cdot \left(a \cdot c\right)}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}{a}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\frac{\frac{1 \cdot \left(a \cdot c\right)}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}{a}
double f(double a, double b, double c) {
        double r119711 = b;
        double r119712 = -r119711;
        double r119713 = r119711 * r119711;
        double r119714 = 3.0;
        double r119715 = a;
        double r119716 = r119714 * r119715;
        double r119717 = c;
        double r119718 = r119716 * r119717;
        double r119719 = r119713 - r119718;
        double r119720 = sqrt(r119719);
        double r119721 = r119712 + r119720;
        double r119722 = r119721 / r119716;
        return r119722;
}

double f(double a, double b, double c) {
        double r119723 = 1.0;
        double r119724 = a;
        double r119725 = c;
        double r119726 = r119724 * r119725;
        double r119727 = r119723 * r119726;
        double r119728 = b;
        double r119729 = -r119728;
        double r119730 = r119728 * r119728;
        double r119731 = 3.0;
        double r119732 = r119731 * r119724;
        double r119733 = r119732 * r119725;
        double r119734 = r119730 - r119733;
        double r119735 = sqrt(r119734);
        double r119736 = r119729 - r119735;
        double r119737 = r119727 / r119736;
        double r119738 = r119737 / r119724;
        return r119738;
}

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 43.6

    \[\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-+43.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}{\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.5

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

    \[\leadsto \frac{\color{blue}{\frac{\frac{3 \cdot \left(a \cdot c\right)}{3}}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}}{a}\]
  8. Taylor expanded around 0 0.4

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

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

Reproduce

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