Average Error: 0.0 → 0.0
Time: 12.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 r9280 = xre;
        double r9281 = xim;
        double r9282 = /* ERROR: no complex support in C */;
        double r9283 = exp(r9282);
        double r9284 = -r9282;
        double r9285 = exp(r9284);
        double r9286 = r9283 + r9285;
        double r9287 = 2.0;
        double r9288 = 0.0;
        double r9289 = /* ERROR: no complex support in C */;
        double r9290 = r9286 / r9289;
        double r9291 = /* ERROR: no complex support in C */;
        return r9291;
}

double f(double xre, double xim) {
        double r9292 = xre;
        double r9293 = xim;
        double r9294 = /* ERROR: no complex support in C */;
        double r9295 = exp(r9294);
        double r9296 = -r9294;
        double r9297 = exp(r9296);
        double r9298 = r9295 + r9297;
        double r9299 = 2.0;
        double r9300 = 0.0;
        double r9301 = /* ERROR: no complex support in C */;
        double r9302 = r9298 / r9301;
        double r9303 = /* ERROR: no complex support in C */;
        return r9303;
}

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