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

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

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