Average Error: 52.2 → 6.5
Time: 20.4s
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 r458123 = b;
        double r458124 = -r458123;
        double r458125 = r458123 * r458123;
        double r458126 = 4.0;
        double r458127 = a;
        double r458128 = r458126 * r458127;
        double r458129 = c;
        double r458130 = r458128 * r458129;
        double r458131 = r458125 - r458130;
        double r458132 = sqrt(r458131);
        double r458133 = r458124 + r458132;
        double r458134 = 2.0;
        double r458135 = r458134 * r458127;
        double r458136 = r458133 / r458135;
        return r458136;
}

double f(double __attribute__((unused)) a, double b, double c) {
        double r458137 = c;
        double r458138 = b;
        double r458139 = r458137 / r458138;
        double r458140 = -r458139;
        return r458140;
}

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

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

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

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

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

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

Reproduce

herbie shell --seed 2019134 +o rules:numerics
(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)))