Average Error: 0.0 → 0.0
Time: 4.8s
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 r16263 = xre;
        double r16264 = xim;
        double r16265 = /* ERROR: no complex support in C */;
        double r16266 = exp(r16265);
        double r16267 = -r16265;
        double r16268 = exp(r16267);
        double r16269 = r16266 + r16268;
        double r16270 = 2.0;
        double r16271 = 0.0;
        double r16272 = /* ERROR: no complex support in C */;
        double r16273 = r16269 / r16272;
        double r16274 = /* ERROR: no complex support in C */;
        return r16274;
}

double f(double xre, double xim) {
        double r16275 = xre;
        double r16276 = xim;
        double r16277 = /* ERROR: no complex support in C */;
        double r16278 = exp(r16277);
        double r16279 = -r16277;
        double r16280 = exp(r16279);
        double r16281 = r16278 + r16280;
        double r16282 = 2.0;
        double r16283 = 0.0;
        double r16284 = /* ERROR: no complex support in C */;
        double r16285 = r16281 / r16284;
        double r16286 = /* ERROR: no complex support in C */;
        return r16286;
}

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 2020036 +o rules:numerics
(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))))