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 r16100 = xre;
        double r16101 = xim;
        double r16102 = /* ERROR: no complex support in C */;
        double r16103 = exp(r16102);
        double r16104 = -r16102;
        double r16105 = exp(r16104);
        double r16106 = r16103 + r16105;
        double r16107 = 2.0;
        double r16108 = 0.0;
        double r16109 = /* ERROR: no complex support in C */;
        double r16110 = r16106 / r16109;
        double r16111 = /* ERROR: no complex support in C */;
        return r16111;
}

double f(double xre, double xim) {
        double r16112 = xre;
        double r16113 = xim;
        double r16114 = /* ERROR: no complex support in C */;
        double r16115 = exp(r16114);
        double r16116 = -r16114;
        double r16117 = exp(r16116);
        double r16118 = r16115 + r16117;
        double r16119 = 2.0;
        double r16120 = 0.0;
        double r16121 = /* ERROR: no complex support in C */;
        double r16122 = r16118 / r16121;
        double r16123 = /* ERROR: no complex support in C */;
        return r16123;
}

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