Average Error: 44.3 → 44.3
Time: 10.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 r13012 = xre;
        double r13013 = xim;
        double r13014 = /* ERROR: no complex support in C */;
        double r13015 = exp(r13014);
        double r13016 = -r13014;
        double r13017 = exp(r13016);
        double r13018 = r13015 + r13017;
        double r13019 = 2.0;
        double r13020 = 0.0;
        double r13021 = /* ERROR: no complex support in C */;
        double r13022 = r13018 / r13021;
        double r13023 = /* ERROR: no complex support in C */;
        return r13023;
}

double f(double xre, double xim) {
        double r13024 = xre;
        double r13025 = xim;
        double r13026 = /* ERROR: no complex support in C */;
        double r13027 = exp(r13026);
        double r13028 = -r13026;
        double r13029 = exp(r13028);
        double r13030 = r13027 + r13029;
        double r13031 = 2.0;
        double r13032 = 0.0;
        double r13033 = /* ERROR: no complex support in C */;
        double r13034 = r13030 / r13033;
        double r13035 = /* ERROR: no complex support in C */;
        return r13035;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 44.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 simplification44.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 2020034 
(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))))