Average Error: 0.0 → 0.0
Time: 4.3s
Precision: 64
\[\Re(\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))\]
\[\Re(\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))\]
\Re(\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))
\Re(\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 r14045 = xre;
        double r14046 = xim;
        double r14047 = /* ERROR: no complex support in C */;
        double r14048 = exp(r14047);
        double r14049 = -r14047;
        double r14050 = exp(r14049);
        double r14051 = r14048 + r14050;
        double r14052 = 2.0;
        double r14053 = 0.0;
        double r14054 = /* ERROR: no complex support in C */;
        double r14055 = r14051 / r14054;
        double r14056 = /* ERROR: no complex support in C */;
        return r14056;
}

double f(double xre, double xim) {
        double r14057 = xre;
        double r14058 = xim;
        double r14059 = /* ERROR: no complex support in C */;
        double r14060 = exp(r14059);
        double r14061 = -r14059;
        double r14062 = exp(r14061);
        double r14063 = r14060 + r14062;
        double r14064 = 2.0;
        double r14065 = 0.0;
        double r14066 = /* ERROR: no complex support in C */;
        double r14067 = r14063 / r14066;
        double r14068 = /* ERROR: no complex support in C */;
        return r14068;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 0.0

    \[\Re(\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 simplification0.0

    \[\leadsto \Re(\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 2020021 
(FPCore (xre xim)
  :name "exp with complex power real part (p55)"
  :precision binary64
  (re (/ (+ (exp (complex xre xim)) (exp (- (complex xre xim)))) (complex 2 0.0))))