Average Error: 0.0 → 0.0
Time: 4.9s
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 r24734 = xre;
        double r24735 = xim;
        double r24736 = /* ERROR: no complex support in C */;
        double r24737 = exp(r24736);
        double r24738 = -r24736;
        double r24739 = exp(r24738);
        double r24740 = r24737 + r24739;
        double r24741 = 2.0;
        double r24742 = 0.0;
        double r24743 = /* ERROR: no complex support in C */;
        double r24744 = r24740 / r24743;
        double r24745 = /* ERROR: no complex support in C */;
        return r24745;
}

double f(double xre, double xim) {
        double r24746 = xre;
        double r24747 = xim;
        double r24748 = /* ERROR: no complex support in C */;
        double r24749 = exp(r24748);
        double r24750 = -r24748;
        double r24751 = exp(r24750);
        double r24752 = r24749 + r24751;
        double r24753 = 2.0;
        double r24754 = 0.0;
        double r24755 = /* ERROR: no complex support in C */;
        double r24756 = r24752 / r24755;
        double r24757 = /* ERROR: no complex support in C */;
        return r24757;
}

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