Average Error: 43.8 → 43.8
Time: 11.3s
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 r18755 = xre;
        double r18756 = xim;
        double r18757 = /* ERROR: no complex support in C */;
        double r18758 = exp(r18757);
        double r18759 = -r18757;
        double r18760 = exp(r18759);
        double r18761 = r18758 + r18760;
        double r18762 = 2.0;
        double r18763 = 0.0;
        double r18764 = /* ERROR: no complex support in C */;
        double r18765 = r18761 / r18764;
        double r18766 = /* ERROR: no complex support in C */;
        return r18766;
}

double f(double xre, double xim) {
        double r18767 = xre;
        double r18768 = xim;
        double r18769 = /* ERROR: no complex support in C */;
        double r18770 = exp(r18769);
        double r18771 = -r18769;
        double r18772 = exp(r18771);
        double r18773 = r18770 + r18772;
        double r18774 = 2.0;
        double r18775 = 0.0;
        double r18776 = /* ERROR: no complex support in C */;
        double r18777 = r18773 / r18776;
        double r18778 = /* ERROR: no complex support in C */;
        return r18778;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 43.8

    \[\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.8

    \[\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 2019347 +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))))