Average Error: 0.0 → 0.0
Time: 4.0s
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 r16088 = xre;
        double r16089 = xim;
        double r16090 = /* ERROR: no complex support in C */;
        double r16091 = exp(r16090);
        double r16092 = -r16090;
        double r16093 = exp(r16092);
        double r16094 = r16091 + r16093;
        double r16095 = 2.0;
        double r16096 = 0.0;
        double r16097 = /* ERROR: no complex support in C */;
        double r16098 = r16094 / r16097;
        double r16099 = /* ERROR: no complex support in C */;
        return r16099;
}

double f(double xre, double xim) {
        double r16100 = xre;
        double r16101 = xim;
        double r16102 = /* ERROR: no complex support in C */;
        double r16103 = exp(r16102);
        double r16104 = -r16102;
        double r16105 = exp(r16104);
        double r16106 = r16103 + r16105;
        double r16107 = 2.0;
        double r16108 = 0.0;
        double r16109 = /* ERROR: no complex support in C */;
        double r16110 = r16106 / r16109;
        double r16111 = /* ERROR: no complex support in C */;
        return r16111;
}

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