Average Error: 43.4 → 43.4
Time: 28.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 r10513 = xre;
        double r10514 = xim;
        double r10515 = /* ERROR: no complex support in C */;
        double r10516 = exp(r10515);
        double r10517 = -r10515;
        double r10518 = exp(r10517);
        double r10519 = r10516 + r10518;
        double r10520 = 2.0;
        double r10521 = 0.0;
        double r10522 = /* ERROR: no complex support in C */;
        double r10523 = r10519 / r10522;
        double r10524 = /* ERROR: no complex support in C */;
        return r10524;
}

double f(double xre, double xim) {
        double r10525 = xre;
        double r10526 = xim;
        double r10527 = /* ERROR: no complex support in C */;
        double r10528 = -r10527;
        double r10529 = exp(r10528);
        double r10530 = exp(r10527);
        double r10531 = r10529 + r10530;
        double r10532 = 2.0;
        double r10533 = 0.0;
        double r10534 = /* ERROR: no complex support in C */;
        double r10535 = r10531 / r10534;
        double r10536 = /* ERROR: no complex support in C */;
        return r10536;
}

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

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

Reproduce

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