Average Error: 43.4 → 43.4
Time: 10.5s
Precision: 64
\[\Im(\left(\frac{\left(\left(e^{\left(xre + xim i\right)}\right) + \left(e^{\left(-\left(xre + xim i\right)\right)}\right)\right)}{\left(2 + 0.0 i\right)}\right))\]
\[\Im(\left(\frac{\left(\left(e^{\left(xre + xim i\right)}\right) + \left(e^{\left(-\left(xre + xim i\right)\right)}\right)\right)}{\left(2 + 0.0 i\right)}\right))\]
\Im(\left(\frac{\left(\left(e^{\left(xre + xim i\right)}\right) + \left(e^{\left(-\left(xre + xim i\right)\right)}\right)\right)}{\left(2 + 0.0 i\right)}\right))
\Im(\left(\frac{\left(\left(e^{\left(xre + xim i\right)}\right) + \left(e^{\left(-\left(xre + xim i\right)\right)}\right)\right)}{\left(2 + 0.0 i\right)}\right))
double f(double xre, double xim) {
        double r17687 = xre;
        double r17688 = xim;
        double r17689 = /* ERROR: no complex support in C */;
        double r17690 = exp(r17689);
        double r17691 = -r17689;
        double r17692 = exp(r17691);
        double r17693 = r17690 + r17692;
        double r17694 = 2.0;
        double r17695 = 0.0;
        double r17696 = /* ERROR: no complex support in C */;
        double r17697 = r17693 / r17696;
        double r17698 = /* ERROR: no complex support in C */;
        return r17698;
}

double f(double xre, double xim) {
        double r17699 = xre;
        double r17700 = xim;
        double r17701 = /* ERROR: no complex support in C */;
        double r17702 = exp(r17701);
        double r17703 = -r17701;
        double r17704 = exp(r17703);
        double r17705 = r17702 + r17704;
        double r17706 = 2.0;
        double r17707 = 0.0;
        double r17708 = /* ERROR: no complex support in C */;
        double r17709 = r17705 / r17708;
        double r17710 = /* ERROR: no complex support in C */;
        return r17710;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 43.4

    \[\Im(\left(\frac{\left(\left(e^{\left(xre + xim i\right)}\right) + \left(e^{\left(-\left(xre + xim i\right)\right)}\right)\right)}{\left(2 + 0.0 i\right)}\right))\]
  2. Final simplification43.4

    \[\leadsto \Im(\left(\frac{\left(\left(e^{\left(xre + xim i\right)}\right) + \left(e^{\left(-\left(xre + xim i\right)\right)}\right)\right)}{\left(2 + 0.0 i\right)}\right))\]

Reproduce

herbie shell --seed 2020062 +o rules:numerics
(FPCore (xre xim)
  :name "exp with complex power imaginary part (p55)"
  :precision binary64
  (im (/ (+ (exp (complex xre xim)) (exp (- (complex xre xim)))) (complex 2 0.0))))