Average Error: 43.4 → 43.4
Time: 10.8s
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 r19938 = xre;
        double r19939 = xim;
        double r19940 = /* ERROR: no complex support in C */;
        double r19941 = exp(r19940);
        double r19942 = -r19940;
        double r19943 = exp(r19942);
        double r19944 = r19941 + r19943;
        double r19945 = 2.0;
        double r19946 = 0.0;
        double r19947 = /* ERROR: no complex support in C */;
        double r19948 = r19944 / r19947;
        double r19949 = /* ERROR: no complex support in C */;
        return r19949;
}

double f(double xre, double xim) {
        double r19950 = xre;
        double r19951 = xim;
        double r19952 = /* ERROR: no complex support in C */;
        double r19953 = exp(r19952);
        double r19954 = -r19952;
        double r19955 = exp(r19954);
        double r19956 = r19953 + r19955;
        double r19957 = 2.0;
        double r19958 = 0.0;
        double r19959 = /* ERROR: no complex support in C */;
        double r19960 = r19956 / r19959;
        double r19961 = /* ERROR: no complex support in C */;
        return r19961;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 43.4

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

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