Average Error: 0.0 → 0.0
Time: 4.8s
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 r16151 = xre;
        double r16152 = xim;
        double r16153 = /* ERROR: no complex support in C */;
        double r16154 = exp(r16153);
        double r16155 = -r16153;
        double r16156 = exp(r16155);
        double r16157 = r16154 + r16156;
        double r16158 = 2.0;
        double r16159 = 0.0;
        double r16160 = /* ERROR: no complex support in C */;
        double r16161 = r16157 / r16160;
        double r16162 = /* ERROR: no complex support in C */;
        return r16162;
}

double f(double xre, double xim) {
        double r16163 = xre;
        double r16164 = xim;
        double r16165 = /* ERROR: no complex support in C */;
        double r16166 = exp(r16165);
        double r16167 = -r16165;
        double r16168 = exp(r16167);
        double r16169 = r16166 + r16168;
        double r16170 = 2.0;
        double r16171 = 0.0;
        double r16172 = /* ERROR: no complex support in C */;
        double r16173 = r16169 / r16172;
        double r16174 = /* ERROR: no complex support in C */;
        return r16174;
}

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 2020065 +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))))