Average Error: 43.3 → 43.3
Time: 27.4s
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 r11427 = xre;
        double r11428 = xim;
        double r11429 = /* ERROR: no complex support in C */;
        double r11430 = exp(r11429);
        double r11431 = -r11429;
        double r11432 = exp(r11431);
        double r11433 = r11430 + r11432;
        double r11434 = 2.0;
        double r11435 = 0.0;
        double r11436 = /* ERROR: no complex support in C */;
        double r11437 = r11433 / r11436;
        double r11438 = /* ERROR: no complex support in C */;
        return r11438;
}

double f(double xre, double xim) {
        double r11439 = xre;
        double r11440 = xim;
        double r11441 = /* ERROR: no complex support in C */;
        double r11442 = exp(r11441);
        double r11443 = -r11441;
        double r11444 = exp(r11443);
        double r11445 = r11442 + r11444;
        double r11446 = 2.0;
        double r11447 = 0.0;
        double r11448 = /* ERROR: no complex support in C */;
        double r11449 = r11445 / r11448;
        double r11450 = /* ERROR: no complex support in C */;
        return r11450;
}

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 2019173 +o rules:numerics
(FPCore (xre xim)
  :name "exp with complex power imaginary part (p55)"
  (im (/ (+ (exp (complex xre xim)) (exp (- (complex xre xim)))) (complex 2.0 0.0))))