Average Error: 52.5 → 6.2
Time: 44.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 r3784170 = b;
        double r3784171 = -r3784170;
        double r3784172 = r3784170 * r3784170;
        double r3784173 = 4.0;
        double r3784174 = a;
        double r3784175 = r3784173 * r3784174;
        double r3784176 = c;
        double r3784177 = r3784175 * r3784176;
        double r3784178 = r3784172 - r3784177;
        double r3784179 = sqrt(r3784178);
        double r3784180 = r3784171 + r3784179;
        double r3784181 = 2.0;
        double r3784182 = r3784181 * r3784174;
        double r3784183 = r3784180 / r3784182;
        return r3784183;
}

double f(double __attribute__((unused)) a, double b, double c) {
        double r3784184 = c;
        double r3784185 = b;
        double r3784186 = r3784184 / r3784185;
        double r3784187 = -r3784186;
        return r3784187;
}

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

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

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

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

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

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

Reproduce

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