[racket] Math - factorial.rkt, binomial.rkt and memoization

From: Hendrik Boom (hendrik at topoi.pooq.com)
Date: Tue Apr 9 14:41:31 EDT 2013

On Tue, Apr 09, 2013 at 08:26:31PM +0200, Jos Koot wrote:
> Would it be possible to use
> <http://en.wikipedia.org/wiki/Stirling%27s_approximation> Stirling's
> approximation for a fast inexact first approximation for factorials of very
> big numbers and from there quickly get to an exact factorial? (if exactness
> is required) I don't know for I haven't thought thoroughly about this.
> Jos.

I don't know of a way take an approximation and by applying some 
operation to it to get a better one.

There are ways to do thie for other functions, like squate root, but I 
don't know one for factorial.

But there might be a bound on the error in Stirling's approximation that 
you cna use teo determine whether that's good enough for your 
application (if you have one).

-- hendrik

Posted on the users mailing list.