Average Error: 43.8 → 43.8
Time: 11.7s
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 r17418 = xre;
        double r17419 = xim;
        double r17420 = /* ERROR: no complex support in C */;
        double r17421 = exp(r17420);
        double r17422 = -r17420;
        double r17423 = exp(r17422);
        double r17424 = r17421 + r17423;
        double r17425 = 2.0;
        double r17426 = 0.0;
        double r17427 = /* ERROR: no complex support in C */;
        double r17428 = r17424 / r17427;
        double r17429 = /* ERROR: no complex support in C */;
        return r17429;
}

double f(double xre, double xim) {
        double r17430 = xre;
        double r17431 = xim;
        double r17432 = /* ERROR: no complex support in C */;
        double r17433 = exp(r17432);
        double r17434 = -r17432;
        double r17435 = exp(r17434);
        double r17436 = r17433 + r17435;
        double r17437 = 2.0;
        double r17438 = 0.0;
        double r17439 = /* ERROR: no complex support in C */;
        double r17440 = r17436 / r17439;
        double r17441 = /* ERROR: no complex support in C */;
        return r17441;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 43.8

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

    \[\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 2019353 
(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))))