I too many search on internet to found algorithm calculated %Us , %Sy , %Id , ... on result of top command . but can not found any documentation .
some documents like this or this calculate cpu utilization but output not equal with output of top command . (too diff !!!)
How do the top or mpstat commands calculate cpu statistics ?