Average Error: 0.0 → 0.0
Time: 12.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 r11062 = xre;
        double r11063 = xim;
        double r11064 = /* ERROR: no complex support in C */;
        double r11065 = exp(r11064);
        double r11066 = -r11064;
        double r11067 = exp(r11066);
        double r11068 = r11065 + r11067;
        double r11069 = 2.0;
        double r11070 = 0.0;
        double r11071 = /* ERROR: no complex support in C */;
        double r11072 = r11068 / r11071;
        double r11073 = /* ERROR: no complex support in C */;
        return r11073;
}

double f(double xre, double xim) {
        double r11074 = xre;
        double r11075 = xim;
        double r11076 = /* ERROR: no complex support in C */;
        double r11077 = exp(r11076);
        double r11078 = -r11076;
        double r11079 = exp(r11078);
        double r11080 = r11077 + r11079;
        double r11081 = 2.0;
        double r11082 = 0.0;
        double r11083 = /* ERROR: no complex support in C */;
        double r11084 = r11080 / r11083;
        double r11085 = /* ERROR: no complex support in C */;
        return r11085;
}

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 2019173 +o rules:numerics
(FPCore (xre xim)
  :name "exp with complex power real part (p55)"
  (re (/ (+ (exp (complex xre xim)) (exp (- (complex xre xim)))) (complex 2.0 0.0))))