Average Error: 43.5 → 43.5
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 r10433 = xre;
        double r10434 = xim;
        double r10435 = /* ERROR: no complex support in C */;
        double r10436 = exp(r10435);
        double r10437 = -r10435;
        double r10438 = exp(r10437);
        double r10439 = r10436 + r10438;
        double r10440 = 2.0;
        double r10441 = 0.0;
        double r10442 = /* ERROR: no complex support in C */;
        double r10443 = r10439 / r10442;
        double r10444 = /* ERROR: no complex support in C */;
        return r10444;
}

double f(double xre, double xim) {
        double r10445 = xre;
        double r10446 = xim;
        double r10447 = /* ERROR: no complex support in C */;
        double r10448 = -r10447;
        double r10449 = exp(r10448);
        double r10450 = exp(r10447);
        double r10451 = r10449 + r10450;
        double r10452 = 2.0;
        double r10453 = 0.0;
        double r10454 = /* ERROR: no complex support in C */;
        double r10455 = r10451 / r10454;
        double r10456 = /* ERROR: no complex support in C */;
        return r10456;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 43.5

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

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

Reproduce

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