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 r13964 = xre;
        double r13965 = xim;
        double r13966 = /* ERROR: no complex support in C */;
        double r13967 = exp(r13966);
        double r13968 = -r13966;
        double r13969 = exp(r13968);
        double r13970 = r13967 + r13969;
        double r13971 = 2.0;
        double r13972 = 0.0;
        double r13973 = /* ERROR: no complex support in C */;
        double r13974 = r13970 / r13973;
        double r13975 = /* ERROR: no complex support in C */;
        return r13975;
}

double f(double xre, double xim) {
        double r13976 = xre;
        double r13977 = xim;
        double r13978 = /* ERROR: no complex support in C */;
        double r13979 = exp(r13978);
        double r13980 = -r13978;
        double r13981 = exp(r13980);
        double r13982 = r13979 + r13981;
        double r13983 = 2.0;
        double r13984 = 0.0;
        double r13985 = /* ERROR: no complex support in C */;
        double r13986 = r13982 / r13985;
        double r13987 = /* ERROR: no complex support in C */;
        return r13987;
}

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