Average Error: 0.0 → 0.0
Time: 4.3s
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 r12920 = xre;
        double r12921 = xim;
        double r12922 = /* ERROR: no complex support in C */;
        double r12923 = exp(r12922);
        double r12924 = -r12922;
        double r12925 = exp(r12924);
        double r12926 = r12923 + r12925;
        double r12927 = 2.0;
        double r12928 = 0.0;
        double r12929 = /* ERROR: no complex support in C */;
        double r12930 = r12926 / r12929;
        double r12931 = /* ERROR: no complex support in C */;
        return r12931;
}

double f(double xre, double xim) {
        double r12932 = xre;
        double r12933 = xim;
        double r12934 = /* ERROR: no complex support in C */;
        double r12935 = exp(r12934);
        double r12936 = -r12934;
        double r12937 = exp(r12936);
        double r12938 = r12935 + r12937;
        double r12939 = 2.0;
        double r12940 = 0.0;
        double r12941 = /* ERROR: no complex support in C */;
        double r12942 = r12938 / r12941;
        double r12943 = /* ERROR: no complex support in C */;
        return r12943;
}

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