Average Error: 43.2 → 43.2
Time: 10.4s
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.0 i\right)}\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.0 i\right)}\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.0 i\right)}\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.0 i\right)}\right))
double f(double xre, double xim) {
        double r15481 = xre;
        double r15482 = xim;
        double r15483 = /* ERROR: no complex support in C */;
        double r15484 = exp(r15483);
        double r15485 = -r15483;
        double r15486 = exp(r15485);
        double r15487 = r15484 + r15486;
        double r15488 = 2.0;
        double r15489 = 0.0;
        double r15490 = /* ERROR: no complex support in C */;
        double r15491 = r15487 / r15490;
        double r15492 = /* ERROR: no complex support in C */;
        return r15492;
}

double f(double xre, double xim) {
        double r15493 = xre;
        double r15494 = xim;
        double r15495 = /* ERROR: no complex support in C */;
        double r15496 = exp(r15495);
        double r15497 = -r15495;
        double r15498 = exp(r15497);
        double r15499 = r15496 + r15498;
        double r15500 = 2.0;
        double r15501 = 0.0;
        double r15502 = /* ERROR: no complex support in C */;
        double r15503 = r15499 / r15502;
        double r15504 = /* ERROR: no complex support in C */;
        return r15504;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 43.2

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

    \[\leadsto \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.0 i\right)}\right))\]

Reproduce

herbie shell --seed 2020039 
(FPCore (xre xim)
  :name "exp with complex power imaginary part (p55)"
  :precision binary64
  (im (/ (+ (exp (complex xre xim)) (exp (- (complex xre xim)))) (complex 2 0.0))))