Average Error: 43.5 → 43.5
Time: 26.9s
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 r10402 = xre;
        double r10403 = xim;
        double r10404 = /* ERROR: no complex support in C */;
        double r10405 = exp(r10404);
        double r10406 = -r10404;
        double r10407 = exp(r10406);
        double r10408 = r10405 + r10407;
        double r10409 = 2.0;
        double r10410 = 0.0;
        double r10411 = /* ERROR: no complex support in C */;
        double r10412 = r10408 / r10411;
        double r10413 = /* ERROR: no complex support in C */;
        return r10413;
}

double f(double xre, double xim) {
        double r10414 = xre;
        double r10415 = xim;
        double r10416 = /* ERROR: no complex support in C */;
        double r10417 = -r10416;
        double r10418 = exp(r10417);
        double r10419 = exp(r10416);
        double r10420 = r10418 + r10419;
        double r10421 = 2.0;
        double r10422 = 0.0;
        double r10423 = /* ERROR: no complex support in C */;
        double r10424 = r10420 / r10423;
        double r10425 = /* ERROR: no complex support in C */;
        return r10425;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 43.5

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

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