Average Error: 43.4 → 43.4
Time: 10.7s
Precision: 64
\[\Im(\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))\]
\[\Im(\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))\]
\Im(\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))
\Im(\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 r17162 = xre;
        double r17163 = xim;
        double r17164 = /* ERROR: no complex support in C */;
        double r17165 = exp(r17164);
        double r17166 = -r17164;
        double r17167 = exp(r17166);
        double r17168 = r17165 + r17167;
        double r17169 = 2.0;
        double r17170 = 0.0;
        double r17171 = /* ERROR: no complex support in C */;
        double r17172 = r17168 / r17171;
        double r17173 = /* ERROR: no complex support in C */;
        return r17173;
}

double f(double xre, double xim) {
        double r17174 = xre;
        double r17175 = xim;
        double r17176 = /* ERROR: no complex support in C */;
        double r17177 = exp(r17176);
        double r17178 = -r17176;
        double r17179 = exp(r17178);
        double r17180 = r17177 + r17179;
        double r17181 = 2.0;
        double r17182 = 0.0;
        double r17183 = /* ERROR: no complex support in C */;
        double r17184 = r17180 / r17183;
        double r17185 = /* ERROR: no complex support in C */;
        return r17185;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 43.4

    \[\Im(\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 simplification43.4

    \[\leadsto \Im(\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 2020100 +o rules:numerics
(FPCore (xre xim)
  :name "exp with complex power imaginary part (p55)"
  :precision binary64
  (im (/ (+ (exp (complex xre xim)) (exp (- (complex xre xim)))) (complex 2 0.0))))