Average Error: 0.0 → 0.0
Time: 12.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 r9001 = xre;
        double r9002 = xim;
        double r9003 = /* ERROR: no complex support in C */;
        double r9004 = exp(r9003);
        double r9005 = -r9003;
        double r9006 = exp(r9005);
        double r9007 = r9004 + r9006;
        double r9008 = 2.0;
        double r9009 = 0.0;
        double r9010 = /* ERROR: no complex support in C */;
        double r9011 = r9007 / r9010;
        double r9012 = /* ERROR: no complex support in C */;
        return r9012;
}

double f(double xre, double xim) {
        double r9013 = xre;
        double r9014 = xim;
        double r9015 = /* ERROR: no complex support in C */;
        double r9016 = exp(r9015);
        double r9017 = -r9015;
        double r9018 = exp(r9017);
        double r9019 = r9016 + r9018;
        double r9020 = 2.0;
        double r9021 = 0.0;
        double r9022 = /* ERROR: no complex support in C */;
        double r9023 = r9019 / r9022;
        double r9024 = /* ERROR: no complex support in C */;
        return r9024;
}

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