Average Error: 0.0 → 0.0
Time: 4.7s
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 r16955 = xre;
        double r16956 = xim;
        double r16957 = /* ERROR: no complex support in C */;
        double r16958 = exp(r16957);
        double r16959 = -r16957;
        double r16960 = exp(r16959);
        double r16961 = r16958 + r16960;
        double r16962 = 2.0;
        double r16963 = 0.0;
        double r16964 = /* ERROR: no complex support in C */;
        double r16965 = r16961 / r16964;
        double r16966 = /* ERROR: no complex support in C */;
        return r16966;
}

double f(double xre, double xim) {
        double r16967 = xre;
        double r16968 = xim;
        double r16969 = /* ERROR: no complex support in C */;
        double r16970 = exp(r16969);
        double r16971 = -r16969;
        double r16972 = exp(r16971);
        double r16973 = r16970 + r16972;
        double r16974 = 2.0;
        double r16975 = 0.0;
        double r16976 = /* ERROR: no complex support in C */;
        double r16977 = r16973 / r16976;
        double r16978 = /* ERROR: no complex support in C */;
        return r16978;
}

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