Average Error: 52.3 → 6.4
Time: 23.1s
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 \cdot a\right) \cdot c}}{2 \cdot a}\]
\[\frac{\frac{c}{b} \cdot -2}{2}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\frac{\frac{c}{b} \cdot -2}{2}
double f(double a, double b, double c) {
        double r648611 = b;
        double r648612 = -r648611;
        double r648613 = r648611 * r648611;
        double r648614 = 4.0;
        double r648615 = a;
        double r648616 = r648614 * r648615;
        double r648617 = c;
        double r648618 = r648616 * r648617;
        double r648619 = r648613 - r648618;
        double r648620 = sqrt(r648619);
        double r648621 = r648612 + r648620;
        double r648622 = 2.0;
        double r648623 = r648622 * r648615;
        double r648624 = r648621 / r648623;
        return r648624;
}

double f(double __attribute__((unused)) a, double b, double c) {
        double r648625 = c;
        double r648626 = b;
        double r648627 = r648625 / r648626;
        double r648628 = -2.0;
        double r648629 = r648627 * r648628;
        double r648630 = 2.0;
        double r648631 = r648629 / r648630;
        return r648631;
}

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

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

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

Reproduce

herbie shell --seed 2019144 
(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 a) c)))) (* 2 a)))