Average Error: 43.6 → 43.6
Time: 10.5s
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 r18361 = xre;
        double r18362 = xim;
        double r18363 = /* ERROR: no complex support in C */;
        double r18364 = exp(r18363);
        double r18365 = -r18363;
        double r18366 = exp(r18365);
        double r18367 = r18364 + r18366;
        double r18368 = 2.0;
        double r18369 = 0.0;
        double r18370 = /* ERROR: no complex support in C */;
        double r18371 = r18367 / r18370;
        double r18372 = /* ERROR: no complex support in C */;
        return r18372;
}

double f(double xre, double xim) {
        double r18373 = xre;
        double r18374 = xim;
        double r18375 = /* ERROR: no complex support in C */;
        double r18376 = exp(r18375);
        double r18377 = -r18375;
        double r18378 = exp(r18377);
        double r18379 = r18376 + r18378;
        double r18380 = 2.0;
        double r18381 = 0.0;
        double r18382 = /* ERROR: no complex support in C */;
        double r18383 = r18379 / r18382;
        double r18384 = /* ERROR: no complex support in C */;
        return r18384;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 43.6

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

    \[\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 2020049 +o rules:numerics
(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))))