Average Error: 44.1 → 11.8
Time: 18.9s
Precision: 64
\[1.1102230246251565 \cdot 10^{-16} \lt a \lt 9007199254740992.0 \land 1.1102230246251565 \cdot 10^{-16} \lt b \lt 9007199254740992.0 \land 1.1102230246251565 \cdot 10^{-16} \lt c \lt 9007199254740992.0\]
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\]
\[-\frac{c}{b}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
-\frac{c}{b}
double f(double a, double b, double c) {
        double r1187994 = b;
        double r1187995 = -r1187994;
        double r1187996 = r1187994 * r1187994;
        double r1187997 = 4.0;
        double r1187998 = a;
        double r1187999 = r1187997 * r1187998;
        double r1188000 = c;
        double r1188001 = r1187999 * r1188000;
        double r1188002 = r1187996 - r1188001;
        double r1188003 = sqrt(r1188002);
        double r1188004 = r1187995 + r1188003;
        double r1188005 = 2.0;
        double r1188006 = r1188005 * r1187998;
        double r1188007 = r1188004 / r1188006;
        return r1188007;
}

double f(double __attribute__((unused)) a, double b, double c) {
        double r1188008 = c;
        double r1188009 = b;
        double r1188010 = r1188008 / r1188009;
        double r1188011 = -r1188010;
        return r1188011;
}

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 44.1

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

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

    \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}}\]
  4. Simplified11.8

    \[\leadsto \color{blue}{-\frac{c}{b}}\]
  5. Final simplification11.8

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

Reproduce

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