Average Error: 43.9 → 12.0
Time: 7.1s
Precision: 64
\[1.11022 \cdot 10^{-16} \lt a \lt 9.0072 \cdot 10^{15} \land 1.11022 \cdot 10^{-16} \lt b \lt 9.0072 \cdot 10^{15} \land 1.11022 \cdot 10^{-16} \lt c \lt 9.0072 \cdot 10^{15}\]
\[\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 r27472 = b;
        double r27473 = -r27472;
        double r27474 = r27472 * r27472;
        double r27475 = 4.0;
        double r27476 = a;
        double r27477 = r27475 * r27476;
        double r27478 = c;
        double r27479 = r27477 * r27478;
        double r27480 = r27474 - r27479;
        double r27481 = sqrt(r27480);
        double r27482 = r27473 + r27481;
        double r27483 = 2.0;
        double r27484 = r27483 * r27476;
        double r27485 = r27482 / r27484;
        return r27485;
}

double f(double __attribute__((unused)) a, double b, double c) {
        double r27486 = -1.0;
        double r27487 = c;
        double r27488 = b;
        double r27489 = r27487 / r27488;
        double r27490 = r27486 * r27489;
        return r27490;
}

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 43.9

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

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

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

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

Reproduce

herbie shell --seed 2020045 +o rules:numerics
(FPCore (a b c)
  :name "Quadratic roots, medium range"
  :precision binary64
  :pre (and (< 1.11022e-16 a 9.0072e+15) (< 1.11022e-16 b 9.0072e+15) (< 1.11022e-16 c 9.0072e+15))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 4 a) c)))) (* 2 a)))