Average Error: 52.6 → 6.1
Time: 1.2m
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}\]
\[-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 r14710 = b;
        double r14711 = -r14710;
        double r14712 = r14710 * r14710;
        double r14713 = 4.0;
        double r14714 = a;
        double r14715 = r14713 * r14714;
        double r14716 = c;
        double r14717 = r14715 * r14716;
        double r14718 = r14712 - r14717;
        double r14719 = sqrt(r14718);
        double r14720 = r14711 + r14719;
        double r14721 = 2.0;
        double r14722 = r14721 * r14714;
        double r14723 = r14720 / r14722;
        return r14723;
}

double f(double __attribute__((unused)) a, double b, double c) {
        double r14724 = -1.0;
        double r14725 = c;
        double r14726 = b;
        double r14727 = r14725 / r14726;
        double r14728 = r14724 * r14727;
        return r14728;
}

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

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

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

Reproduce

herbie shell --seed 2019202 
(FPCore (a b c)
  :name "Quadratic roots, wide range"
  :pre (and (< 4.93038e-32 a 2.02824e31) (< 4.93038e-32 b 2.02824e31) (< 4.93038e-32 c 2.02824e31))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 4 a) c)))) (* 2 a)))