Benchmarking and Optimisation Q's
1) I've always wondered how at the most basic level, mathematical operations are handled, efficiently. I've looked through the math.h several times really carefully, trying to atleast understand or make out what each bit was doing. In general, I succeeded, but I didn't at all get how the code computed trignometric functions. I'm wondering whether it is a machine routine or what. I'd be thrilled to find out how it works
2) Another thing I've always wanted to check out was how much better a particular way of doing the program is over another method. I can perhaps reason out to a large extent, and make small little calculations of the number of calls require and all, but can't get any quantitative comparision. Also when programs are nearly the same, I don't know how to compare. So is there a nice little package that could print out the execution time and memory usage? (I'm not using too complex programs yet, so I generally compute the difference in time between the start and finish using time.h and all, but I'd like a better way).
Thanks for all the help.