Average Error: 44.2 → 44.2
Time: 30.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.0 i\right)}\right))\]
\[\Im(\left(\frac{\left(\left(e^{\left(-\left(xre + xim i\right)\right)}\right) + \left(e^{\left(xre + xim i\right)}\right)\right)}{\left(2.0 + 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.0 i\right)}\right))
\Im(\left(\frac{\left(\left(e^{\left(-\left(xre + xim i\right)\right)}\right) + \left(e^{\left(xre + xim i\right)}\right)\right)}{\left(2.0 + 0.0 i\right)}\right))
double f(double xre, double xim) {
        double r10626 = xre;
        double r10627 = xim;
        double r10628 = /* ERROR: no complex support in C */;
        double r10629 = exp(r10628);
        double r10630 = -r10628;
        double r10631 = exp(r10630);
        double r10632 = r10629 + r10631;
        double r10633 = 2.0;
        double r10634 = 0.0;
        double r10635 = /* ERROR: no complex support in C */;
        double r10636 = r10632 / r10635;
        double r10637 = /* ERROR: no complex support in C */;
        return r10637;
}

double f(double xre, double xim) {
        double r10638 = xre;
        double r10639 = xim;
        double r10640 = /* ERROR: no complex support in C */;
        double r10641 = -r10640;
        double r10642 = exp(r10641);
        double r10643 = exp(r10640);
        double r10644 = r10642 + r10643;
        double r10645 = 2.0;
        double r10646 = 0.0;
        double r10647 = /* ERROR: no complex support in C */;
        double r10648 = r10644 / r10647;
        double r10649 = /* ERROR: no complex support in C */;
        return r10649;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 44.2

    \[\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.0 i\right)}\right))\]
  2. Final simplification44.2

    \[\leadsto \Im(\left(\frac{\left(\left(e^{\left(-\left(xre + xim i\right)\right)}\right) + \left(e^{\left(xre + xim i\right)}\right)\right)}{\left(2.0 + 0.0 i\right)}\right))\]

Reproduce

herbie shell --seed 2019165 
(FPCore (xre xim)
  :name "exp with complex power imaginary part (p55)"
  (im (/.c (+.c (exp.c (complex xre xim)) (exp.c (neg.c (complex xre xim)))) (complex 2.0 0.0))))