Average Error: 43.6 → 43.6
Time: 10.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 r3305 = xre;
        double r3306 = xim;
        double r3307 = /* ERROR: no complex support in C */;
        double r3308 = exp(r3307);
        double r3309 = -r3307;
        double r3310 = exp(r3309);
        double r3311 = r3308 + r3310;
        double r3312 = 2.0;
        double r3313 = 0.0;
        double r3314 = /* ERROR: no complex support in C */;
        double r3315 = r3311 / r3314;
        double r3316 = /* ERROR: no complex support in C */;
        return r3316;
}

double f(double xre, double xim) {
        double r3317 = xre;
        double r3318 = xim;
        double r3319 = /* ERROR: no complex support in C */;
        double r3320 = exp(r3319);
        double r3321 = -r3319;
        double r3322 = exp(r3321);
        double r3323 = r3320 + r3322;
        double r3324 = 2.0;
        double r3325 = 0.0;
        double r3326 = /* ERROR: no complex support in C */;
        double r3327 = r3323 / r3326;
        double r3328 = /* ERROR: no complex support in C */;
        return r3328;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 43.6

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

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