Implementation of DIRECT based on Reference Implementation.