"Nadav Har'El" <[EMAIL PROTECTED]> writes: > I bet that the Sparc code is obfuscated for a reason (typically, > such codes contain "magical" tables, for example) not just because > the programmer was an idiot.
Mathematical algorithms are usually very heavily optimized by hand, loops unrolled, scores of tricks etc. This makes the code very difficult to understand (exp and log are in hardware usually nowadays, I am talking about more complicated stuff). I would strongly advise anybody considering writing his/her own special function, linear algebra, numerical integration etc, not to kid oneself: many man-years went into figuring out to do things like that with precision and robustness. A homemade implementation will usually lose to standard libraries overall. A memorable war story (personal experience) concerns computation of inverse error function which proved to be a performance bottleneck in a certain project. A very talented guy implemented a table lookup / interpolation algorithm, which gained 50% in speed against the math library we were using. Problem was, the algorithm gave only 6 or 7 digits of precision (quite unacceptable), while the library worked at machine precision over a much wider range. Case closed. -- Oleg Goldshmidt | [EMAIL PROTECTED] "If it ain't broken, it has not got enough features yet." ================================================================= To unsubscribe, send mail to [EMAIL PROTECTED] with the word "unsubscribe" in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]