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 r17807 = xre;
        double r17808 = xim;
        double r17809 = /* ERROR: no complex support in C */;
        double r17810 = exp(r17809);
        double r17811 = -r17809;
        double r17812 = exp(r17811);
        double r17813 = r17810 + r17812;
        double r17814 = 2.0;
        double r17815 = 0.0;
        double r17816 = /* ERROR: no complex support in C */;
        double r17817 = r17813 / r17816;
        double r17818 = /* ERROR: no complex support in C */;
        return r17818;
}

double f(double xre, double xim) {
        double r17819 = xre;
        double r17820 = xim;
        double r17821 = /* ERROR: no complex support in C */;
        double r17822 = exp(r17821);
        double r17823 = -r17821;
        double r17824 = exp(r17823);
        double r17825 = r17822 + r17824;
        double r17826 = 2.0;
        double r17827 = 0.0;
        double r17828 = /* ERROR: no complex support in C */;
        double r17829 = r17825 / r17828;
        double r17830 = /* ERROR: no complex support in C */;
        return r17830;
}

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