Average Error: 0.0 → 0.0
Time: 14.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 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 r10209 = xre;
        double r10210 = xim;
        double r10211 = /* ERROR: no complex support in C */;
        double r10212 = exp(r10211);
        double r10213 = -r10211;
        double r10214 = exp(r10213);
        double r10215 = r10212 + r10214;
        double r10216 = 2.0;
        double r10217 = 0.0;
        double r10218 = /* ERROR: no complex support in C */;
        double r10219 = r10215 / r10218;
        double r10220 = /* ERROR: no complex support in C */;
        return r10220;
}

double f(double xre, double xim) {
        double r10221 = xre;
        double r10222 = xim;
        double r10223 = /* ERROR: no complex support in C */;
        double r10224 = -r10223;
        double r10225 = exp(r10224);
        double r10226 = exp(r10223);
        double r10227 = r10225 + r10226;
        double r10228 = 2.0;
        double r10229 = 0.0;
        double r10230 = /* ERROR: no complex support in C */;
        double r10231 = r10227 / r10230;
        double r10232 = /* ERROR: no complex support in C */;
        return r10232;
}

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