some fast mathematical operations algo