Average Error: 43.7 → 43.7
Time: 10.5s
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 r17535 = xre;
        double r17536 = xim;
        double r17537 = /* ERROR: no complex support in C */;
        double r17538 = exp(r17537);
        double r17539 = -r17537;
        double r17540 = exp(r17539);
        double r17541 = r17538 + r17540;
        double r17542 = 2.0;
        double r17543 = 0.0;
        double r17544 = /* ERROR: no complex support in C */;
        double r17545 = r17541 / r17544;
        double r17546 = /* ERROR: no complex support in C */;
        return r17546;
}

double f(double xre, double xim) {
        double r17547 = xre;
        double r17548 = xim;
        double r17549 = /* ERROR: no complex support in C */;
        double r17550 = exp(r17549);
        double r17551 = -r17549;
        double r17552 = exp(r17551);
        double r17553 = r17550 + r17552;
        double r17554 = 2.0;
        double r17555 = 0.0;
        double r17556 = /* ERROR: no complex support in C */;
        double r17557 = r17553 / r17556;
        double r17558 = /* ERROR: no complex support in C */;
        return r17558;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 43.7

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

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