Average Error: 0.0 → 0.0
Time: 4.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 r9952 = xre;
        double r9953 = xim;
        double r9954 = /* ERROR: no complex support in C */;
        double r9955 = exp(r9954);
        double r9956 = -r9954;
        double r9957 = exp(r9956);
        double r9958 = r9955 + r9957;
        double r9959 = 2.0;
        double r9960 = 0.0;
        double r9961 = /* ERROR: no complex support in C */;
        double r9962 = r9958 / r9961;
        double r9963 = /* ERROR: no complex support in C */;
        return r9963;
}

double f(double xre, double xim) {
        double r9964 = xre;
        double r9965 = xim;
        double r9966 = /* ERROR: no complex support in C */;
        double r9967 = exp(r9966);
        double r9968 = -r9966;
        double r9969 = exp(r9968);
        double r9970 = r9967 + r9969;
        double r9971 = 2.0;
        double r9972 = 0.0;
        double r9973 = /* ERROR: no complex support in C */;
        double r9974 = r9970 / r9973;
        double r9975 = /* ERROR: no complex support in C */;
        return r9975;
}

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