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 r12146 = xre;
        double r12147 = xim;
        double r12148 = /* ERROR: no complex support in C */;
        double r12149 = exp(r12148);
        double r12150 = -r12148;
        double r12151 = exp(r12150);
        double r12152 = r12149 + r12151;
        double r12153 = 2.0;
        double r12154 = 0.0;
        double r12155 = /* ERROR: no complex support in C */;
        double r12156 = r12152 / r12155;
        double r12157 = /* ERROR: no complex support in C */;
        return r12157;
}

double f(double xre, double xim) {
        double r12158 = xre;
        double r12159 = xim;
        double r12160 = /* ERROR: no complex support in C */;
        double r12161 = exp(r12160);
        double r12162 = -r12160;
        double r12163 = exp(r12162);
        double r12164 = r12161 + r12163;
        double r12165 = 2.0;
        double r12166 = 0.0;
        double r12167 = /* ERROR: no complex support in C */;
        double r12168 = r12164 / r12167;
        double r12169 = /* ERROR: no complex support in C */;
        return r12169;
}

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