Post Reply 
Gamma Function Using Spouge's Method
08-22-2015, 08:58 AM
Post: #16
RE: Gamma Function Using Spouge's Methjod
(08-22-2015 08:35 AM)Ángel Martin Wrote:  Well, yes I tweak the code all the time (in fact just recently since Dieter found a bug in FLOOR) - but first of all, the reference I use doesn't have any free parameter that I can see. This is the link, and the coefficients are already shown in the more efficient way, I think:

I'm sure I'm missing something so will appreciate the enlightenment.

The free, or arbitrary, parameter used in the Numerical Recipes Lanczos formula and rearranged by Viktor is embedded in the 5.5. It is little gamma in the original paper, g on Viktor's page, and r in the Pugh thesis. In the formula you are using it happens to be 5. Read further down on that very page, to the discuss of the Godfrey matrix decomposition, where Viktor identifies this g as "an arbitrary real parameter."

The key to minimizing relative error to choose this parameter--and yes it is chosen, and the coefficients then computed in the complex way according to it and the number of desired terms--just so. Both Lanczos and Godfrey, who inspired Viktor's calculations, were more or less arbitrary in the selection. Pugh did empirical tests and theoretical analysis to find the best value for a desired number of terms. Indeed, in subsequent years he extended this work up to n = 100 (the thesis only goes to n = 60) and I just found that page that he sent me in 2006. In it he gives the parameters to more digits and has improved the error estimates by using a more rigourous calculation. And indeed, it seems that in the very situation you use (n = 6, or 7 coefficients with the index starting at 0), the optimal value of g is around 6.78, not 5.

That's what I mean by "free parameter." Sorry for the confusion.

As for SandMath use, I am curious about two things:

1. What is Library 4 and why do I need it?
2. Given the switching going on in SandMath (as in the Advantage Pac), how do I correctly configure ClonixConfig to burn it into my Nov-64?

Thanks again,

Find all posts by this user
Quote this message in a reply
Post Reply 

Messages In This Thread
RE: Gamma Function Using Spouge's Methjod - lcwright1964 - 08-22-2015 08:58 AM

User(s) browsing this thread: 1 Guest(s)