I think there are still many things to improve, but a simple thing that sticks out to me is squaring with ^2.0
. Avoid this and use ^2
instead. The latter is a simple multiplication, while the former is a complicated floating point power function.
4 Likes