Average Error: 43.6 → 43.6
Time: 10.5s
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 r21384 = xre;
        double r21385 = xim;
        double r21386 = /* ERROR: no complex support in C */;
        double r21387 = exp(r21386);
        double r21388 = -r21386;
        double r21389 = exp(r21388);
        double r21390 = r21387 + r21389;
        double r21391 = 2.0;
        double r21392 = 0.0;
        double r21393 = /* ERROR: no complex support in C */;
        double r21394 = r21390 / r21393;
        double r21395 = /* ERROR: no complex support in C */;
        return r21395;
}

double f(double xre, double xim) {
        double r21396 = xre;
        double r21397 = xim;
        double r21398 = /* ERROR: no complex support in C */;
        double r21399 = exp(r21398);
        double r21400 = -r21398;
        double r21401 = exp(r21400);
        double r21402 = r21399 + r21401;
        double r21403 = 2.0;
        double r21404 = 0.0;
        double r21405 = /* ERROR: no complex support in C */;
        double r21406 = r21402 / r21405;
        double r21407 = /* ERROR: no complex support in C */;
        return r21407;
}

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