Average Error: 0.0 → 0.0
Time: 16.6s
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(-\left(xre + xim i\right)\right)}\right) + \left(e^{\left(xre + xim i\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(-\left(xre + xim i\right)\right)}\right) + \left(e^{\left(xre + xim i\right)}\right)\right)}{\left(2 + 0.0 i\right)}\right))
double f(double xre, double xim) {
        double r10034 = xre;
        double r10035 = xim;
        double r10036 = /* ERROR: no complex support in C */;
        double r10037 = exp(r10036);
        double r10038 = -r10036;
        double r10039 = exp(r10038);
        double r10040 = r10037 + r10039;
        double r10041 = 2.0;
        double r10042 = 0.0;
        double r10043 = /* ERROR: no complex support in C */;
        double r10044 = r10040 / r10043;
        double r10045 = /* ERROR: no complex support in C */;
        return r10045;
}

double f(double xre, double xim) {
        double r10046 = xre;
        double r10047 = xim;
        double r10048 = /* ERROR: no complex support in C */;
        double r10049 = -r10048;
        double r10050 = exp(r10049);
        double r10051 = exp(r10048);
        double r10052 = r10050 + r10051;
        double r10053 = 2.0;
        double r10054 = 0.0;
        double r10055 = /* ERROR: no complex support in C */;
        double r10056 = r10052 / r10055;
        double r10057 = /* ERROR: no complex support in C */;
        return r10057;
}

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(-\left(xre + xim i\right)\right)}\right) + \left(e^{\left(xre + xim i\right)}\right)\right)}{\left(2 + 0.0 i\right)}\right))\]

Reproduce

herbie shell --seed 2019169 
(FPCore (xre xim)
  :name "exp with complex power real part (p55)"
  (re (/ (+ (exp (complex xre xim)) (exp (- (complex xre xim)))) (complex 2.0 0.0))))