Hi,
I don't see anything wrong due to the package you have used. But, I see a compiler error in the last 'if' condition, where x is divided by y. Most of the synthesis tools support division operator '/' only when the divisor is a constant, and a power-of-2.
Since y in your case is not a power-of-2, it results in compiler error. Also, note that, generally, REAL data types aren't supported by synthesis tools either.