Average Error: 52.3 → 6.4
Time: 18.7s
Precision: 64
\[4.930380657631323783823303533017413935458 \cdot 10^{-32} \lt a \lt 20282409603651670423947251286016 \land 4.930380657631323783823303533017413935458 \cdot 10^{-32} \lt b \lt 20282409603651670423947251286016 \land 4.930380657631323783823303533017413935458 \cdot 10^{-32} \lt c \lt 20282409603651670423947251286016\]
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\]
\[\frac{c}{b} \cdot -1\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\frac{c}{b} \cdot -1
double f(double a, double b, double c) {
        double r949958 = b;
        double r949959 = -r949958;
        double r949960 = r949958 * r949958;
        double r949961 = 4.0;
        double r949962 = a;
        double r949963 = r949961 * r949962;
        double r949964 = c;
        double r949965 = r949963 * r949964;
        double r949966 = r949960 - r949965;
        double r949967 = sqrt(r949966);
        double r949968 = r949959 + r949967;
        double r949969 = 2.0;
        double r949970 = r949969 * r949962;
        double r949971 = r949968 / r949970;
        return r949971;
}

double f(double __attribute__((unused)) a, double b, double c) {
        double r949972 = c;
        double r949973 = b;
        double r949974 = r949972 / r949973;
        double r949975 = -1.0;
        double r949976 = r949974 * r949975;
        return r949976;
}

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{\frac{\sqrt{b \cdot b - 4 \cdot \left(c \cdot a\right)} - b}{2}}{a}}\]
  3. Taylor expanded around inf 6.4

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

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

Reproduce

herbie shell --seed 2019169 +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)))