Average Error: 0.0 → 0.0
Time: 3.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(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 r16911 = xre;
        double r16912 = xim;
        double r16913 = /* ERROR: no complex support in C */;
        double r16914 = exp(r16913);
        double r16915 = -r16913;
        double r16916 = exp(r16915);
        double r16917 = r16914 + r16916;
        double r16918 = 2.0;
        double r16919 = 0.0;
        double r16920 = /* ERROR: no complex support in C */;
        double r16921 = r16917 / r16920;
        double r16922 = /* ERROR: no complex support in C */;
        return r16922;
}

double f(double xre, double xim) {
        double r16923 = xre;
        double r16924 = xim;
        double r16925 = /* ERROR: no complex support in C */;
        double r16926 = exp(r16925);
        double r16927 = -r16925;
        double r16928 = exp(r16927);
        double r16929 = r16926 + r16928;
        double r16930 = 2.0;
        double r16931 = 0.0;
        double r16932 = /* ERROR: no complex support in C */;
        double r16933 = r16929 / r16932;
        double r16934 = /* ERROR: no complex support in C */;
        return r16934;
}

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