Average Error: 0.0 → 0.0
Time: 4.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 r28555 = xre;
        double r28556 = xim;
        double r28557 = /* ERROR: no complex support in C */;
        double r28558 = exp(r28557);
        double r28559 = -r28557;
        double r28560 = exp(r28559);
        double r28561 = r28558 + r28560;
        double r28562 = 2.0;
        double r28563 = 0.0;
        double r28564 = /* ERROR: no complex support in C */;
        double r28565 = r28561 / r28564;
        double r28566 = /* ERROR: no complex support in C */;
        return r28566;
}

double f(double xre, double xim) {
        double r28567 = xre;
        double r28568 = xim;
        double r28569 = /* ERROR: no complex support in C */;
        double r28570 = exp(r28569);
        double r28571 = -r28569;
        double r28572 = exp(r28571);
        double r28573 = r28570 + r28572;
        double r28574 = 2.0;
        double r28575 = 0.0;
        double r28576 = /* ERROR: no complex support in C */;
        double r28577 = r28573 / r28576;
        double r28578 = /* ERROR: no complex support in C */;
        return r28578;
}

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