Average Error: 43.2 → 43.2
Time: 25.6s
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 r9037 = xre;
        double r9038 = xim;
        double r9039 = /* ERROR: no complex support in C */;
        double r9040 = exp(r9039);
        double r9041 = -r9039;
        double r9042 = exp(r9041);
        double r9043 = r9040 + r9042;
        double r9044 = 2.0;
        double r9045 = 0.0;
        double r9046 = /* ERROR: no complex support in C */;
        double r9047 = r9043 / r9046;
        double r9048 = /* ERROR: no complex support in C */;
        return r9048;
}

double f(double xre, double xim) {
        double r9049 = xre;
        double r9050 = xim;
        double r9051 = /* ERROR: no complex support in C */;
        double r9052 = exp(r9051);
        double r9053 = -r9051;
        double r9054 = exp(r9053);
        double r9055 = r9052 + r9054;
        double r9056 = 2.0;
        double r9057 = 0.0;
        double r9058 = /* ERROR: no complex support in C */;
        double r9059 = r9055 / r9058;
        double r9060 = /* ERROR: no complex support in C */;
        return r9060;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 43.2

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

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