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 r19953 = xre;
        double r19954 = xim;
        double r19955 = /* ERROR: no complex support in C */;
        double r19956 = exp(r19955);
        double r19957 = -r19955;
        double r19958 = exp(r19957);
        double r19959 = r19956 + r19958;
        double r19960 = 2.0;
        double r19961 = 0.0;
        double r19962 = /* ERROR: no complex support in C */;
        double r19963 = r19959 / r19962;
        double r19964 = /* ERROR: no complex support in C */;
        return r19964;
}

double f(double xre, double xim) {
        double r19965 = xre;
        double r19966 = xim;
        double r19967 = /* ERROR: no complex support in C */;
        double r19968 = exp(r19967);
        double r19969 = -r19967;
        double r19970 = exp(r19969);
        double r19971 = r19968 + r19970;
        double r19972 = 2.0;
        double r19973 = 0.0;
        double r19974 = /* ERROR: no complex support in C */;
        double r19975 = r19971 / r19974;
        double r19976 = /* ERROR: no complex support in C */;
        return r19976;
}

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