Average Error: 0.0 → 0.0
Time: 4.7s
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 r9941 = xre;
        double r9942 = xim;
        double r9943 = /* ERROR: no complex support in C */;
        double r9944 = exp(r9943);
        double r9945 = -r9943;
        double r9946 = exp(r9945);
        double r9947 = r9944 + r9946;
        double r9948 = 2.0;
        double r9949 = 0.0;
        double r9950 = /* ERROR: no complex support in C */;
        double r9951 = r9947 / r9950;
        double r9952 = /* ERROR: no complex support in C */;
        return r9952;
}

double f(double xre, double xim) {
        double r9953 = xre;
        double r9954 = xim;
        double r9955 = /* ERROR: no complex support in C */;
        double r9956 = exp(r9955);
        double r9957 = -r9955;
        double r9958 = exp(r9957);
        double r9959 = r9956 + r9958;
        double r9960 = 2.0;
        double r9961 = 0.0;
        double r9962 = /* ERROR: no complex support in C */;
        double r9963 = r9959 / r9962;
        double r9964 = /* ERROR: no complex support in C */;
        return r9964;
}

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