Average Error: 43.1 → 43.1
Time: 26.1s
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 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;
}

double f(double xre, double xim) {
        double r9280 = xre;
        double r9281 = xim;
        double r9282 = /* ERROR: no complex support in C */;
        double r9283 = exp(r9282);
        double r9284 = -r9282;
        double r9285 = exp(r9284);
        double r9286 = r9283 + r9285;
        double r9287 = 2.0;
        double r9288 = 0.0;
        double r9289 = /* ERROR: no complex support in C */;
        double r9290 = r9286 / r9289;
        double r9291 = /* ERROR: no complex support in C */;
        return r9291;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 43.1

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

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