Average Error: 0.0 → 0.0
Time: 4.8s
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 r12072 = xre;
        double r12073 = xim;
        double r12074 = /* ERROR: no complex support in C */;
        double r12075 = exp(r12074);
        double r12076 = -r12074;
        double r12077 = exp(r12076);
        double r12078 = r12075 + r12077;
        double r12079 = 2.0;
        double r12080 = 0.0;
        double r12081 = /* ERROR: no complex support in C */;
        double r12082 = r12078 / r12081;
        double r12083 = /* ERROR: no complex support in C */;
        return r12083;
}

double f(double xre, double xim) {
        double r12084 = xre;
        double r12085 = xim;
        double r12086 = /* ERROR: no complex support in C */;
        double r12087 = exp(r12086);
        double r12088 = -r12086;
        double r12089 = exp(r12088);
        double r12090 = r12087 + r12089;
        double r12091 = 2.0;
        double r12092 = 0.0;
        double r12093 = /* ERROR: no complex support in C */;
        double r12094 = r12090 / r12093;
        double r12095 = /* ERROR: no complex support in C */;
        return r12095;
}

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