Average Error: 0.0 → 0.0
Time: 16.1s
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 r9294 = xre;
        double r9295 = xim;
        double r9296 = /* ERROR: no complex support in C */;
        double r9297 = exp(r9296);
        double r9298 = -r9296;
        double r9299 = exp(r9298);
        double r9300 = r9297 + r9299;
        double r9301 = 2.0;
        double r9302 = 0.0;
        double r9303 = /* ERROR: no complex support in C */;
        double r9304 = r9300 / r9303;
        double r9305 = /* ERROR: no complex support in C */;
        return r9305;
}

double f(double xre, double xim) {
        double r9306 = xre;
        double r9307 = xim;
        double r9308 = /* ERROR: no complex support in C */;
        double r9309 = exp(r9308);
        double r9310 = -r9308;
        double r9311 = exp(r9310);
        double r9312 = r9309 + r9311;
        double r9313 = 2.0;
        double r9314 = 0.0;
        double r9315 = /* ERROR: no complex support in C */;
        double r9316 = r9312 / r9315;
        double r9317 = /* ERROR: no complex support in C */;
        return r9317;
}

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