Neural Network Unit Algorithm