efficiency and basic math functions
Two questions, related:
1) Pretty much all modern desktop processors have some of the basic higher level math approximation functions built-in, right? In particular, square root, and three basic trig functions (sine, cosine, tangent)? (Also, e^x and ln(x) would be good ones.) Are these contained in SSE*, or some other extended instruction set? I read some online material that seemed to indicate that functions were hardwired into the chips now.
2) If you are coding on a typical Gnu/Linux system, is your glibc using the built-in versions of these basic functions? Or do you have to use special calls / libraries to make use of them? I poked around a little in some glibc source code I have (2.14), and I couldn't tell for sure. The README.libm seemed to indicate that for sqrt, glibc uses a "(slow but portable) bit by bit method using integer arithmetic" which sounded kind of scary.
|