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 r17408 = xre;
        double r17409 = xim;
        double r17410 = /* ERROR: no complex support in C */;
        double r17411 = exp(r17410);
        double r17412 = -r17410;
        double r17413 = exp(r17412);
        double r17414 = r17411 + r17413;
        double r17415 = 2.0;
        double r17416 = 0.0;
        double r17417 = /* ERROR: no complex support in C */;
        double r17418 = r17414 / r17417;
        double r17419 = /* ERROR: no complex support in C */;
        return r17419;
}

double f(double xre, double xim) {
        double r17420 = xre;
        double r17421 = xim;
        double r17422 = /* ERROR: no complex support in C */;
        double r17423 = exp(r17422);
        double r17424 = -r17422;
        double r17425 = exp(r17424);
        double r17426 = r17423 + r17425;
        double r17427 = 2.0;
        double r17428 = 0.0;
        double r17429 = /* ERROR: no complex support in C */;
        double r17430 = r17426 / r17429;
        double r17431 = /* ERROR: no complex support in C */;
        return r17431;
}

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