Average Error: 0.0 → 0.0
Time: 12.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 r9053 = xre;
        double r9054 = xim;
        double r9055 = /* ERROR: no complex support in C */;
        double r9056 = exp(r9055);
        double r9057 = -r9055;
        double r9058 = exp(r9057);
        double r9059 = r9056 + r9058;
        double r9060 = 2.0;
        double r9061 = 0.0;
        double r9062 = /* ERROR: no complex support in C */;
        double r9063 = r9059 / r9062;
        double r9064 = /* ERROR: no complex support in C */;
        return r9064;
}

double f(double xre, double xim) {
        double r9065 = xre;
        double r9066 = xim;
        double r9067 = /* ERROR: no complex support in C */;
        double r9068 = exp(r9067);
        double r9069 = -r9067;
        double r9070 = exp(r9069);
        double r9071 = r9068 + r9070;
        double r9072 = 2.0;
        double r9073 = 0.0;
        double r9074 = /* ERROR: no complex support in C */;
        double r9075 = r9071 / r9074;
        double r9076 = /* ERROR: no complex support in C */;
        return r9076;
}

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 2019323 +o rules:numerics
(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))))