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 r18581 = xre;
        double r18582 = xim;
        double r18583 = /* ERROR: no complex support in C */;
        double r18584 = exp(r18583);
        double r18585 = -r18583;
        double r18586 = exp(r18585);
        double r18587 = r18584 + r18586;
        double r18588 = 2.0;
        double r18589 = 0.0;
        double r18590 = /* ERROR: no complex support in C */;
        double r18591 = r18587 / r18590;
        double r18592 = /* ERROR: no complex support in C */;
        return r18592;
}

double f(double xre, double xim) {
        double r18593 = xre;
        double r18594 = xim;
        double r18595 = /* ERROR: no complex support in C */;
        double r18596 = exp(r18595);
        double r18597 = -r18595;
        double r18598 = exp(r18597);
        double r18599 = r18596 + r18598;
        double r18600 = 2.0;
        double r18601 = 0.0;
        double r18602 = /* ERROR: no complex support in C */;
        double r18603 = r18599 / r18602;
        double r18604 = /* ERROR: no complex support in C */;
        return r18604;
}

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