Average Error: 43.5 → 43.5
Time: 2.8m
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 r9127 = xre;
        double r9128 = xim;
        double r9129 = /* ERROR: no complex support in C */;
        double r9130 = exp(r9129);
        double r9131 = -r9129;
        double r9132 = exp(r9131);
        double r9133 = r9130 + r9132;
        double r9134 = 2.0;
        double r9135 = 0.0;
        double r9136 = /* ERROR: no complex support in C */;
        double r9137 = r9133 / r9136;
        double r9138 = /* ERROR: no complex support in C */;
        return r9138;
}

double f(double xre, double xim) {
        double r9139 = xre;
        double r9140 = xim;
        double r9141 = /* ERROR: no complex support in C */;
        double r9142 = exp(r9141);
        double r9143 = -r9141;
        double r9144 = exp(r9143);
        double r9145 = r9142 + r9144;
        double r9146 = 2.0;
        double r9147 = 0.0;
        double r9148 = /* ERROR: no complex support in C */;
        double r9149 = r9145 / r9148;
        double r9150 = /* ERROR: no complex support in C */;
        return r9150;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 43.5

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

    \[\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 2019200 
(FPCore (xre xim)
  :name "exp with complex power imaginary part (p55)"
  (im (/ (+ (exp (complex xre xim)) (exp (- (complex xre xim)))) (complex 2 0.0))))