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 r10093 = xre;
        double r10094 = xim;
        double r10095 = /* ERROR: no complex support in C */;
        double r10096 = exp(r10095);
        double r10097 = -r10095;
        double r10098 = exp(r10097);
        double r10099 = r10096 + r10098;
        double r10100 = 2.0;
        double r10101 = 0.0;
        double r10102 = /* ERROR: no complex support in C */;
        double r10103 = r10099 / r10102;
        double r10104 = /* ERROR: no complex support in C */;
        return r10104;
}

double f(double xre, double xim) {
        double r10105 = xre;
        double r10106 = xim;
        double r10107 = /* ERROR: no complex support in C */;
        double r10108 = exp(r10107);
        double r10109 = -r10107;
        double r10110 = exp(r10109);
        double r10111 = r10108 + r10110;
        double r10112 = 2.0;
        double r10113 = 0.0;
        double r10114 = /* ERROR: no complex support in C */;
        double r10115 = r10111 / r10114;
        double r10116 = /* ERROR: no complex support in C */;
        return r10116;
}

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