Average Error: 43.4 → 43.4
Time: 25.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 r9069 = xre;
        double r9070 = xim;
        double r9071 = /* ERROR: no complex support in C */;
        double r9072 = exp(r9071);
        double r9073 = -r9071;
        double r9074 = exp(r9073);
        double r9075 = r9072 + r9074;
        double r9076 = 2.0;
        double r9077 = 0.0;
        double r9078 = /* ERROR: no complex support in C */;
        double r9079 = r9075 / r9078;
        double r9080 = /* ERROR: no complex support in C */;
        return r9080;
}

double f(double xre, double xim) {
        double r9081 = xre;
        double r9082 = xim;
        double r9083 = /* ERROR: no complex support in C */;
        double r9084 = exp(r9083);
        double r9085 = -r9083;
        double r9086 = exp(r9085);
        double r9087 = r9084 + r9086;
        double r9088 = 2.0;
        double r9089 = 0.0;
        double r9090 = /* ERROR: no complex support in C */;
        double r9091 = r9087 / r9090;
        double r9092 = /* ERROR: no complex support in C */;
        return r9092;
}

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