Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!spool.mu.edu!cs.umn.edu!kksys!wd0gol!newave!john From: john@newave.UUCP (John A. Weeks III) Newsgroups: comp.lang.c Subject: Re: Log Library - How is it done in the library code? Keywords: log, library, series expansion Message-ID: <702@newave.UUCP> Date: 16 Mar 91 05:38:59 GMT References: <1991Mar11.022141.12068@m.cs.uiuc.edu> <15438@smoke.brl.mil> <1991Mar12.014416.4289@m.cs.uiuc.edu> Reply-To: john@newave.mn.org (John A. Weeks III) Organization: NeWave Communications Ltd, Eden Prairie, MN Lines: 26 In article <1991Mar12.014416.4289@m.cs.uiuc.edu> joshi@m.cs.uiuc.edu (Anil Joshi) writes: > I do not want the accuracy that might have been provided in the c library > log(). It might be spending more time than necessary to calculate more > accurately than I want it to be. > I am tending towards Idea 3, which seems to be fastest (my intuition). As an experiment, why not try running your program using log, then try one of the alternate solutions. Compare the time it takes to run each example. Then post your results to the net. What I expect you to find is that the difference is rather small--an optimized hand coded assembly routine or a math coprocessor call as compared to a C routine. I have often found that the program algorithm makes a far greater impact on performance than optimizing small pieces of code. But since you sound like you will be using log extensively, it might make a great deal of difference. If you do find a difference, I bet that the difference will vary greatly between different machines. -john- -- ----------------------------------------------------------------------------- John A. Weeks III (612) 942-6969 john@newave.mn.org NeWave Communications ...uunet!tcnet!wd0gol!newave!john