Average Error: 0.0 → 0.0
Time: 14.5s
Precision: 64
\[\Re(\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))\]
\[\Re(\left(\frac{\left(\left(e^{\left(-\left(xre + xim i\right)\right)}\right) + \left(e^{\left(xre + xim i\right)}\right)\right)}{\left(2 + 0.0 i\right)}\right))\]
\Re(\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))
\Re(\left(\frac{\left(\left(e^{\left(-\left(xre + xim i\right)\right)}\right) + \left(e^{\left(xre + xim i\right)}\right)\right)}{\left(2 + 0.0 i\right)}\right))
double f(double xre, double xim) {
        double r10112 = xre;
        double r10113 = xim;
        double r10114 = /* ERROR: no complex support in C */;
        double r10115 = exp(r10114);
        double r10116 = -r10114;
        double r10117 = exp(r10116);
        double r10118 = r10115 + r10117;
        double r10119 = 2.0;
        double r10120 = 0.0;
        double r10121 = /* ERROR: no complex support in C */;
        double r10122 = r10118 / r10121;
        double r10123 = /* ERROR: no complex support in C */;
        return r10123;
}

double f(double xre, double xim) {
        double r10124 = xre;
        double r10125 = xim;
        double r10126 = /* ERROR: no complex support in C */;
        double r10127 = -r10126;
        double r10128 = exp(r10127);
        double r10129 = exp(r10126);
        double r10130 = r10128 + r10129;
        double r10131 = 2.0;
        double r10132 = 0.0;
        double r10133 = /* ERROR: no complex support in C */;
        double r10134 = r10130 / r10133;
        double r10135 = /* ERROR: no complex support in C */;
        return r10135;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 0.0

    \[\Re(\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 simplification0.0

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

Reproduce

herbie shell --seed 2019192 
(FPCore (xre xim)
  :name "exp with complex power real part (p55)"
  (re (/ (+ (exp (complex xre xim)) (exp (- (complex xre xim)))) (complex 2.0 0.0))))