Average Error: 0.0 → 0.0
Time: 3.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.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 r17587 = xre;
        double r17588 = xim;
        double r17589 = /* ERROR: no complex support in C */;
        double r17590 = exp(r17589);
        double r17591 = -r17589;
        double r17592 = exp(r17591);
        double r17593 = r17590 + r17592;
        double r17594 = 2.0;
        double r17595 = 0.0;
        double r17596 = /* ERROR: no complex support in C */;
        double r17597 = r17593 / r17596;
        double r17598 = /* ERROR: no complex support in C */;
        return r17598;
}

double f(double xre, double xim) {
        double r17599 = xre;
        double r17600 = xim;
        double r17601 = /* ERROR: no complex support in C */;
        double r17602 = exp(r17601);
        double r17603 = -r17601;
        double r17604 = exp(r17603);
        double r17605 = r17602 + r17604;
        double r17606 = 2.0;
        double r17607 = 0.0;
        double r17608 = /* ERROR: no complex support in C */;
        double r17609 = r17605 / r17608;
        double r17610 = /* ERROR: no complex support in C */;
        return r17610;
}

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 2020045 +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))))