Average Error: 0.0 → 0.0
Time: 12.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 r10187 = xre;
        double r10188 = xim;
        double r10189 = /* ERROR: no complex support in C */;
        double r10190 = exp(r10189);
        double r10191 = -r10189;
        double r10192 = exp(r10191);
        double r10193 = r10190 + r10192;
        double r10194 = 2.0;
        double r10195 = 0.0;
        double r10196 = /* ERROR: no complex support in C */;
        double r10197 = r10193 / r10196;
        double r10198 = /* ERROR: no complex support in C */;
        return r10198;
}

double f(double xre, double xim) {
        double r10199 = xre;
        double r10200 = xim;
        double r10201 = /* ERROR: no complex support in C */;
        double r10202 = -r10201;
        double r10203 = exp(r10202);
        double r10204 = exp(r10201);
        double r10205 = r10203 + r10204;
        double r10206 = 2.0;
        double r10207 = 0.0;
        double r10208 = /* ERROR: no complex support in C */;
        double r10209 = r10205 / r10208;
        double r10210 = /* ERROR: no complex support in C */;
        return r10210;
}

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