Average Error: 43.6 → 43.6
Time: 11.3s
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 r15280 = xre;
        double r15281 = xim;
        double r15282 = /* ERROR: no complex support in C */;
        double r15283 = exp(r15282);
        double r15284 = -r15282;
        double r15285 = exp(r15284);
        double r15286 = r15283 + r15285;
        double r15287 = 2.0;
        double r15288 = 0.0;
        double r15289 = /* ERROR: no complex support in C */;
        double r15290 = r15286 / r15289;
        double r15291 = /* ERROR: no complex support in C */;
        return r15291;
}

double f(double xre, double xim) {
        double r15292 = xre;
        double r15293 = xim;
        double r15294 = /* ERROR: no complex support in C */;
        double r15295 = exp(r15294);
        double r15296 = -r15294;
        double r15297 = exp(r15296);
        double r15298 = r15295 + r15297;
        double r15299 = 2.0;
        double r15300 = 0.0;
        double r15301 = /* ERROR: no complex support in C */;
        double r15302 = r15298 / r15301;
        double r15303 = /* ERROR: no complex support in C */;
        return r15303;
}

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