Average Error: 43.6 → 43.6
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 r17186 = xre;
        double r17187 = xim;
        double r17188 = /* ERROR: no complex support in C */;
        double r17189 = exp(r17188);
        double r17190 = -r17188;
        double r17191 = exp(r17190);
        double r17192 = r17189 + r17191;
        double r17193 = 2.0;
        double r17194 = 0.0;
        double r17195 = /* ERROR: no complex support in C */;
        double r17196 = r17192 / r17195;
        double r17197 = /* ERROR: no complex support in C */;
        return r17197;
}

double f(double xre, double xim) {
        double r17198 = xre;
        double r17199 = xim;
        double r17200 = /* ERROR: no complex support in C */;
        double r17201 = exp(r17200);
        double r17202 = -r17200;
        double r17203 = exp(r17202);
        double r17204 = r17201 + r17203;
        double r17205 = 2.0;
        double r17206 = 0.0;
        double r17207 = /* ERROR: no complex support in C */;
        double r17208 = r17204 / r17207;
        double r17209 = /* ERROR: no complex support in C */;
        return r17209;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 43.6

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

    \[\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 2020056 +o rules:numerics
(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))))