Average Error: 43.2 → 43.2
Time: 22.4s
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 r9333 = xre;
        double r9334 = xim;
        double r9335 = /* ERROR: no complex support in C */;
        double r9336 = exp(r9335);
        double r9337 = -r9335;
        double r9338 = exp(r9337);
        double r9339 = r9336 + r9338;
        double r9340 = 2.0;
        double r9341 = 0.0;
        double r9342 = /* ERROR: no complex support in C */;
        double r9343 = r9339 / r9342;
        double r9344 = /* ERROR: no complex support in C */;
        return r9344;
}

double f(double xre, double xim) {
        double r9345 = xre;
        double r9346 = xim;
        double r9347 = /* ERROR: no complex support in C */;
        double r9348 = exp(r9347);
        double r9349 = -r9347;
        double r9350 = exp(r9349);
        double r9351 = r9348 + r9350;
        double r9352 = 2.0;
        double r9353 = 0.0;
        double r9354 = /* ERROR: no complex support in C */;
        double r9355 = r9351 / r9354;
        double r9356 = /* ERROR: no complex support in C */;
        return r9356;
}

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