Average Error: 43.9 → 43.9
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 r24940 = xre;
        double r24941 = xim;
        double r24942 = /* ERROR: no complex support in C */;
        double r24943 = exp(r24942);
        double r24944 = -r24942;
        double r24945 = exp(r24944);
        double r24946 = r24943 + r24945;
        double r24947 = 2.0;
        double r24948 = 0.0;
        double r24949 = /* ERROR: no complex support in C */;
        double r24950 = r24946 / r24949;
        double r24951 = /* ERROR: no complex support in C */;
        return r24951;
}

double f(double xre, double xim) {
        double r24952 = xre;
        double r24953 = xim;
        double r24954 = /* ERROR: no complex support in C */;
        double r24955 = exp(r24954);
        double r24956 = -r24954;
        double r24957 = exp(r24956);
        double r24958 = r24955 + r24957;
        double r24959 = 2.0;
        double r24960 = 0.0;
        double r24961 = /* ERROR: no complex support in C */;
        double r24962 = r24958 / r24961;
        double r24963 = /* ERROR: no complex support in C */;
        return r24963;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 43.9

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

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