Average Error: 0.0 → 0.0
Time: 4.0s
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 r11895 = xre;
        double r11896 = xim;
        double r11897 = /* ERROR: no complex support in C */;
        double r11898 = exp(r11897);
        double r11899 = -r11897;
        double r11900 = exp(r11899);
        double r11901 = r11898 + r11900;
        double r11902 = 2.0;
        double r11903 = 0.0;
        double r11904 = /* ERROR: no complex support in C */;
        double r11905 = r11901 / r11904;
        double r11906 = /* ERROR: no complex support in C */;
        return r11906;
}

double f(double xre, double xim) {
        double r11907 = xre;
        double r11908 = xim;
        double r11909 = /* ERROR: no complex support in C */;
        double r11910 = exp(r11909);
        double r11911 = -r11909;
        double r11912 = exp(r11911);
        double r11913 = r11910 + r11912;
        double r11914 = 2.0;
        double r11915 = 0.0;
        double r11916 = /* ERROR: no complex support in C */;
        double r11917 = r11913 / r11916;
        double r11918 = /* ERROR: no complex support in C */;
        return r11918;
}

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