Average Error: 43.7 → 43.7
Time: 11.4s
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 r15369 = xre;
        double r15370 = xim;
        double r15371 = /* ERROR: no complex support in C */;
        double r15372 = exp(r15371);
        double r15373 = -r15371;
        double r15374 = exp(r15373);
        double r15375 = r15372 + r15374;
        double r15376 = 2.0;
        double r15377 = 0.0;
        double r15378 = /* ERROR: no complex support in C */;
        double r15379 = r15375 / r15378;
        double r15380 = /* ERROR: no complex support in C */;
        return r15380;
}

double f(double xre, double xim) {
        double r15381 = xre;
        double r15382 = xim;
        double r15383 = /* ERROR: no complex support in C */;
        double r15384 = exp(r15383);
        double r15385 = -r15383;
        double r15386 = exp(r15385);
        double r15387 = r15384 + r15386;
        double r15388 = 2.0;
        double r15389 = 0.0;
        double r15390 = /* ERROR: no complex support in C */;
        double r15391 = r15387 / r15390;
        double r15392 = /* ERROR: no complex support in C */;
        return r15392;
}

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 2020021 
(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))))