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

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

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))))