Average Error: 53.0 → 5.9
Time: 32.2s
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 r3631876 = b;
        double r3631877 = -r3631876;
        double r3631878 = r3631876 * r3631876;
        double r3631879 = 3.0;
        double r3631880 = a;
        double r3631881 = r3631879 * r3631880;
        double r3631882 = c;
        double r3631883 = r3631881 * r3631882;
        double r3631884 = r3631878 - r3631883;
        double r3631885 = sqrt(r3631884);
        double r3631886 = r3631877 + r3631885;
        double r3631887 = r3631886 / r3631881;
        return r3631887;
}

double f(double __attribute__((unused)) a, double b, double c) {
        double r3631888 = c;
        double r3631889 = b;
        double r3631890 = r3631888 / r3631889;
        double r3631891 = -0.5;
        double r3631892 = r3631890 * r3631891;
        return r3631892;
}

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 53.0

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

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

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

Reproduce

herbie shell --seed 2019168 +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)))