Average Error: 43.1 → 43.1
Time: 26.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 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 r10580 = xre;
        double r10581 = xim;
        double r10582 = /* ERROR: no complex support in C */;
        double r10583 = exp(r10582);
        double r10584 = -r10582;
        double r10585 = exp(r10584);
        double r10586 = r10583 + r10585;
        double r10587 = 2.0;
        double r10588 = 0.0;
        double r10589 = /* ERROR: no complex support in C */;
        double r10590 = r10586 / r10589;
        double r10591 = /* ERROR: no complex support in C */;
        return r10591;
}

double f(double xre, double xim) {
        double r10592 = xre;
        double r10593 = xim;
        double r10594 = /* ERROR: no complex support in C */;
        double r10595 = -r10594;
        double r10596 = exp(r10595);
        double r10597 = exp(r10594);
        double r10598 = r10596 + r10597;
        double r10599 = 2.0;
        double r10600 = 0.0;
        double r10601 = /* ERROR: no complex support in C */;
        double r10602 = r10598 / r10601;
        double r10603 = /* ERROR: no complex support in C */;
        return r10603;
}

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{e^{-\left(xre + xim i\right)} + e^{xre + xim i}}{2 + 0 i}\right))\]

Reproduce

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