Average Error: 0.0 → 0.0
Time: 4.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 r15804 = xre;
        double r15805 = xim;
        double r15806 = /* ERROR: no complex support in C */;
        double r15807 = exp(r15806);
        double r15808 = -r15806;
        double r15809 = exp(r15808);
        double r15810 = r15807 + r15809;
        double r15811 = 2.0;
        double r15812 = 0.0;
        double r15813 = /* ERROR: no complex support in C */;
        double r15814 = r15810 / r15813;
        double r15815 = /* ERROR: no complex support in C */;
        return r15815;
}

double f(double xre, double xim) {
        double r15816 = xre;
        double r15817 = xim;
        double r15818 = /* ERROR: no complex support in C */;
        double r15819 = exp(r15818);
        double r15820 = -r15818;
        double r15821 = exp(r15820);
        double r15822 = r15819 + r15821;
        double r15823 = 2.0;
        double r15824 = 0.0;
        double r15825 = /* ERROR: no complex support in C */;
        double r15826 = r15822 / r15825;
        double r15827 = /* ERROR: no complex support in C */;
        return r15827;
}

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