Average Error: 0.0 → 0.0
Time: 3.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 r23620 = xre;
        double r23621 = xim;
        double r23622 = /* ERROR: no complex support in C */;
        double r23623 = exp(r23622);
        double r23624 = -r23622;
        double r23625 = exp(r23624);
        double r23626 = r23623 + r23625;
        double r23627 = 2.0;
        double r23628 = 0.0;
        double r23629 = /* ERROR: no complex support in C */;
        double r23630 = r23626 / r23629;
        double r23631 = /* ERROR: no complex support in C */;
        return r23631;
}

double f(double xre, double xim) {
        double r23632 = xre;
        double r23633 = xim;
        double r23634 = /* ERROR: no complex support in C */;
        double r23635 = exp(r23634);
        double r23636 = -r23634;
        double r23637 = exp(r23636);
        double r23638 = r23635 + r23637;
        double r23639 = 2.0;
        double r23640 = 0.0;
        double r23641 = /* ERROR: no complex support in C */;
        double r23642 = r23638 / r23641;
        double r23643 = /* ERROR: no complex support in C */;
        return r23643;
}

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