Average Error: 52.6 → 6.1
Time: 7.3s
Precision: 64
\[4.93038 \cdot 10^{-32} \lt a \lt 2.02824 \cdot 10^{31} \land 4.93038 \cdot 10^{-32} \lt b \lt 2.02824 \cdot 10^{31} \land 4.93038 \cdot 10^{-32} \lt c \lt 2.02824 \cdot 10^{31}\]
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\]
\[-1 \cdot \frac{c}{b}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
-1 \cdot \frac{c}{b}
double f(double a, double b, double c) {
        double r25314 = b;
        double r25315 = -r25314;
        double r25316 = r25314 * r25314;
        double r25317 = 4.0;
        double r25318 = a;
        double r25319 = r25317 * r25318;
        double r25320 = c;
        double r25321 = r25319 * r25320;
        double r25322 = r25316 - r25321;
        double r25323 = sqrt(r25322);
        double r25324 = r25315 + r25323;
        double r25325 = 2.0;
        double r25326 = r25325 * r25318;
        double r25327 = r25324 / r25326;
        return r25327;
}

double f(double __attribute__((unused)) a, double b, double c) {
        double r25328 = -1.0;
        double r25329 = c;
        double r25330 = b;
        double r25331 = r25329 / r25330;
        double r25332 = r25328 * r25331;
        return r25332;
}

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

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

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

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

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

Reproduce

herbie shell --seed 2020045 
(FPCore (a b c)
  :name "Quadratic roots, wide range"
  :precision binary64
  :pre (and (< 4.9303800000000003e-32 a 2.02824e+31) (< 4.9303800000000003e-32 b 2.02824e+31) (< 4.9303800000000003e-32 c 2.02824e+31))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 4 a) c)))) (* 2 a)))