Average Error: 52.7 → 6.1
Time: 16.9s
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 r3328487 = b;
        double r3328488 = -r3328487;
        double r3328489 = r3328487 * r3328487;
        double r3328490 = 3.0;
        double r3328491 = a;
        double r3328492 = r3328490 * r3328491;
        double r3328493 = c;
        double r3328494 = r3328492 * r3328493;
        double r3328495 = r3328489 - r3328494;
        double r3328496 = sqrt(r3328495);
        double r3328497 = r3328488 + r3328496;
        double r3328498 = r3328497 / r3328492;
        return r3328498;
}

double f(double __attribute__((unused)) a, double b, double c) {
        double r3328499 = c;
        double r3328500 = b;
        double r3328501 = r3328499 / r3328500;
        double r3328502 = -0.5;
        double r3328503 = r3328501 * r3328502;
        return r3328503;
}

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

    \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
  2. Simplified52.7

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

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

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

Reproduce

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