Average Error: 43.5 → 43.5
Time: 2.9m
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 r10368 = xre;
        double r10369 = xim;
        double r10370 = /* ERROR: no complex support in C */;
        double r10371 = exp(r10370);
        double r10372 = -r10370;
        double r10373 = exp(r10372);
        double r10374 = r10371 + r10373;
        double r10375 = 2.0;
        double r10376 = 0.0;
        double r10377 = /* ERROR: no complex support in C */;
        double r10378 = r10374 / r10377;
        double r10379 = /* ERROR: no complex support in C */;
        return r10379;
}

double f(double xre, double xim) {
        double r10380 = xre;
        double r10381 = xim;
        double r10382 = /* ERROR: no complex support in C */;
        double r10383 = exp(r10382);
        double r10384 = -r10382;
        double r10385 = exp(r10384);
        double r10386 = r10383 + r10385;
        double r10387 = 2.0;
        double r10388 = 0.0;
        double r10389 = /* ERROR: no complex support in C */;
        double r10390 = r10386 / r10389;
        double r10391 = /* ERROR: no complex support in C */;
        return r10391;
}

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 2019200 
(FPCore (xre xim)
  :name "exp with complex power imaginary part (p55)"
  (im (/ (+ (exp (complex xre xim)) (exp (- (complex xre xim)))) (complex 2.0 0.0))))