Average Error: 43.2 → 43.2
Time: 11.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 r13986 = xre;
        double r13987 = xim;
        double r13988 = /* ERROR: no complex support in C */;
        double r13989 = exp(r13988);
        double r13990 = -r13988;
        double r13991 = exp(r13990);
        double r13992 = r13989 + r13991;
        double r13993 = 2.0;
        double r13994 = 0.0;
        double r13995 = /* ERROR: no complex support in C */;
        double r13996 = r13992 / r13995;
        double r13997 = /* ERROR: no complex support in C */;
        return r13997;
}

double f(double xre, double xim) {
        double r13998 = xre;
        double r13999 = xim;
        double r14000 = /* ERROR: no complex support in C */;
        double r14001 = exp(r14000);
        double r14002 = -r14000;
        double r14003 = exp(r14002);
        double r14004 = r14001 + r14003;
        double r14005 = 2.0;
        double r14006 = 0.0;
        double r14007 = /* ERROR: no complex support in C */;
        double r14008 = r14004 / r14007;
        double r14009 = /* ERROR: no complex support in C */;
        return r14009;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 43.2

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

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