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 r16019 = xre;
        double r16020 = xim;
        double r16021 = /* ERROR: no complex support in C */;
        double r16022 = exp(r16021);
        double r16023 = -r16021;
        double r16024 = exp(r16023);
        double r16025 = r16022 + r16024;
        double r16026 = 2.0;
        double r16027 = 0.0;
        double r16028 = /* ERROR: no complex support in C */;
        double r16029 = r16025 / r16028;
        double r16030 = /* ERROR: no complex support in C */;
        return r16030;
}

double f(double xre, double xim) {
        double r16031 = xre;
        double r16032 = xim;
        double r16033 = /* ERROR: no complex support in C */;
        double r16034 = exp(r16033);
        double r16035 = -r16033;
        double r16036 = exp(r16035);
        double r16037 = r16034 + r16036;
        double r16038 = 2.0;
        double r16039 = 0.0;
        double r16040 = /* ERROR: no complex support in C */;
        double r16041 = r16037 / r16040;
        double r16042 = /* ERROR: no complex support in C */;
        return r16042;
}

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