Average Error: 0.0 → 0.0
Time: 3.8s
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 r13352 = xre;
        double r13353 = xim;
        double r13354 = /* ERROR: no complex support in C */;
        double r13355 = exp(r13354);
        double r13356 = -r13354;
        double r13357 = exp(r13356);
        double r13358 = r13355 + r13357;
        double r13359 = 2.0;
        double r13360 = 0.0;
        double r13361 = /* ERROR: no complex support in C */;
        double r13362 = r13358 / r13361;
        double r13363 = /* ERROR: no complex support in C */;
        return r13363;
}

double f(double xre, double xim) {
        double r13364 = xre;
        double r13365 = xim;
        double r13366 = /* ERROR: no complex support in C */;
        double r13367 = exp(r13366);
        double r13368 = -r13366;
        double r13369 = exp(r13368);
        double r13370 = r13367 + r13369;
        double r13371 = 2.0;
        double r13372 = 0.0;
        double r13373 = /* ERROR: no complex support in C */;
        double r13374 = r13370 / r13373;
        double r13375 = /* ERROR: no complex support in C */;
        return r13375;
}

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