Average Error: 43.6 → 43.6
Time: 10.3s
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 r18941 = xre;
        double r18942 = xim;
        double r18943 = /* ERROR: no complex support in C */;
        double r18944 = exp(r18943);
        double r18945 = -r18943;
        double r18946 = exp(r18945);
        double r18947 = r18944 + r18946;
        double r18948 = 2.0;
        double r18949 = 0.0;
        double r18950 = /* ERROR: no complex support in C */;
        double r18951 = r18947 / r18950;
        double r18952 = /* ERROR: no complex support in C */;
        return r18952;
}

double f(double xre, double xim) {
        double r18953 = xre;
        double r18954 = xim;
        double r18955 = /* ERROR: no complex support in C */;
        double r18956 = exp(r18955);
        double r18957 = -r18955;
        double r18958 = exp(r18957);
        double r18959 = r18956 + r18958;
        double r18960 = 2.0;
        double r18961 = 0.0;
        double r18962 = /* ERROR: no complex support in C */;
        double r18963 = r18959 / r18962;
        double r18964 = /* ERROR: no complex support in C */;
        return r18964;
}

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