Average Error: 0.0 → 0.0
Time: 10.5s
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 r29585 = xre;
        double r29586 = xim;
        double r29587 = /* ERROR: no complex support in C */;
        double r29588 = exp(r29587);
        double r29589 = -r29587;
        double r29590 = exp(r29589);
        double r29591 = r29588 + r29590;
        double r29592 = 2.0;
        double r29593 = 0.0;
        double r29594 = /* ERROR: no complex support in C */;
        double r29595 = r29591 / r29594;
        double r29596 = /* ERROR: no complex support in C */;
        return r29596;
}

double f(double xre, double xim) {
        double r29597 = xre;
        double r29598 = xim;
        double r29599 = /* ERROR: no complex support in C */;
        double r29600 = exp(r29599);
        double r29601 = -r29599;
        double r29602 = exp(r29601);
        double r29603 = r29600 + r29602;
        double r29604 = 2.0;
        double r29605 = 0.0;
        double r29606 = /* ERROR: no complex support in C */;
        double r29607 = r29603 / r29606;
        double r29608 = /* ERROR: no complex support in C */;
        return r29608;
}

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