Average Error: 43.4 → 43.4
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 r23233 = xre;
        double r23234 = xim;
        double r23235 = /* ERROR: no complex support in C */;
        double r23236 = exp(r23235);
        double r23237 = -r23235;
        double r23238 = exp(r23237);
        double r23239 = r23236 + r23238;
        double r23240 = 2.0;
        double r23241 = 0.0;
        double r23242 = /* ERROR: no complex support in C */;
        double r23243 = r23239 / r23242;
        double r23244 = /* ERROR: no complex support in C */;
        return r23244;
}

double f(double xre, double xim) {
        double r23245 = xre;
        double r23246 = xim;
        double r23247 = /* ERROR: no complex support in C */;
        double r23248 = exp(r23247);
        double r23249 = -r23247;
        double r23250 = exp(r23249);
        double r23251 = r23248 + r23250;
        double r23252 = 2.0;
        double r23253 = 0.0;
        double r23254 = /* ERROR: no complex support in C */;
        double r23255 = r23251 / r23254;
        double r23256 = /* ERROR: no complex support in C */;
        return r23256;
}

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