\Re(\left(\frac{e^{x} + e^{-x}}{2} \cdot \cos y + \frac{e^{x} - e^{-x}}{2} \cdot \sin y i\right))\frac{1}{2} \cdot \mathsf{fma}\left(\cos y, e^{x}, \frac{\cos y}{e^{x}}\right)double f(double x, double y) {
double r338406 = x;
double r338407 = exp(r338406);
double r338408 = -r338406;
double r338409 = exp(r338408);
double r338410 = r338407 + r338409;
double r338411 = 2.0;
double r338412 = r338410 / r338411;
double r338413 = y;
double r338414 = cos(r338413);
double r338415 = r338412 * r338414;
double r338416 = r338407 - r338409;
double r338417 = r338416 / r338411;
double r338418 = sin(r338413);
double r338419 = r338417 * r338418;
double r338420 = /* ERROR: no complex support in C */;
double r338421 = /* ERROR: no complex support in C */;
return r338421;
}
double f(double x, double y) {
double r338422 = 0.5;
double r338423 = y;
double r338424 = cos(r338423);
double r338425 = x;
double r338426 = exp(r338425);
double r338427 = r338424 / r338426;
double r338428 = fma(r338424, r338426, r338427);
double r338429 = r338422 * r338428;
return r338429;
}



Bits error versus x



Bits error versus y
Initial program 0.0
Simplified0.0
Final simplification0.0
herbie shell --seed 2019146 +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)))))