Determine periodicity of a function (#372)