Average Error: 0.0 → 0.0
Time: 5.0s
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 r15530 = xre;
        double r15531 = xim;
        double r15532 = /* ERROR: no complex support in C */;
        double r15533 = exp(r15532);
        double r15534 = -r15532;
        double r15535 = exp(r15534);
        double r15536 = r15533 + r15535;
        double r15537 = 2.0;
        double r15538 = 0.0;
        double r15539 = /* ERROR: no complex support in C */;
        double r15540 = r15536 / r15539;
        double r15541 = /* ERROR: no complex support in C */;
        return r15541;
}

double f(double xre, double xim) {
        double r15542 = xre;
        double r15543 = xim;
        double r15544 = /* ERROR: no complex support in C */;
        double r15545 = exp(r15544);
        double r15546 = -r15544;
        double r15547 = exp(r15546);
        double r15548 = r15545 + r15547;
        double r15549 = 2.0;
        double r15550 = 0.0;
        double r15551 = /* ERROR: no complex support in C */;
        double r15552 = r15548 / r15551;
        double r15553 = /* ERROR: no complex support in C */;
        return r15553;
}

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