Average Error: 43.4 → 43.4
Time: 27.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 i\right)}\right))\]
\[\Im(\left(\frac{e^{-\left(xre + xim i\right)} + e^{xre + xim i}}{2 + 0 i}\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 i\right)}\right))
\Im(\left(\frac{e^{-\left(xre + xim i\right)} + e^{xre + xim i}}{2 + 0 i}\right))
double f(double xre, double xim) {
        double r10448 = xre;
        double r10449 = xim;
        double r10450 = /* ERROR: no complex support in C */;
        double r10451 = exp(r10450);
        double r10452 = -r10450;
        double r10453 = exp(r10452);
        double r10454 = r10451 + r10453;
        double r10455 = 2.0;
        double r10456 = 0.0;
        double r10457 = /* ERROR: no complex support in C */;
        double r10458 = r10454 / r10457;
        double r10459 = /* ERROR: no complex support in C */;
        return r10459;
}

double f(double xre, double xim) {
        double r10460 = xre;
        double r10461 = xim;
        double r10462 = /* ERROR: no complex support in C */;
        double r10463 = -r10462;
        double r10464 = exp(r10463);
        double r10465 = exp(r10462);
        double r10466 = r10464 + r10465;
        double r10467 = 2.0;
        double r10468 = 0.0;
        double r10469 = /* ERROR: no complex support in C */;
        double r10470 = r10466 / r10469;
        double r10471 = /* ERROR: no complex support in C */;
        return r10471;
}

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 i\right)}\right))\]
  2. Final simplification43.4

    \[\leadsto \Im(\left(\frac{e^{-\left(xre + xim i\right)} + e^{xre + xim i}}{2 + 0 i}\right))\]

Reproduce

herbie shell --seed 2019141 
(FPCore (xre xim)
  :name "exp with complex power imaginary part (p55)"
  (im (/.c (+.c (exp.c (complex xre xim)) (exp.c (neg.c (complex xre xim)))) (complex 2 0))))