Average Error: 0.0 → 0.0
Time: 14.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 r9160 = xre;
        double r9161 = xim;
        double r9162 = /* ERROR: no complex support in C */;
        double r9163 = exp(r9162);
        double r9164 = -r9162;
        double r9165 = exp(r9164);
        double r9166 = r9163 + r9165;
        double r9167 = 2.0;
        double r9168 = 0.0;
        double r9169 = /* ERROR: no complex support in C */;
        double r9170 = r9166 / r9169;
        double r9171 = /* ERROR: no complex support in C */;
        return r9171;
}

double f(double xre, double xim) {
        double r9172 = xre;
        double r9173 = xim;
        double r9174 = /* ERROR: no complex support in C */;
        double r9175 = exp(r9174);
        double r9176 = -r9174;
        double r9177 = exp(r9176);
        double r9178 = r9175 + r9177;
        double r9179 = 2.0;
        double r9180 = 0.0;
        double r9181 = /* ERROR: no complex support in C */;
        double r9182 = r9178 / r9181;
        double r9183 = /* ERROR: no complex support in C */;
        return r9183;
}

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