Average Error: 0.0 → 0.0
Time: 3.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 r12970 = xre;
        double r12971 = xim;
        double r12972 = /* ERROR: no complex support in C */;
        double r12973 = exp(r12972);
        double r12974 = -r12972;
        double r12975 = exp(r12974);
        double r12976 = r12973 + r12975;
        double r12977 = 2.0;
        double r12978 = 0.0;
        double r12979 = /* ERROR: no complex support in C */;
        double r12980 = r12976 / r12979;
        double r12981 = /* ERROR: no complex support in C */;
        return r12981;
}

double f(double xre, double xim) {
        double r12982 = xre;
        double r12983 = xim;
        double r12984 = /* ERROR: no complex support in C */;
        double r12985 = exp(r12984);
        double r12986 = -r12984;
        double r12987 = exp(r12986);
        double r12988 = r12985 + r12987;
        double r12989 = 2.0;
        double r12990 = 0.0;
        double r12991 = /* ERROR: no complex support in C */;
        double r12992 = r12988 / r12991;
        double r12993 = /* ERROR: no complex support in C */;
        return r12993;
}

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