Average Error: 43.4 → 43.4
Time: 11.7s
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 r24954 = xre;
        double r24955 = xim;
        double r24956 = /* ERROR: no complex support in C */;
        double r24957 = exp(r24956);
        double r24958 = -r24956;
        double r24959 = exp(r24958);
        double r24960 = r24957 + r24959;
        double r24961 = 2.0;
        double r24962 = 0.0;
        double r24963 = /* ERROR: no complex support in C */;
        double r24964 = r24960 / r24963;
        double r24965 = /* ERROR: no complex support in C */;
        return r24965;
}

double f(double xre, double xim) {
        double r24966 = xre;
        double r24967 = xim;
        double r24968 = /* ERROR: no complex support in C */;
        double r24969 = exp(r24968);
        double r24970 = -r24968;
        double r24971 = exp(r24970);
        double r24972 = r24969 + r24971;
        double r24973 = 2.0;
        double r24974 = 0.0;
        double r24975 = /* ERROR: no complex support in C */;
        double r24976 = r24972 / r24975;
        double r24977 = /* ERROR: no complex support in C */;
        return r24977;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 43.4

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

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