Average Error: 0.0 → 0.0
Time: 15.6s
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 r9079 = xre;
        double r9080 = xim;
        double r9081 = /* ERROR: no complex support in C */;
        double r9082 = exp(r9081);
        double r9083 = -r9081;
        double r9084 = exp(r9083);
        double r9085 = r9082 + r9084;
        double r9086 = 2.0;
        double r9087 = 0.0;
        double r9088 = /* ERROR: no complex support in C */;
        double r9089 = r9085 / r9088;
        double r9090 = /* ERROR: no complex support in C */;
        return r9090;
}

double f(double xre, double xim) {
        double r9091 = xre;
        double r9092 = xim;
        double r9093 = /* ERROR: no complex support in C */;
        double r9094 = exp(r9093);
        double r9095 = -r9093;
        double r9096 = exp(r9095);
        double r9097 = r9094 + r9096;
        double r9098 = 2.0;
        double r9099 = 0.0;
        double r9100 = /* ERROR: no complex support in C */;
        double r9101 = r9097 / r9100;
        double r9102 = /* ERROR: no complex support in C */;
        return r9102;
}

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 2019208 +o rules:numerics
(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))))