Average Error: 0.0 → 0.0
Time: 12.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 r9130 = xre;
        double r9131 = xim;
        double r9132 = /* ERROR: no complex support in C */;
        double r9133 = exp(r9132);
        double r9134 = -r9132;
        double r9135 = exp(r9134);
        double r9136 = r9133 + r9135;
        double r9137 = 2.0;
        double r9138 = 0.0;
        double r9139 = /* ERROR: no complex support in C */;
        double r9140 = r9136 / r9139;
        double r9141 = /* ERROR: no complex support in C */;
        return r9141;
}

double f(double xre, double xim) {
        double r9142 = xre;
        double r9143 = xim;
        double r9144 = /* ERROR: no complex support in C */;
        double r9145 = exp(r9144);
        double r9146 = -r9144;
        double r9147 = exp(r9146);
        double r9148 = r9145 + r9147;
        double r9149 = 2.0;
        double r9150 = 0.0;
        double r9151 = /* ERROR: no complex support in C */;
        double r9152 = r9148 / r9151;
        double r9153 = /* ERROR: no complex support in C */;
        return r9153;
}

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