Average Error: 43.2 → 43.2
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 r14867 = xre;
        double r14868 = xim;
        double r14869 = /* ERROR: no complex support in C */;
        double r14870 = exp(r14869);
        double r14871 = -r14869;
        double r14872 = exp(r14871);
        double r14873 = r14870 + r14872;
        double r14874 = 2.0;
        double r14875 = 0.0;
        double r14876 = /* ERROR: no complex support in C */;
        double r14877 = r14873 / r14876;
        double r14878 = /* ERROR: no complex support in C */;
        return r14878;
}

double f(double xre, double xim) {
        double r14879 = xre;
        double r14880 = xim;
        double r14881 = /* ERROR: no complex support in C */;
        double r14882 = exp(r14881);
        double r14883 = -r14881;
        double r14884 = exp(r14883);
        double r14885 = r14882 + r14884;
        double r14886 = 2.0;
        double r14887 = 0.0;
        double r14888 = /* ERROR: no complex support in C */;
        double r14889 = r14885 / r14888;
        double r14890 = /* ERROR: no complex support in C */;
        return r14890;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 43.2

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

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