Average Error: 0.0 → 0.0
Time: 4.7s
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 r13676 = xre;
        double r13677 = xim;
        double r13678 = /* ERROR: no complex support in C */;
        double r13679 = exp(r13678);
        double r13680 = -r13678;
        double r13681 = exp(r13680);
        double r13682 = r13679 + r13681;
        double r13683 = 2.0;
        double r13684 = 0.0;
        double r13685 = /* ERROR: no complex support in C */;
        double r13686 = r13682 / r13685;
        double r13687 = /* ERROR: no complex support in C */;
        return r13687;
}

double f(double xre, double xim) {
        double r13688 = xre;
        double r13689 = xim;
        double r13690 = /* ERROR: no complex support in C */;
        double r13691 = exp(r13690);
        double r13692 = -r13690;
        double r13693 = exp(r13692);
        double r13694 = r13691 + r13693;
        double r13695 = 2.0;
        double r13696 = 0.0;
        double r13697 = /* ERROR: no complex support in C */;
        double r13698 = r13694 / r13697;
        double r13699 = /* ERROR: no complex support in C */;
        return r13699;
}

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