Average Error: 43.4 → 43.4
Time: 10.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 r25590 = xre;
        double r25591 = xim;
        double r25592 = /* ERROR: no complex support in C */;
        double r25593 = exp(r25592);
        double r25594 = -r25592;
        double r25595 = exp(r25594);
        double r25596 = r25593 + r25595;
        double r25597 = 2.0;
        double r25598 = 0.0;
        double r25599 = /* ERROR: no complex support in C */;
        double r25600 = r25596 / r25599;
        double r25601 = /* ERROR: no complex support in C */;
        return r25601;
}

double f(double xre, double xim) {
        double r25602 = xre;
        double r25603 = xim;
        double r25604 = /* ERROR: no complex support in C */;
        double r25605 = exp(r25604);
        double r25606 = -r25604;
        double r25607 = exp(r25606);
        double r25608 = r25605 + r25607;
        double r25609 = 2.0;
        double r25610 = 0.0;
        double r25611 = /* ERROR: no complex support in C */;
        double r25612 = r25608 / r25611;
        double r25613 = /* ERROR: no complex support in C */;
        return r25613;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 43.4

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

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