An optimization connected with cashing "S-function" results