Average Error: 52.6 → 6.1
Time: 20.0s
Precision: 64
\[4.930380657631323783823303533017413935458 \cdot 10^{-32} \lt a \lt 20282409603651670423947251286016 \land 4.930380657631323783823303533017413935458 \cdot 10^{-32} \lt b \lt 20282409603651670423947251286016 \land 4.930380657631323783823303533017413935458 \cdot 10^{-32} \lt c \lt 20282409603651670423947251286016\]
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
\[\frac{c}{b} \cdot -0.5\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\frac{c}{b} \cdot -0.5
double f(double a, double b, double c) {
        double r3205666 = b;
        double r3205667 = -r3205666;
        double r3205668 = r3205666 * r3205666;
        double r3205669 = 3.0;
        double r3205670 = a;
        double r3205671 = r3205669 * r3205670;
        double r3205672 = c;
        double r3205673 = r3205671 * r3205672;
        double r3205674 = r3205668 - r3205673;
        double r3205675 = sqrt(r3205674);
        double r3205676 = r3205667 + r3205675;
        double r3205677 = r3205676 / r3205671;
        return r3205677;
}

double f(double __attribute__((unused)) a, double b, double c) {
        double r3205678 = c;
        double r3205679 = b;
        double r3205680 = r3205678 / r3205679;
        double r3205681 = -0.5;
        double r3205682 = r3205680 * r3205681;
        return r3205682;
}

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 52.6

    \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
  2. Taylor expanded around inf 6.1

    \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b}}\]
  3. Final simplification6.1

    \[\leadsto \frac{c}{b} \cdot -0.5\]

Reproduce

herbie shell --seed 2019174 +o rules:numerics
(FPCore (a b c)
  :name "Cubic critical, wide range"
  :pre (and (< 4.930380657631324e-32 a 2.028240960365167e+31) (< 4.930380657631324e-32 b 2.028240960365167e+31) (< 4.930380657631324e-32 c 2.028240960365167e+31))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))