Yigal, On January 28, 2006 9:31 AM I wrote: > > I am a rush right now, but I will get back to you later > today. I think you have made a very good start. >
Please see: http://wiki.axiom-developer.org/SandBoxGamma This implements exactly the algorithm of Recipes eq. (6.27) It uses a good numerical method (Lentz) for evaluating the continued fraction. I would like to talk to you so more about your use of Axiom's ContinuedFraction domain. I think this is interesting for a very different reason than just evaluating the incomplete Gamma function. Continued fractions (especially as implemented here in Axiom as "infinite" streams) is one of the better methods for implement **exact** real arithmetic. But maybe that is a subject for another day. Regards, Bill Page. > > On January 28, 2006 3:18 AM you wrote: > > > > Well instead of trying to help I better learn how to program > > in Axiom - atleast. I trying to implement a continued fraction > > representation of the incomplete gamma function found in > > Numerical Recipes for C: > > http://www.library.cornell.edu/nr/bookcpdf/c6-4.pdf > > > > equation 6.2.7 but have had little success and thought you > > might have some simple solution, here is my code; > > > > n:=10 > > num(a) == cons(1,[i*(i-a) for i in 1..]) > > den(a,x) == cons(x+1-a,[-(x-a+2*i+1) for i in 1..]) > > num5 := num(5) > > den5 := den(5,10) > > gamma := exp(-1.0)*(1.0)^5*continuedFraction(0,num5,den5) > > > > as you can see I don't even have a function to compute gamma > > only a continued function that Axiom doesn't like. > > > > Thank you, > > > > Yigal Weinstein > > > > > _______________________________________________ Axiom-math mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/axiom-math
