Average Error: 43.7 → 43.7
Time: 11.7s
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.0 i\right)}\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.0 i\right)}\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.0 i\right)}\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.0 i\right)}\right))
double f(double xre, double xim) {
        double r18173 = xre;
        double r18174 = xim;
        double r18175 = /* ERROR: no complex support in C */;
        double r18176 = exp(r18175);
        double r18177 = -r18175;
        double r18178 = exp(r18177);
        double r18179 = r18176 + r18178;
        double r18180 = 2.0;
        double r18181 = 0.0;
        double r18182 = /* ERROR: no complex support in C */;
        double r18183 = r18179 / r18182;
        double r18184 = /* ERROR: no complex support in C */;
        return r18184;
}

double f(double xre, double xim) {
        double r18185 = xre;
        double r18186 = xim;
        double r18187 = /* ERROR: no complex support in C */;
        double r18188 = exp(r18187);
        double r18189 = -r18187;
        double r18190 = exp(r18189);
        double r18191 = r18188 + r18190;
        double r18192 = 2.0;
        double r18193 = 0.0;
        double r18194 = /* ERROR: no complex support in C */;
        double r18195 = r18191 / r18194;
        double r18196 = /* ERROR: no complex support in C */;
        return r18196;
}

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.0 i\right)}\right))\]
  2. Final simplification43.7

    \[\leadsto \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.0 i\right)}\right))\]

Reproduce

herbie shell --seed 2020002 
(FPCore (xre xim)
  :name "exp with complex power imaginary part (p55)"
  :precision binary64
  (im (/ (+ (exp (complex xre xim)) (exp (- (complex xre xim)))) (complex 2 0.0))))