Average Error: 0.0 → 0.0
Time: 16.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 r9128 = xre;
        double r9129 = xim;
        double r9130 = /* ERROR: no complex support in C */;
        double r9131 = exp(r9130);
        double r9132 = -r9130;
        double r9133 = exp(r9132);
        double r9134 = r9131 + r9133;
        double r9135 = 2.0;
        double r9136 = 0.0;
        double r9137 = /* ERROR: no complex support in C */;
        double r9138 = r9134 / r9137;
        double r9139 = /* ERROR: no complex support in C */;
        return r9139;
}

double f(double xre, double xim) {
        double r9140 = xre;
        double r9141 = xim;
        double r9142 = /* ERROR: no complex support in C */;
        double r9143 = exp(r9142);
        double r9144 = -r9142;
        double r9145 = exp(r9144);
        double r9146 = r9143 + r9145;
        double r9147 = 2.0;
        double r9148 = 0.0;
        double r9149 = /* ERROR: no complex support in C */;
        double r9150 = r9146 / r9149;
        double r9151 = /* ERROR: no complex support in C */;
        return r9151;
}

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