Average Error: 43.6 → 43.6
Time: 26.4s
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 r10528 = xre;
        double r10529 = xim;
        double r10530 = /* ERROR: no complex support in C */;
        double r10531 = exp(r10530);
        double r10532 = -r10530;
        double r10533 = exp(r10532);
        double r10534 = r10531 + r10533;
        double r10535 = 2.0;
        double r10536 = 0.0;
        double r10537 = /* ERROR: no complex support in C */;
        double r10538 = r10534 / r10537;
        double r10539 = /* ERROR: no complex support in C */;
        return r10539;
}

double f(double xre, double xim) {
        double r10540 = xre;
        double r10541 = xim;
        double r10542 = /* ERROR: no complex support in C */;
        double r10543 = -r10542;
        double r10544 = exp(r10543);
        double r10545 = exp(r10542);
        double r10546 = r10544 + r10545;
        double r10547 = 2.0;
        double r10548 = 0.0;
        double r10549 = /* ERROR: no complex support in C */;
        double r10550 = r10546 / r10549;
        double r10551 = /* ERROR: no complex support in C */;
        return r10551;
}

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))))