Average Error: 43.8 → 43.8
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 r14986 = xre;
        double r14987 = xim;
        double r14988 = /* ERROR: no complex support in C */;
        double r14989 = exp(r14988);
        double r14990 = -r14988;
        double r14991 = exp(r14990);
        double r14992 = r14989 + r14991;
        double r14993 = 2.0;
        double r14994 = 0.0;
        double r14995 = /* ERROR: no complex support in C */;
        double r14996 = r14992 / r14995;
        double r14997 = /* ERROR: no complex support in C */;
        return r14997;
}

double f(double xre, double xim) {
        double r14998 = xre;
        double r14999 = xim;
        double r15000 = /* ERROR: no complex support in C */;
        double r15001 = exp(r15000);
        double r15002 = -r15000;
        double r15003 = exp(r15002);
        double r15004 = r15001 + r15003;
        double r15005 = 2.0;
        double r15006 = 0.0;
        double r15007 = /* ERROR: no complex support in C */;
        double r15008 = r15004 / r15007;
        double r15009 = /* ERROR: no complex support in C */;
        return r15009;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 43.8

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

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