Average Error: 0.0 → 0.0
Time: 15.0s
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 r9267 = xre;
        double r9268 = xim;
        double r9269 = /* ERROR: no complex support in C */;
        double r9270 = exp(r9269);
        double r9271 = -r9269;
        double r9272 = exp(r9271);
        double r9273 = r9270 + r9272;
        double r9274 = 2.0;
        double r9275 = 0.0;
        double r9276 = /* ERROR: no complex support in C */;
        double r9277 = r9273 / r9276;
        double r9278 = /* ERROR: no complex support in C */;
        return r9278;
}

double f(double xre, double xim) {
        double r9279 = xre;
        double r9280 = xim;
        double r9281 = /* ERROR: no complex support in C */;
        double r9282 = exp(r9281);
        double r9283 = -r9281;
        double r9284 = exp(r9283);
        double r9285 = r9282 + r9284;
        double r9286 = 2.0;
        double r9287 = 0.0;
        double r9288 = /* ERROR: no complex support in C */;
        double r9289 = r9285 / r9288;
        double r9290 = /* ERROR: no complex support in C */;
        return r9290;
}

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