Average Error: 43.2 → 43.2
Time: 13.8s
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 r64251 = xre;
        double r64252 = xim;
        double r64253 = /* ERROR: no complex support in C */;
        double r64254 = exp(r64253);
        double r64255 = -r64253;
        double r64256 = exp(r64255);
        double r64257 = r64254 + r64256;
        double r64258 = 2.0;
        double r64259 = 0.0;
        double r64260 = /* ERROR: no complex support in C */;
        double r64261 = r64257 / r64260;
        double r64262 = /* ERROR: no complex support in C */;
        return r64262;
}

double f(double xre, double xim) {
        double r64263 = xre;
        double r64264 = xim;
        double r64265 = /* ERROR: no complex support in C */;
        double r64266 = exp(r64265);
        double r64267 = -r64265;
        double r64268 = exp(r64267);
        double r64269 = r64266 + r64268;
        double r64270 = 2.0;
        double r64271 = 0.0;
        double r64272 = /* ERROR: no complex support in C */;
        double r64273 = r64269 / r64272;
        double r64274 = /* ERROR: no complex support in C */;
        return r64274;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 43.2

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

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