Average Error: 43.3 → 43.3
Time: 10.5s
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 r17475 = xre;
        double r17476 = xim;
        double r17477 = /* ERROR: no complex support in C */;
        double r17478 = exp(r17477);
        double r17479 = -r17477;
        double r17480 = exp(r17479);
        double r17481 = r17478 + r17480;
        double r17482 = 2.0;
        double r17483 = 0.0;
        double r17484 = /* ERROR: no complex support in C */;
        double r17485 = r17481 / r17484;
        double r17486 = /* ERROR: no complex support in C */;
        return r17486;
}

double f(double xre, double xim) {
        double r17487 = xre;
        double r17488 = xim;
        double r17489 = /* ERROR: no complex support in C */;
        double r17490 = exp(r17489);
        double r17491 = -r17489;
        double r17492 = exp(r17491);
        double r17493 = r17490 + r17492;
        double r17494 = 2.0;
        double r17495 = 0.0;
        double r17496 = /* ERROR: no complex support in C */;
        double r17497 = r17493 / r17496;
        double r17498 = /* ERROR: no complex support in C */;
        return r17498;
}

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 2020036 +o rules:numerics
(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))))