Average Error: 43.4 → 43.4
Time: 25.9s
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 r9229 = xre;
        double r9230 = xim;
        double r9231 = /* ERROR: no complex support in C */;
        double r9232 = exp(r9231);
        double r9233 = -r9231;
        double r9234 = exp(r9233);
        double r9235 = r9232 + r9234;
        double r9236 = 2.0;
        double r9237 = 0.0;
        double r9238 = /* ERROR: no complex support in C */;
        double r9239 = r9235 / r9238;
        double r9240 = /* ERROR: no complex support in C */;
        return r9240;
}

double f(double xre, double xim) {
        double r9241 = xre;
        double r9242 = xim;
        double r9243 = /* ERROR: no complex support in C */;
        double r9244 = exp(r9243);
        double r9245 = -r9243;
        double r9246 = exp(r9245);
        double r9247 = r9244 + r9246;
        double r9248 = 2.0;
        double r9249 = 0.0;
        double r9250 = /* ERROR: no complex support in C */;
        double r9251 = r9247 / r9250;
        double r9252 = /* ERROR: no complex support in C */;
        return r9252;
}

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

    \[\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 2019298 
(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))))