\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{1}{e^{x}} \cdot \cos y\right)double f(double x, double y) {
double r729989 = x;
double r729990 = exp(r729989);
double r729991 = -r729989;
double r729992 = exp(r729991);
double r729993 = r729990 + r729992;
double r729994 = 2.0;
double r729995 = r729993 / r729994;
double r729996 = y;
double r729997 = cos(r729996);
double r729998 = r729995 * r729997;
double r729999 = r729990 - r729992;
double r730000 = r729999 / r729994;
double r730001 = sin(r729996);
double r730002 = r730000 * r730001;
double r730003 = /* ERROR: no complex support in C */;
double r730004 = /* ERROR: no complex support in C */;
return r730004;
}
double f(double x, double y) {
double r730005 = 0.5;
double r730006 = y;
double r730007 = cos(r730006);
double r730008 = x;
double r730009 = exp(r730008);
double r730010 = 1.0;
double r730011 = r730010 / r730009;
double r730012 = r730011 * r730007;
double r730013 = fma(r730007, r730009, r730012);
double r730014 = r730005 * r730013;
return r730014;
}



Bits error versus x



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