Average Error: 43.4 → 43.4
Time: 26.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 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 r10801 = xre;
        double r10802 = xim;
        double r10803 = /* ERROR: no complex support in C */;
        double r10804 = exp(r10803);
        double r10805 = -r10803;
        double r10806 = exp(r10805);
        double r10807 = r10804 + r10806;
        double r10808 = 2.0;
        double r10809 = 0.0;
        double r10810 = /* ERROR: no complex support in C */;
        double r10811 = r10807 / r10810;
        double r10812 = /* ERROR: no complex support in C */;
        return r10812;
}

double f(double xre, double xim) {
        double r10813 = xre;
        double r10814 = xim;
        double r10815 = /* ERROR: no complex support in C */;
        double r10816 = -r10815;
        double r10817 = exp(r10816);
        double r10818 = exp(r10815);
        double r10819 = r10817 + r10818;
        double r10820 = 2.0;
        double r10821 = 0.0;
        double r10822 = /* ERROR: no complex support in C */;
        double r10823 = r10819 / r10822;
        double r10824 = /* ERROR: no complex support in C */;
        return r10824;
}

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

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

Reproduce

herbie shell --seed 2019137 
(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))))