Average Error: 0.0 → 0.0
Time: 3.9s
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 r14179 = xre;
        double r14180 = xim;
        double r14181 = /* ERROR: no complex support in C */;
        double r14182 = exp(r14181);
        double r14183 = -r14181;
        double r14184 = exp(r14183);
        double r14185 = r14182 + r14184;
        double r14186 = 2.0;
        double r14187 = 0.0;
        double r14188 = /* ERROR: no complex support in C */;
        double r14189 = r14185 / r14188;
        double r14190 = /* ERROR: no complex support in C */;
        return r14190;
}

double f(double xre, double xim) {
        double r14191 = xre;
        double r14192 = xim;
        double r14193 = /* ERROR: no complex support in C */;
        double r14194 = exp(r14193);
        double r14195 = -r14193;
        double r14196 = exp(r14195);
        double r14197 = r14194 + r14196;
        double r14198 = 2.0;
        double r14199 = 0.0;
        double r14200 = /* ERROR: no complex support in C */;
        double r14201 = r14197 / r14200;
        double r14202 = /* ERROR: no complex support in C */;
        return r14202;
}

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