Average Error: 52.7 → 6.1
Time: 17.1s
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 r265204 = b;
        double r265205 = -r265204;
        double r265206 = r265204 * r265204;
        double r265207 = 4.0;
        double r265208 = a;
        double r265209 = r265207 * r265208;
        double r265210 = c;
        double r265211 = r265209 * r265210;
        double r265212 = r265206 - r265211;
        double r265213 = sqrt(r265212);
        double r265214 = r265205 + r265213;
        double r265215 = 2.0;
        double r265216 = r265215 * r265208;
        double r265217 = r265214 / r265216;
        return r265217;
}

double f(double __attribute__((unused)) a, double b, double c) {
        double r265218 = c;
        double r265219 = b;
        double r265220 = r265218 / r265219;
        double r265221 = -2.0;
        double r265222 = r265220 * r265221;
        double r265223 = 2.0;
        double r265224 = r265222 / r265223;
        return r265224;
}

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

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

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

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

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

Reproduce

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