Average Error: 43.6 → 43.6
Time: 10.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 r14347 = xre;
        double r14348 = xim;
        double r14349 = /* ERROR: no complex support in C */;
        double r14350 = exp(r14349);
        double r14351 = -r14349;
        double r14352 = exp(r14351);
        double r14353 = r14350 + r14352;
        double r14354 = 2.0;
        double r14355 = 0.0;
        double r14356 = /* ERROR: no complex support in C */;
        double r14357 = r14353 / r14356;
        double r14358 = /* ERROR: no complex support in C */;
        return r14358;
}

double f(double xre, double xim) {
        double r14359 = xre;
        double r14360 = xim;
        double r14361 = /* ERROR: no complex support in C */;
        double r14362 = exp(r14361);
        double r14363 = -r14361;
        double r14364 = exp(r14363);
        double r14365 = r14362 + r14364;
        double r14366 = 2.0;
        double r14367 = 0.0;
        double r14368 = /* ERROR: no complex support in C */;
        double r14369 = r14365 / r14368;
        double r14370 = /* ERROR: no complex support in C */;
        return r14370;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 43.6

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

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