Average Error: 43.1 → 43.1
Time: 27.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 i\right)}\right))\]
\[\Im(\left(\frac{\left(\left(e^{\left(-\left(xre + xim i\right)\right)}\right) + \left(e^{\left(xre + xim i\right)}\right)\right)}{\left(2 + 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 i\right)}\right))
\Im(\left(\frac{\left(\left(e^{\left(-\left(xre + xim i\right)\right)}\right) + \left(e^{\left(xre + xim i\right)}\right)\right)}{\left(2 + 0 i\right)}\right))
double f(double xre, double xim) {
        double r10252 = xre;
        double r10253 = xim;
        double r10254 = /* ERROR: no complex support in C */;
        double r10255 = exp(r10254);
        double r10256 = -r10254;
        double r10257 = exp(r10256);
        double r10258 = r10255 + r10257;
        double r10259 = 2.0;
        double r10260 = 0.0;
        double r10261 = /* ERROR: no complex support in C */;
        double r10262 = r10258 / r10261;
        double r10263 = /* ERROR: no complex support in C */;
        return r10263;
}

double f(double xre, double xim) {
        double r10264 = xre;
        double r10265 = xim;
        double r10266 = /* ERROR: no complex support in C */;
        double r10267 = -r10266;
        double r10268 = exp(r10267);
        double r10269 = exp(r10266);
        double r10270 = r10268 + r10269;
        double r10271 = 2.0;
        double r10272 = 0.0;
        double r10273 = /* ERROR: no complex support in C */;
        double r10274 = r10270 / r10273;
        double r10275 = /* ERROR: no complex support in C */;
        return r10275;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 43.1

    \[\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 i\right)}\right))\]
  2. Final simplification43.1

    \[\leadsto \Im(\left(\frac{\left(\left(e^{\left(-\left(xre + xim i\right)\right)}\right) + \left(e^{\left(xre + xim i\right)}\right)\right)}{\left(2 + 0 i\right)}\right))\]

Reproduce

herbie shell --seed 2019164 
(FPCore (xre xim)
  :name "exp with complex power imaginary part (p55)"
  (im (/.c (+.c (exp.c (complex xre xim)) (exp.c (neg.c (complex xre xim)))) (complex 2 0))))