Port of Kurt Spencer's java implementation of open simplex noise to C