Average Error: 52.3 → 6.4
Time: 56.6s
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{c}{b}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
-\frac{c}{b}
double f(double a, double b, double c) {
        double r5057848 = b;
        double r5057849 = -r5057848;
        double r5057850 = r5057848 * r5057848;
        double r5057851 = 4.0;
        double r5057852 = a;
        double r5057853 = r5057851 * r5057852;
        double r5057854 = c;
        double r5057855 = r5057853 * r5057854;
        double r5057856 = r5057850 - r5057855;
        double r5057857 = sqrt(r5057856);
        double r5057858 = r5057849 + r5057857;
        double r5057859 = 2.0;
        double r5057860 = r5057859 * r5057852;
        double r5057861 = r5057858 / r5057860;
        return r5057861;
}

double f(double __attribute__((unused)) a, double b, double c) {
        double r5057862 = c;
        double r5057863 = b;
        double r5057864 = r5057862 / r5057863;
        double r5057865 = -r5057864;
        return r5057865;
}

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

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

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

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

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

Reproduce

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