Average Error: 43.8 → 43.8
Time: 27.6s
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 r12061 = xre;
        double r12062 = xim;
        double r12063 = /* ERROR: no complex support in C */;
        double r12064 = exp(r12063);
        double r12065 = -r12063;
        double r12066 = exp(r12065);
        double r12067 = r12064 + r12066;
        double r12068 = 2.0;
        double r12069 = 0.0;
        double r12070 = /* ERROR: no complex support in C */;
        double r12071 = r12067 / r12070;
        double r12072 = /* ERROR: no complex support in C */;
        return r12072;
}

double f(double xre, double xim) {
        double r12073 = xre;
        double r12074 = xim;
        double r12075 = /* ERROR: no complex support in C */;
        double r12076 = -r12075;
        double r12077 = exp(r12076);
        double r12078 = exp(r12075);
        double r12079 = r12077 + r12078;
        double r12080 = 2.0;
        double r12081 = 0.0;
        double r12082 = /* ERROR: no complex support in C */;
        double r12083 = r12079 / r12082;
        double r12084 = /* ERROR: no complex support in C */;
        return r12084;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 43.8

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

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

Reproduce

herbie shell --seed 2019121 +o rules:numerics
(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))))