Average Error: 43.1 → 43.1
Time: 25.6s
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 r9102 = xre;
        double r9103 = xim;
        double r9104 = /* ERROR: no complex support in C */;
        double r9105 = exp(r9104);
        double r9106 = -r9104;
        double r9107 = exp(r9106);
        double r9108 = r9105 + r9107;
        double r9109 = 2.0;
        double r9110 = 0.0;
        double r9111 = /* ERROR: no complex support in C */;
        double r9112 = r9108 / r9111;
        double r9113 = /* ERROR: no complex support in C */;
        return r9113;
}

double f(double xre, double xim) {
        double r9114 = xre;
        double r9115 = xim;
        double r9116 = /* ERROR: no complex support in C */;
        double r9117 = exp(r9116);
        double r9118 = -r9116;
        double r9119 = exp(r9118);
        double r9120 = r9117 + r9119;
        double r9121 = 2.0;
        double r9122 = 0.0;
        double r9123 = /* ERROR: no complex support in C */;
        double r9124 = r9120 / r9123;
        double r9125 = /* ERROR: no complex support in C */;
        return r9125;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 43.1

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

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