Average Error: 53.0 → 5.8
Time: 17.1s
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 r713887 = b;
        double r713888 = -r713887;
        double r713889 = r713887 * r713887;
        double r713890 = 4.0;
        double r713891 = a;
        double r713892 = r713890 * r713891;
        double r713893 = c;
        double r713894 = r713892 * r713893;
        double r713895 = r713889 - r713894;
        double r713896 = sqrt(r713895);
        double r713897 = r713888 + r713896;
        double r713898 = 2.0;
        double r713899 = r713898 * r713891;
        double r713900 = r713897 / r713899;
        return r713900;
}

double f(double __attribute__((unused)) a, double b, double c) {
        double r713901 = c;
        double r713902 = b;
        double r713903 = r713901 / r713902;
        double r713904 = -2.0;
        double r713905 = r713903 * r713904;
        double r713906 = 2.0;
        double r713907 = r713905 / r713906;
        return r713907;
}

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

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

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

Reproduce

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