Average Error: 0.0 → 0.0
Time: 21.6s
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 r9067 = xre;
        double r9068 = xim;
        double r9069 = /* ERROR: no complex support in C */;
        double r9070 = exp(r9069);
        double r9071 = -r9069;
        double r9072 = exp(r9071);
        double r9073 = r9070 + r9072;
        double r9074 = 2.0;
        double r9075 = 0.0;
        double r9076 = /* ERROR: no complex support in C */;
        double r9077 = r9073 / r9076;
        double r9078 = /* ERROR: no complex support in C */;
        return r9078;
}

double f(double xre, double xim) {
        double r9079 = xre;
        double r9080 = xim;
        double r9081 = /* ERROR: no complex support in C */;
        double r9082 = exp(r9081);
        double r9083 = -r9081;
        double r9084 = exp(r9083);
        double r9085 = r9082 + r9084;
        double r9086 = 2.0;
        double r9087 = 0.0;
        double r9088 = /* ERROR: no complex support in C */;
        double r9089 = r9085 / r9088;
        double r9090 = /* ERROR: no complex support in C */;
        return r9090;
}

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 2019199 +o rules:numerics
(FPCore (xre xim)
  :name "exp with complex power real part (p55)"
  (re (/ (+ (exp (complex xre xim)) (exp (- (complex xre xim)))) (complex 2.0 0.0))))