Average Error: 52.2 → 6.4
Time: 39.0s
Precision: 64
\[4.930380657631324 \cdot 10^{-32} \lt a \lt 2.028240960365167 \cdot 10^{+31} \land 4.930380657631324 \cdot 10^{-32} \lt b \lt 2.028240960365167 \cdot 10^{+31} \land 4.930380657631324 \cdot 10^{-32} \lt c \lt 2.028240960365167 \cdot 10^{+31}\]
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
\[\frac{c}{b} \cdot \frac{-1}{2}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\frac{c}{b} \cdot \frac{-1}{2}
double f(double a, double b, double c) {
        double r3617458 = b;
        double r3617459 = -r3617458;
        double r3617460 = r3617458 * r3617458;
        double r3617461 = 3.0;
        double r3617462 = a;
        double r3617463 = r3617461 * r3617462;
        double r3617464 = c;
        double r3617465 = r3617463 * r3617464;
        double r3617466 = r3617460 - r3617465;
        double r3617467 = sqrt(r3617466);
        double r3617468 = r3617459 + r3617467;
        double r3617469 = r3617468 / r3617463;
        return r3617469;
}

double f(double __attribute__((unused)) a, double b, double c) {
        double r3617470 = c;
        double r3617471 = b;
        double r3617472 = r3617470 / r3617471;
        double r3617473 = -0.5;
        double r3617474 = r3617472 * r3617473;
        return r3617474;
}

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

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

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

    \[\leadsto \frac{c}{b} \cdot \frac{-1}{2}\]

Reproduce

herbie shell --seed 2019144 +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 a) c)))) (* 3 a)))