Average Error: 43.6 → 43.6
Time: 10.6s
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 r2732 = xre;
        double r2733 = xim;
        double r2734 = /* ERROR: no complex support in C */;
        double r2735 = exp(r2734);
        double r2736 = -r2734;
        double r2737 = exp(r2736);
        double r2738 = r2735 + r2737;
        double r2739 = 2.0;
        double r2740 = 0.0;
        double r2741 = /* ERROR: no complex support in C */;
        double r2742 = r2738 / r2741;
        double r2743 = /* ERROR: no complex support in C */;
        return r2743;
}

double f(double xre, double xim) {
        double r2744 = xre;
        double r2745 = xim;
        double r2746 = /* ERROR: no complex support in C */;
        double r2747 = exp(r2746);
        double r2748 = -r2746;
        double r2749 = exp(r2748);
        double r2750 = r2747 + r2749;
        double r2751 = 2.0;
        double r2752 = 0.0;
        double r2753 = /* ERROR: no complex support in C */;
        double r2754 = r2750 / r2753;
        double r2755 = /* ERROR: no complex support in C */;
        return r2755;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 43.6

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

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