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

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

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 43.7

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

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

Reproduce

herbie shell --seed 2019104 +o rules:numerics
(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))))