A generalized scaling function for AdS/CFT