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 r19072 = xre;
        double r19073 = xim;
        double r19074 = /* ERROR: no complex support in C */;
        double r19075 = exp(r19074);
        double r19076 = -r19074;
        double r19077 = exp(r19076);
        double r19078 = r19075 + r19077;
        double r19079 = 2.0;
        double r19080 = 0.0;
        double r19081 = /* ERROR: no complex support in C */;
        double r19082 = r19078 / r19081;
        double r19083 = /* ERROR: no complex support in C */;
        return r19083;
}

double f(double xre, double xim) {
        double r19084 = xre;
        double r19085 = xim;
        double r19086 = /* ERROR: no complex support in C */;
        double r19087 = exp(r19086);
        double r19088 = -r19086;
        double r19089 = exp(r19088);
        double r19090 = r19087 + r19089;
        double r19091 = 2.0;
        double r19092 = 0.0;
        double r19093 = /* ERROR: no complex support in C */;
        double r19094 = r19090 / r19093;
        double r19095 = /* ERROR: no complex support in C */;
        return r19095;
}

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