Average Error: 0.0 → 0.0
Time: 4.7s
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 r14976 = xre;
        double r14977 = xim;
        double r14978 = /* ERROR: no complex support in C */;
        double r14979 = exp(r14978);
        double r14980 = -r14978;
        double r14981 = exp(r14980);
        double r14982 = r14979 + r14981;
        double r14983 = 2.0;
        double r14984 = 0.0;
        double r14985 = /* ERROR: no complex support in C */;
        double r14986 = r14982 / r14985;
        double r14987 = /* ERROR: no complex support in C */;
        return r14987;
}

double f(double xre, double xim) {
        double r14988 = xre;
        double r14989 = xim;
        double r14990 = /* ERROR: no complex support in C */;
        double r14991 = exp(r14990);
        double r14992 = -r14990;
        double r14993 = exp(r14992);
        double r14994 = r14991 + r14993;
        double r14995 = 2.0;
        double r14996 = 0.0;
        double r14997 = /* ERROR: no complex support in C */;
        double r14998 = r14994 / r14997;
        double r14999 = /* ERROR: no complex support in C */;
        return r14999;
}

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