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 r13667 = xre;
        double r13668 = xim;
        double r13669 = /* ERROR: no complex support in C */;
        double r13670 = exp(r13669);
        double r13671 = -r13669;
        double r13672 = exp(r13671);
        double r13673 = r13670 + r13672;
        double r13674 = 2.0;
        double r13675 = 0.0;
        double r13676 = /* ERROR: no complex support in C */;
        double r13677 = r13673 / r13676;
        double r13678 = /* ERROR: no complex support in C */;
        return r13678;
}

double f(double xre, double xim) {
        double r13679 = xre;
        double r13680 = xim;
        double r13681 = /* ERROR: no complex support in C */;
        double r13682 = exp(r13681);
        double r13683 = -r13681;
        double r13684 = exp(r13683);
        double r13685 = r13682 + r13684;
        double r13686 = 2.0;
        double r13687 = 0.0;
        double r13688 = /* ERROR: no complex support in C */;
        double r13689 = r13685 / r13688;
        double r13690 = /* ERROR: no complex support in C */;
        return r13690;
}

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