Average Error: 0.0 → 0.0
Time: 5.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 r19935 = xre;
        double r19936 = xim;
        double r19937 = /* ERROR: no complex support in C */;
        double r19938 = exp(r19937);
        double r19939 = -r19937;
        double r19940 = exp(r19939);
        double r19941 = r19938 + r19940;
        double r19942 = 2.0;
        double r19943 = 0.0;
        double r19944 = /* ERROR: no complex support in C */;
        double r19945 = r19941 / r19944;
        double r19946 = /* ERROR: no complex support in C */;
        return r19946;
}

double f(double xre, double xim) {
        double r19947 = xre;
        double r19948 = xim;
        double r19949 = /* ERROR: no complex support in C */;
        double r19950 = exp(r19949);
        double r19951 = -r19949;
        double r19952 = exp(r19951);
        double r19953 = r19950 + r19952;
        double r19954 = 2.0;
        double r19955 = 0.0;
        double r19956 = /* ERROR: no complex support in C */;
        double r19957 = r19953 / r19956;
        double r19958 = /* ERROR: no complex support in C */;
        return r19958;
}

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