Average Error: 0.0 → 0.0
Time: 5.6s
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 r22229 = xre;
        double r22230 = xim;
        double r22231 = /* ERROR: no complex support in C */;
        double r22232 = exp(r22231);
        double r22233 = -r22231;
        double r22234 = exp(r22233);
        double r22235 = r22232 + r22234;
        double r22236 = 2.0;
        double r22237 = 0.0;
        double r22238 = /* ERROR: no complex support in C */;
        double r22239 = r22235 / r22238;
        double r22240 = /* ERROR: no complex support in C */;
        return r22240;
}

double f(double xre, double xim) {
        double r22241 = xre;
        double r22242 = xim;
        double r22243 = /* ERROR: no complex support in C */;
        double r22244 = exp(r22243);
        double r22245 = -r22243;
        double r22246 = exp(r22245);
        double r22247 = r22244 + r22246;
        double r22248 = 2.0;
        double r22249 = 0.0;
        double r22250 = /* ERROR: no complex support in C */;
        double r22251 = r22247 / r22250;
        double r22252 = /* ERROR: no complex support in C */;
        return r22252;
}

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 2020042 +o rules:numerics
(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))))