Average Error: 0.0 → 0.0
Time: 14.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 r10312 = xre;
        double r10313 = xim;
        double r10314 = /* ERROR: no complex support in C */;
        double r10315 = exp(r10314);
        double r10316 = -r10314;
        double r10317 = exp(r10316);
        double r10318 = r10315 + r10317;
        double r10319 = 2.0;
        double r10320 = 0.0;
        double r10321 = /* ERROR: no complex support in C */;
        double r10322 = r10318 / r10321;
        double r10323 = /* ERROR: no complex support in C */;
        return r10323;
}

double f(double xre, double xim) {
        double r10324 = xre;
        double r10325 = xim;
        double r10326 = /* ERROR: no complex support in C */;
        double r10327 = -r10326;
        double r10328 = exp(r10327);
        double r10329 = exp(r10326);
        double r10330 = r10328 + r10329;
        double r10331 = 2.0;
        double r10332 = 0.0;
        double r10333 = /* ERROR: no complex support in C */;
        double r10334 = r10330 / r10333;
        double r10335 = /* ERROR: no complex support in C */;
        return r10335;
}

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