Average Error: 0.0 → 0.0
Time: 4.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 r19685 = xre;
        double r19686 = xim;
        double r19687 = /* ERROR: no complex support in C */;
        double r19688 = exp(r19687);
        double r19689 = -r19687;
        double r19690 = exp(r19689);
        double r19691 = r19688 + r19690;
        double r19692 = 2.0;
        double r19693 = 0.0;
        double r19694 = /* ERROR: no complex support in C */;
        double r19695 = r19691 / r19694;
        double r19696 = /* ERROR: no complex support in C */;
        return r19696;
}

double f(double xre, double xim) {
        double r19697 = xre;
        double r19698 = xim;
        double r19699 = /* ERROR: no complex support in C */;
        double r19700 = exp(r19699);
        double r19701 = -r19699;
        double r19702 = exp(r19701);
        double r19703 = r19700 + r19702;
        double r19704 = 2.0;
        double r19705 = 0.0;
        double r19706 = /* ERROR: no complex support in C */;
        double r19707 = r19703 / r19706;
        double r19708 = /* ERROR: no complex support in C */;
        return r19708;
}

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