Average Error: 0.0 → 0.0
Time: 3.9s
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 r16217 = xre;
        double r16218 = xim;
        double r16219 = /* ERROR: no complex support in C */;
        double r16220 = exp(r16219);
        double r16221 = -r16219;
        double r16222 = exp(r16221);
        double r16223 = r16220 + r16222;
        double r16224 = 2.0;
        double r16225 = 0.0;
        double r16226 = /* ERROR: no complex support in C */;
        double r16227 = r16223 / r16226;
        double r16228 = /* ERROR: no complex support in C */;
        return r16228;
}

double f(double xre, double xim) {
        double r16229 = xre;
        double r16230 = xim;
        double r16231 = /* ERROR: no complex support in C */;
        double r16232 = exp(r16231);
        double r16233 = -r16231;
        double r16234 = exp(r16233);
        double r16235 = r16232 + r16234;
        double r16236 = 2.0;
        double r16237 = 0.0;
        double r16238 = /* ERROR: no complex support in C */;
        double r16239 = r16235 / r16238;
        double r16240 = /* ERROR: no complex support in C */;
        return r16240;
}

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