Average Error: 43.3 → 43.3
Time: 25.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 r9256 = xre;
        double r9257 = xim;
        double r9258 = /* ERROR: no complex support in C */;
        double r9259 = exp(r9258);
        double r9260 = -r9258;
        double r9261 = exp(r9260);
        double r9262 = r9259 + r9261;
        double r9263 = 2.0;
        double r9264 = 0.0;
        double r9265 = /* ERROR: no complex support in C */;
        double r9266 = r9262 / r9265;
        double r9267 = /* ERROR: no complex support in C */;
        return r9267;
}

double f(double xre, double xim) {
        double r9268 = xre;
        double r9269 = xim;
        double r9270 = /* ERROR: no complex support in C */;
        double r9271 = exp(r9270);
        double r9272 = -r9270;
        double r9273 = exp(r9272);
        double r9274 = r9271 + r9273;
        double r9275 = 2.0;
        double r9276 = 0.0;
        double r9277 = /* ERROR: no complex support in C */;
        double r9278 = r9274 / r9277;
        double r9279 = /* ERROR: no complex support in C */;
        return r9279;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 43.3

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

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