Average Error: 52.3 → 6.3
Time: 16.8s
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 r1956492 = b;
        double r1956493 = -r1956492;
        double r1956494 = r1956492 * r1956492;
        double r1956495 = 3.0;
        double r1956496 = a;
        double r1956497 = r1956495 * r1956496;
        double r1956498 = c;
        double r1956499 = r1956497 * r1956498;
        double r1956500 = r1956494 - r1956499;
        double r1956501 = sqrt(r1956500);
        double r1956502 = r1956493 + r1956501;
        double r1956503 = r1956502 / r1956497;
        return r1956503;
}

double f(double __attribute__((unused)) a, double b, double c) {
        double r1956504 = c;
        double r1956505 = b;
        double r1956506 = r1956504 / r1956505;
        double r1956507 = -0.5;
        double r1956508 = r1956506 * r1956507;
        return r1956508;
}

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

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

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

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

Reproduce

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