Average Error: 0.0 → 0.0
Time: 16.7s
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 r13122 = xre;
        double r13123 = xim;
        double r13124 = /* ERROR: no complex support in C */;
        double r13125 = exp(r13124);
        double r13126 = -r13124;
        double r13127 = exp(r13126);
        double r13128 = r13125 + r13127;
        double r13129 = 2.0;
        double r13130 = 0.0;
        double r13131 = /* ERROR: no complex support in C */;
        double r13132 = r13128 / r13131;
        double r13133 = /* ERROR: no complex support in C */;
        return r13133;
}

double f(double xre, double xim) {
        double r13134 = xre;
        double r13135 = xim;
        double r13136 = /* ERROR: no complex support in C */;
        double r13137 = -r13136;
        double r13138 = exp(r13137);
        double r13139 = exp(r13136);
        double r13140 = r13138 + r13139;
        double r13141 = 2.0;
        double r13142 = 0.0;
        double r13143 = /* ERROR: no complex support in C */;
        double r13144 = r13140 / r13143;
        double r13145 = /* ERROR: no complex support in C */;
        return r13145;
}

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