Average Error: 0.0 → 0.0
Time: 4.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(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(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(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 r14067 = xre;
        double r14068 = xim;
        double r14069 = /* ERROR: no complex support in C */;
        double r14070 = exp(r14069);
        double r14071 = -r14069;
        double r14072 = exp(r14071);
        double r14073 = r14070 + r14072;
        double r14074 = 2.0;
        double r14075 = 0.0;
        double r14076 = /* ERROR: no complex support in C */;
        double r14077 = r14073 / r14076;
        double r14078 = /* ERROR: no complex support in C */;
        return r14078;
}

double f(double xre, double xim) {
        double r14079 = xre;
        double r14080 = xim;
        double r14081 = /* ERROR: no complex support in C */;
        double r14082 = exp(r14081);
        double r14083 = -r14081;
        double r14084 = exp(r14083);
        double r14085 = r14082 + r14084;
        double r14086 = 2.0;
        double r14087 = 0.0;
        double r14088 = /* ERROR: no complex support in C */;
        double r14089 = r14085 / r14088;
        double r14090 = /* ERROR: no complex support in C */;
        return r14090;
}

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(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 2020039 
(FPCore (xre xim)
  :name "exp with complex power real part (p55)"
  :precision binary64
  (re (/ (+ (exp (complex xre xim)) (exp (- (complex xre xim)))) (complex 2 0.0))))