On 25 Dec 2001, Oleg Goldshmidt wrote: > "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. >
But who is John Galt? Speed is not of the outmost importance in this case, so I think my implementation is fine. If anybody can point me to a highly optimized code in C, that I can easily rip and compile as part of the kernel, I would use that instead. Regards, Shlomi Fish There is no IGLU Cabal! The current IGLU Cabal was not very optimized and so did not stand the growing demands of the super-embedded highly-real-time technology. > -- > 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] > ---------------------------------------------------------------------- Shlomi Fish [EMAIL PROTECTED] Home Page: http://t2.technion.ac.il/~shlomif/ Home E-mail: [EMAIL PROTECTED] "Let's suppose you have a table with 2^n cups..." "Wait a second - is n a natural number?" ================================================================= 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]