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 r10174 = xre;
        double r10175 = xim;
        double r10176 = /* ERROR: no complex support in C */;
        double r10177 = exp(r10176);
        double r10178 = -r10176;
        double r10179 = exp(r10178);
        double r10180 = r10177 + r10179;
        double r10181 = 2.0;
        double r10182 = 0.0;
        double r10183 = /* ERROR: no complex support in C */;
        double r10184 = r10180 / r10183;
        double r10185 = /* ERROR: no complex support in C */;
        return r10185;
}

double f(double xre, double xim) {
        double r10186 = xre;
        double r10187 = xim;
        double r10188 = /* ERROR: no complex support in C */;
        double r10189 = -r10188;
        double r10190 = exp(r10189);
        double r10191 = exp(r10188);
        double r10192 = r10190 + r10191;
        double r10193 = 2.0;
        double r10194 = 0.0;
        double r10195 = /* ERROR: no complex support in C */;
        double r10196 = r10192 / r10195;
        double r10197 = /* ERROR: no complex support in C */;
        return r10197;
}

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