Average Error: 43.4 → 43.4
Time: 26.5s
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 r11076 = xre;
        double r11077 = xim;
        double r11078 = /* ERROR: no complex support in C */;
        double r11079 = exp(r11078);
        double r11080 = -r11078;
        double r11081 = exp(r11080);
        double r11082 = r11079 + r11081;
        double r11083 = 2.0;
        double r11084 = 0.0;
        double r11085 = /* ERROR: no complex support in C */;
        double r11086 = r11082 / r11085;
        double r11087 = /* ERROR: no complex support in C */;
        return r11087;
}

double f(double xre, double xim) {
        double r11088 = xre;
        double r11089 = xim;
        double r11090 = /* ERROR: no complex support in C */;
        double r11091 = -r11090;
        double r11092 = exp(r11091);
        double r11093 = exp(r11090);
        double r11094 = r11092 + r11093;
        double r11095 = 2.0;
        double r11096 = 0.0;
        double r11097 = /* ERROR: no complex support in C */;
        double r11098 = r11094 / r11097;
        double r11099 = /* ERROR: no complex support in C */;
        return r11099;
}

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