Average Error: 0.0 → 0.0
Time: 7.4s
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 r63177 = xre;
        double r63178 = xim;
        double r63179 = /* ERROR: no complex support in C */;
        double r63180 = exp(r63179);
        double r63181 = -r63179;
        double r63182 = exp(r63181);
        double r63183 = r63180 + r63182;
        double r63184 = 2.0;
        double r63185 = 0.0;
        double r63186 = /* ERROR: no complex support in C */;
        double r63187 = r63183 / r63186;
        double r63188 = /* ERROR: no complex support in C */;
        return r63188;
}

double f(double xre, double xim) {
        double r63189 = xre;
        double r63190 = xim;
        double r63191 = /* ERROR: no complex support in C */;
        double r63192 = exp(r63191);
        double r63193 = -r63191;
        double r63194 = exp(r63193);
        double r63195 = r63192 + r63194;
        double r63196 = 2.0;
        double r63197 = 0.0;
        double r63198 = /* ERROR: no complex support in C */;
        double r63199 = r63195 / r63198;
        double r63200 = /* ERROR: no complex support in C */;
        return r63200;
}

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