Average Error: 43.7 → 43.7
Time: 12.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.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 r14053 = xre;
        double r14054 = xim;
        double r14055 = /* ERROR: no complex support in C */;
        double r14056 = exp(r14055);
        double r14057 = -r14055;
        double r14058 = exp(r14057);
        double r14059 = r14056 + r14058;
        double r14060 = 2.0;
        double r14061 = 0.0;
        double r14062 = /* ERROR: no complex support in C */;
        double r14063 = r14059 / r14062;
        double r14064 = /* ERROR: no complex support in C */;
        return r14064;
}

double f(double xre, double xim) {
        double r14065 = xre;
        double r14066 = xim;
        double r14067 = /* ERROR: no complex support in C */;
        double r14068 = exp(r14067);
        double r14069 = -r14067;
        double r14070 = exp(r14069);
        double r14071 = r14068 + r14070;
        double r14072 = 2.0;
        double r14073 = 0.0;
        double r14074 = /* ERROR: no complex support in C */;
        double r14075 = r14071 / r14074;
        double r14076 = /* ERROR: no complex support in C */;
        return r14076;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 43.7

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

    \[\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 2020002 +o rules:numerics
(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))))