Add function for calculate root mean square.