Average Error: 0.0 → 0.0
Time: 4.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 r20234 = xre;
        double r20235 = xim;
        double r20236 = /* ERROR: no complex support in C */;
        double r20237 = exp(r20236);
        double r20238 = -r20236;
        double r20239 = exp(r20238);
        double r20240 = r20237 + r20239;
        double r20241 = 2.0;
        double r20242 = 0.0;
        double r20243 = /* ERROR: no complex support in C */;
        double r20244 = r20240 / r20243;
        double r20245 = /* ERROR: no complex support in C */;
        return r20245;
}

double f(double xre, double xim) {
        double r20246 = xre;
        double r20247 = xim;
        double r20248 = /* ERROR: no complex support in C */;
        double r20249 = exp(r20248);
        double r20250 = -r20248;
        double r20251 = exp(r20250);
        double r20252 = r20249 + r20251;
        double r20253 = 2.0;
        double r20254 = 0.0;
        double r20255 = /* ERROR: no complex support in C */;
        double r20256 = r20252 / r20255;
        double r20257 = /* ERROR: no complex support in C */;
        return r20257;
}

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