Average Error: 0.0 → 0.0
Time: 14.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 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 r10788 = xre;
        double r10789 = xim;
        double r10790 = /* ERROR: no complex support in C */;
        double r10791 = exp(r10790);
        double r10792 = -r10790;
        double r10793 = exp(r10792);
        double r10794 = r10791 + r10793;
        double r10795 = 2.0;
        double r10796 = 0.0;
        double r10797 = /* ERROR: no complex support in C */;
        double r10798 = r10794 / r10797;
        double r10799 = /* ERROR: no complex support in C */;
        return r10799;
}

double f(double xre, double xim) {
        double r10800 = xre;
        double r10801 = xim;
        double r10802 = /* ERROR: no complex support in C */;
        double r10803 = -r10802;
        double r10804 = exp(r10803);
        double r10805 = exp(r10802);
        double r10806 = r10804 + r10805;
        double r10807 = 2.0;
        double r10808 = 0.0;
        double r10809 = /* ERROR: no complex support in C */;
        double r10810 = r10806 / r10809;
        double r10811 = /* ERROR: no complex support in C */;
        return r10811;
}

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 2019137 
(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))))