Average Error: 43.8 → 43.8
Time: 11.5s
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 r24722 = xre;
        double r24723 = xim;
        double r24724 = /* ERROR: no complex support in C */;
        double r24725 = exp(r24724);
        double r24726 = -r24724;
        double r24727 = exp(r24726);
        double r24728 = r24725 + r24727;
        double r24729 = 2.0;
        double r24730 = 0.0;
        double r24731 = /* ERROR: no complex support in C */;
        double r24732 = r24728 / r24731;
        double r24733 = /* ERROR: no complex support in C */;
        return r24733;
}

double f(double xre, double xim) {
        double r24734 = xre;
        double r24735 = xim;
        double r24736 = /* ERROR: no complex support in C */;
        double r24737 = exp(r24736);
        double r24738 = -r24736;
        double r24739 = exp(r24738);
        double r24740 = r24737 + r24739;
        double r24741 = 2.0;
        double r24742 = 0.0;
        double r24743 = /* ERROR: no complex support in C */;
        double r24744 = r24740 / r24743;
        double r24745 = /* ERROR: no complex support in C */;
        return r24745;
}

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