Average Error: 43.9 → 12.0
Time: 21.7s
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}\]
\[-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 r3465609 = b;
        double r3465610 = -r3465609;
        double r3465611 = r3465609 * r3465609;
        double r3465612 = 4.0;
        double r3465613 = a;
        double r3465614 = r3465612 * r3465613;
        double r3465615 = c;
        double r3465616 = r3465614 * r3465615;
        double r3465617 = r3465611 - r3465616;
        double r3465618 = sqrt(r3465617);
        double r3465619 = r3465610 + r3465618;
        double r3465620 = 2.0;
        double r3465621 = r3465620 * r3465613;
        double r3465622 = r3465619 / r3465621;
        return r3465622;
}

double f(double __attribute__((unused)) a, double b, double c) {
        double r3465623 = -1.0;
        double r3465624 = c;
        double r3465625 = b;
        double r3465626 = r3465624 / r3465625;
        double r3465627 = r3465623 * r3465626;
        return r3465627;
}

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

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

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

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