Average Error: 0.0 → 0.0
Time: 16.5s
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 r11123 = xre;
        double r11124 = xim;
        double r11125 = /* ERROR: no complex support in C */;
        double r11126 = exp(r11125);
        double r11127 = -r11125;
        double r11128 = exp(r11127);
        double r11129 = r11126 + r11128;
        double r11130 = 2.0;
        double r11131 = 0.0;
        double r11132 = /* ERROR: no complex support in C */;
        double r11133 = r11129 / r11132;
        double r11134 = /* ERROR: no complex support in C */;
        return r11134;
}

double f(double xre, double xim) {
        double r11135 = xre;
        double r11136 = xim;
        double r11137 = /* ERROR: no complex support in C */;
        double r11138 = -r11137;
        double r11139 = exp(r11138);
        double r11140 = exp(r11137);
        double r11141 = r11139 + r11140;
        double r11142 = 2.0;
        double r11143 = 0.0;
        double r11144 = /* ERROR: no complex support in C */;
        double r11145 = r11141 / r11144;
        double r11146 = /* ERROR: no complex support in C */;
        return r11146;
}

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