Average Error: 42.9 → 42.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 r19628 = xre;
        double r19629 = xim;
        double r19630 = /* ERROR: no complex support in C */;
        double r19631 = exp(r19630);
        double r19632 = -r19630;
        double r19633 = exp(r19632);
        double r19634 = r19631 + r19633;
        double r19635 = 2.0;
        double r19636 = 0.0;
        double r19637 = /* ERROR: no complex support in C */;
        double r19638 = r19634 / r19637;
        double r19639 = /* ERROR: no complex support in C */;
        return r19639;
}

double f(double xre, double xim) {
        double r19640 = xre;
        double r19641 = xim;
        double r19642 = /* ERROR: no complex support in C */;
        double r19643 = exp(r19642);
        double r19644 = -r19642;
        double r19645 = exp(r19644);
        double r19646 = r19643 + r19645;
        double r19647 = 2.0;
        double r19648 = 0.0;
        double r19649 = /* ERROR: no complex support in C */;
        double r19650 = r19646 / r19649;
        double r19651 = /* ERROR: no complex support in C */;
        return r19651;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 42.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 simplification42.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 2020047 
(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))))