Average Error: 0.0 → 0.0
Time: 4.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.0 i\right)}\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.0 i\right)}\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.0 i\right)}\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.0 i\right)}\right))
double f(double xre, double xim) {
        double r13174 = xre;
        double r13175 = xim;
        double r13176 = /* ERROR: no complex support in C */;
        double r13177 = exp(r13176);
        double r13178 = -r13176;
        double r13179 = exp(r13178);
        double r13180 = r13177 + r13179;
        double r13181 = 2.0;
        double r13182 = 0.0;
        double r13183 = /* ERROR: no complex support in C */;
        double r13184 = r13180 / r13183;
        double r13185 = /* ERROR: no complex support in C */;
        return r13185;
}

double f(double xre, double xim) {
        double r13186 = xre;
        double r13187 = xim;
        double r13188 = /* ERROR: no complex support in C */;
        double r13189 = exp(r13188);
        double r13190 = -r13188;
        double r13191 = exp(r13190);
        double r13192 = r13189 + r13191;
        double r13193 = 2.0;
        double r13194 = 0.0;
        double r13195 = /* ERROR: no complex support in C */;
        double r13196 = r13192 / r13195;
        double r13197 = /* ERROR: no complex support in C */;
        return r13197;
}

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.0 i\right)}\right))\]
  2. Final simplification0.0

    \[\leadsto \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.0 i\right)}\right))\]

Reproduce

herbie shell --seed 2020047 
(FPCore (xre xim)
  :name "exp with complex power real part (p55)"
  :precision binary64
  (re (/ (+ (exp (complex xre xim)) (exp (- (complex xre xim)))) (complex 2 0.0))))