Average Error: 43.8 → 43.8
Time: 11.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 r11639 = xre;
        double r11640 = xim;
        double r11641 = /* ERROR: no complex support in C */;
        double r11642 = exp(r11641);
        double r11643 = -r11641;
        double r11644 = exp(r11643);
        double r11645 = r11642 + r11644;
        double r11646 = 2.0;
        double r11647 = 0.0;
        double r11648 = /* ERROR: no complex support in C */;
        double r11649 = r11645 / r11648;
        double r11650 = /* ERROR: no complex support in C */;
        return r11650;
}

double f(double xre, double xim) {
        double r11651 = xre;
        double r11652 = xim;
        double r11653 = /* ERROR: no complex support in C */;
        double r11654 = exp(r11653);
        double r11655 = -r11653;
        double r11656 = exp(r11655);
        double r11657 = r11654 + r11656;
        double r11658 = 2.0;
        double r11659 = 0.0;
        double r11660 = /* ERROR: no complex support in C */;
        double r11661 = r11657 / r11660;
        double r11662 = /* ERROR: no complex support in C */;
        return r11662;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 43.8

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

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