Average Error: 0.0 → 0.0
Time: 12.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 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 r10247 = xre;
        double r10248 = xim;
        double r10249 = /* ERROR: no complex support in C */;
        double r10250 = exp(r10249);
        double r10251 = -r10249;
        double r10252 = exp(r10251);
        double r10253 = r10250 + r10252;
        double r10254 = 2.0;
        double r10255 = 0.0;
        double r10256 = /* ERROR: no complex support in C */;
        double r10257 = r10253 / r10256;
        double r10258 = /* ERROR: no complex support in C */;
        return r10258;
}

double f(double xre, double xim) {
        double r10259 = xre;
        double r10260 = xim;
        double r10261 = /* ERROR: no complex support in C */;
        double r10262 = -r10261;
        double r10263 = exp(r10262);
        double r10264 = exp(r10261);
        double r10265 = r10263 + r10264;
        double r10266 = 2.0;
        double r10267 = 0.0;
        double r10268 = /* ERROR: no complex support in C */;
        double r10269 = r10265 / r10268;
        double r10270 = /* ERROR: no complex support in C */;
        return r10270;
}

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