Average Error: 0.0 → 0.0
Time: 15.2s
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 r9118 = xre;
        double r9119 = xim;
        double r9120 = /* ERROR: no complex support in C */;
        double r9121 = exp(r9120);
        double r9122 = -r9120;
        double r9123 = exp(r9122);
        double r9124 = r9121 + r9123;
        double r9125 = 2.0;
        double r9126 = 0.0;
        double r9127 = /* ERROR: no complex support in C */;
        double r9128 = r9124 / r9127;
        double r9129 = /* ERROR: no complex support in C */;
        return r9129;
}

double f(double xre, double xim) {
        double r9130 = xre;
        double r9131 = xim;
        double r9132 = /* ERROR: no complex support in C */;
        double r9133 = exp(r9132);
        double r9134 = -r9132;
        double r9135 = exp(r9134);
        double r9136 = r9133 + r9135;
        double r9137 = 2.0;
        double r9138 = 0.0;
        double r9139 = /* ERROR: no complex support in C */;
        double r9140 = r9136 / r9139;
        double r9141 = /* ERROR: no complex support in C */;
        return r9141;
}

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 2019209 +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))))