Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!ames!decwrl!sdd.hp.com!uakari.primate.wisc.edu!aplcen!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: Implementation of pow(3m) function Keywords: math-library exponentiation C Message-ID: <13474@smoke.BRL.MIL> Date: 3 Aug 90 21:21:40 GMT References: <1990Aug2.120706.25713@bnrgate.bnr.ca> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 10 In article <1990Aug2.120706.25713@bnrgate.bnr.ca> mleech@bcarh342.bnr.ca (Marcus Leech) writes: >I'm wondering about the efficiency of "standard" implementations of this > (and other) math library functions for C. Does pow(3m) conventionally > use a logarithm table, or is it (ugh!) iterative, or some B.O.T? All common implementations of pow(x,y) basically perform exp(log(x)*y), but they add some twists designed to avoid unnecessary overflow, or in the case of 4.3BSD, to implement the IEEE FP funny numbers. Thus there is often a considerable amount of additional bookkeeping computation beyond the log() and exp() evaluations that one would expect.