Average Error: 43.9 → 43.9
Time: 11.2s
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 r15341 = xre;
        double r15342 = xim;
        double r15343 = /* ERROR: no complex support in C */;
        double r15344 = exp(r15343);
        double r15345 = -r15343;
        double r15346 = exp(r15345);
        double r15347 = r15344 + r15346;
        double r15348 = 2.0;
        double r15349 = 0.0;
        double r15350 = /* ERROR: no complex support in C */;
        double r15351 = r15347 / r15350;
        double r15352 = /* ERROR: no complex support in C */;
        return r15352;
}

double f(double xre, double xim) {
        double r15353 = xre;
        double r15354 = xim;
        double r15355 = /* ERROR: no complex support in C */;
        double r15356 = exp(r15355);
        double r15357 = -r15355;
        double r15358 = exp(r15357);
        double r15359 = r15356 + r15358;
        double r15360 = 2.0;
        double r15361 = 0.0;
        double r15362 = /* ERROR: no complex support in C */;
        double r15363 = r15359 / r15362;
        double r15364 = /* ERROR: no complex support in C */;
        return r15364;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 43.9

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

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