Average Error: 43.8 → 43.8
Time: 27.8s
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(-\left(xre + xim i\right)\right)}\right) + \left(e^{\left(xre + xim i\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(-\left(xre + xim i\right)\right)}\right) + \left(e^{\left(xre + xim i\right)}\right)\right)}{\left(2 + 0.0 i\right)}\right))
double f(double xre, double xim) {
        double r10350 = xre;
        double r10351 = xim;
        double r10352 = /* ERROR: no complex support in C */;
        double r10353 = exp(r10352);
        double r10354 = -r10352;
        double r10355 = exp(r10354);
        double r10356 = r10353 + r10355;
        double r10357 = 2.0;
        double r10358 = 0.0;
        double r10359 = /* ERROR: no complex support in C */;
        double r10360 = r10356 / r10359;
        double r10361 = /* ERROR: no complex support in C */;
        return r10361;
}

double f(double xre, double xim) {
        double r10362 = xre;
        double r10363 = xim;
        double r10364 = /* ERROR: no complex support in C */;
        double r10365 = -r10364;
        double r10366 = exp(r10365);
        double r10367 = exp(r10364);
        double r10368 = r10366 + r10367;
        double r10369 = 2.0;
        double r10370 = 0.0;
        double r10371 = /* ERROR: no complex support in C */;
        double r10372 = r10368 / r10371;
        double r10373 = /* ERROR: no complex support in C */;
        return r10373;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 43.8

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

    \[\leadsto \Im(\left(\frac{\left(\left(e^{\left(-\left(xre + xim i\right)\right)}\right) + \left(e^{\left(xre + xim i\right)}\right)\right)}{\left(2 + 0.0 i\right)}\right))\]

Reproduce

herbie shell --seed 2019170 
(FPCore (xre xim)
  :name "exp with complex power imaginary part (p55)"
  (im (/ (+ (exp (complex xre xim)) (exp (- (complex xre xim)))) (complex 2.0 0.0))))