Average Error: 0.0 → 0.0
Time: 13.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 r9252 = xre;
        double r9253 = xim;
        double r9254 = /* ERROR: no complex support in C */;
        double r9255 = exp(r9254);
        double r9256 = -r9254;
        double r9257 = exp(r9256);
        double r9258 = r9255 + r9257;
        double r9259 = 2.0;
        double r9260 = 0.0;
        double r9261 = /* ERROR: no complex support in C */;
        double r9262 = r9258 / r9261;
        double r9263 = /* ERROR: no complex support in C */;
        return r9263;
}

double f(double xre, double xim) {
        double r9264 = xre;
        double r9265 = xim;
        double r9266 = /* ERROR: no complex support in C */;
        double r9267 = exp(r9266);
        double r9268 = -r9266;
        double r9269 = exp(r9268);
        double r9270 = r9267 + r9269;
        double r9271 = 2.0;
        double r9272 = 0.0;
        double r9273 = /* ERROR: no complex support in C */;
        double r9274 = r9270 / r9273;
        double r9275 = /* ERROR: no complex support in C */;
        return r9275;
}

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