Average Error: 43.2 → 43.2
Time: 27.0s
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 r11055 = xre;
        double r11056 = xim;
        double r11057 = /* ERROR: no complex support in C */;
        double r11058 = exp(r11057);
        double r11059 = -r11057;
        double r11060 = exp(r11059);
        double r11061 = r11058 + r11060;
        double r11062 = 2.0;
        double r11063 = 0.0;
        double r11064 = /* ERROR: no complex support in C */;
        double r11065 = r11061 / r11064;
        double r11066 = /* ERROR: no complex support in C */;
        return r11066;
}

double f(double xre, double xim) {
        double r11067 = xre;
        double r11068 = xim;
        double r11069 = /* ERROR: no complex support in C */;
        double r11070 = -r11069;
        double r11071 = exp(r11070);
        double r11072 = exp(r11069);
        double r11073 = r11071 + r11072;
        double r11074 = 2.0;
        double r11075 = 0.0;
        double r11076 = /* ERROR: no complex support in C */;
        double r11077 = r11073 / r11076;
        double r11078 = /* ERROR: no complex support in C */;
        return r11078;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 43.2

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

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

Reproduce

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