Average Error: 0.0 → 0.0
Time: 1.3m
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 r9105 = xre;
        double r9106 = xim;
        double r9107 = /* ERROR: no complex support in C */;
        double r9108 = exp(r9107);
        double r9109 = -r9107;
        double r9110 = exp(r9109);
        double r9111 = r9108 + r9110;
        double r9112 = 2.0;
        double r9113 = 0.0;
        double r9114 = /* ERROR: no complex support in C */;
        double r9115 = r9111 / r9114;
        double r9116 = /* ERROR: no complex support in C */;
        return r9116;
}

double f(double xre, double xim) {
        double r9117 = xre;
        double r9118 = xim;
        double r9119 = /* ERROR: no complex support in C */;
        double r9120 = exp(r9119);
        double r9121 = -r9119;
        double r9122 = exp(r9121);
        double r9123 = r9120 + r9122;
        double r9124 = 2.0;
        double r9125 = 0.0;
        double r9126 = /* ERROR: no complex support in C */;
        double r9127 = r9123 / r9126;
        double r9128 = /* ERROR: no complex support in C */;
        return r9128;
}

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 2019200 
(FPCore (xre xim)
  :name "exp with complex power real part (p55)"
  (re (/ (+ (exp (complex xre xim)) (exp (- (complex xre xim)))) (complex 2 0.0))))