Average Error: 52.4 → 6.3
Time: 16.6s
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 r285122 = b;
        double r285123 = -r285122;
        double r285124 = r285122 * r285122;
        double r285125 = 4.0;
        double r285126 = a;
        double r285127 = r285125 * r285126;
        double r285128 = c;
        double r285129 = r285127 * r285128;
        double r285130 = r285124 - r285129;
        double r285131 = sqrt(r285130);
        double r285132 = r285123 + r285131;
        double r285133 = 2.0;
        double r285134 = r285133 * r285126;
        double r285135 = r285132 / r285134;
        return r285135;
}

double f(double __attribute__((unused)) a, double b, double c) {
        double r285136 = c;
        double r285137 = b;
        double r285138 = r285136 / r285137;
        double r285139 = -2.0;
        double r285140 = r285138 * r285139;
        double r285141 = 2.0;
        double r285142 = r285140 / r285141;
        return r285142;
}

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

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

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

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

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

Reproduce

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