Average Error: 43.9 → 43.9
Time: 11.2s
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 r15232 = xre;
        double r15233 = xim;
        double r15234 = /* ERROR: no complex support in C */;
        double r15235 = exp(r15234);
        double r15236 = -r15234;
        double r15237 = exp(r15236);
        double r15238 = r15235 + r15237;
        double r15239 = 2.0;
        double r15240 = 0.0;
        double r15241 = /* ERROR: no complex support in C */;
        double r15242 = r15238 / r15241;
        double r15243 = /* ERROR: no complex support in C */;
        return r15243;
}

double f(double xre, double xim) {
        double r15244 = xre;
        double r15245 = xim;
        double r15246 = /* ERROR: no complex support in C */;
        double r15247 = exp(r15246);
        double r15248 = -r15246;
        double r15249 = exp(r15248);
        double r15250 = r15247 + r15249;
        double r15251 = 2.0;
        double r15252 = 0.0;
        double r15253 = /* ERROR: no complex support in C */;
        double r15254 = r15250 / r15253;
        double r15255 = /* ERROR: no complex support in C */;
        return r15255;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 43.9

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

    \[\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 2020001 
(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))))