Average Error: 52.5 → 6.2
Time: 23.6s
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 r835159 = b;
        double r835160 = -r835159;
        double r835161 = r835159 * r835159;
        double r835162 = 4.0;
        double r835163 = a;
        double r835164 = r835162 * r835163;
        double r835165 = c;
        double r835166 = r835164 * r835165;
        double r835167 = r835161 - r835166;
        double r835168 = sqrt(r835167);
        double r835169 = r835160 + r835168;
        double r835170 = 2.0;
        double r835171 = r835170 * r835163;
        double r835172 = r835169 / r835171;
        return r835172;
}

double f(double __attribute__((unused)) a, double b, double c) {
        double r835173 = c;
        double r835174 = b;
        double r835175 = r835173 / r835174;
        double r835176 = -1.0;
        double r835177 = r835175 * r835176;
        return r835177;
}

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

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

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

Reproduce

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