Average Error: 0.0 → 0.0
Time: 14.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 r11046 = xre;
        double r11047 = xim;
        double r11048 = /* ERROR: no complex support in C */;
        double r11049 = exp(r11048);
        double r11050 = -r11048;
        double r11051 = exp(r11050);
        double r11052 = r11049 + r11051;
        double r11053 = 2.0;
        double r11054 = 0.0;
        double r11055 = /* ERROR: no complex support in C */;
        double r11056 = r11052 / r11055;
        double r11057 = /* ERROR: no complex support in C */;
        return r11057;
}

double f(double xre, double xim) {
        double r11058 = xre;
        double r11059 = xim;
        double r11060 = /* ERROR: no complex support in C */;
        double r11061 = -r11060;
        double r11062 = exp(r11061);
        double r11063 = exp(r11060);
        double r11064 = r11062 + r11063;
        double r11065 = 2.0;
        double r11066 = 0.0;
        double r11067 = /* ERROR: no complex support in C */;
        double r11068 = r11064 / r11067;
        double r11069 = /* ERROR: no complex support in C */;
        return r11069;
}

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