Average Error: 43.5 → 43.5
Time: 27.2s
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 r11388 = xre;
        double r11389 = xim;
        double r11390 = /* ERROR: no complex support in C */;
        double r11391 = exp(r11390);
        double r11392 = -r11390;
        double r11393 = exp(r11392);
        double r11394 = r11391 + r11393;
        double r11395 = 2.0;
        double r11396 = 0.0;
        double r11397 = /* ERROR: no complex support in C */;
        double r11398 = r11394 / r11397;
        double r11399 = /* ERROR: no complex support in C */;
        return r11399;
}

double f(double xre, double xim) {
        double r11400 = xre;
        double r11401 = xim;
        double r11402 = /* ERROR: no complex support in C */;
        double r11403 = exp(r11402);
        double r11404 = -r11402;
        double r11405 = exp(r11404);
        double r11406 = r11403 + r11405;
        double r11407 = 2.0;
        double r11408 = 0.0;
        double r11409 = /* ERROR: no complex support in C */;
        double r11410 = r11406 / r11409;
        double r11411 = /* ERROR: no complex support in C */;
        return r11411;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 43.5

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

    \[\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 2019174 
(FPCore (xre xim)
  :name "exp with complex power imaginary part (p55)"
  (im (/ (+ (exp (complex xre xim)) (exp (- (complex xre xim)))) (complex 2.0 0.0))))