Average Error: 0.0 → 0.0
Time: 4.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 r15586 = xre;
        double r15587 = xim;
        double r15588 = /* ERROR: no complex support in C */;
        double r15589 = exp(r15588);
        double r15590 = -r15588;
        double r15591 = exp(r15590);
        double r15592 = r15589 + r15591;
        double r15593 = 2.0;
        double r15594 = 0.0;
        double r15595 = /* ERROR: no complex support in C */;
        double r15596 = r15592 / r15595;
        double r15597 = /* ERROR: no complex support in C */;
        return r15597;
}

double f(double xre, double xim) {
        double r15598 = xre;
        double r15599 = xim;
        double r15600 = /* ERROR: no complex support in C */;
        double r15601 = exp(r15600);
        double r15602 = -r15600;
        double r15603 = exp(r15602);
        double r15604 = r15601 + r15603;
        double r15605 = 2.0;
        double r15606 = 0.0;
        double r15607 = /* ERROR: no complex support in C */;
        double r15608 = r15604 / r15607;
        double r15609 = /* ERROR: no complex support in C */;
        return r15609;
}

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