Average Error: 0.0 → 0.0
Time: 3.9s
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 r12370 = xre;
        double r12371 = xim;
        double r12372 = /* ERROR: no complex support in C */;
        double r12373 = exp(r12372);
        double r12374 = -r12372;
        double r12375 = exp(r12374);
        double r12376 = r12373 + r12375;
        double r12377 = 2.0;
        double r12378 = 0.0;
        double r12379 = /* ERROR: no complex support in C */;
        double r12380 = r12376 / r12379;
        double r12381 = /* ERROR: no complex support in C */;
        return r12381;
}

double f(double xre, double xim) {
        double r12382 = xre;
        double r12383 = xim;
        double r12384 = /* ERROR: no complex support in C */;
        double r12385 = exp(r12384);
        double r12386 = -r12384;
        double r12387 = exp(r12386);
        double r12388 = r12385 + r12387;
        double r12389 = 2.0;
        double r12390 = 0.0;
        double r12391 = /* ERROR: no complex support in C */;
        double r12392 = r12388 / r12391;
        double r12393 = /* ERROR: no complex support in C */;
        return r12393;
}

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