Average Error: 43.9 → 43.9
Time: 27.1s
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 i\right)}\right))\]
\[\Im(\left(\frac{e^{-\left(xre + xim i\right)} + e^{xre + xim i}}{2 + 0 i}\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 i\right)}\right))
\Im(\left(\frac{e^{-\left(xre + xim i\right)} + e^{xre + xim i}}{2 + 0 i}\right))
double f(double xre, double xim) {
        double r10606 = xre;
        double r10607 = xim;
        double r10608 = /* ERROR: no complex support in C */;
        double r10609 = exp(r10608);
        double r10610 = -r10608;
        double r10611 = exp(r10610);
        double r10612 = r10609 + r10611;
        double r10613 = 2.0;
        double r10614 = 0.0;
        double r10615 = /* ERROR: no complex support in C */;
        double r10616 = r10612 / r10615;
        double r10617 = /* ERROR: no complex support in C */;
        return r10617;
}

double f(double xre, double xim) {
        double r10618 = xre;
        double r10619 = xim;
        double r10620 = /* ERROR: no complex support in C */;
        double r10621 = -r10620;
        double r10622 = exp(r10621);
        double r10623 = exp(r10620);
        double r10624 = r10622 + r10623;
        double r10625 = 2.0;
        double r10626 = 0.0;
        double r10627 = /* ERROR: no complex support in C */;
        double r10628 = r10624 / r10627;
        double r10629 = /* ERROR: no complex support in C */;
        return r10629;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 43.9

    \[\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 i\right)}\right))\]
  2. Final simplification43.9

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

Reproduce

herbie shell --seed 2019152 
(FPCore (xre xim)
  :name "exp with complex power imaginary part (p55)"
  (im (/.c (+.c (exp.c (complex xre xim)) (exp.c (neg.c (complex xre xim)))) (complex 2 0))))