Average Error: 0.0 → 0.0
Time: 3.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 r12183 = xre;
        double r12184 = xim;
        double r12185 = /* ERROR: no complex support in C */;
        double r12186 = exp(r12185);
        double r12187 = -r12185;
        double r12188 = exp(r12187);
        double r12189 = r12186 + r12188;
        double r12190 = 2.0;
        double r12191 = 0.0;
        double r12192 = /* ERROR: no complex support in C */;
        double r12193 = r12189 / r12192;
        double r12194 = /* ERROR: no complex support in C */;
        return r12194;
}

double f(double xre, double xim) {
        double r12195 = xre;
        double r12196 = xim;
        double r12197 = /* ERROR: no complex support in C */;
        double r12198 = exp(r12197);
        double r12199 = -r12197;
        double r12200 = exp(r12199);
        double r12201 = r12198 + r12200;
        double r12202 = 2.0;
        double r12203 = 0.0;
        double r12204 = /* ERROR: no complex support in C */;
        double r12205 = r12201 / r12204;
        double r12206 = /* ERROR: no complex support in C */;
        return r12206;
}

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