Average Error: 0.0 → 0.0
Time: 4.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 r13562 = xre;
        double r13563 = xim;
        double r13564 = /* ERROR: no complex support in C */;
        double r13565 = exp(r13564);
        double r13566 = -r13564;
        double r13567 = exp(r13566);
        double r13568 = r13565 + r13567;
        double r13569 = 2.0;
        double r13570 = 0.0;
        double r13571 = /* ERROR: no complex support in C */;
        double r13572 = r13568 / r13571;
        double r13573 = /* ERROR: no complex support in C */;
        return r13573;
}

double f(double xre, double xim) {
        double r13574 = xre;
        double r13575 = xim;
        double r13576 = /* ERROR: no complex support in C */;
        double r13577 = exp(r13576);
        double r13578 = -r13576;
        double r13579 = exp(r13578);
        double r13580 = r13577 + r13579;
        double r13581 = 2.0;
        double r13582 = 0.0;
        double r13583 = /* ERROR: no complex support in C */;
        double r13584 = r13580 / r13583;
        double r13585 = /* ERROR: no complex support in C */;
        return r13585;
}

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