No such thing as a small change  
PerlMonks 
Re^4: Fastest way to calculate hypergeometric distribution probabilities (i.e. BIG factorials)?by salva (Abbot) 
on Jun 14, 2005 at 08:15 UTC ( #466422=note: print w/replies, xml )  Need Help?? 
if your calculations over the factorial numbers are only multiplications and divisions (as I think they are), you can operate over their log values instead, transforming multiplications and divisions to additions and substractions respectively. i.e.:
and as your operations will only involve a small number of integers, you can cache log($n) and log($n!) to speed up the calculations.
In Section
Seekers of Perl Wisdom

