Average Error: 43.9 → 43.9
Time: 27.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 r9140 = xre;
        double r9141 = xim;
        double r9142 = /* ERROR: no complex support in C */;
        double r9143 = exp(r9142);
        double r9144 = -r9142;
        double r9145 = exp(r9144);
        double r9146 = r9143 + r9145;
        double r9147 = 2.0;
        double r9148 = 0.0;
        double r9149 = /* ERROR: no complex support in C */;
        double r9150 = r9146 / r9149;
        double r9151 = /* ERROR: no complex support in C */;
        return r9151;
}

double f(double xre, double xim) {
        double r9152 = xre;
        double r9153 = xim;
        double r9154 = /* ERROR: no complex support in C */;
        double r9155 = exp(r9154);
        double r9156 = -r9154;
        double r9157 = exp(r9156);
        double r9158 = r9155 + r9157;
        double r9159 = 2.0;
        double r9160 = 0.0;
        double r9161 = /* ERROR: no complex support in C */;
        double r9162 = r9158 / r9161;
        double r9163 = /* ERROR: no complex support in C */;
        return r9163;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 43.9

    \[\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.9

    \[\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 2019305 
(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))))