Average Error: 0.0 → 0.0
Time: 12.5s
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 r10261 = xre;
        double r10262 = xim;
        double r10263 = /* ERROR: no complex support in C */;
        double r10264 = exp(r10263);
        double r10265 = -r10263;
        double r10266 = exp(r10265);
        double r10267 = r10264 + r10266;
        double r10268 = 2.0;
        double r10269 = 0.0;
        double r10270 = /* ERROR: no complex support in C */;
        double r10271 = r10267 / r10270;
        double r10272 = /* ERROR: no complex support in C */;
        return r10272;
}

double f(double xre, double xim) {
        double r10273 = xre;
        double r10274 = xim;
        double r10275 = /* ERROR: no complex support in C */;
        double r10276 = -r10275;
        double r10277 = exp(r10276);
        double r10278 = exp(r10275);
        double r10279 = r10277 + r10278;
        double r10280 = 2.0;
        double r10281 = 0.0;
        double r10282 = /* ERROR: no complex support in C */;
        double r10283 = r10279 / r10282;
        double r10284 = /* ERROR: no complex support in C */;
        return r10284;
}

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