Average Error: 53.0 → 5.9
Time: 19.9s
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(4 \cdot a\right) \cdot c}}{2 \cdot a}\]
\[\frac{\frac{c}{b} \cdot -2}{2}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\frac{\frac{c}{b} \cdot -2}{2}
double f(double a, double b, double c) {
        double r635977 = b;
        double r635978 = -r635977;
        double r635979 = r635977 * r635977;
        double r635980 = 4.0;
        double r635981 = a;
        double r635982 = r635980 * r635981;
        double r635983 = c;
        double r635984 = r635982 * r635983;
        double r635985 = r635979 - r635984;
        double r635986 = sqrt(r635985);
        double r635987 = r635978 + r635986;
        double r635988 = 2.0;
        double r635989 = r635988 * r635981;
        double r635990 = r635987 / r635989;
        return r635990;
}

double f(double __attribute__((unused)) a, double b, double c) {
        double r635991 = c;
        double r635992 = b;
        double r635993 = r635991 / r635992;
        double r635994 = -2.0;
        double r635995 = r635993 * r635994;
        double r635996 = 2.0;
        double r635997 = r635995 / r635996;
        return r635997;
}

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(4 \cdot a\right) \cdot c}}{2 \cdot a}\]
  2. Simplified53.0

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

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

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

Reproduce

herbie shell --seed 2019146 
(FPCore (a b c)
  :name "Quadratic roots, 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) (* (* 4 a) c)))) (* 2 a)))