Average Error: 0.0 → 0.0
Time: 12.4s
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 r11067 = xre;
        double r11068 = xim;
        double r11069 = /* ERROR: no complex support in C */;
        double r11070 = exp(r11069);
        double r11071 = -r11069;
        double r11072 = exp(r11071);
        double r11073 = r11070 + r11072;
        double r11074 = 2.0;
        double r11075 = 0.0;
        double r11076 = /* ERROR: no complex support in C */;
        double r11077 = r11073 / r11076;
        double r11078 = /* ERROR: no complex support in C */;
        return r11078;
}

double f(double xre, double xim) {
        double r11079 = xre;
        double r11080 = xim;
        double r11081 = /* ERROR: no complex support in C */;
        double r11082 = -r11081;
        double r11083 = exp(r11082);
        double r11084 = exp(r11081);
        double r11085 = r11083 + r11084;
        double r11086 = 2.0;
        double r11087 = 0.0;
        double r11088 = /* ERROR: no complex support in C */;
        double r11089 = r11085 / r11088;
        double r11090 = /* ERROR: no complex support in C */;
        return r11090;
}

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 2019135 +o rules:numerics
(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))))