Average Error: 43.7 → 43.7
Time: 11.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 r10197 = xre;
        double r10198 = xim;
        double r10199 = /* ERROR: no complex support in C */;
        double r10200 = exp(r10199);
        double r10201 = -r10199;
        double r10202 = exp(r10201);
        double r10203 = r10200 + r10202;
        double r10204 = 2.0;
        double r10205 = 0.0;
        double r10206 = /* ERROR: no complex support in C */;
        double r10207 = r10203 / r10206;
        double r10208 = /* ERROR: no complex support in C */;
        return r10208;
}

double f(double xre, double xim) {
        double r10209 = xre;
        double r10210 = xim;
        double r10211 = /* ERROR: no complex support in C */;
        double r10212 = exp(r10211);
        double r10213 = -r10211;
        double r10214 = exp(r10213);
        double r10215 = r10212 + r10214;
        double r10216 = 2.0;
        double r10217 = 0.0;
        double r10218 = /* ERROR: no complex support in C */;
        double r10219 = r10215 / r10218;
        double r10220 = /* ERROR: no complex support in C */;
        return r10220;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 43.7

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

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