Average Error: 43.7 → 43.7
Time: 10.6s
Precision: 64
\[\Im(\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))\]
\[\Im(\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))\]
\Im(\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))
\Im(\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 r13007 = xre;
        double r13008 = xim;
        double r13009 = /* ERROR: no complex support in C */;
        double r13010 = exp(r13009);
        double r13011 = -r13009;
        double r13012 = exp(r13011);
        double r13013 = r13010 + r13012;
        double r13014 = 2.0;
        double r13015 = 0.0;
        double r13016 = /* ERROR: no complex support in C */;
        double r13017 = r13013 / r13016;
        double r13018 = /* ERROR: no complex support in C */;
        return r13018;
}

double f(double xre, double xim) {
        double r13019 = xre;
        double r13020 = xim;
        double r13021 = /* ERROR: no complex support in C */;
        double r13022 = exp(r13021);
        double r13023 = -r13021;
        double r13024 = exp(r13023);
        double r13025 = r13022 + r13024;
        double r13026 = 2.0;
        double r13027 = 0.0;
        double r13028 = /* ERROR: no complex support in C */;
        double r13029 = r13025 / r13028;
        double r13030 = /* ERROR: no complex support in C */;
        return r13030;
}

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 43.7

    \[\Im(\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 simplification43.7

    \[\leadsto \Im(\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 2020089 +o rules:numerics
(FPCore (xre xim)
  :name "exp with complex power imaginary part (p55)"
  :precision binary64
  (im (/ (+ (exp (complex xre xim)) (exp (- (complex xre xim)))) (complex 2 0.0))))