Average Error: 43.7 → 43.7
Time: 26.5s
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 r9293 = xre;
        double r9294 = xim;
        double r9295 = /* ERROR: no complex support in C */;
        double r9296 = exp(r9295);
        double r9297 = -r9295;
        double r9298 = exp(r9297);
        double r9299 = r9296 + r9298;
        double r9300 = 2.0;
        double r9301 = 0.0;
        double r9302 = /* ERROR: no complex support in C */;
        double r9303 = r9299 / r9302;
        double r9304 = /* ERROR: no complex support in C */;
        return r9304;
}

double f(double xre, double xim) {
        double r9305 = xre;
        double r9306 = xim;
        double r9307 = /* ERROR: no complex support in C */;
        double r9308 = exp(r9307);
        double r9309 = -r9307;
        double r9310 = exp(r9309);
        double r9311 = r9308 + r9310;
        double r9312 = 2.0;
        double r9313 = 0.0;
        double r9314 = /* ERROR: no complex support in C */;
        double r9315 = r9311 / r9314;
        double r9316 = /* ERROR: no complex support in C */;
        return r9316;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 43.7

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

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