Average Error: 0.0 → 0.0
Time: 14.7s
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 i\right)}\right))\]
\[\Re(\left(\frac{e^{-\left(xre + xim i\right)} + e^{xre + xim i}}{2 + 0 i}\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 i\right)}\right))
\Re(\left(\frac{e^{-\left(xre + xim i\right)} + e^{xre + xim i}}{2 + 0 i}\right))
double f(double xre, double xim) {
        double r10961 = xre;
        double r10962 = xim;
        double r10963 = /* ERROR: no complex support in C */;
        double r10964 = exp(r10963);
        double r10965 = -r10963;
        double r10966 = exp(r10965);
        double r10967 = r10964 + r10966;
        double r10968 = 2.0;
        double r10969 = 0.0;
        double r10970 = /* ERROR: no complex support in C */;
        double r10971 = r10967 / r10970;
        double r10972 = /* ERROR: no complex support in C */;
        return r10972;
}

double f(double xre, double xim) {
        double r10973 = xre;
        double r10974 = xim;
        double r10975 = /* ERROR: no complex support in C */;
        double r10976 = -r10975;
        double r10977 = exp(r10976);
        double r10978 = exp(r10975);
        double r10979 = r10977 + r10978;
        double r10980 = 2.0;
        double r10981 = 0.0;
        double r10982 = /* ERROR: no complex support in C */;
        double r10983 = r10979 / r10982;
        double r10984 = /* ERROR: no complex support in C */;
        return r10984;
}

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 i\right)}\right))\]
  2. Final simplification0.0

    \[\leadsto \Re(\left(\frac{e^{-\left(xre + xim i\right)} + e^{xre + xim i}}{2 + 0 i}\right))\]

Reproduce

herbie shell --seed 2019130 
(FPCore (xre xim)
  :name "exp with complex power real part (p55)"
  (re (/.c (+.c (exp.c (complex xre xim)) (exp.c (neg.c (complex xre xim)))) (complex 2 0))))