Average Error: 42.9 → 42.9
Time: 10.7s
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 r14982 = xre;
        double r14983 = xim;
        double r14984 = /* ERROR: no complex support in C */;
        double r14985 = exp(r14984);
        double r14986 = -r14984;
        double r14987 = exp(r14986);
        double r14988 = r14985 + r14987;
        double r14989 = 2.0;
        double r14990 = 0.0;
        double r14991 = /* ERROR: no complex support in C */;
        double r14992 = r14988 / r14991;
        double r14993 = /* ERROR: no complex support in C */;
        return r14993;
}

double f(double xre, double xim) {
        double r14994 = xre;
        double r14995 = xim;
        double r14996 = /* ERROR: no complex support in C */;
        double r14997 = exp(r14996);
        double r14998 = -r14996;
        double r14999 = exp(r14998);
        double r15000 = r14997 + r14999;
        double r15001 = 2.0;
        double r15002 = 0.0;
        double r15003 = /* ERROR: no complex support in C */;
        double r15004 = r15000 / r15003;
        double r15005 = /* ERROR: no complex support in C */;
        return r15005;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 42.9

    \[\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 simplification42.9

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