Average Error: 43.6 → 43.6
Time: 10.6s
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 r16207 = xre;
        double r16208 = xim;
        double r16209 = /* ERROR: no complex support in C */;
        double r16210 = exp(r16209);
        double r16211 = -r16209;
        double r16212 = exp(r16211);
        double r16213 = r16210 + r16212;
        double r16214 = 2.0;
        double r16215 = 0.0;
        double r16216 = /* ERROR: no complex support in C */;
        double r16217 = r16213 / r16216;
        double r16218 = /* ERROR: no complex support in C */;
        return r16218;
}

double f(double xre, double xim) {
        double r16219 = xre;
        double r16220 = xim;
        double r16221 = /* ERROR: no complex support in C */;
        double r16222 = exp(r16221);
        double r16223 = -r16221;
        double r16224 = exp(r16223);
        double r16225 = r16222 + r16224;
        double r16226 = 2.0;
        double r16227 = 0.0;
        double r16228 = /* ERROR: no complex support in C */;
        double r16229 = r16225 / r16228;
        double r16230 = /* ERROR: no complex support in C */;
        return r16230;
}

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 2020064 +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))))