Average Error: 43.8 → 43.8
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 r21149 = xre;
        double r21150 = xim;
        double r21151 = /* ERROR: no complex support in C */;
        double r21152 = exp(r21151);
        double r21153 = -r21151;
        double r21154 = exp(r21153);
        double r21155 = r21152 + r21154;
        double r21156 = 2.0;
        double r21157 = 0.0;
        double r21158 = /* ERROR: no complex support in C */;
        double r21159 = r21155 / r21158;
        double r21160 = /* ERROR: no complex support in C */;
        return r21160;
}

double f(double xre, double xim) {
        double r21161 = xre;
        double r21162 = xim;
        double r21163 = /* ERROR: no complex support in C */;
        double r21164 = exp(r21163);
        double r21165 = -r21163;
        double r21166 = exp(r21165);
        double r21167 = r21164 + r21166;
        double r21168 = 2.0;
        double r21169 = 0.0;
        double r21170 = /* ERROR: no complex support in C */;
        double r21171 = r21167 / r21170;
        double r21172 = /* ERROR: no complex support in C */;
        return r21172;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 43.8

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

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