Average Error: 0.0 → 0.0
Time: 3.8s
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 r21281 = xre;
        double r21282 = xim;
        double r21283 = /* ERROR: no complex support in C */;
        double r21284 = exp(r21283);
        double r21285 = -r21283;
        double r21286 = exp(r21285);
        double r21287 = r21284 + r21286;
        double r21288 = 2.0;
        double r21289 = 0.0;
        double r21290 = /* ERROR: no complex support in C */;
        double r21291 = r21287 / r21290;
        double r21292 = /* ERROR: no complex support in C */;
        return r21292;
}

double f(double xre, double xim) {
        double r21293 = xre;
        double r21294 = xim;
        double r21295 = /* ERROR: no complex support in C */;
        double r21296 = exp(r21295);
        double r21297 = -r21295;
        double r21298 = exp(r21297);
        double r21299 = r21296 + r21298;
        double r21300 = 2.0;
        double r21301 = 0.0;
        double r21302 = /* ERROR: no complex support in C */;
        double r21303 = r21299 / r21302;
        double r21304 = /* ERROR: no complex support in C */;
        return r21304;
}

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