Average Error: 42.9 → 42.9
Time: 10.7s
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 r12282 = xre;
        double r12283 = xim;
        double r12284 = /* ERROR: no complex support in C */;
        double r12285 = exp(r12284);
        double r12286 = -r12284;
        double r12287 = exp(r12286);
        double r12288 = r12285 + r12287;
        double r12289 = 2.0;
        double r12290 = 0.0;
        double r12291 = /* ERROR: no complex support in C */;
        double r12292 = r12288 / r12291;
        double r12293 = /* ERROR: no complex support in C */;
        return r12293;
}

double f(double xre, double xim) {
        double r12294 = xre;
        double r12295 = xim;
        double r12296 = /* ERROR: no complex support in C */;
        double r12297 = exp(r12296);
        double r12298 = -r12296;
        double r12299 = exp(r12298);
        double r12300 = r12297 + r12299;
        double r12301 = 2.0;
        double r12302 = 0.0;
        double r12303 = /* ERROR: no complex support in C */;
        double r12304 = r12300 / r12303;
        double r12305 = /* ERROR: no complex support in C */;
        return r12305;
}

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