Average Error: 43.4 → 43.4
Time: 11.0s
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 r17144 = xre;
        double r17145 = xim;
        double r17146 = /* ERROR: no complex support in C */;
        double r17147 = exp(r17146);
        double r17148 = -r17146;
        double r17149 = exp(r17148);
        double r17150 = r17147 + r17149;
        double r17151 = 2.0;
        double r17152 = 0.0;
        double r17153 = /* ERROR: no complex support in C */;
        double r17154 = r17150 / r17153;
        double r17155 = /* ERROR: no complex support in C */;
        return r17155;
}

double f(double xre, double xim) {
        double r17156 = xre;
        double r17157 = xim;
        double r17158 = /* ERROR: no complex support in C */;
        double r17159 = exp(r17158);
        double r17160 = -r17158;
        double r17161 = exp(r17160);
        double r17162 = r17159 + r17161;
        double r17163 = 2.0;
        double r17164 = 0.0;
        double r17165 = /* ERROR: no complex support in C */;
        double r17166 = r17162 / r17165;
        double r17167 = /* ERROR: no complex support in C */;
        return r17167;
}

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