Average Error: 52.6 → 6.2
Time: 18.7s
Precision: 64
\[4.93038 \cdot 10^{-32} \lt a \lt 2.02824 \cdot 10^{31} \land 4.93038 \cdot 10^{-32} \lt b \lt 2.02824 \cdot 10^{31} \land 4.93038 \cdot 10^{-32} \lt c \lt 2.02824 \cdot 10^{31}\]
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\]
\[-1 \cdot \frac{c}{b}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
-1 \cdot \frac{c}{b}
double f(double a, double b, double c) {
        double r19275 = b;
        double r19276 = -r19275;
        double r19277 = r19275 * r19275;
        double r19278 = 4.0;
        double r19279 = a;
        double r19280 = r19278 * r19279;
        double r19281 = c;
        double r19282 = r19280 * r19281;
        double r19283 = r19277 - r19282;
        double r19284 = sqrt(r19283);
        double r19285 = r19276 + r19284;
        double r19286 = 2.0;
        double r19287 = r19286 * r19279;
        double r19288 = r19285 / r19287;
        return r19288;
}

double f(double __attribute__((unused)) a, double b, double c) {
        double r19289 = -1.0;
        double r19290 = c;
        double r19291 = b;
        double r19292 = r19290 / r19291;
        double r19293 = r19289 * r19292;
        return r19293;
}

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

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

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

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

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

Reproduce

herbie shell --seed 2019195 +o rules:numerics
(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.0 a) c)))) (* 2.0 a)))