Average Error: 43.7 → 12.1
Time: 17.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 r1894409 = b;
        double r1894410 = -r1894409;
        double r1894411 = r1894409 * r1894409;
        double r1894412 = 4.0;
        double r1894413 = a;
        double r1894414 = r1894412 * r1894413;
        double r1894415 = c;
        double r1894416 = r1894414 * r1894415;
        double r1894417 = r1894411 - r1894416;
        double r1894418 = sqrt(r1894417);
        double r1894419 = r1894410 + r1894418;
        double r1894420 = 2.0;
        double r1894421 = r1894420 * r1894413;
        double r1894422 = r1894419 / r1894421;
        return r1894422;
}

double f(double __attribute__((unused)) a, double b, double c) {
        double r1894423 = c;
        double r1894424 = b;
        double r1894425 = r1894423 / r1894424;
        double r1894426 = -2.0;
        double r1894427 = r1894425 * r1894426;
        double r1894428 = 2.0;
        double r1894429 = r1894427 / r1894428;
        return r1894429;
}

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

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

    \[\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.1

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

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

Reproduce

herbie shell --seed 2019192 +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)))