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 r10409 = xre;
        double r10410 = xim;
        double r10411 = /* ERROR: no complex support in C */;
        double r10412 = exp(r10411);
        double r10413 = -r10411;
        double r10414 = exp(r10413);
        double r10415 = r10412 + r10414;
        double r10416 = 2.0;
        double r10417 = 0.0;
        double r10418 = /* ERROR: no complex support in C */;
        double r10419 = r10415 / r10418;
        double r10420 = /* ERROR: no complex support in C */;
        return r10420;
}

double f(double xre, double xim) {
        double r10421 = xre;
        double r10422 = xim;
        double r10423 = /* ERROR: no complex support in C */;
        double r10424 = -r10423;
        double r10425 = exp(r10424);
        double r10426 = exp(r10423);
        double r10427 = r10425 + r10426;
        double r10428 = 2.0;
        double r10429 = 0.0;
        double r10430 = /* ERROR: no complex support in C */;
        double r10431 = r10427 / r10430;
        double r10432 = /* ERROR: no complex support in C */;
        return r10432;
}

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