Average Error: 0.0 → 0.0
Time: 3.8s
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 r21559 = xre;
        double r21560 = xim;
        double r21561 = /* ERROR: no complex support in C */;
        double r21562 = exp(r21561);
        double r21563 = -r21561;
        double r21564 = exp(r21563);
        double r21565 = r21562 + r21564;
        double r21566 = 2.0;
        double r21567 = 0.0;
        double r21568 = /* ERROR: no complex support in C */;
        double r21569 = r21565 / r21568;
        double r21570 = /* ERROR: no complex support in C */;
        return r21570;
}

double f(double xre, double xim) {
        double r21571 = xre;
        double r21572 = xim;
        double r21573 = /* ERROR: no complex support in C */;
        double r21574 = exp(r21573);
        double r21575 = -r21573;
        double r21576 = exp(r21575);
        double r21577 = r21574 + r21576;
        double r21578 = 2.0;
        double r21579 = 0.0;
        double r21580 = /* ERROR: no complex support in C */;
        double r21581 = r21577 / r21580;
        double r21582 = /* ERROR: no complex support in C */;
        return r21582;
}

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