Average Error: 0.0 → 0.0
Time: 9.5s
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 r21038 = xre;
        double r21039 = xim;
        double r21040 = /* ERROR: no complex support in C */;
        double r21041 = exp(r21040);
        double r21042 = -r21040;
        double r21043 = exp(r21042);
        double r21044 = r21041 + r21043;
        double r21045 = 2.0;
        double r21046 = 0.0;
        double r21047 = /* ERROR: no complex support in C */;
        double r21048 = r21044 / r21047;
        double r21049 = /* ERROR: no complex support in C */;
        return r21049;
}

double f(double xre, double xim) {
        double r21050 = xre;
        double r21051 = xim;
        double r21052 = /* ERROR: no complex support in C */;
        double r21053 = exp(r21052);
        double r21054 = -r21052;
        double r21055 = exp(r21054);
        double r21056 = r21053 + r21055;
        double r21057 = 2.0;
        double r21058 = 0.0;
        double r21059 = /* ERROR: no complex support in C */;
        double r21060 = r21056 / r21059;
        double r21061 = /* ERROR: no complex support in C */;
        return r21061;
}

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