Average Error: 44.2 → 43.2
Time: 30.0s
Precision: 64
\[1.1102230246251565 \cdot 10^{-16} \lt a \lt 9007199254740992.0 \land 1.1102230246251565 \cdot 10^{-16} \lt b \lt 9007199254740992.0 \land 1.1102230246251565 \cdot 10^{-16} \lt c \lt 9007199254740992.0\]
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\]
\[\frac{\frac{\mathsf{fma}\left(\left(\sqrt{\sqrt{{\left(e^{\log \left(\mathsf{fma}\left(c, \left(a \cdot -4\right), \left(b \cdot b\right)\right)\right) + \log \left(\mathsf{fma}\left(c, \left(a \cdot -4\right), \left(b \cdot b\right)\right)\right)} \cdot \mathsf{fma}\left(c, \left(a \cdot -4\right), \left(b \cdot b\right)\right)\right)}^{\frac{1}{3}}}}\right), \left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(a \cdot -4\right), \left(b \cdot b\right)\right)}}\right), \left(-b\right)\right)}{2}}{a}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\frac{\frac{\mathsf{fma}\left(\left(\sqrt{\sqrt{{\left(e^{\log \left(\mathsf{fma}\left(c, \left(a \cdot -4\right), \left(b \cdot b\right)\right)\right) + \log \left(\mathsf{fma}\left(c, \left(a \cdot -4\right), \left(b \cdot b\right)\right)\right)} \cdot \mathsf{fma}\left(c, \left(a \cdot -4\right), \left(b \cdot b\right)\right)\right)}^{\frac{1}{3}}}}\right), \left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(a \cdot -4\right), \left(b \cdot b\right)\right)}}\right), \left(-b\right)\right)}{2}}{a}
double f(double a, double b, double c) {
        double r1866526 = b;
        double r1866527 = -r1866526;
        double r1866528 = r1866526 * r1866526;
        double r1866529 = 4.0;
        double r1866530 = a;
        double r1866531 = r1866529 * r1866530;
        double r1866532 = c;
        double r1866533 = r1866531 * r1866532;
        double r1866534 = r1866528 - r1866533;
        double r1866535 = sqrt(r1866534);
        double r1866536 = r1866527 + r1866535;
        double r1866537 = 2.0;
        double r1866538 = r1866537 * r1866530;
        double r1866539 = r1866536 / r1866538;
        return r1866539;
}

double f(double a, double b, double c) {
        double r1866540 = c;
        double r1866541 = a;
        double r1866542 = -4.0;
        double r1866543 = r1866541 * r1866542;
        double r1866544 = b;
        double r1866545 = r1866544 * r1866544;
        double r1866546 = fma(r1866540, r1866543, r1866545);
        double r1866547 = log(r1866546);
        double r1866548 = r1866547 + r1866547;
        double r1866549 = exp(r1866548);
        double r1866550 = r1866549 * r1866546;
        double r1866551 = 0.3333333333333333;
        double r1866552 = pow(r1866550, r1866551);
        double r1866553 = sqrt(r1866552);
        double r1866554 = sqrt(r1866553);
        double r1866555 = sqrt(r1866546);
        double r1866556 = sqrt(r1866555);
        double r1866557 = -r1866544;
        double r1866558 = fma(r1866554, r1866556, r1866557);
        double r1866559 = 2.0;
        double r1866560 = r1866558 / r1866559;
        double r1866561 = r1866560 / r1866541;
        return r1866561;
}

Error

Bits error versus a

Bits error versus b

Bits error versus c

Derivation

  1. Initial program 44.2

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

    \[\leadsto \color{blue}{\frac{\frac{\sqrt{\mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)} - b}{2}}{a}}\]
  3. Using strategy rm
  4. Applied add-sqr-sqrt44.2

    \[\leadsto \frac{\frac{\color{blue}{\sqrt{\sqrt{\mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)}} \cdot \sqrt{\sqrt{\mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)}}} - b}{2}}{a}\]
  5. Applied fma-neg43.6

    \[\leadsto \frac{\frac{\color{blue}{\mathsf{fma}\left(\left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)}}\right), \left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)}}\right), \left(-b\right)\right)}}{2}}{a}\]
  6. Using strategy rm
  7. Applied add-cbrt-cube43.6

    \[\leadsto \frac{\frac{\mathsf{fma}\left(\left(\sqrt{\sqrt{\color{blue}{\sqrt[3]{\left(\mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right) \cdot \mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)\right) \cdot \mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)}}}}\right), \left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)}}\right), \left(-b\right)\right)}{2}}{a}\]
  8. Using strategy rm
  9. Applied pow1/343.2

    \[\leadsto \frac{\frac{\mathsf{fma}\left(\left(\sqrt{\sqrt{\color{blue}{{\left(\left(\mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right) \cdot \mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)\right) \cdot \mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)\right)}^{\frac{1}{3}}}}}\right), \left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)}}\right), \left(-b\right)\right)}{2}}{a}\]
  10. Using strategy rm
  11. Applied add-exp-log43.2

    \[\leadsto \frac{\frac{\mathsf{fma}\left(\left(\sqrt{\sqrt{{\left(\left(\mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right) \cdot \color{blue}{e^{\log \left(\mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)\right)}}\right) \cdot \mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)\right)}^{\frac{1}{3}}}}\right), \left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)}}\right), \left(-b\right)\right)}{2}}{a}\]
  12. Applied add-exp-log43.2

    \[\leadsto \frac{\frac{\mathsf{fma}\left(\left(\sqrt{\sqrt{{\left(\left(\color{blue}{e^{\log \left(\mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)\right)}} \cdot e^{\log \left(\mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)\right)}\right) \cdot \mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)\right)}^{\frac{1}{3}}}}\right), \left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)}}\right), \left(-b\right)\right)}{2}}{a}\]
  13. Applied prod-exp43.2

    \[\leadsto \frac{\frac{\mathsf{fma}\left(\left(\sqrt{\sqrt{{\left(\color{blue}{e^{\log \left(\mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)\right) + \log \left(\mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)\right)}} \cdot \mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)\right)}^{\frac{1}{3}}}}\right), \left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)}}\right), \left(-b\right)\right)}{2}}{a}\]
  14. Final simplification43.2

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

Reproduce

herbie shell --seed 2019130 +o rules:numerics
(FPCore (a b c)
  :name "Quadratic roots, medium range"
  :pre (and (< 1.1102230246251565e-16 a 9007199254740992.0) (< 1.1102230246251565e-16 b 9007199254740992.0) (< 1.1102230246251565e-16 c 9007199254740992.0))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 4 a) c)))) (* 2 a)))