Average Error: 43.4 → 43.4
Time: 17.3s
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 r28303 = xre;
        double r28304 = xim;
        double r28305 = /* ERROR: no complex support in C */;
        double r28306 = exp(r28305);
        double r28307 = -r28305;
        double r28308 = exp(r28307);
        double r28309 = r28306 + r28308;
        double r28310 = 2.0;
        double r28311 = 0.0;
        double r28312 = /* ERROR: no complex support in C */;
        double r28313 = r28309 / r28312;
        double r28314 = /* ERROR: no complex support in C */;
        return r28314;
}

double f(double xre, double xim) {
        double r28315 = xre;
        double r28316 = xim;
        double r28317 = /* ERROR: no complex support in C */;
        double r28318 = exp(r28317);
        double r28319 = -r28317;
        double r28320 = exp(r28319);
        double r28321 = r28318 + r28320;
        double r28322 = 2.0;
        double r28323 = 0.0;
        double r28324 = /* ERROR: no complex support in C */;
        double r28325 = r28321 / r28324;
        double r28326 = /* ERROR: no complex support in C */;
        return r28326;
}

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