Average Error: 0.0 → 0.0
Time: 6.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 r111 = xre;
        double r112 = xim;
        double r113 = /* ERROR: no complex support in C */;
        double r114 = exp(r113);
        double r115 = -r113;
        double r116 = exp(r115);
        double r117 = r114 + r116;
        double r118 = 2.0;
        double r119 = 0.0;
        double r120 = /* ERROR: no complex support in C */;
        double r121 = r117 / r120;
        double r122 = /* ERROR: no complex support in C */;
        return r122;
}

double f(double xre, double xim) {
        double r123 = xre;
        double r124 = xim;
        double r125 = /* ERROR: no complex support in C */;
        double r126 = exp(r125);
        double r127 = -r125;
        double r128 = exp(r127);
        double r129 = r126 + r128;
        double r130 = 2.0;
        double r131 = 0.0;
        double r132 = /* ERROR: no complex support in C */;
        double r133 = r129 / r132;
        double r134 = /* ERROR: no complex support in C */;
        return r134;
}

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