Average Error: 0.0 → 0.0
Time: 3.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 r14565 = xre;
        double r14566 = xim;
        double r14567 = /* ERROR: no complex support in C */;
        double r14568 = exp(r14567);
        double r14569 = -r14567;
        double r14570 = exp(r14569);
        double r14571 = r14568 + r14570;
        double r14572 = 2.0;
        double r14573 = 0.0;
        double r14574 = /* ERROR: no complex support in C */;
        double r14575 = r14571 / r14574;
        double r14576 = /* ERROR: no complex support in C */;
        return r14576;
}

double f(double xre, double xim) {
        double r14577 = xre;
        double r14578 = xim;
        double r14579 = /* ERROR: no complex support in C */;
        double r14580 = exp(r14579);
        double r14581 = -r14579;
        double r14582 = exp(r14581);
        double r14583 = r14580 + r14582;
        double r14584 = 2.0;
        double r14585 = 0.0;
        double r14586 = /* ERROR: no complex support in C */;
        double r14587 = r14583 / r14586;
        double r14588 = /* ERROR: no complex support in C */;
        return r14588;
}

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 2020024 +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))))