Average Error: 0.0 → 0.0
Time: 1.3m
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 r10099 = xre;
        double r10100 = xim;
        double r10101 = /* ERROR: no complex support in C */;
        double r10102 = exp(r10101);
        double r10103 = -r10101;
        double r10104 = exp(r10103);
        double r10105 = r10102 + r10104;
        double r10106 = 2.0;
        double r10107 = 0.0;
        double r10108 = /* ERROR: no complex support in C */;
        double r10109 = r10105 / r10108;
        double r10110 = /* ERROR: no complex support in C */;
        return r10110;
}

double f(double xre, double xim) {
        double r10111 = xre;
        double r10112 = xim;
        double r10113 = /* ERROR: no complex support in C */;
        double r10114 = exp(r10113);
        double r10115 = -r10113;
        double r10116 = exp(r10115);
        double r10117 = r10114 + r10116;
        double r10118 = 2.0;
        double r10119 = 0.0;
        double r10120 = /* ERROR: no complex support in C */;
        double r10121 = r10117 / r10120;
        double r10122 = /* ERROR: no complex support in C */;
        return r10122;
}

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 2019200 
(FPCore (xre xim)
  :name "exp with complex power real part (p55)"
  (re (/ (+ (exp (complex xre xim)) (exp (- (complex xre xim)))) (complex 2.0 0.0))))