Average Error: 43.9 → 12.0
Time: 20.3s
Precision: 64
\[1.1102230246251565404236316680908203125 \cdot 10^{-16} \lt a \lt 9007199254740992 \land 1.1102230246251565404236316680908203125 \cdot 10^{-16} \lt b \lt 9007199254740992 \land 1.1102230246251565404236316680908203125 \cdot 10^{-16} \lt c \lt 9007199254740992\]
\[\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 r2215707 = b;
        double r2215708 = -r2215707;
        double r2215709 = r2215707 * r2215707;
        double r2215710 = 4.0;
        double r2215711 = a;
        double r2215712 = r2215710 * r2215711;
        double r2215713 = c;
        double r2215714 = r2215712 * r2215713;
        double r2215715 = r2215709 - r2215714;
        double r2215716 = sqrt(r2215715);
        double r2215717 = r2215708 + r2215716;
        double r2215718 = 2.0;
        double r2215719 = r2215718 * r2215711;
        double r2215720 = r2215717 / r2215719;
        return r2215720;
}

double f(double __attribute__((unused)) a, double b, double c) {
        double r2215721 = c;
        double r2215722 = b;
        double r2215723 = r2215721 / r2215722;
        double r2215724 = -2.0;
        double r2215725 = r2215723 * r2215724;
        double r2215726 = 2.0;
        double r2215727 = r2215725 / r2215726;
        return r2215727;
}

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 43.9

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

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

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

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

Reproduce

herbie shell --seed 2019174 +o rules:numerics
(FPCore (a b c)
  :name "Quadratic roots, medium range"
  :pre (and (< 1.1102230246251565e-16 a 9007199254740992.0) (< 1.1102230246251565e-16 b 9007199254740992.0) (< 1.1102230246251565e-16 c 9007199254740992.0))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))