Average Error: 43.4 → 43.4
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 r21178 = xre;
        double r21179 = xim;
        double r21180 = /* ERROR: no complex support in C */;
        double r21181 = exp(r21180);
        double r21182 = -r21180;
        double r21183 = exp(r21182);
        double r21184 = r21181 + r21183;
        double r21185 = 2.0;
        double r21186 = 0.0;
        double r21187 = /* ERROR: no complex support in C */;
        double r21188 = r21184 / r21187;
        double r21189 = /* ERROR: no complex support in C */;
        return r21189;
}

double f(double xre, double xim) {
        double r21190 = xre;
        double r21191 = xim;
        double r21192 = /* ERROR: no complex support in C */;
        double r21193 = exp(r21192);
        double r21194 = -r21192;
        double r21195 = exp(r21194);
        double r21196 = r21193 + r21195;
        double r21197 = 2.0;
        double r21198 = 0.0;
        double r21199 = /* ERROR: no complex support in C */;
        double r21200 = r21196 / r21199;
        double r21201 = /* ERROR: no complex support in C */;
        return r21201;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 43.4

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

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