Average Error: 0.0 → 0.0
Time: 15.2s
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 i\right)}\right))\]
\[\Re(\left(\frac{e^{-\left(xre + xim i\right)} + e^{xre + xim i}}{2 + 0 i}\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 i\right)}\right))
\Re(\left(\frac{e^{-\left(xre + xim i\right)} + e^{xre + xim i}}{2 + 0 i}\right))
double f(double xre, double xim) {
        double r10794 = xre;
        double r10795 = xim;
        double r10796 = /* ERROR: no complex support in C */;
        double r10797 = exp(r10796);
        double r10798 = -r10796;
        double r10799 = exp(r10798);
        double r10800 = r10797 + r10799;
        double r10801 = 2.0;
        double r10802 = 0.0;
        double r10803 = /* ERROR: no complex support in C */;
        double r10804 = r10800 / r10803;
        double r10805 = /* ERROR: no complex support in C */;
        return r10805;
}

double f(double xre, double xim) {
        double r10806 = xre;
        double r10807 = xim;
        double r10808 = /* ERROR: no complex support in C */;
        double r10809 = -r10808;
        double r10810 = exp(r10809);
        double r10811 = exp(r10808);
        double r10812 = r10810 + r10811;
        double r10813 = 2.0;
        double r10814 = 0.0;
        double r10815 = /* ERROR: no complex support in C */;
        double r10816 = r10812 / r10815;
        double r10817 = /* ERROR: no complex support in C */;
        return r10817;
}

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 i\right)}\right))\]
  2. Final simplification0.0

    \[\leadsto \Re(\left(\frac{e^{-\left(xre + xim i\right)} + e^{xre + xim i}}{2 + 0 i}\right))\]

Reproduce

herbie shell --seed 2019132 
(FPCore (xre xim)
  :name "exp with complex power real part (p55)"
  (re (/.c (+.c (exp.c (complex xre xim)) (exp.c (neg.c (complex xre xim)))) (complex 2 0))))