Average Error: 43.5 → 43.5
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 r18587 = xre;
        double r18588 = xim;
        double r18589 = /* ERROR: no complex support in C */;
        double r18590 = exp(r18589);
        double r18591 = -r18589;
        double r18592 = exp(r18591);
        double r18593 = r18590 + r18592;
        double r18594 = 2.0;
        double r18595 = 0.0;
        double r18596 = /* ERROR: no complex support in C */;
        double r18597 = r18593 / r18596;
        double r18598 = /* ERROR: no complex support in C */;
        return r18598;
}

double f(double xre, double xim) {
        double r18599 = xre;
        double r18600 = xim;
        double r18601 = /* ERROR: no complex support in C */;
        double r18602 = exp(r18601);
        double r18603 = -r18601;
        double r18604 = exp(r18603);
        double r18605 = r18602 + r18604;
        double r18606 = 2.0;
        double r18607 = 0.0;
        double r18608 = /* ERROR: no complex support in C */;
        double r18609 = r18605 / r18608;
        double r18610 = /* ERROR: no complex support in C */;
        return r18610;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 43.5

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

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