Average Error: 0.0 → 0.0
Time: 4.4s
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 r13238 = xre;
        double r13239 = xim;
        double r13240 = /* ERROR: no complex support in C */;
        double r13241 = exp(r13240);
        double r13242 = -r13240;
        double r13243 = exp(r13242);
        double r13244 = r13241 + r13243;
        double r13245 = 2.0;
        double r13246 = 0.0;
        double r13247 = /* ERROR: no complex support in C */;
        double r13248 = r13244 / r13247;
        double r13249 = /* ERROR: no complex support in C */;
        return r13249;
}

double f(double xre, double xim) {
        double r13250 = xre;
        double r13251 = xim;
        double r13252 = /* ERROR: no complex support in C */;
        double r13253 = exp(r13252);
        double r13254 = -r13252;
        double r13255 = exp(r13254);
        double r13256 = r13253 + r13255;
        double r13257 = 2.0;
        double r13258 = 0.0;
        double r13259 = /* ERROR: no complex support in C */;
        double r13260 = r13256 / r13259;
        double r13261 = /* ERROR: no complex support in C */;
        return r13261;
}

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