Average Error: 0.0 → 0.0
Time: 12.2s
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 r9015 = xre;
        double r9016 = xim;
        double r9017 = /* ERROR: no complex support in C */;
        double r9018 = exp(r9017);
        double r9019 = -r9017;
        double r9020 = exp(r9019);
        double r9021 = r9018 + r9020;
        double r9022 = 2.0;
        double r9023 = 0.0;
        double r9024 = /* ERROR: no complex support in C */;
        double r9025 = r9021 / r9024;
        double r9026 = /* ERROR: no complex support in C */;
        return r9026;
}

double f(double xre, double xim) {
        double r9027 = xre;
        double r9028 = xim;
        double r9029 = /* ERROR: no complex support in C */;
        double r9030 = exp(r9029);
        double r9031 = -r9029;
        double r9032 = exp(r9031);
        double r9033 = r9030 + r9032;
        double r9034 = 2.0;
        double r9035 = 0.0;
        double r9036 = /* ERROR: no complex support in C */;
        double r9037 = r9033 / r9036;
        double r9038 = /* ERROR: no complex support in C */;
        return r9038;
}

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 2019323 +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))))