Average Error: 44.0 → 44.0
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 r16417 = xre;
        double r16418 = xim;
        double r16419 = /* ERROR: no complex support in C */;
        double r16420 = exp(r16419);
        double r16421 = -r16419;
        double r16422 = exp(r16421);
        double r16423 = r16420 + r16422;
        double r16424 = 2.0;
        double r16425 = 0.0;
        double r16426 = /* ERROR: no complex support in C */;
        double r16427 = r16423 / r16426;
        double r16428 = /* ERROR: no complex support in C */;
        return r16428;
}

double f(double xre, double xim) {
        double r16429 = xre;
        double r16430 = xim;
        double r16431 = /* ERROR: no complex support in C */;
        double r16432 = exp(r16431);
        double r16433 = -r16431;
        double r16434 = exp(r16433);
        double r16435 = r16432 + r16434;
        double r16436 = 2.0;
        double r16437 = 0.0;
        double r16438 = /* ERROR: no complex support in C */;
        double r16439 = r16435 / r16438;
        double r16440 = /* ERROR: no complex support in C */;
        return r16440;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 44.0

    \[\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 simplification44.0

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