Average Error: 43.6 → 43.6
Time: 11.8s
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 r15932 = xre;
        double r15933 = xim;
        double r15934 = /* ERROR: no complex support in C */;
        double r15935 = exp(r15934);
        double r15936 = -r15934;
        double r15937 = exp(r15936);
        double r15938 = r15935 + r15937;
        double r15939 = 2.0;
        double r15940 = 0.0;
        double r15941 = /* ERROR: no complex support in C */;
        double r15942 = r15938 / r15941;
        double r15943 = /* ERROR: no complex support in C */;
        return r15943;
}

double f(double xre, double xim) {
        double r15944 = xre;
        double r15945 = xim;
        double r15946 = /* ERROR: no complex support in C */;
        double r15947 = exp(r15946);
        double r15948 = -r15946;
        double r15949 = exp(r15948);
        double r15950 = r15947 + r15949;
        double r15951 = 2.0;
        double r15952 = 0.0;
        double r15953 = /* ERROR: no complex support in C */;
        double r15954 = r15950 / r15953;
        double r15955 = /* ERROR: no complex support in C */;
        return r15955;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 43.6

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

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