Average Error: 43.7 → 43.7
Time: 11.3s
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 r18198 = xre;
        double r18199 = xim;
        double r18200 = /* ERROR: no complex support in C */;
        double r18201 = exp(r18200);
        double r18202 = -r18200;
        double r18203 = exp(r18202);
        double r18204 = r18201 + r18203;
        double r18205 = 2.0;
        double r18206 = 0.0;
        double r18207 = /* ERROR: no complex support in C */;
        double r18208 = r18204 / r18207;
        double r18209 = /* ERROR: no complex support in C */;
        return r18209;
}

double f(double xre, double xim) {
        double r18210 = xre;
        double r18211 = xim;
        double r18212 = /* ERROR: no complex support in C */;
        double r18213 = exp(r18212);
        double r18214 = -r18212;
        double r18215 = exp(r18214);
        double r18216 = r18213 + r18215;
        double r18217 = 2.0;
        double r18218 = 0.0;
        double r18219 = /* ERROR: no complex support in C */;
        double r18220 = r18216 / r18219;
        double r18221 = /* ERROR: no complex support in C */;
        return r18221;
}

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