Average Error: 43.4 → 43.4
Time: 11.4s
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 r15145 = xre;
        double r15146 = xim;
        double r15147 = /* ERROR: no complex support in C */;
        double r15148 = exp(r15147);
        double r15149 = -r15147;
        double r15150 = exp(r15149);
        double r15151 = r15148 + r15150;
        double r15152 = 2.0;
        double r15153 = 0.0;
        double r15154 = /* ERROR: no complex support in C */;
        double r15155 = r15151 / r15154;
        double r15156 = /* ERROR: no complex support in C */;
        return r15156;
}

double f(double xre, double xim) {
        double r15157 = xre;
        double r15158 = xim;
        double r15159 = /* ERROR: no complex support in C */;
        double r15160 = exp(r15159);
        double r15161 = -r15159;
        double r15162 = exp(r15161);
        double r15163 = r15160 + r15162;
        double r15164 = 2.0;
        double r15165 = 0.0;
        double r15166 = /* ERROR: no complex support in C */;
        double r15167 = r15163 / r15166;
        double r15168 = /* ERROR: no complex support in C */;
        return r15168;
}

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