Average Error: 28.4 → 0.5
Time: 7.9s
Precision: 64
\[1.053671212772350866701172186984739043147 \cdot 10^{-8} \lt a \lt 94906265.62425155937671661376953125 \land 1.053671212772350866701172186984739043147 \cdot 10^{-8} \lt b \lt 94906265.62425155937671661376953125 \land 1.053671212772350866701172186984739043147 \cdot 10^{-8} \lt c \lt 94906265.62425155937671661376953125\]
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\]
\[\frac{\frac{0 + 4 \cdot \left(a \cdot c\right)}{\left(-b\right) - \sqrt{\frac{{b}^{6} - 64 \cdot \left({a}^{3} \cdot {c}^{3}\right)}{\mathsf{fma}\left(4, \left(a \cdot c\right) \cdot \mathsf{fma}\left(b, b, \left(4 \cdot a\right) \cdot c\right), {b}^{4}\right)}}}}{2 \cdot a}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\frac{\frac{0 + 4 \cdot \left(a \cdot c\right)}{\left(-b\right) - \sqrt{\frac{{b}^{6} - 64 \cdot \left({a}^{3} \cdot {c}^{3}\right)}{\mathsf{fma}\left(4, \left(a \cdot c\right) \cdot \mathsf{fma}\left(b, b, \left(4 \cdot a\right) \cdot c\right), {b}^{4}\right)}}}}{2 \cdot a}
double f(double a, double b, double c) {
        double r43444 = b;
        double r43445 = -r43444;
        double r43446 = r43444 * r43444;
        double r43447 = 4.0;
        double r43448 = a;
        double r43449 = r43447 * r43448;
        double r43450 = c;
        double r43451 = r43449 * r43450;
        double r43452 = r43446 - r43451;
        double r43453 = sqrt(r43452);
        double r43454 = r43445 + r43453;
        double r43455 = 2.0;
        double r43456 = r43455 * r43448;
        double r43457 = r43454 / r43456;
        return r43457;
}

double f(double a, double b, double c) {
        double r43458 = 0.0;
        double r43459 = 4.0;
        double r43460 = a;
        double r43461 = c;
        double r43462 = r43460 * r43461;
        double r43463 = r43459 * r43462;
        double r43464 = r43458 + r43463;
        double r43465 = b;
        double r43466 = -r43465;
        double r43467 = 6.0;
        double r43468 = pow(r43465, r43467);
        double r43469 = 64.0;
        double r43470 = 3.0;
        double r43471 = pow(r43460, r43470);
        double r43472 = pow(r43461, r43470);
        double r43473 = r43471 * r43472;
        double r43474 = r43469 * r43473;
        double r43475 = r43468 - r43474;
        double r43476 = r43459 * r43460;
        double r43477 = r43476 * r43461;
        double r43478 = fma(r43465, r43465, r43477);
        double r43479 = r43462 * r43478;
        double r43480 = 4.0;
        double r43481 = pow(r43465, r43480);
        double r43482 = fma(r43459, r43479, r43481);
        double r43483 = r43475 / r43482;
        double r43484 = sqrt(r43483);
        double r43485 = r43466 - r43484;
        double r43486 = r43464 / r43485;
        double r43487 = 2.0;
        double r43488 = r43487 * r43460;
        double r43489 = r43486 / r43488;
        return r43489;
}

Error

Bits error versus a

Bits error versus b

Bits error versus c

Derivation

  1. Initial program 28.4

    \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\]
  2. Using strategy rm
  3. Applied flip-+28.5

    \[\leadsto \frac{\color{blue}{\frac{\left(-b\right) \cdot \left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} \cdot \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}}{2 \cdot a}\]
  4. Simplified0.4

    \[\leadsto \frac{\frac{\color{blue}{0 + 4 \cdot \left(a \cdot c\right)}}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}{2 \cdot a}\]
  5. Using strategy rm
  6. Applied flip3--0.5

    \[\leadsto \frac{\frac{0 + 4 \cdot \left(a \cdot c\right)}{\left(-b\right) - \sqrt{\color{blue}{\frac{{\left(b \cdot b\right)}^{3} - {\left(\left(4 \cdot a\right) \cdot c\right)}^{3}}{\left(b \cdot b\right) \cdot \left(b \cdot b\right) + \left(\left(\left(4 \cdot a\right) \cdot c\right) \cdot \left(\left(4 \cdot a\right) \cdot c\right) + \left(b \cdot b\right) \cdot \left(\left(4 \cdot a\right) \cdot c\right)\right)}}}}}{2 \cdot a}\]
  7. Simplified0.5

    \[\leadsto \frac{\frac{0 + 4 \cdot \left(a \cdot c\right)}{\left(-b\right) - \sqrt{\frac{\color{blue}{{b}^{6} - {\left(\left(4 \cdot a\right) \cdot c\right)}^{3}}}{\left(b \cdot b\right) \cdot \left(b \cdot b\right) + \left(\left(\left(4 \cdot a\right) \cdot c\right) \cdot \left(\left(4 \cdot a\right) \cdot c\right) + \left(b \cdot b\right) \cdot \left(\left(4 \cdot a\right) \cdot c\right)\right)}}}}{2 \cdot a}\]
  8. Simplified0.5

    \[\leadsto \frac{\frac{0 + 4 \cdot \left(a \cdot c\right)}{\left(-b\right) - \sqrt{\frac{{b}^{6} - {\left(\left(4 \cdot a\right) \cdot c\right)}^{3}}{\color{blue}{\mathsf{fma}\left(4, \left(a \cdot c\right) \cdot \mathsf{fma}\left(b, b, \left(4 \cdot a\right) \cdot c\right), {b}^{4}\right)}}}}}{2 \cdot a}\]
  9. Taylor expanded around 0 0.5

    \[\leadsto \frac{\frac{0 + 4 \cdot \left(a \cdot c\right)}{\left(-b\right) - \sqrt{\frac{{b}^{6} - \color{blue}{64 \cdot \left({a}^{3} \cdot {c}^{3}\right)}}{\mathsf{fma}\left(4, \left(a \cdot c\right) \cdot \mathsf{fma}\left(b, b, \left(4 \cdot a\right) \cdot c\right), {b}^{4}\right)}}}}{2 \cdot a}\]
  10. Final simplification0.5

    \[\leadsto \frac{\frac{0 + 4 \cdot \left(a \cdot c\right)}{\left(-b\right) - \sqrt{\frac{{b}^{6} - 64 \cdot \left({a}^{3} \cdot {c}^{3}\right)}{\mathsf{fma}\left(4, \left(a \cdot c\right) \cdot \mathsf{fma}\left(b, b, \left(4 \cdot a\right) \cdot c\right), {b}^{4}\right)}}}}{2 \cdot a}\]

Reproduce

herbie shell --seed 2019346 +o rules:numerics
(FPCore (a b c)
  :name "Quadratic roots, narrow range"
  :precision binary64
  :pre (and (< 1.0536712127723509e-08 a 94906265.62425156) (< 1.0536712127723509e-08 b 94906265.62425156) (< 1.0536712127723509e-08 c 94906265.62425156))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 4 a) c)))) (* 2 a)))