Average Error: 0.0 → 0.0
Time: 15.2s
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 i\right)}\right))\]
\[\Re(\left(\frac{e^{-\left(xre + xim i\right)} + e^{xre + xim i}}{2 + 0 i}\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 i\right)}\right))
\Re(\left(\frac{e^{-\left(xre + xim i\right)} + e^{xre + xim i}}{2 + 0 i}\right))
double f(double xre, double xim) {
        double r10253 = xre;
        double r10254 = xim;
        double r10255 = /* ERROR: no complex support in C */;
        double r10256 = exp(r10255);
        double r10257 = -r10255;
        double r10258 = exp(r10257);
        double r10259 = r10256 + r10258;
        double r10260 = 2.0;
        double r10261 = 0.0;
        double r10262 = /* ERROR: no complex support in C */;
        double r10263 = r10259 / r10262;
        double r10264 = /* ERROR: no complex support in C */;
        return r10264;
}

double f(double xre, double xim) {
        double r10265 = xre;
        double r10266 = xim;
        double r10267 = /* ERROR: no complex support in C */;
        double r10268 = -r10267;
        double r10269 = exp(r10268);
        double r10270 = exp(r10267);
        double r10271 = r10269 + r10270;
        double r10272 = 2.0;
        double r10273 = 0.0;
        double r10274 = /* ERROR: no complex support in C */;
        double r10275 = r10271 / r10274;
        double r10276 = /* ERROR: no complex support in C */;
        return r10276;
}

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 i\right)}\right))\]
  2. Final simplification0.0

    \[\leadsto \Re(\left(\frac{e^{-\left(xre + xim i\right)} + e^{xre + xim i}}{2 + 0 i}\right))\]

Reproduce

herbie shell --seed 2019152 
(FPCore (xre xim)
  :name "exp with complex power real part (p55)"
  (re (/.c (+.c (exp.c (complex xre xim)) (exp.c (neg.c (complex xre xim)))) (complex 2 0))))