Average Error: 43.3 → 43.3
Time: 10.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 r16553 = xre;
        double r16554 = xim;
        double r16555 = /* ERROR: no complex support in C */;
        double r16556 = exp(r16555);
        double r16557 = -r16555;
        double r16558 = exp(r16557);
        double r16559 = r16556 + r16558;
        double r16560 = 2.0;
        double r16561 = 0.0;
        double r16562 = /* ERROR: no complex support in C */;
        double r16563 = r16559 / r16562;
        double r16564 = /* ERROR: no complex support in C */;
        return r16564;
}

double f(double xre, double xim) {
        double r16565 = xre;
        double r16566 = xim;
        double r16567 = /* ERROR: no complex support in C */;
        double r16568 = exp(r16567);
        double r16569 = -r16567;
        double r16570 = exp(r16569);
        double r16571 = r16568 + r16570;
        double r16572 = 2.0;
        double r16573 = 0.0;
        double r16574 = /* ERROR: no complex support in C */;
        double r16575 = r16571 / r16574;
        double r16576 = /* ERROR: no complex support in C */;
        return r16576;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 43.3

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

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