Average Error: 0.0 → 0.0
Time: 4.0s
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 r12037 = xre;
        double r12038 = xim;
        double r12039 = /* ERROR: no complex support in C */;
        double r12040 = exp(r12039);
        double r12041 = -r12039;
        double r12042 = exp(r12041);
        double r12043 = r12040 + r12042;
        double r12044 = 2.0;
        double r12045 = 0.0;
        double r12046 = /* ERROR: no complex support in C */;
        double r12047 = r12043 / r12046;
        double r12048 = /* ERROR: no complex support in C */;
        return r12048;
}

double f(double xre, double xim) {
        double r12049 = xre;
        double r12050 = xim;
        double r12051 = /* ERROR: no complex support in C */;
        double r12052 = exp(r12051);
        double r12053 = -r12051;
        double r12054 = exp(r12053);
        double r12055 = r12052 + r12054;
        double r12056 = 2.0;
        double r12057 = 0.0;
        double r12058 = /* ERROR: no complex support in C */;
        double r12059 = r12055 / r12058;
        double r12060 = /* ERROR: no complex support in C */;
        return r12060;
}

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