Average Error: 43.6 → 43.6
Time: 10.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 r19656 = xre;
        double r19657 = xim;
        double r19658 = /* ERROR: no complex support in C */;
        double r19659 = exp(r19658);
        double r19660 = -r19658;
        double r19661 = exp(r19660);
        double r19662 = r19659 + r19661;
        double r19663 = 2.0;
        double r19664 = 0.0;
        double r19665 = /* ERROR: no complex support in C */;
        double r19666 = r19662 / r19665;
        double r19667 = /* ERROR: no complex support in C */;
        return r19667;
}

double f(double xre, double xim) {
        double r19668 = xre;
        double r19669 = xim;
        double r19670 = /* ERROR: no complex support in C */;
        double r19671 = exp(r19670);
        double r19672 = -r19670;
        double r19673 = exp(r19672);
        double r19674 = r19671 + r19673;
        double r19675 = 2.0;
        double r19676 = 0.0;
        double r19677 = /* ERROR: no complex support in C */;
        double r19678 = r19674 / r19677;
        double r19679 = /* ERROR: no complex support in C */;
        return r19679;
}

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 2020064 
(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))))