Average Error: 43.7 → 43.7
Time: 26.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 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 r10495 = xre;
        double r10496 = xim;
        double r10497 = /* ERROR: no complex support in C */;
        double r10498 = exp(r10497);
        double r10499 = -r10497;
        double r10500 = exp(r10499);
        double r10501 = r10498 + r10500;
        double r10502 = 2.0;
        double r10503 = 0.0;
        double r10504 = /* ERROR: no complex support in C */;
        double r10505 = r10501 / r10504;
        double r10506 = /* ERROR: no complex support in C */;
        return r10506;
}

double f(double xre, double xim) {
        double r10507 = xre;
        double r10508 = xim;
        double r10509 = /* ERROR: no complex support in C */;
        double r10510 = -r10509;
        double r10511 = exp(r10510);
        double r10512 = exp(r10509);
        double r10513 = r10511 + r10512;
        double r10514 = 2.0;
        double r10515 = 0.0;
        double r10516 = /* ERROR: no complex support in C */;
        double r10517 = r10513 / r10516;
        double r10518 = /* ERROR: no complex support in C */;
        return r10518;
}

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