\Re(\left(\frac{e^{x} + e^{-x}}{2} \cdot \cos y + \frac{e^{x} - e^{-x}}{2} \cdot \sin y i\right))\frac{\mathsf{fma}\left(\cos y, e^{x}, \frac{\cos y}{e^{x}}\right)}{2}double f(double x, double y) {
double r472620 = x;
double r472621 = exp(r472620);
double r472622 = -r472620;
double r472623 = exp(r472622);
double r472624 = r472621 + r472623;
double r472625 = 2.0;
double r472626 = r472624 / r472625;
double r472627 = y;
double r472628 = cos(r472627);
double r472629 = r472626 * r472628;
double r472630 = r472621 - r472623;
double r472631 = r472630 / r472625;
double r472632 = sin(r472627);
double r472633 = r472631 * r472632;
double r472634 = /* ERROR: no complex support in C */;
double r472635 = /* ERROR: no complex support in C */;
return r472635;
}
double f(double x, double y) {
double r472636 = y;
double r472637 = cos(r472636);
double r472638 = x;
double r472639 = exp(r472638);
double r472640 = r472637 / r472639;
double r472641 = fma(r472637, r472639, r472640);
double r472642 = 2.0;
double r472643 = r472641 / r472642;
return r472643;
}



Bits error versus x



Bits error versus y
Initial program 0.0
Simplified0.0
Final simplification0.0
herbie shell --seed 2019156 +o rules:numerics
(FPCore (x y)
:name "Euler formula real part (p55)"
(re (complex (* (/ (+ (exp x) (exp (- x))) 2) (cos y)) (* (/ (- (exp x) (exp (- x))) 2) (sin y)))))