Average Error: 43.6 → 43.6
Time: 10.5s
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 r15685 = xre;
        double r15686 = xim;
        double r15687 = /* ERROR: no complex support in C */;
        double r15688 = exp(r15687);
        double r15689 = -r15687;
        double r15690 = exp(r15689);
        double r15691 = r15688 + r15690;
        double r15692 = 2.0;
        double r15693 = 0.0;
        double r15694 = /* ERROR: no complex support in C */;
        double r15695 = r15691 / r15694;
        double r15696 = /* ERROR: no complex support in C */;
        return r15696;
}

double f(double xre, double xim) {
        double r15697 = xre;
        double r15698 = xim;
        double r15699 = /* ERROR: no complex support in C */;
        double r15700 = exp(r15699);
        double r15701 = -r15699;
        double r15702 = exp(r15701);
        double r15703 = r15700 + r15702;
        double r15704 = 2.0;
        double r15705 = 0.0;
        double r15706 = /* ERROR: no complex support in C */;
        double r15707 = r15703 / r15706;
        double r15708 = /* ERROR: no complex support in C */;
        return r15708;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 43.6

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

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