Average Error: 43.8 → 43.8
Time: 11.6s
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 r23641 = xre;
        double r23642 = xim;
        double r23643 = /* ERROR: no complex support in C */;
        double r23644 = exp(r23643);
        double r23645 = -r23643;
        double r23646 = exp(r23645);
        double r23647 = r23644 + r23646;
        double r23648 = 2.0;
        double r23649 = 0.0;
        double r23650 = /* ERROR: no complex support in C */;
        double r23651 = r23647 / r23650;
        double r23652 = /* ERROR: no complex support in C */;
        return r23652;
}

double f(double xre, double xim) {
        double r23653 = xre;
        double r23654 = xim;
        double r23655 = /* ERROR: no complex support in C */;
        double r23656 = exp(r23655);
        double r23657 = -r23655;
        double r23658 = exp(r23657);
        double r23659 = r23656 + r23658;
        double r23660 = 2.0;
        double r23661 = 0.0;
        double r23662 = /* ERROR: no complex support in C */;
        double r23663 = r23659 / r23662;
        double r23664 = /* ERROR: no complex support in C */;
        return r23664;
}

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 2019352 
(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))))