Average Error: 43.7 → 43.7
Time: 28.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 r9147 = xre;
        double r9148 = xim;
        double r9149 = /* ERROR: no complex support in C */;
        double r9150 = exp(r9149);
        double r9151 = -r9149;
        double r9152 = exp(r9151);
        double r9153 = r9150 + r9152;
        double r9154 = 2.0;
        double r9155 = 0.0;
        double r9156 = /* ERROR: no complex support in C */;
        double r9157 = r9153 / r9156;
        double r9158 = /* ERROR: no complex support in C */;
        return r9158;
}

double f(double xre, double xim) {
        double r9159 = xre;
        double r9160 = xim;
        double r9161 = /* ERROR: no complex support in C */;
        double r9162 = exp(r9161);
        double r9163 = -r9161;
        double r9164 = exp(r9163);
        double r9165 = r9162 + r9164;
        double r9166 = 2.0;
        double r9167 = 0.0;
        double r9168 = /* ERROR: no complex support in C */;
        double r9169 = r9165 / r9168;
        double r9170 = /* ERROR: no complex support in C */;
        return r9170;
}

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