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 r15573 = xre;
        double r15574 = xim;
        double r15575 = /* ERROR: no complex support in C */;
        double r15576 = exp(r15575);
        double r15577 = -r15575;
        double r15578 = exp(r15577);
        double r15579 = r15576 + r15578;
        double r15580 = 2.0;
        double r15581 = 0.0;
        double r15582 = /* ERROR: no complex support in C */;
        double r15583 = r15579 / r15582;
        double r15584 = /* ERROR: no complex support in C */;
        return r15584;
}

double f(double xre, double xim) {
        double r15585 = xre;
        double r15586 = xim;
        double r15587 = /* ERROR: no complex support in C */;
        double r15588 = exp(r15587);
        double r15589 = -r15587;
        double r15590 = exp(r15589);
        double r15591 = r15588 + r15590;
        double r15592 = 2.0;
        double r15593 = 0.0;
        double r15594 = /* ERROR: no complex support in C */;
        double r15595 = r15591 / r15594;
        double r15596 = /* ERROR: no complex support in C */;
        return r15596;
}

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