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

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

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