Average Error: 0.0 → 0.0
Time: 3.6s
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 r15630 = xre;
        double r15631 = xim;
        double r15632 = /* ERROR: no complex support in C */;
        double r15633 = exp(r15632);
        double r15634 = -r15632;
        double r15635 = exp(r15634);
        double r15636 = r15633 + r15635;
        double r15637 = 2.0;
        double r15638 = 0.0;
        double r15639 = /* ERROR: no complex support in C */;
        double r15640 = r15636 / r15639;
        double r15641 = /* ERROR: no complex support in C */;
        return r15641;
}

double f(double xre, double xim) {
        double r15642 = xre;
        double r15643 = xim;
        double r15644 = /* ERROR: no complex support in C */;
        double r15645 = exp(r15644);
        double r15646 = -r15644;
        double r15647 = exp(r15646);
        double r15648 = r15645 + r15647;
        double r15649 = 2.0;
        double r15650 = 0.0;
        double r15651 = /* ERROR: no complex support in C */;
        double r15652 = r15648 / r15651;
        double r15653 = /* ERROR: no complex support in C */;
        return r15653;
}

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