Average Error: 43.9 → 43.9
Time: 10.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(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 r14736 = xre;
        double r14737 = xim;
        double r14738 = /* ERROR: no complex support in C */;
        double r14739 = exp(r14738);
        double r14740 = -r14738;
        double r14741 = exp(r14740);
        double r14742 = r14739 + r14741;
        double r14743 = 2.0;
        double r14744 = 0.0;
        double r14745 = /* ERROR: no complex support in C */;
        double r14746 = r14742 / r14745;
        double r14747 = /* ERROR: no complex support in C */;
        return r14747;
}

double f(double xre, double xim) {
        double r14748 = xre;
        double r14749 = xim;
        double r14750 = /* ERROR: no complex support in C */;
        double r14751 = exp(r14750);
        double r14752 = -r14750;
        double r14753 = exp(r14752);
        double r14754 = r14751 + r14753;
        double r14755 = 2.0;
        double r14756 = 0.0;
        double r14757 = /* ERROR: no complex support in C */;
        double r14758 = r14754 / r14757;
        double r14759 = /* ERROR: no complex support in C */;
        return r14759;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 43.9

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

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