Average Error: 42.9 → 42.9
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 r12089 = xre;
        double r12090 = xim;
        double r12091 = /* ERROR: no complex support in C */;
        double r12092 = exp(r12091);
        double r12093 = -r12091;
        double r12094 = exp(r12093);
        double r12095 = r12092 + r12094;
        double r12096 = 2.0;
        double r12097 = 0.0;
        double r12098 = /* ERROR: no complex support in C */;
        double r12099 = r12095 / r12098;
        double r12100 = /* ERROR: no complex support in C */;
        return r12100;
}

double f(double xre, double xim) {
        double r12101 = xre;
        double r12102 = xim;
        double r12103 = /* ERROR: no complex support in C */;
        double r12104 = -r12103;
        double r12105 = exp(r12104);
        double r12106 = exp(r12103);
        double r12107 = r12105 + r12106;
        double r12108 = 2.0;
        double r12109 = 0.0;
        double r12110 = /* ERROR: no complex support in C */;
        double r12111 = r12107 / r12110;
        double r12112 = /* ERROR: no complex support in C */;
        return r12112;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 42.9

    \[\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 simplification42.9

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

Reproduce

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