Average Error: 0.0 → 0.0
Time: 3.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 r13065 = xre;
        double r13066 = xim;
        double r13067 = /* ERROR: no complex support in C */;
        double r13068 = exp(r13067);
        double r13069 = -r13067;
        double r13070 = exp(r13069);
        double r13071 = r13068 + r13070;
        double r13072 = 2.0;
        double r13073 = 0.0;
        double r13074 = /* ERROR: no complex support in C */;
        double r13075 = r13071 / r13074;
        double r13076 = /* ERROR: no complex support in C */;
        return r13076;
}

double f(double xre, double xim) {
        double r13077 = xre;
        double r13078 = xim;
        double r13079 = /* ERROR: no complex support in C */;
        double r13080 = exp(r13079);
        double r13081 = -r13079;
        double r13082 = exp(r13081);
        double r13083 = r13080 + r13082;
        double r13084 = 2.0;
        double r13085 = 0.0;
        double r13086 = /* ERROR: no complex support in C */;
        double r13087 = r13083 / r13086;
        double r13088 = /* ERROR: no complex support in C */;
        return r13088;
}

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