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 r17011 = xre;
        double r17012 = xim;
        double r17013 = /* ERROR: no complex support in C */;
        double r17014 = exp(r17013);
        double r17015 = -r17013;
        double r17016 = exp(r17015);
        double r17017 = r17014 + r17016;
        double r17018 = 2.0;
        double r17019 = 0.0;
        double r17020 = /* ERROR: no complex support in C */;
        double r17021 = r17017 / r17020;
        double r17022 = /* ERROR: no complex support in C */;
        return r17022;
}

double f(double xre, double xim) {
        double r17023 = xre;
        double r17024 = xim;
        double r17025 = /* ERROR: no complex support in C */;
        double r17026 = exp(r17025);
        double r17027 = -r17025;
        double r17028 = exp(r17027);
        double r17029 = r17026 + r17028;
        double r17030 = 2.0;
        double r17031 = 0.0;
        double r17032 = /* ERROR: no complex support in C */;
        double r17033 = r17029 / r17032;
        double r17034 = /* ERROR: no complex support in C */;
        return r17034;
}

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