nan check for logging and rescale as functor