Average Error: 0.0 → 0.0
Time: 12.9s
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 r10138 = xre;
        double r10139 = xim;
        double r10140 = /* ERROR: no complex support in C */;
        double r10141 = exp(r10140);
        double r10142 = -r10140;
        double r10143 = exp(r10142);
        double r10144 = r10141 + r10143;
        double r10145 = 2.0;
        double r10146 = 0.0;
        double r10147 = /* ERROR: no complex support in C */;
        double r10148 = r10144 / r10147;
        double r10149 = /* ERROR: no complex support in C */;
        return r10149;
}

double f(double xre, double xim) {
        double r10150 = xre;
        double r10151 = xim;
        double r10152 = /* ERROR: no complex support in C */;
        double r10153 = -r10152;
        double r10154 = exp(r10153);
        double r10155 = exp(r10152);
        double r10156 = r10154 + r10155;
        double r10157 = 2.0;
        double r10158 = 0.0;
        double r10159 = /* ERROR: no complex support in C */;
        double r10160 = r10156 / r10159;
        double r10161 = /* ERROR: no complex support in C */;
        return r10161;
}

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