Average Error: 52.9 → 5.9
Time: 35.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 r920672 = b;
        double r920673 = -r920672;
        double r920674 = r920672 * r920672;
        double r920675 = 4.0;
        double r920676 = a;
        double r920677 = r920675 * r920676;
        double r920678 = c;
        double r920679 = r920677 * r920678;
        double r920680 = r920674 - r920679;
        double r920681 = sqrt(r920680);
        double r920682 = r920673 + r920681;
        double r920683 = 2.0;
        double r920684 = r920683 * r920676;
        double r920685 = r920682 / r920684;
        return r920685;
}

double f(double __attribute__((unused)) a, double b, double c) {
        double r920686 = c;
        double r920687 = b;
        double r920688 = r920686 / r920687;
        double r920689 = -1.0;
        double r920690 = r920688 * r920689;
        return r920690;
}

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

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

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

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

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

Reproduce

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