Re: fast pow() for limited inputs

"Simon Fenney" <[email protected]> Thu, 19 Aug 2010 06:37:02 +0100
Newsgroups gmane.games.devel.algorithms
Message-ID <[email protected]>
> with my own cheap Taylor series in place of the natural log function.
 
This may be a silly question, but why did you use a natural log instead
of a log base 2? 
 
Cheers
Simon


________________________________

	From: Jeff Russell [mailto:[email protected]] 
	Sent: 19 August 2010 02:16
	To: Game Development Algorithms
	Subject: [Algorithms] fast pow() for limited inputs
	
	
	So I need to speed up the CRT pow() function a bit, but I have
some restrictions on the input which hopefully should give me some room
to optimize:
	
	I need to compute pow(x,y), where x is on [0,1], and y is
guaranteed positive and could have an upper bound in the neighborhood of
1000.
	
	I need "reasonable" accuracy (could be a little looser than the
standard pow() implementation). I've searched online and found some bit
twiddling approaches that claim to be very fast, but they seem to be too
inaccurate for my purposes. I've tried implementing pow() as exp(
log(x), y ), with my own cheap Taylor series in place of the natural log
function. It did produce good output but wasn't very fast (slightly
slower than the CRT pow()). It is probably worth mentioning before
anyone asks that yes I have confirmed pow() as the bottleneck with a
profiling tool ;-)
	
	I would also love to just see a sample implementation of pow(),
log(), and exp() somewhere, even that might be helpful.
	
	Thanks,
	
	Jeff
	
	-- 
	Jeff Russell
	Engineer, 8monkey Labs
	www.8monkeylabs.com

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev

_______________________________________________
GDAlgorithms-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list
Archives:
http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list