Average Error: 0.0 → 0.0
Time: 5.1s
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 r16095 = xre;
        double r16096 = xim;
        double r16097 = /* ERROR: no complex support in C */;
        double r16098 = exp(r16097);
        double r16099 = -r16097;
        double r16100 = exp(r16099);
        double r16101 = r16098 + r16100;
        double r16102 = 2.0;
        double r16103 = 0.0;
        double r16104 = /* ERROR: no complex support in C */;
        double r16105 = r16101 / r16104;
        double r16106 = /* ERROR: no complex support in C */;
        return r16106;
}

double f(double xre, double xim) {
        double r16107 = xre;
        double r16108 = xim;
        double r16109 = /* ERROR: no complex support in C */;
        double r16110 = exp(r16109);
        double r16111 = -r16109;
        double r16112 = exp(r16111);
        double r16113 = r16110 + r16112;
        double r16114 = 2.0;
        double r16115 = 0.0;
        double r16116 = /* ERROR: no complex support in C */;
        double r16117 = r16113 / r16116;
        double r16118 = /* ERROR: no complex support in C */;
        return r16118;
}

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