Average Error: 43.4 → 43.4
Time: 27.1s
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 r9089 = xre;
        double r9090 = xim;
        double r9091 = /* ERROR: no complex support in C */;
        double r9092 = exp(r9091);
        double r9093 = -r9091;
        double r9094 = exp(r9093);
        double r9095 = r9092 + r9094;
        double r9096 = 2.0;
        double r9097 = 0.0;
        double r9098 = /* ERROR: no complex support in C */;
        double r9099 = r9095 / r9098;
        double r9100 = /* ERROR: no complex support in C */;
        return r9100;
}

double f(double xre, double xim) {
        double r9101 = xre;
        double r9102 = xim;
        double r9103 = /* ERROR: no complex support in C */;
        double r9104 = exp(r9103);
        double r9105 = -r9103;
        double r9106 = exp(r9105);
        double r9107 = r9104 + r9106;
        double r9108 = 2.0;
        double r9109 = 0.0;
        double r9110 = /* ERROR: no complex support in C */;
        double r9111 = r9107 / r9110;
        double r9112 = /* ERROR: no complex support in C */;
        return r9112;
}

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