Average Error: 43.6 → 43.6
Time: 26.8s
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 r11145 = xre;
        double r11146 = xim;
        double r11147 = /* ERROR: no complex support in C */;
        double r11148 = exp(r11147);
        double r11149 = -r11147;
        double r11150 = exp(r11149);
        double r11151 = r11148 + r11150;
        double r11152 = 2.0;
        double r11153 = 0.0;
        double r11154 = /* ERROR: no complex support in C */;
        double r11155 = r11151 / r11154;
        double r11156 = /* ERROR: no complex support in C */;
        return r11156;
}

double f(double xre, double xim) {
        double r11157 = xre;
        double r11158 = xim;
        double r11159 = /* ERROR: no complex support in C */;
        double r11160 = -r11159;
        double r11161 = exp(r11160);
        double r11162 = exp(r11159);
        double r11163 = r11161 + r11162;
        double r11164 = 2.0;
        double r11165 = 0.0;
        double r11166 = /* ERROR: no complex support in C */;
        double r11167 = r11163 / r11166;
        double r11168 = /* ERROR: no complex support in C */;
        return r11168;
}

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 i\right)}\right))\]
  2. Final simplification43.6

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

Reproduce

herbie shell --seed 2019134 +o rules:numerics
(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))))