Average Error: 52.4 → 6.3
Time: 20.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 r601792 = b;
        double r601793 = -r601792;
        double r601794 = r601792 * r601792;
        double r601795 = 4.0;
        double r601796 = a;
        double r601797 = r601795 * r601796;
        double r601798 = c;
        double r601799 = r601797 * r601798;
        double r601800 = r601794 - r601799;
        double r601801 = sqrt(r601800);
        double r601802 = r601793 + r601801;
        double r601803 = 2.0;
        double r601804 = r601803 * r601796;
        double r601805 = r601802 / r601804;
        return r601805;
}

double f(double __attribute__((unused)) a, double b, double c) {
        double r601806 = c;
        double r601807 = b;
        double r601808 = r601806 / r601807;
        double r601809 = -2.0;
        double r601810 = r601808 * r601809;
        double r601811 = 2.0;
        double r601812 = r601810 / r601811;
        return r601812;
}

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 2019139 
(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)))