Average Error: 44.1 → 44.1
Time: 27.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 i\right)}\right))\]
\[\Im(\left(\frac{e^{-\left(xre + xim i\right)} + e^{xre + xim i}}{2 + 0 i}\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 i\right)}\right))
\Im(\left(\frac{e^{-\left(xre + xim i\right)} + e^{xre + xim i}}{2 + 0 i}\right))
double f(double xre, double xim) {
        double r11093 = xre;
        double r11094 = xim;
        double r11095 = /* ERROR: no complex support in C */;
        double r11096 = exp(r11095);
        double r11097 = -r11095;
        double r11098 = exp(r11097);
        double r11099 = r11096 + r11098;
        double r11100 = 2.0;
        double r11101 = 0.0;
        double r11102 = /* ERROR: no complex support in C */;
        double r11103 = r11099 / r11102;
        double r11104 = /* ERROR: no complex support in C */;
        return r11104;
}

double f(double xre, double xim) {
        double r11105 = xre;
        double r11106 = xim;
        double r11107 = /* ERROR: no complex support in C */;
        double r11108 = -r11107;
        double r11109 = exp(r11108);
        double r11110 = exp(r11107);
        double r11111 = r11109 + r11110;
        double r11112 = 2.0;
        double r11113 = 0.0;
        double r11114 = /* ERROR: no complex support in C */;
        double r11115 = r11111 / r11114;
        double r11116 = /* ERROR: no complex support in C */;
        return r11116;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 44.1

    \[\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 i\right)}\right))\]
  2. Final simplification44.1

    \[\leadsto \Im(\left(\frac{e^{-\left(xre + xim i\right)} + e^{xre + xim i}}{2 + 0 i}\right))\]

Reproduce

herbie shell --seed 2019129 
(FPCore (xre xim)
  :name "exp with complex power imaginary part (p55)"
  (im (/.c (+.c (exp.c (complex xre xim)) (exp.c (neg.c (complex xre xim)))) (complex 2 0))))