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 r12525 = xre;
        double r12526 = xim;
        double r12527 = /* ERROR: no complex support in C */;
        double r12528 = exp(r12527);
        double r12529 = -r12527;
        double r12530 = exp(r12529);
        double r12531 = r12528 + r12530;
        double r12532 = 2.0;
        double r12533 = 0.0;
        double r12534 = /* ERROR: no complex support in C */;
        double r12535 = r12531 / r12534;
        double r12536 = /* ERROR: no complex support in C */;
        return r12536;
}

double f(double xre, double xim) {
        double r12537 = xre;
        double r12538 = xim;
        double r12539 = /* ERROR: no complex support in C */;
        double r12540 = exp(r12539);
        double r12541 = -r12539;
        double r12542 = exp(r12541);
        double r12543 = r12540 + r12542;
        double r12544 = 2.0;
        double r12545 = 0.0;
        double r12546 = /* ERROR: no complex support in C */;
        double r12547 = r12543 / r12546;
        double r12548 = /* ERROR: no complex support in C */;
        return r12548;
}

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