Average Error: 0.0 → 0.0
Time: 15.2s
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 r9141 = xre;
        double r9142 = xim;
        double r9143 = /* ERROR: no complex support in C */;
        double r9144 = exp(r9143);
        double r9145 = -r9143;
        double r9146 = exp(r9145);
        double r9147 = r9144 + r9146;
        double r9148 = 2.0;
        double r9149 = 0.0;
        double r9150 = /* ERROR: no complex support in C */;
        double r9151 = r9147 / r9150;
        double r9152 = /* ERROR: no complex support in C */;
        return r9152;
}

double f(double xre, double xim) {
        double r9153 = xre;
        double r9154 = xim;
        double r9155 = /* ERROR: no complex support in C */;
        double r9156 = exp(r9155);
        double r9157 = -r9155;
        double r9158 = exp(r9157);
        double r9159 = r9156 + r9158;
        double r9160 = 2.0;
        double r9161 = 0.0;
        double r9162 = /* ERROR: no complex support in C */;
        double r9163 = r9159 / r9162;
        double r9164 = /* ERROR: no complex support in C */;
        return r9164;
}

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 2019322 +o rules:numerics
(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))))