Average Error: 52.6 → 6.2
Time: 13.8s
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 r110143 = b;
        double r110144 = -r110143;
        double r110145 = r110143 * r110143;
        double r110146 = 3.0;
        double r110147 = a;
        double r110148 = r110146 * r110147;
        double r110149 = c;
        double r110150 = r110148 * r110149;
        double r110151 = r110145 - r110150;
        double r110152 = sqrt(r110151);
        double r110153 = r110144 + r110152;
        double r110154 = r110153 / r110148;
        return r110154;
}

double f(double __attribute__((unused)) a, double b, double c) {
        double r110155 = c;
        double r110156 = b;
        double r110157 = r110155 / r110156;
        double r110158 = -0.5;
        double r110159 = r110157 * r110158;
        return r110159;
}

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

    \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b}}\]
  3. Simplified6.2

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

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

Reproduce

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