Average Error: 43.5 → 43.5
Time: 25.9s
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 r9281 = xre;
        double r9282 = xim;
        double r9283 = /* ERROR: no complex support in C */;
        double r9284 = exp(r9283);
        double r9285 = -r9283;
        double r9286 = exp(r9285);
        double r9287 = r9284 + r9286;
        double r9288 = 2.0;
        double r9289 = 0.0;
        double r9290 = /* ERROR: no complex support in C */;
        double r9291 = r9287 / r9290;
        double r9292 = /* ERROR: no complex support in C */;
        return r9292;
}

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;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 43.5

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

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