Average Error: 0.0 → 0.0
Time: 17.6s
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(-\left(xre + xim i\right)\right)}\right) + \left(e^{\left(xre + xim i\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(-\left(xre + xim i\right)\right)}\right) + \left(e^{\left(xre + xim i\right)}\right)\right)}{\left(2 + 0.0 i\right)}\right))
double f(double xre, double xim) {
        double r8975 = xre;
        double r8976 = xim;
        double r8977 = /* ERROR: no complex support in C */;
        double r8978 = exp(r8977);
        double r8979 = -r8977;
        double r8980 = exp(r8979);
        double r8981 = r8978 + r8980;
        double r8982 = 2.0;
        double r8983 = 0.0;
        double r8984 = /* ERROR: no complex support in C */;
        double r8985 = r8981 / r8984;
        double r8986 = /* ERROR: no complex support in C */;
        return r8986;
}

double f(double xre, double xim) {
        double r8987 = xre;
        double r8988 = xim;
        double r8989 = /* ERROR: no complex support in C */;
        double r8990 = -r8989;
        double r8991 = exp(r8990);
        double r8992 = exp(r8989);
        double r8993 = r8991 + r8992;
        double r8994 = 2.0;
        double r8995 = 0.0;
        double r8996 = /* ERROR: no complex support in C */;
        double r8997 = r8993 / r8996;
        double r8998 = /* ERROR: no complex support in C */;
        return r8998;
}

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(-\left(xre + xim i\right)\right)}\right) + \left(e^{\left(xre + xim i\right)}\right)\right)}{\left(2 + 0.0 i\right)}\right))\]

Reproduce

herbie shell --seed 2019174 
(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))))