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 r12312 = xre;
        double r12313 = xim;
        double r12314 = /* ERROR: no complex support in C */;
        double r12315 = exp(r12314);
        double r12316 = -r12314;
        double r12317 = exp(r12316);
        double r12318 = r12315 + r12317;
        double r12319 = 2.0;
        double r12320 = 0.0;
        double r12321 = /* ERROR: no complex support in C */;
        double r12322 = r12318 / r12321;
        double r12323 = /* ERROR: no complex support in C */;
        return r12323;
}

double f(double xre, double xim) {
        double r12324 = xre;
        double r12325 = xim;
        double r12326 = /* ERROR: no complex support in C */;
        double r12327 = exp(r12326);
        double r12328 = -r12326;
        double r12329 = exp(r12328);
        double r12330 = r12327 + r12329;
        double r12331 = 2.0;
        double r12332 = 0.0;
        double r12333 = /* ERROR: no complex support in C */;
        double r12334 = r12330 / r12333;
        double r12335 = /* ERROR: no complex support in C */;
        return r12335;
}

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