UPD: It works fine. The problem was I was testing the noise on a plane with few thouthands vertices. Testing it on a plane with absurd resolution showed me that the initial solution was fine.