Average Error: 42.9 → 42.9
Time: 3.5m
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 r9114 = xre;
        double r9115 = xim;
        double r9116 = /* ERROR: no complex support in C */;
        double r9117 = exp(r9116);
        double r9118 = -r9116;
        double r9119 = exp(r9118);
        double r9120 = r9117 + r9119;
        double r9121 = 2.0;
        double r9122 = 0.0;
        double r9123 = /* ERROR: no complex support in C */;
        double r9124 = r9120 / r9123;
        double r9125 = /* ERROR: no complex support in C */;
        return r9125;
}

double f(double xre, double xim) {
        double r9126 = xre;
        double r9127 = xim;
        double r9128 = /* ERROR: no complex support in C */;
        double r9129 = exp(r9128);
        double r9130 = -r9128;
        double r9131 = exp(r9130);
        double r9132 = r9129 + r9131;
        double r9133 = 2.0;
        double r9134 = 0.0;
        double r9135 = /* ERROR: no complex support in C */;
        double r9136 = r9132 / r9135;
        double r9137 = /* ERROR: no complex support in C */;
        return r9137;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 42.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 simplification42.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 2019202 
(FPCore (xre xim)
  :name "exp with complex power imaginary part (p55)"
  (im (/ (+ (exp (complex xre xim)) (exp (- (complex xre xim)))) (complex 2 0.0))))