Average Error: 52.8 → 6.0
Time: 18.0s
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{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 r655438 = b;
        double r655439 = -r655438;
        double r655440 = r655438 * r655438;
        double r655441 = 4.0;
        double r655442 = a;
        double r655443 = r655441 * r655442;
        double r655444 = c;
        double r655445 = r655443 * r655444;
        double r655446 = r655440 - r655445;
        double r655447 = sqrt(r655446);
        double r655448 = r655439 + r655447;
        double r655449 = 2.0;
        double r655450 = r655449 * r655442;
        double r655451 = r655448 / r655450;
        return r655451;
}

double f(double __attribute__((unused)) a, double b, double c) {
        double r655452 = c;
        double r655453 = b;
        double r655454 = r655452 / r655453;
        double r655455 = -r655454;
        return r655455;
}

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

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

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

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

    \[\leadsto \color{blue}{-\frac{c}{b}}\]
  5. Final simplification6.0

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

Reproduce

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