Average Error: 52.5 → 6.2
Time: 20.1s
Precision: 64
\[4.930380657631323783823303533017413935458 \cdot 10^{-32} \lt a \lt 20282409603651670423947251286016 \land 4.930380657631323783823303533017413935458 \cdot 10^{-32} \lt b \lt 20282409603651670423947251286016 \land 4.930380657631323783823303533017413935458 \cdot 10^{-32} \lt c \lt 20282409603651670423947251286016\]
\[\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 r1146586 = b;
        double r1146587 = -r1146586;
        double r1146588 = r1146586 * r1146586;
        double r1146589 = 4.0;
        double r1146590 = a;
        double r1146591 = r1146589 * r1146590;
        double r1146592 = c;
        double r1146593 = r1146591 * r1146592;
        double r1146594 = r1146588 - r1146593;
        double r1146595 = sqrt(r1146594);
        double r1146596 = r1146587 + r1146595;
        double r1146597 = 2.0;
        double r1146598 = r1146597 * r1146590;
        double r1146599 = r1146596 / r1146598;
        return r1146599;
}

double f(double __attribute__((unused)) a, double b, double c) {
        double r1146600 = -1.0;
        double r1146601 = c;
        double r1146602 = b;
        double r1146603 = r1146601 / r1146602;
        double r1146604 = r1146600 * r1146603;
        return r1146604;
}

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

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

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

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

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

Reproduce

herbie shell --seed 2019174 
(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.0 a) c)))) (* 2.0 a)))