Average Error: 0.0 → 0.0
Time: 4.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 r8874 = xre;
        double r8875 = xim;
        double r8876 = /* ERROR: no complex support in C */;
        double r8877 = exp(r8876);
        double r8878 = -r8876;
        double r8879 = exp(r8878);
        double r8880 = r8877 + r8879;
        double r8881 = 2.0;
        double r8882 = 0.0;
        double r8883 = /* ERROR: no complex support in C */;
        double r8884 = r8880 / r8883;
        double r8885 = /* ERROR: no complex support in C */;
        return r8885;
}

double f(double xre, double xim) {
        double r8886 = xre;
        double r8887 = xim;
        double r8888 = /* ERROR: no complex support in C */;
        double r8889 = exp(r8888);
        double r8890 = -r8888;
        double r8891 = exp(r8890);
        double r8892 = r8889 + r8891;
        double r8893 = 2.0;
        double r8894 = 0.0;
        double r8895 = /* ERROR: no complex support in C */;
        double r8896 = r8892 / r8895;
        double r8897 = /* ERROR: no complex support in C */;
        return r8897;
}

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