Average Error: 43.5 → 43.5
Time: 27.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 r10552 = xre;
        double r10553 = xim;
        double r10554 = /* ERROR: no complex support in C */;
        double r10555 = exp(r10554);
        double r10556 = -r10554;
        double r10557 = exp(r10556);
        double r10558 = r10555 + r10557;
        double r10559 = 2.0;
        double r10560 = 0.0;
        double r10561 = /* ERROR: no complex support in C */;
        double r10562 = r10558 / r10561;
        double r10563 = /* ERROR: no complex support in C */;
        return r10563;
}

double f(double xre, double xim) {
        double r10564 = xre;
        double r10565 = xim;
        double r10566 = /* ERROR: no complex support in C */;
        double r10567 = -r10566;
        double r10568 = exp(r10567);
        double r10569 = exp(r10566);
        double r10570 = r10568 + r10569;
        double r10571 = 2.0;
        double r10572 = 0.0;
        double r10573 = /* ERROR: no complex support in C */;
        double r10574 = r10570 / r10573;
        double r10575 = /* ERROR: no complex support in C */;
        return r10575;
}

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