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 r15376 = xre;
        double r15377 = xim;
        double r15378 = /* ERROR: no complex support in C */;
        double r15379 = exp(r15378);
        double r15380 = -r15378;
        double r15381 = exp(r15380);
        double r15382 = r15379 + r15381;
        double r15383 = 2.0;
        double r15384 = 0.0;
        double r15385 = /* ERROR: no complex support in C */;
        double r15386 = r15382 / r15385;
        double r15387 = /* ERROR: no complex support in C */;
        return r15387;
}

double f(double xre, double xim) {
        double r15388 = xre;
        double r15389 = xim;
        double r15390 = /* ERROR: no complex support in C */;
        double r15391 = exp(r15390);
        double r15392 = -r15390;
        double r15393 = exp(r15392);
        double r15394 = r15391 + r15393;
        double r15395 = 2.0;
        double r15396 = 0.0;
        double r15397 = /* ERROR: no complex support in C */;
        double r15398 = r15394 / r15397;
        double r15399 = /* ERROR: no complex support in C */;
        return r15399;
}

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