Average Error: 53.0 → 5.8
Time: 29.7s
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 r1250264 = b;
        double r1250265 = -r1250264;
        double r1250266 = r1250264 * r1250264;
        double r1250267 = 4.0;
        double r1250268 = a;
        double r1250269 = r1250267 * r1250268;
        double r1250270 = c;
        double r1250271 = r1250269 * r1250270;
        double r1250272 = r1250266 - r1250271;
        double r1250273 = sqrt(r1250272);
        double r1250274 = r1250265 + r1250273;
        double r1250275 = 2.0;
        double r1250276 = r1250275 * r1250268;
        double r1250277 = r1250274 / r1250276;
        return r1250277;
}

double f(double __attribute__((unused)) a, double b, double c) {
        double r1250278 = c;
        double r1250279 = b;
        double r1250280 = r1250278 / r1250279;
        double r1250281 = -2.0;
        double r1250282 = r1250280 * r1250281;
        double r1250283 = 2.0;
        double r1250284 = r1250282 / r1250283;
        return r1250284;
}

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 53.0

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

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

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

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

Reproduce

herbie shell --seed 2019158 
(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)))