Average Error: 0.0 → 0.0
Time: 12.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 r9332 = xre;
        double r9333 = xim;
        double r9334 = /* ERROR: no complex support in C */;
        double r9335 = exp(r9334);
        double r9336 = -r9334;
        double r9337 = exp(r9336);
        double r9338 = r9335 + r9337;
        double r9339 = 2.0;
        double r9340 = 0.0;
        double r9341 = /* ERROR: no complex support in C */;
        double r9342 = r9338 / r9341;
        double r9343 = /* ERROR: no complex support in C */;
        return r9343;
}

double f(double xre, double xim) {
        double r9344 = xre;
        double r9345 = xim;
        double r9346 = /* ERROR: no complex support in C */;
        double r9347 = exp(r9346);
        double r9348 = -r9346;
        double r9349 = exp(r9348);
        double r9350 = r9347 + r9349;
        double r9351 = 2.0;
        double r9352 = 0.0;
        double r9353 = /* ERROR: no complex support in C */;
        double r9354 = r9350 / r9353;
        double r9355 = /* ERROR: no complex support in C */;
        return r9355;
}

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