Average Error: 0.0 → 0.0
Time: 4.0s
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 r25458 = xre;
        double r25459 = xim;
        double r25460 = /* ERROR: no complex support in C */;
        double r25461 = exp(r25460);
        double r25462 = -r25460;
        double r25463 = exp(r25462);
        double r25464 = r25461 + r25463;
        double r25465 = 2.0;
        double r25466 = 0.0;
        double r25467 = /* ERROR: no complex support in C */;
        double r25468 = r25464 / r25467;
        double r25469 = /* ERROR: no complex support in C */;
        return r25469;
}

double f(double xre, double xim) {
        double r25470 = xre;
        double r25471 = xim;
        double r25472 = /* ERROR: no complex support in C */;
        double r25473 = exp(r25472);
        double r25474 = -r25472;
        double r25475 = exp(r25474);
        double r25476 = r25473 + r25475;
        double r25477 = 2.0;
        double r25478 = 0.0;
        double r25479 = /* ERROR: no complex support in C */;
        double r25480 = r25476 / r25479;
        double r25481 = /* ERROR: no complex support in C */;
        return r25481;
}

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