On Tue, Dec 25, 2001, Shlomi Fish wrote about "Implementation of log(x) for SPARC32": > I need an implementation of the C function double log(double x) for SPARC > (32-bit - not UltraSPARC) written using Assembler or C or a combination of > both. > > I tried to rip code out of the glibc (which I was succesfully able to do > with the i386 architecture), but I could not make sense of what was going > on there.
It's too bad the manual (http://www.gnu.org/manual/glibc-2.2.3/html_node/libc_381.html#SEC390) doesn't say anything about the algorithms used. At least the source code should have a full description of the algorithm, or a pointer to an article or book describing it. If it doesn't, it's a shame :( Anyway, I doubt the log() code has any i386-specific stuff in there, except perhaps relying on the exact format of a floating point number (and how many bits of mantissa/exponent it has) to get absolute accuracy with the lowest number of operations. Isn't there an IEEE standard for 64-bit doubles by now? Why do you say glibc is i386 specific? Isn't it supposed to work on the Sparc too? I know that Redhat once had a version for sparc, so glibc must have worked on the sparc too! If you want to understand the "tricks" usually used to calculated "special functions", like log (or sin or bessel functions, or whatever), you might want to take a look at books like "Numerical Recipes in C" (includes an interesting introduction to this area, but I couldn't find where it talks about log()), Knuth's "The Art of Computer Programming Vol 1", or other books. The site http://www.dattalo.com/technical/theory/logs.html (which I found by googling "logarithm algorithm calculating") might also be relevant to you (I didn't verify its quality though). -- Nadav Har'El | Tuesday, Dec 25 2001, 10 Tevet 5762 [EMAIL PROTECTED] |----------------------------------------- Phone: +972-53-245868, ICQ 13349191 |Are you still here? The message is over. http://nadav.harel.org.il |Shoo! Go away! ================================================================= 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]
