Average Error: 0.0 → 0.0
Time: 3.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 r14146 = xre;
        double r14147 = xim;
        double r14148 = /* ERROR: no complex support in C */;
        double r14149 = exp(r14148);
        double r14150 = -r14148;
        double r14151 = exp(r14150);
        double r14152 = r14149 + r14151;
        double r14153 = 2.0;
        double r14154 = 0.0;
        double r14155 = /* ERROR: no complex support in C */;
        double r14156 = r14152 / r14155;
        double r14157 = /* ERROR: no complex support in C */;
        return r14157;
}

double f(double xre, double xim) {
        double r14158 = xre;
        double r14159 = xim;
        double r14160 = /* ERROR: no complex support in C */;
        double r14161 = exp(r14160);
        double r14162 = -r14160;
        double r14163 = exp(r14162);
        double r14164 = r14161 + r14163;
        double r14165 = 2.0;
        double r14166 = 0.0;
        double r14167 = /* ERROR: no complex support in C */;
        double r14168 = r14164 / r14167;
        double r14169 = /* ERROR: no complex support in C */;
        return r14169;
}

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