Average Error: 52.8 → 6.1
Time: 57.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(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 r5058200 = b;
        double r5058201 = -r5058200;
        double r5058202 = r5058200 * r5058200;
        double r5058203 = 4.0;
        double r5058204 = a;
        double r5058205 = r5058203 * r5058204;
        double r5058206 = c;
        double r5058207 = r5058205 * r5058206;
        double r5058208 = r5058202 - r5058207;
        double r5058209 = sqrt(r5058208);
        double r5058210 = r5058201 + r5058209;
        double r5058211 = 2.0;
        double r5058212 = r5058211 * r5058204;
        double r5058213 = r5058210 / r5058212;
        return r5058213;
}

double f(double __attribute__((unused)) a, double b, double c) {
        double r5058214 = c;
        double r5058215 = b;
        double r5058216 = r5058214 / r5058215;
        double r5058217 = -r5058216;
        return r5058217;
}

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

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

    \[\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.1

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

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

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

Reproduce

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