Average Error: 0.0 → 0.0
Time: 13.3s
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 r9241 = xre;
        double r9242 = xim;
        double r9243 = /* ERROR: no complex support in C */;
        double r9244 = exp(r9243);
        double r9245 = -r9243;
        double r9246 = exp(r9245);
        double r9247 = r9244 + r9246;
        double r9248 = 2.0;
        double r9249 = 0.0;
        double r9250 = /* ERROR: no complex support in C */;
        double r9251 = r9247 / r9250;
        double r9252 = /* ERROR: no complex support in C */;
        return r9252;
}

double f(double xre, double xim) {
        double r9253 = xre;
        double r9254 = xim;
        double r9255 = /* ERROR: no complex support in C */;
        double r9256 = exp(r9255);
        double r9257 = -r9255;
        double r9258 = exp(r9257);
        double r9259 = r9256 + r9258;
        double r9260 = 2.0;
        double r9261 = 0.0;
        double r9262 = /* ERROR: no complex support in C */;
        double r9263 = r9259 / r9262;
        double r9264 = /* ERROR: no complex support in C */;
        return r9264;
}

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