Average Error: 52.7 → 6.1
Time: 40.8s
Precision: 64
\[4.930380657631324 \cdot 10^{-32} \lt a \lt 2.028240960365167 \cdot 10^{+31} \land 4.930380657631324 \cdot 10^{-32} \lt b \lt 2.028240960365167 \cdot 10^{+31} \land 4.930380657631324 \cdot 10^{-32} \lt c \lt 2.028240960365167 \cdot 10^{+31}\]
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4.0 \cdot a\right) \cdot c}}{2.0 \cdot a}\]
\[\frac{\frac{c}{b} \cdot -2.0}{2.0}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4.0 \cdot a\right) \cdot c}}{2.0 \cdot a}
\frac{\frac{c}{b} \cdot -2.0}{2.0}
double f(double a, double b, double c) {
        double r734724 = b;
        double r734725 = -r734724;
        double r734726 = r734724 * r734724;
        double r734727 = 4.0;
        double r734728 = a;
        double r734729 = r734727 * r734728;
        double r734730 = c;
        double r734731 = r734729 * r734730;
        double r734732 = r734726 - r734731;
        double r734733 = sqrt(r734732);
        double r734734 = r734725 + r734733;
        double r734735 = 2.0;
        double r734736 = r734735 * r734728;
        double r734737 = r734734 / r734736;
        return r734737;
}

double f(double __attribute__((unused)) a, double b, double c) {
        double r734738 = c;
        double r734739 = b;
        double r734740 = r734738 / r734739;
        double r734741 = -2.0;
        double r734742 = r734740 * r734741;
        double r734743 = 2.0;
        double r734744 = r734742 / r734743;
        return r734744;
}

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

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

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

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

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

Reproduce

herbie shell --seed 2019165 
(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)))