Average Error: 0.0 → 0.0
Time: 4.5s
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 r26796 = xre;
        double r26797 = xim;
        double r26798 = /* ERROR: no complex support in C */;
        double r26799 = exp(r26798);
        double r26800 = -r26798;
        double r26801 = exp(r26800);
        double r26802 = r26799 + r26801;
        double r26803 = 2.0;
        double r26804 = 0.0;
        double r26805 = /* ERROR: no complex support in C */;
        double r26806 = r26802 / r26805;
        double r26807 = /* ERROR: no complex support in C */;
        return r26807;
}

double f(double xre, double xim) {
        double r26808 = xre;
        double r26809 = xim;
        double r26810 = /* ERROR: no complex support in C */;
        double r26811 = exp(r26810);
        double r26812 = -r26810;
        double r26813 = exp(r26812);
        double r26814 = r26811 + r26813;
        double r26815 = 2.0;
        double r26816 = 0.0;
        double r26817 = /* ERROR: no complex support in C */;
        double r26818 = r26814 / r26817;
        double r26819 = /* ERROR: no complex support in C */;
        return r26819;
}

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