Average Error: 43.3 → 43.3
Time: 26.2s
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 r9152 = xre;
        double r9153 = xim;
        double r9154 = /* ERROR: no complex support in C */;
        double r9155 = exp(r9154);
        double r9156 = -r9154;
        double r9157 = exp(r9156);
        double r9158 = r9155 + r9157;
        double r9159 = 2.0;
        double r9160 = 0.0;
        double r9161 = /* ERROR: no complex support in C */;
        double r9162 = r9158 / r9161;
        double r9163 = /* ERROR: no complex support in C */;
        return r9163;
}

double f(double xre, double xim) {
        double r9164 = xre;
        double r9165 = xim;
        double r9166 = /* ERROR: no complex support in C */;
        double r9167 = exp(r9166);
        double r9168 = -r9166;
        double r9169 = exp(r9168);
        double r9170 = r9167 + r9169;
        double r9171 = 2.0;
        double r9172 = 0.0;
        double r9173 = /* ERROR: no complex support in C */;
        double r9174 = r9170 / r9173;
        double r9175 = /* ERROR: no complex support in C */;
        return r9175;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 43.3

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

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