Average Error: 0.0 → 0.0
Time: 4.1s
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 r17853 = xre;
        double r17854 = xim;
        double r17855 = /* ERROR: no complex support in C */;
        double r17856 = exp(r17855);
        double r17857 = -r17855;
        double r17858 = exp(r17857);
        double r17859 = r17856 + r17858;
        double r17860 = 2.0;
        double r17861 = 0.0;
        double r17862 = /* ERROR: no complex support in C */;
        double r17863 = r17859 / r17862;
        double r17864 = /* ERROR: no complex support in C */;
        return r17864;
}

double f(double xre, double xim) {
        double r17865 = xre;
        double r17866 = xim;
        double r17867 = /* ERROR: no complex support in C */;
        double r17868 = exp(r17867);
        double r17869 = -r17867;
        double r17870 = exp(r17869);
        double r17871 = r17868 + r17870;
        double r17872 = 2.0;
        double r17873 = 0.0;
        double r17874 = /* ERROR: no complex support in C */;
        double r17875 = r17871 / r17874;
        double r17876 = /* ERROR: no complex support in C */;
        return r17876;
}

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