Average Error: 0.0 → 0.0
Time: 4.7s
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 r24986 = xre;
        double r24987 = xim;
        double r24988 = /* ERROR: no complex support in C */;
        double r24989 = exp(r24988);
        double r24990 = -r24988;
        double r24991 = exp(r24990);
        double r24992 = r24989 + r24991;
        double r24993 = 2.0;
        double r24994 = 0.0;
        double r24995 = /* ERROR: no complex support in C */;
        double r24996 = r24992 / r24995;
        double r24997 = /* ERROR: no complex support in C */;
        return r24997;
}

double f(double xre, double xim) {
        double r24998 = xre;
        double r24999 = xim;
        double r25000 = /* ERROR: no complex support in C */;
        double r25001 = exp(r25000);
        double r25002 = -r25000;
        double r25003 = exp(r25002);
        double r25004 = r25001 + r25003;
        double r25005 = 2.0;
        double r25006 = 0.0;
        double r25007 = /* ERROR: no complex support in C */;
        double r25008 = r25004 / r25007;
        double r25009 = /* ERROR: no complex support in C */;
        return r25009;
}

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