Average Error: 0.0 → 0.0
Time: 14.8s
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 r12092 = xre;
        double r12093 = xim;
        double r12094 = /* ERROR: no complex support in C */;
        double r12095 = exp(r12094);
        double r12096 = -r12094;
        double r12097 = exp(r12096);
        double r12098 = r12095 + r12097;
        double r12099 = 2.0;
        double r12100 = 0.0;
        double r12101 = /* ERROR: no complex support in C */;
        double r12102 = r12098 / r12101;
        double r12103 = /* ERROR: no complex support in C */;
        return r12103;
}

double f(double xre, double xim) {
        double r12104 = xre;
        double r12105 = xim;
        double r12106 = /* ERROR: no complex support in C */;
        double r12107 = -r12106;
        double r12108 = exp(r12107);
        double r12109 = exp(r12106);
        double r12110 = r12108 + r12109;
        double r12111 = 2.0;
        double r12112 = 0.0;
        double r12113 = /* ERROR: no complex support in C */;
        double r12114 = r12110 / r12113;
        double r12115 = /* ERROR: no complex support in C */;
        return r12115;
}

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