Average Error: 0.0 → 0.0
Time: 3.7s
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 r20680 = xre;
        double r20681 = xim;
        double r20682 = /* ERROR: no complex support in C */;
        double r20683 = exp(r20682);
        double r20684 = -r20682;
        double r20685 = exp(r20684);
        double r20686 = r20683 + r20685;
        double r20687 = 2.0;
        double r20688 = 0.0;
        double r20689 = /* ERROR: no complex support in C */;
        double r20690 = r20686 / r20689;
        double r20691 = /* ERROR: no complex support in C */;
        return r20691;
}

double f(double xre, double xim) {
        double r20692 = xre;
        double r20693 = xim;
        double r20694 = /* ERROR: no complex support in C */;
        double r20695 = exp(r20694);
        double r20696 = -r20694;
        double r20697 = exp(r20696);
        double r20698 = r20695 + r20697;
        double r20699 = 2.0;
        double r20700 = 0.0;
        double r20701 = /* ERROR: no complex support in C */;
        double r20702 = r20698 / r20701;
        double r20703 = /* ERROR: no complex support in C */;
        return r20703;
}

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