Average Error: 44.1 → 44.1
Time: 17.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 r24603 = xre;
        double r24604 = xim;
        double r24605 = /* ERROR: no complex support in C */;
        double r24606 = exp(r24605);
        double r24607 = -r24605;
        double r24608 = exp(r24607);
        double r24609 = r24606 + r24608;
        double r24610 = 2.0;
        double r24611 = 0.0;
        double r24612 = /* ERROR: no complex support in C */;
        double r24613 = r24609 / r24612;
        double r24614 = /* ERROR: no complex support in C */;
        return r24614;
}

double f(double xre, double xim) {
        double r24615 = xre;
        double r24616 = xim;
        double r24617 = /* ERROR: no complex support in C */;
        double r24618 = exp(r24617);
        double r24619 = -r24617;
        double r24620 = exp(r24619);
        double r24621 = r24618 + r24620;
        double r24622 = 2.0;
        double r24623 = 0.0;
        double r24624 = /* ERROR: no complex support in C */;
        double r24625 = r24621 / r24624;
        double r24626 = /* ERROR: no complex support in C */;
        return r24626;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 44.1

    \[\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 simplification44.1

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