Average Error: 0.0 → 0.0
Time: 3.9s
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 r1199 = xre;
        double r1200 = xim;
        double r1201 = /* ERROR: no complex support in C */;
        double r1202 = exp(r1201);
        double r1203 = -r1201;
        double r1204 = exp(r1203);
        double r1205 = r1202 + r1204;
        double r1206 = 2.0;
        double r1207 = 0.0;
        double r1208 = /* ERROR: no complex support in C */;
        double r1209 = r1205 / r1208;
        double r1210 = /* ERROR: no complex support in C */;
        return r1210;
}

double f(double xre, double xim) {
        double r1211 = xre;
        double r1212 = xim;
        double r1213 = /* ERROR: no complex support in C */;
        double r1214 = exp(r1213);
        double r1215 = -r1213;
        double r1216 = exp(r1215);
        double r1217 = r1214 + r1216;
        double r1218 = 2.0;
        double r1219 = 0.0;
        double r1220 = /* ERROR: no complex support in C */;
        double r1221 = r1217 / r1220;
        double r1222 = /* ERROR: no complex support in C */;
        return r1222;
}

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