Average Error: 44.1 → 44.1
Time: 11.4s
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 r17677 = xre;
        double r17678 = xim;
        double r17679 = /* ERROR: no complex support in C */;
        double r17680 = exp(r17679);
        double r17681 = -r17679;
        double r17682 = exp(r17681);
        double r17683 = r17680 + r17682;
        double r17684 = 2.0;
        double r17685 = 0.0;
        double r17686 = /* ERROR: no complex support in C */;
        double r17687 = r17683 / r17686;
        double r17688 = /* ERROR: no complex support in C */;
        return r17688;
}

double f(double xre, double xim) {
        double r17689 = xre;
        double r17690 = xim;
        double r17691 = /* ERROR: no complex support in C */;
        double r17692 = exp(r17691);
        double r17693 = -r17691;
        double r17694 = exp(r17693);
        double r17695 = r17692 + r17694;
        double r17696 = 2.0;
        double r17697 = 0.0;
        double r17698 = /* ERROR: no complex support in C */;
        double r17699 = r17695 / r17698;
        double r17700 = /* ERROR: no complex support in C */;
        return r17700;
}

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