Average Error: 0.0 → 0.0
Time: 3.9s
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 r11840 = xre;
        double r11841 = xim;
        double r11842 = /* ERROR: no complex support in C */;
        double r11843 = exp(r11842);
        double r11844 = -r11842;
        double r11845 = exp(r11844);
        double r11846 = r11843 + r11845;
        double r11847 = 2.0;
        double r11848 = 0.0;
        double r11849 = /* ERROR: no complex support in C */;
        double r11850 = r11846 / r11849;
        double r11851 = /* ERROR: no complex support in C */;
        return r11851;
}

double f(double xre, double xim) {
        double r11852 = xre;
        double r11853 = xim;
        double r11854 = /* ERROR: no complex support in C */;
        double r11855 = exp(r11854);
        double r11856 = -r11854;
        double r11857 = exp(r11856);
        double r11858 = r11855 + r11857;
        double r11859 = 2.0;
        double r11860 = 0.0;
        double r11861 = /* ERROR: no complex support in C */;
        double r11862 = r11858 / r11861;
        double r11863 = /* ERROR: no complex support in C */;
        return r11863;
}

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 2020081 
(FPCore (xre xim)
  :name "exp with complex power real part (p55)"
  :precision binary64
  (re (/ (+ (exp (complex xre xim)) (exp (- (complex xre xim)))) (complex 2 0.0))))