Average Error: 52.3 → 6.4
Time: 27.3s
Precision: 64
\[4.930380657631324 \cdot 10^{-32} \lt a \lt 2.028240960365167 \cdot 10^{+31} \land 4.930380657631324 \cdot 10^{-32} \lt b \lt 2.028240960365167 \cdot 10^{+31} \land 4.930380657631324 \cdot 10^{-32} \lt c \lt 2.028240960365167 \cdot 10^{+31}\]
\[\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 r995001 = b;
        double r995002 = -r995001;
        double r995003 = r995001 * r995001;
        double r995004 = 4.0;
        double r995005 = a;
        double r995006 = r995004 * r995005;
        double r995007 = c;
        double r995008 = r995006 * r995007;
        double r995009 = r995003 - r995008;
        double r995010 = sqrt(r995009);
        double r995011 = r995002 + r995010;
        double r995012 = 2.0;
        double r995013 = r995012 * r995005;
        double r995014 = r995011 / r995013;
        return r995014;
}

double f(double __attribute__((unused)) a, double b, double c) {
        double r995015 = c;
        double r995016 = b;
        double r995017 = r995015 / r995016;
        double r995018 = -2.0;
        double r995019 = r995017 * r995018;
        double r995020 = 2.0;
        double r995021 = r995019 / r995020;
        return r995021;
}

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

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

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

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

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

Reproduce

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