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 r10035 = xre;
        double r10036 = xim;
        double r10037 = /* ERROR: no complex support in C */;
        double r10038 = exp(r10037);
        double r10039 = -r10037;
        double r10040 = exp(r10039);
        double r10041 = r10038 + r10040;
        double r10042 = 2.0;
        double r10043 = 0.0;
        double r10044 = /* ERROR: no complex support in C */;
        double r10045 = r10041 / r10044;
        double r10046 = /* ERROR: no complex support in C */;
        return r10046;
}

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

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 2020025 +o rules:numerics
(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))))