Average Error: 0.0 → 0.0
Time: 13.1s
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 r9080 = xre;
        double r9081 = xim;
        double r9082 = /* ERROR: no complex support in C */;
        double r9083 = exp(r9082);
        double r9084 = -r9082;
        double r9085 = exp(r9084);
        double r9086 = r9083 + r9085;
        double r9087 = 2.0;
        double r9088 = 0.0;
        double r9089 = /* ERROR: no complex support in C */;
        double r9090 = r9086 / r9089;
        double r9091 = /* ERROR: no complex support in C */;
        return r9091;
}

double f(double xre, double xim) {
        double r9092 = xre;
        double r9093 = xim;
        double r9094 = /* ERROR: no complex support in C */;
        double r9095 = exp(r9094);
        double r9096 = -r9094;
        double r9097 = exp(r9096);
        double r9098 = r9095 + r9097;
        double r9099 = 2.0;
        double r9100 = 0.0;
        double r9101 = /* ERROR: no complex support in C */;
        double r9102 = r9098 / r9101;
        double r9103 = /* ERROR: no complex support in C */;
        return r9103;
}

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