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

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

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