Average Error: 43.5 → 43.5
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 r16736 = xre;
        double r16737 = xim;
        double r16738 = /* ERROR: no complex support in C */;
        double r16739 = exp(r16738);
        double r16740 = -r16738;
        double r16741 = exp(r16740);
        double r16742 = r16739 + r16741;
        double r16743 = 2.0;
        double r16744 = 0.0;
        double r16745 = /* ERROR: no complex support in C */;
        double r16746 = r16742 / r16745;
        double r16747 = /* ERROR: no complex support in C */;
        return r16747;
}

double f(double xre, double xim) {
        double r16748 = xre;
        double r16749 = xim;
        double r16750 = /* ERROR: no complex support in C */;
        double r16751 = exp(r16750);
        double r16752 = -r16750;
        double r16753 = exp(r16752);
        double r16754 = r16751 + r16753;
        double r16755 = 2.0;
        double r16756 = 0.0;
        double r16757 = /* ERROR: no complex support in C */;
        double r16758 = r16754 / r16757;
        double r16759 = /* ERROR: no complex support in C */;
        return r16759;
}

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))))