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 r13288 = xre;
        double r13289 = xim;
        double r13290 = /* ERROR: no complex support in C */;
        double r13291 = exp(r13290);
        double r13292 = -r13290;
        double r13293 = exp(r13292);
        double r13294 = r13291 + r13293;
        double r13295 = 2.0;
        double r13296 = 0.0;
        double r13297 = /* ERROR: no complex support in C */;
        double r13298 = r13294 / r13297;
        double r13299 = /* ERROR: no complex support in C */;
        return r13299;
}

double f(double xre, double xim) {
        double r13300 = xre;
        double r13301 = xim;
        double r13302 = /* ERROR: no complex support in C */;
        double r13303 = exp(r13302);
        double r13304 = -r13302;
        double r13305 = exp(r13304);
        double r13306 = r13303 + r13305;
        double r13307 = 2.0;
        double r13308 = 0.0;
        double r13309 = /* ERROR: no complex support in C */;
        double r13310 = r13306 / r13309;
        double r13311 = /* ERROR: no complex support in C */;
        return r13311;
}

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