Average Error: 0.0 → 0.0
Time: 3.8s
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 r13131 = xre;
        double r13132 = xim;
        double r13133 = /* ERROR: no complex support in C */;
        double r13134 = exp(r13133);
        double r13135 = -r13133;
        double r13136 = exp(r13135);
        double r13137 = r13134 + r13136;
        double r13138 = 2.0;
        double r13139 = 0.0;
        double r13140 = /* ERROR: no complex support in C */;
        double r13141 = r13137 / r13140;
        double r13142 = /* ERROR: no complex support in C */;
        return r13142;
}

double f(double xre, double xim) {
        double r13143 = xre;
        double r13144 = xim;
        double r13145 = /* ERROR: no complex support in C */;
        double r13146 = exp(r13145);
        double r13147 = -r13145;
        double r13148 = exp(r13147);
        double r13149 = r13146 + r13148;
        double r13150 = 2.0;
        double r13151 = 0.0;
        double r13152 = /* ERROR: no complex support in C */;
        double r13153 = r13149 / r13152;
        double r13154 = /* ERROR: no complex support in C */;
        return r13154;
}

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