Average Error: 0.0 → 0.0
Time: 3.7s
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 r14330 = xre;
        double r14331 = xim;
        double r14332 = /* ERROR: no complex support in C */;
        double r14333 = exp(r14332);
        double r14334 = -r14332;
        double r14335 = exp(r14334);
        double r14336 = r14333 + r14335;
        double r14337 = 2.0;
        double r14338 = 0.0;
        double r14339 = /* ERROR: no complex support in C */;
        double r14340 = r14336 / r14339;
        double r14341 = /* ERROR: no complex support in C */;
        return r14341;
}

double f(double xre, double xim) {
        double r14342 = xre;
        double r14343 = xim;
        double r14344 = /* ERROR: no complex support in C */;
        double r14345 = exp(r14344);
        double r14346 = -r14344;
        double r14347 = exp(r14346);
        double r14348 = r14345 + r14347;
        double r14349 = 2.0;
        double r14350 = 0.0;
        double r14351 = /* ERROR: no complex support in C */;
        double r14352 = r14348 / r14351;
        double r14353 = /* ERROR: no complex support in C */;
        return r14353;
}

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