Average Error: 0.0 → 0.0
Time: 3.9s
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 r18981 = xre;
        double r18982 = xim;
        double r18983 = /* ERROR: no complex support in C */;
        double r18984 = exp(r18983);
        double r18985 = -r18983;
        double r18986 = exp(r18985);
        double r18987 = r18984 + r18986;
        double r18988 = 2.0;
        double r18989 = 0.0;
        double r18990 = /* ERROR: no complex support in C */;
        double r18991 = r18987 / r18990;
        double r18992 = /* ERROR: no complex support in C */;
        return r18992;
}

double f(double xre, double xim) {
        double r18993 = xre;
        double r18994 = xim;
        double r18995 = /* ERROR: no complex support in C */;
        double r18996 = exp(r18995);
        double r18997 = -r18995;
        double r18998 = exp(r18997);
        double r18999 = r18996 + r18998;
        double r19000 = 2.0;
        double r19001 = 0.0;
        double r19002 = /* ERROR: no complex support in C */;
        double r19003 = r18999 / r19002;
        double r19004 = /* ERROR: no complex support in C */;
        return r19004;
}

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