Average Error: 0.0 → 0.0
Time: 8.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 r9319 = xre;
        double r9320 = xim;
        double r9321 = /* ERROR: no complex support in C */;
        double r9322 = exp(r9321);
        double r9323 = -r9321;
        double r9324 = exp(r9323);
        double r9325 = r9322 + r9324;
        double r9326 = 2.0;
        double r9327 = 0.0;
        double r9328 = /* ERROR: no complex support in C */;
        double r9329 = r9325 / r9328;
        double r9330 = /* ERROR: no complex support in C */;
        return r9330;
}

double f(double xre, double xim) {
        double r9331 = xre;
        double r9332 = xim;
        double r9333 = /* ERROR: no complex support in C */;
        double r9334 = exp(r9333);
        double r9335 = -r9333;
        double r9336 = exp(r9335);
        double r9337 = r9334 + r9336;
        double r9338 = 2.0;
        double r9339 = 0.0;
        double r9340 = /* ERROR: no complex support in C */;
        double r9341 = r9337 / r9340;
        double r9342 = /* ERROR: no complex support in C */;
        return r9342;
}

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