Average Error: 0.0 → 0.0
Time: 4.5s
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 r13357 = xre;
        double r13358 = xim;
        double r13359 = /* ERROR: no complex support in C */;
        double r13360 = exp(r13359);
        double r13361 = -r13359;
        double r13362 = exp(r13361);
        double r13363 = r13360 + r13362;
        double r13364 = 2.0;
        double r13365 = 0.0;
        double r13366 = /* ERROR: no complex support in C */;
        double r13367 = r13363 / r13366;
        double r13368 = /* ERROR: no complex support in C */;
        return r13368;
}

double f(double xre, double xim) {
        double r13369 = xre;
        double r13370 = xim;
        double r13371 = /* ERROR: no complex support in C */;
        double r13372 = exp(r13371);
        double r13373 = -r13371;
        double r13374 = exp(r13373);
        double r13375 = r13372 + r13374;
        double r13376 = 2.0;
        double r13377 = 0.0;
        double r13378 = /* ERROR: no complex support in C */;
        double r13379 = r13375 / r13378;
        double r13380 = /* ERROR: no complex support in C */;
        return r13380;
}

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