Average Error: 43.4 → 43.4
Time: 26.9s
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{e^{-\left(xre + xim i\right)} + e^{xre + xim i}}{2 + 0 i}\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{e^{-\left(xre + xim i\right)} + e^{xre + xim i}}{2 + 0 i}\right))
double f(double xre, double xim) {
        double r10265 = xre;
        double r10266 = xim;
        double r10267 = /* ERROR: no complex support in C */;
        double r10268 = exp(r10267);
        double r10269 = -r10267;
        double r10270 = exp(r10269);
        double r10271 = r10268 + r10270;
        double r10272 = 2.0;
        double r10273 = 0.0;
        double r10274 = /* ERROR: no complex support in C */;
        double r10275 = r10271 / r10274;
        double r10276 = /* ERROR: no complex support in C */;
        return r10276;
}

double f(double xre, double xim) {
        double r10277 = xre;
        double r10278 = xim;
        double r10279 = /* ERROR: no complex support in C */;
        double r10280 = -r10279;
        double r10281 = exp(r10280);
        double r10282 = exp(r10279);
        double r10283 = r10281 + r10282;
        double r10284 = 2.0;
        double r10285 = 0.0;
        double r10286 = /* ERROR: no complex support in C */;
        double r10287 = r10283 / r10286;
        double r10288 = /* ERROR: no complex support in C */;
        return r10288;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 43.4

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

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

Reproduce

herbie shell --seed 2019146 
(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))))