Average Error: 0.0 → 0.0
Time: 6.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 r118 = xre;
        double r119 = xim;
        double r120 = /* ERROR: no complex support in C */;
        double r121 = exp(r120);
        double r122 = -r120;
        double r123 = exp(r122);
        double r124 = r121 + r123;
        double r125 = 2.0;
        double r126 = 0.0;
        double r127 = /* ERROR: no complex support in C */;
        double r128 = r124 / r127;
        double r129 = /* ERROR: no complex support in C */;
        return r129;
}

double f(double xre, double xim) {
        double r130 = xre;
        double r131 = xim;
        double r132 = /* ERROR: no complex support in C */;
        double r133 = exp(r132);
        double r134 = -r132;
        double r135 = exp(r134);
        double r136 = r133 + r135;
        double r137 = 2.0;
        double r138 = 0.0;
        double r139 = /* ERROR: no complex support in C */;
        double r140 = r136 / r139;
        double r141 = /* ERROR: no complex support in C */;
        return r141;
}

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