Average Error: 43.4 → 43.4
Time: 27.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 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 r12798 = xre;
        double r12799 = xim;
        double r12800 = /* ERROR: no complex support in C */;
        double r12801 = exp(r12800);
        double r12802 = -r12800;
        double r12803 = exp(r12802);
        double r12804 = r12801 + r12803;
        double r12805 = 2.0;
        double r12806 = 0.0;
        double r12807 = /* ERROR: no complex support in C */;
        double r12808 = r12804 / r12807;
        double r12809 = /* ERROR: no complex support in C */;
        return r12809;
}

double f(double xre, double xim) {
        double r12810 = xre;
        double r12811 = xim;
        double r12812 = /* ERROR: no complex support in C */;
        double r12813 = -r12812;
        double r12814 = exp(r12813);
        double r12815 = exp(r12812);
        double r12816 = r12814 + r12815;
        double r12817 = 2.0;
        double r12818 = 0.0;
        double r12819 = /* ERROR: no complex support in C */;
        double r12820 = r12816 / r12819;
        double r12821 = /* ERROR: no complex support in C */;
        return r12821;
}

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 2019107 
(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))))