static final float grad3(final int hash, final float x, final float y, final float z) {
        int h = hash & 15; // CONVERT LO 4 BITS OF HASH CODE
        return x * ImprovedNoise.GRAD3[h][0] + y * ImprovedNoise.GRAD3[h][1] + z * ImprovedNoise.GRAD3[h][2];
    }
Perlin's default implementation of Improved Perlin Noise
designed to work with Noise base
jme3-terrain/src/main/java/com/jme3/terrain/noise/basis/ImprovedNoise.java