Average Error: 0.0 → 0.0
Time: 5.0s
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 r18757 = xre;
        double r18758 = xim;
        double r18759 = /* ERROR: no complex support in C */;
        double r18760 = exp(r18759);
        double r18761 = -r18759;
        double r18762 = exp(r18761);
        double r18763 = r18760 + r18762;
        double r18764 = 2.0;
        double r18765 = 0.0;
        double r18766 = /* ERROR: no complex support in C */;
        double r18767 = r18763 / r18766;
        double r18768 = /* ERROR: no complex support in C */;
        return r18768;
}

double f(double xre, double xim) {
        double r18769 = xre;
        double r18770 = xim;
        double r18771 = /* ERROR: no complex support in C */;
        double r18772 = exp(r18771);
        double r18773 = -r18771;
        double r18774 = exp(r18773);
        double r18775 = r18772 + r18774;
        double r18776 = 2.0;
        double r18777 = 0.0;
        double r18778 = /* ERROR: no complex support in C */;
        double r18779 = r18775 / r18778;
        double r18780 = /* ERROR: no complex support in C */;
        return r18780;
}

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 2020042 +o rules:numerics
(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))))