Average Error: 43.4 → 43.4
Time: 11.1s
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 r23567 = xre;
        double r23568 = xim;
        double r23569 = /* ERROR: no complex support in C */;
        double r23570 = exp(r23569);
        double r23571 = -r23569;
        double r23572 = exp(r23571);
        double r23573 = r23570 + r23572;
        double r23574 = 2.0;
        double r23575 = 0.0;
        double r23576 = /* ERROR: no complex support in C */;
        double r23577 = r23573 / r23576;
        double r23578 = /* ERROR: no complex support in C */;
        return r23578;
}

double f(double xre, double xim) {
        double r23579 = xre;
        double r23580 = xim;
        double r23581 = /* ERROR: no complex support in C */;
        double r23582 = exp(r23581);
        double r23583 = -r23581;
        double r23584 = exp(r23583);
        double r23585 = r23582 + r23584;
        double r23586 = 2.0;
        double r23587 = 0.0;
        double r23588 = /* ERROR: no complex support in C */;
        double r23589 = r23585 / r23588;
        double r23590 = /* ERROR: no complex support in C */;
        return r23590;
}

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

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