plot numerical question




On Wed, 11 Mar 2009, Kostas Oikonomou wrote:

< I have a function
< 
< r4(s) := s!/(((s/4)!)^4 * 4^s)
< 
< and I am trying to plot it over the range [200,300]:
< 
< plot2d(r4(s), [s,200,300])
< 
< plot2d returns silently, i.e. it produces nothing.   I am 
< fairly sure the problem is that the computation involves 
< intermediate numbers that are too large, although the final 
< result is well within the rang of an ordinary float.  E.g. 
< r4(300) is of the order of 10^-4.
< 
< I thought I had seen a solution to this kind of problem with 
< plot somewhere on the list, but I can't find it.   It seems 
< to me the answer would be worth adding to the documentation 
< for plotting.

Try:

r4(s) := s!/(((s/4)!)^4 * 4^s);
pt : makelist(bfloat(r4(s)),s,200,300)$
spt : makelist(s,s,200,300)$
plot2d([discrete,spt,pt],[style,points]);


< 
< (This is Maxima 5.17.1 using SBCL, same with CMUCL)
< 
< 						Kostas
< 
< 
< _______________________________________________
< Maxima mailing list
< Maxima at math.utexas.edu
< http://www.math.utexas.edu/mailman/listinfo/maxima
< 
< 

-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.