Average Error: 43.6 → 43.6
Time: 10.4s
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 r2751 = xre;
        double r2752 = xim;
        double r2753 = /* ERROR: no complex support in C */;
        double r2754 = exp(r2753);
        double r2755 = -r2753;
        double r2756 = exp(r2755);
        double r2757 = r2754 + r2756;
        double r2758 = 2.0;
        double r2759 = 0.0;
        double r2760 = /* ERROR: no complex support in C */;
        double r2761 = r2757 / r2760;
        double r2762 = /* ERROR: no complex support in C */;
        return r2762;
}

double f(double xre, double xim) {
        double r2763 = xre;
        double r2764 = xim;
        double r2765 = /* ERROR: no complex support in C */;
        double r2766 = exp(r2765);
        double r2767 = -r2765;
        double r2768 = exp(r2767);
        double r2769 = r2766 + r2768;
        double r2770 = 2.0;
        double r2771 = 0.0;
        double r2772 = /* ERROR: no complex support in C */;
        double r2773 = r2769 / r2772;
        double r2774 = /* ERROR: no complex support in C */;
        return r2774;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 43.6

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

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