Average Error: 43.3 → 43.3
Time: 10.6s
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 r16466 = xre;
        double r16467 = xim;
        double r16468 = /* ERROR: no complex support in C */;
        double r16469 = exp(r16468);
        double r16470 = -r16468;
        double r16471 = exp(r16470);
        double r16472 = r16469 + r16471;
        double r16473 = 2.0;
        double r16474 = 0.0;
        double r16475 = /* ERROR: no complex support in C */;
        double r16476 = r16472 / r16475;
        double r16477 = /* ERROR: no complex support in C */;
        return r16477;
}

double f(double xre, double xim) {
        double r16478 = xre;
        double r16479 = xim;
        double r16480 = /* ERROR: no complex support in C */;
        double r16481 = exp(r16480);
        double r16482 = -r16480;
        double r16483 = exp(r16482);
        double r16484 = r16481 + r16483;
        double r16485 = 2.0;
        double r16486 = 0.0;
        double r16487 = /* ERROR: no complex support in C */;
        double r16488 = r16484 / r16487;
        double r16489 = /* ERROR: no complex support in C */;
        return r16489;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 43.3

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

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