Your codes use default real variables. I think it would be better to declare the variables
as double precision with code such as
integer, parameter :: dp = kind(1.0d0)
real(kind=dp) :: x, y
especially since Python floating point variables are double precision.