Average Error: 43.7 → 43.7
Time: 10.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 r16114 = xre;
        double r16115 = xim;
        double r16116 = /* ERROR: no complex support in C */;
        double r16117 = exp(r16116);
        double r16118 = -r16116;
        double r16119 = exp(r16118);
        double r16120 = r16117 + r16119;
        double r16121 = 2.0;
        double r16122 = 0.0;
        double r16123 = /* ERROR: no complex support in C */;
        double r16124 = r16120 / r16123;
        double r16125 = /* ERROR: no complex support in C */;
        return r16125;
}

double f(double xre, double xim) {
        double r16126 = xre;
        double r16127 = xim;
        double r16128 = /* ERROR: no complex support in C */;
        double r16129 = exp(r16128);
        double r16130 = -r16128;
        double r16131 = exp(r16130);
        double r16132 = r16129 + r16131;
        double r16133 = 2.0;
        double r16134 = 0.0;
        double r16135 = /* ERROR: no complex support in C */;
        double r16136 = r16132 / r16135;
        double r16137 = /* ERROR: no complex support in C */;
        return r16137;
}

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 2020089 
(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))))