Average Error: 43.7 → 43.7
Time: 27.2s
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 r10505 = xre;
        double r10506 = xim;
        double r10507 = /* ERROR: no complex support in C */;
        double r10508 = exp(r10507);
        double r10509 = -r10507;
        double r10510 = exp(r10509);
        double r10511 = r10508 + r10510;
        double r10512 = 2.0;
        double r10513 = 0.0;
        double r10514 = /* ERROR: no complex support in C */;
        double r10515 = r10511 / r10514;
        double r10516 = /* ERROR: no complex support in C */;
        return r10516;
}

double f(double xre, double xim) {
        double r10517 = xre;
        double r10518 = xim;
        double r10519 = /* ERROR: no complex support in C */;
        double r10520 = -r10519;
        double r10521 = exp(r10520);
        double r10522 = exp(r10519);
        double r10523 = r10521 + r10522;
        double r10524 = 2.0;
        double r10525 = 0.0;
        double r10526 = /* ERROR: no complex support in C */;
        double r10527 = r10523 / r10526;
        double r10528 = /* ERROR: no complex support in C */;
        return r10528;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 43.7

    \[\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.7

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

Reproduce

herbie shell --seed 2019163 
(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))))