Average Error: 43.0 → 43.0
Time: 27.3s
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 i\right)}\right))\]
\[\Im(\left(\frac{e^{-\left(xre + xim i\right)} + e^{xre + xim i}}{2 + 0 i}\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 i\right)}\right))
\Im(\left(\frac{e^{-\left(xre + xim i\right)} + e^{xre + xim i}}{2 + 0 i}\right))
double f(double xre, double xim) {
        double r10957 = xre;
        double r10958 = xim;
        double r10959 = /* ERROR: no complex support in C */;
        double r10960 = exp(r10959);
        double r10961 = -r10959;
        double r10962 = exp(r10961);
        double r10963 = r10960 + r10962;
        double r10964 = 2.0;
        double r10965 = 0.0;
        double r10966 = /* ERROR: no complex support in C */;
        double r10967 = r10963 / r10966;
        double r10968 = /* ERROR: no complex support in C */;
        return r10968;
}

double f(double xre, double xim) {
        double r10969 = xre;
        double r10970 = xim;
        double r10971 = /* ERROR: no complex support in C */;
        double r10972 = -r10971;
        double r10973 = exp(r10972);
        double r10974 = exp(r10971);
        double r10975 = r10973 + r10974;
        double r10976 = 2.0;
        double r10977 = 0.0;
        double r10978 = /* ERROR: no complex support in C */;
        double r10979 = r10975 / r10978;
        double r10980 = /* ERROR: no complex support in C */;
        return r10980;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 43.0

    \[\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 i\right)}\right))\]
  2. Final simplification43.0

    \[\leadsto \Im(\left(\frac{e^{-\left(xre + xim i\right)} + e^{xre + xim i}}{2 + 0 i}\right))\]

Reproduce

herbie shell --seed 2019130 
(FPCore (xre xim)
  :name "exp with complex power imaginary part (p55)"
  (im (/.c (+.c (exp.c (complex xre xim)) (exp.c (neg.c (complex xre xim)))) (complex 2 0))))