Average Error: 43.2 → 43.2
Time: 26.9s
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 r9019 = xre;
        double r9020 = xim;
        double r9021 = /* ERROR: no complex support in C */;
        double r9022 = exp(r9021);
        double r9023 = -r9021;
        double r9024 = exp(r9023);
        double r9025 = r9022 + r9024;
        double r9026 = 2.0;
        double r9027 = 0.0;
        double r9028 = /* ERROR: no complex support in C */;
        double r9029 = r9025 / r9028;
        double r9030 = /* ERROR: no complex support in C */;
        return r9030;
}

double f(double xre, double xim) {
        double r9031 = xre;
        double r9032 = xim;
        double r9033 = /* ERROR: no complex support in C */;
        double r9034 = exp(r9033);
        double r9035 = -r9033;
        double r9036 = exp(r9035);
        double r9037 = r9034 + r9036;
        double r9038 = 2.0;
        double r9039 = 0.0;
        double r9040 = /* ERROR: no complex support in C */;
        double r9041 = r9037 / r9040;
        double r9042 = /* ERROR: no complex support in C */;
        return r9042;
}

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