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 r1207 = xre;
        double r1208 = xim;
        double r1209 = /* ERROR: no complex support in C */;
        double r1210 = exp(r1209);
        double r1211 = -r1209;
        double r1212 = exp(r1211);
        double r1213 = r1210 + r1212;
        double r1214 = 2.0;
        double r1215 = 0.0;
        double r1216 = /* ERROR: no complex support in C */;
        double r1217 = r1213 / r1216;
        double r1218 = /* ERROR: no complex support in C */;
        return r1218;
}

double f(double xre, double xim) {
        double r1219 = xre;
        double r1220 = xim;
        double r1221 = /* ERROR: no complex support in C */;
        double r1222 = exp(r1221);
        double r1223 = -r1221;
        double r1224 = exp(r1223);
        double r1225 = r1222 + r1224;
        double r1226 = 2.0;
        double r1227 = 0.0;
        double r1228 = /* ERROR: no complex support in C */;
        double r1229 = r1225 / r1228;
        double r1230 = /* ERROR: no complex support in C */;
        return r1230;
}

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