Average Error: 0.0 → 0.0
Time: 4.5s
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 r16535 = xre;
        double r16536 = xim;
        double r16537 = /* ERROR: no complex support in C */;
        double r16538 = exp(r16537);
        double r16539 = -r16537;
        double r16540 = exp(r16539);
        double r16541 = r16538 + r16540;
        double r16542 = 2.0;
        double r16543 = 0.0;
        double r16544 = /* ERROR: no complex support in C */;
        double r16545 = r16541 / r16544;
        double r16546 = /* ERROR: no complex support in C */;
        return r16546;
}

double f(double xre, double xim) {
        double r16547 = xre;
        double r16548 = xim;
        double r16549 = /* ERROR: no complex support in C */;
        double r16550 = exp(r16549);
        double r16551 = -r16549;
        double r16552 = exp(r16551);
        double r16553 = r16550 + r16552;
        double r16554 = 2.0;
        double r16555 = 0.0;
        double r16556 = /* ERROR: no complex support in C */;
        double r16557 = r16553 / r16556;
        double r16558 = /* ERROR: no complex support in C */;
        return r16558;
}

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