Average Error: 0.0 → 0.0
Time: 3.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 r10415 = xre;
        double r10416 = xim;
        double r10417 = /* ERROR: no complex support in C */;
        double r10418 = exp(r10417);
        double r10419 = -r10417;
        double r10420 = exp(r10419);
        double r10421 = r10418 + r10420;
        double r10422 = 2.0;
        double r10423 = 0.0;
        double r10424 = /* ERROR: no complex support in C */;
        double r10425 = r10421 / r10424;
        double r10426 = /* ERROR: no complex support in C */;
        return r10426;
}

double f(double xre, double xim) {
        double r10427 = xre;
        double r10428 = xim;
        double r10429 = /* ERROR: no complex support in C */;
        double r10430 = exp(r10429);
        double r10431 = -r10429;
        double r10432 = exp(r10431);
        double r10433 = r10430 + r10432;
        double r10434 = 2.0;
        double r10435 = 0.0;
        double r10436 = /* ERROR: no complex support in C */;
        double r10437 = r10433 / r10436;
        double r10438 = /* ERROR: no complex support in C */;
        return r10438;
}

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