Average Error: 0.0 → 0.0
Time: 12.1s
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 r10422 = xre;
        double r10423 = xim;
        double r10424 = /* ERROR: no complex support in C */;
        double r10425 = exp(r10424);
        double r10426 = -r10424;
        double r10427 = exp(r10426);
        double r10428 = r10425 + r10427;
        double r10429 = 2.0;
        double r10430 = 0.0;
        double r10431 = /* ERROR: no complex support in C */;
        double r10432 = r10428 / r10431;
        double r10433 = /* ERROR: no complex support in C */;
        return r10433;
}

double f(double xre, double xim) {
        double r10434 = xre;
        double r10435 = xim;
        double r10436 = /* ERROR: no complex support in C */;
        double r10437 = -r10436;
        double r10438 = exp(r10437);
        double r10439 = exp(r10436);
        double r10440 = r10438 + r10439;
        double r10441 = 2.0;
        double r10442 = 0.0;
        double r10443 = /* ERROR: no complex support in C */;
        double r10444 = r10440 / r10443;
        double r10445 = /* ERROR: no complex support in C */;
        return r10445;
}

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