Average Error: 0.0 → 0.0
Time: 4.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 r18525 = xre;
        double r18526 = xim;
        double r18527 = /* ERROR: no complex support in C */;
        double r18528 = exp(r18527);
        double r18529 = -r18527;
        double r18530 = exp(r18529);
        double r18531 = r18528 + r18530;
        double r18532 = 2.0;
        double r18533 = 0.0;
        double r18534 = /* ERROR: no complex support in C */;
        double r18535 = r18531 / r18534;
        double r18536 = /* ERROR: no complex support in C */;
        return r18536;
}

double f(double xre, double xim) {
        double r18537 = xre;
        double r18538 = xim;
        double r18539 = /* ERROR: no complex support in C */;
        double r18540 = exp(r18539);
        double r18541 = -r18539;
        double r18542 = exp(r18541);
        double r18543 = r18540 + r18542;
        double r18544 = 2.0;
        double r18545 = 0.0;
        double r18546 = /* ERROR: no complex support in C */;
        double r18547 = r18543 / r18546;
        double r18548 = /* ERROR: no complex support in C */;
        return r18548;
}

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