Average Error: 0.0 → 0.0
Time: 4.1s
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 r12748 = xre;
        double r12749 = xim;
        double r12750 = /* ERROR: no complex support in C */;
        double r12751 = exp(r12750);
        double r12752 = -r12750;
        double r12753 = exp(r12752);
        double r12754 = r12751 + r12753;
        double r12755 = 2.0;
        double r12756 = 0.0;
        double r12757 = /* ERROR: no complex support in C */;
        double r12758 = r12754 / r12757;
        double r12759 = /* ERROR: no complex support in C */;
        return r12759;
}

double f(double xre, double xim) {
        double r12760 = xre;
        double r12761 = xim;
        double r12762 = /* ERROR: no complex support in C */;
        double r12763 = exp(r12762);
        double r12764 = -r12762;
        double r12765 = exp(r12764);
        double r12766 = r12763 + r12765;
        double r12767 = 2.0;
        double r12768 = 0.0;
        double r12769 = /* ERROR: no complex support in C */;
        double r12770 = r12766 / r12769;
        double r12771 = /* ERROR: no complex support in C */;
        return r12771;
}

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