Average Error: 0.0 → 0.0
Time: 17.1s
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 r11036 = xre;
        double r11037 = xim;
        double r11038 = /* ERROR: no complex support in C */;
        double r11039 = exp(r11038);
        double r11040 = -r11038;
        double r11041 = exp(r11040);
        double r11042 = r11039 + r11041;
        double r11043 = 2.0;
        double r11044 = 0.0;
        double r11045 = /* ERROR: no complex support in C */;
        double r11046 = r11042 / r11045;
        double r11047 = /* ERROR: no complex support in C */;
        return r11047;
}

double f(double xre, double xim) {
        double r11048 = xre;
        double r11049 = xim;
        double r11050 = /* ERROR: no complex support in C */;
        double r11051 = exp(r11050);
        double r11052 = -r11050;
        double r11053 = exp(r11052);
        double r11054 = r11051 + r11053;
        double r11055 = 2.0;
        double r11056 = 0.0;
        double r11057 = /* ERROR: no complex support in C */;
        double r11058 = r11054 / r11057;
        double r11059 = /* ERROR: no complex support in C */;
        return r11059;
}

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