Average Error: 0.0 → 0.0
Time: 14.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 r9242 = xre;
        double r9243 = xim;
        double r9244 = /* ERROR: no complex support in C */;
        double r9245 = exp(r9244);
        double r9246 = -r9244;
        double r9247 = exp(r9246);
        double r9248 = r9245 + r9247;
        double r9249 = 2.0;
        double r9250 = 0.0;
        double r9251 = /* ERROR: no complex support in C */;
        double r9252 = r9248 / r9251;
        double r9253 = /* ERROR: no complex support in C */;
        return r9253;
}

double f(double xre, double xim) {
        double r9254 = xre;
        double r9255 = xim;
        double r9256 = /* ERROR: no complex support in C */;
        double r9257 = exp(r9256);
        double r9258 = -r9256;
        double r9259 = exp(r9258);
        double r9260 = r9257 + r9259;
        double r9261 = 2.0;
        double r9262 = 0.0;
        double r9263 = /* ERROR: no complex support in C */;
        double r9264 = r9260 / r9263;
        double r9265 = /* ERROR: no complex support in C */;
        return r9265;
}

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