Average Error: 43.6 → 43.6
Time: 11.5s
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 r15756 = xre;
        double r15757 = xim;
        double r15758 = /* ERROR: no complex support in C */;
        double r15759 = exp(r15758);
        double r15760 = -r15758;
        double r15761 = exp(r15760);
        double r15762 = r15759 + r15761;
        double r15763 = 2.0;
        double r15764 = 0.0;
        double r15765 = /* ERROR: no complex support in C */;
        double r15766 = r15762 / r15765;
        double r15767 = /* ERROR: no complex support in C */;
        return r15767;
}

double f(double xre, double xim) {
        double r15768 = xre;
        double r15769 = xim;
        double r15770 = /* ERROR: no complex support in C */;
        double r15771 = exp(r15770);
        double r15772 = -r15770;
        double r15773 = exp(r15772);
        double r15774 = r15771 + r15773;
        double r15775 = 2.0;
        double r15776 = 0.0;
        double r15777 = /* ERROR: no complex support in C */;
        double r15778 = r15774 / r15777;
        double r15779 = /* ERROR: no complex support in C */;
        return r15779;
}

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