Average Error: 43.9 → 43.9
Time: 10.4s
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 r15647 = xre;
        double r15648 = xim;
        double r15649 = /* ERROR: no complex support in C */;
        double r15650 = exp(r15649);
        double r15651 = -r15649;
        double r15652 = exp(r15651);
        double r15653 = r15650 + r15652;
        double r15654 = 2.0;
        double r15655 = 0.0;
        double r15656 = /* ERROR: no complex support in C */;
        double r15657 = r15653 / r15656;
        double r15658 = /* ERROR: no complex support in C */;
        return r15658;
}

double f(double xre, double xim) {
        double r15659 = xre;
        double r15660 = xim;
        double r15661 = /* ERROR: no complex support in C */;
        double r15662 = exp(r15661);
        double r15663 = -r15661;
        double r15664 = exp(r15663);
        double r15665 = r15662 + r15664;
        double r15666 = 2.0;
        double r15667 = 0.0;
        double r15668 = /* ERROR: no complex support in C */;
        double r15669 = r15665 / r15668;
        double r15670 = /* ERROR: no complex support in C */;
        return r15670;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 43.9

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

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