Average Error: 43.6 → 43.6
Time: 26.6s
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 r10443 = xre;
        double r10444 = xim;
        double r10445 = /* ERROR: no complex support in C */;
        double r10446 = exp(r10445);
        double r10447 = -r10445;
        double r10448 = exp(r10447);
        double r10449 = r10446 + r10448;
        double r10450 = 2.0;
        double r10451 = 0.0;
        double r10452 = /* ERROR: no complex support in C */;
        double r10453 = r10449 / r10452;
        double r10454 = /* ERROR: no complex support in C */;
        return r10454;
}

double f(double xre, double xim) {
        double r10455 = xre;
        double r10456 = xim;
        double r10457 = /* ERROR: no complex support in C */;
        double r10458 = -r10457;
        double r10459 = exp(r10458);
        double r10460 = exp(r10457);
        double r10461 = r10459 + r10460;
        double r10462 = 2.0;
        double r10463 = 0.0;
        double r10464 = /* ERROR: no complex support in C */;
        double r10465 = r10461 / r10464;
        double r10466 = /* ERROR: no complex support in C */;
        return r10466;
}

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

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

Reproduce

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