Average Error: 43.4 → 43.4
Time: 28.1s
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 r13109 = xre;
        double r13110 = xim;
        double r13111 = /* ERROR: no complex support in C */;
        double r13112 = exp(r13111);
        double r13113 = -r13111;
        double r13114 = exp(r13113);
        double r13115 = r13112 + r13114;
        double r13116 = 2.0;
        double r13117 = 0.0;
        double r13118 = /* ERROR: no complex support in C */;
        double r13119 = r13115 / r13118;
        double r13120 = /* ERROR: no complex support in C */;
        return r13120;
}

double f(double xre, double xim) {
        double r13121 = xre;
        double r13122 = xim;
        double r13123 = /* ERROR: no complex support in C */;
        double r13124 = -r13123;
        double r13125 = exp(r13124);
        double r13126 = exp(r13123);
        double r13127 = r13125 + r13126;
        double r13128 = 2.0;
        double r13129 = 0.0;
        double r13130 = /* ERROR: no complex support in C */;
        double r13131 = r13127 / r13130;
        double r13132 = /* ERROR: no complex support in C */;
        return r13132;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 43.4

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

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

Reproduce

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