|
From: Philipp K. J. <ja...@ie...> - 2010-02-08 16:27:38
|
But it is still meaningless, because you are dividing by an almost equally large number to obtain a nuber 155 orders of magnitude (!) smaller. Round-off error will kill you. On Monday 08 February 2010 08:18:25 am jody wrote: > Hi > Unless some gnuplot versions work with 32bit floats, > I'm surprised that it wouldn't work, because 100! = 9.33262154439442e+157 > which is well inside the range of a (64bit) double... > > Jody > > >> > exponentiate at the end (if needed). > > On Mon, Feb 8, 2010 at 5:04 PM, Philipp K. Janert <ja...@ie...> wrote: > > On Monday 08 February 2010 07:53:24 am Tim Wojtulewicz wrote: > >> On Mon, Feb 08, 2010 at 07:15:21AM -0800, Philipp K. Janert wrote: > >> > On Sunday 07 February 2010 11:07:07 am Tim Wojtulewicz wrote: > >> > > I'm working with a fairly complicated function, one part of which is > >> > > the division of two factorials. I'm having an issue with though, > >> > > because gnuplot keeps returning NaN for what should be a simple > >> > > division. It will return NaN for something as simple as 100!/99!, > >> > > which should just be 100. Is there a reason for this, or an easy way > >> > > to fix it? Thanks. > >> > > >> > The intermediate results overflow, despite the fact that > >> > the final result is of meaningful size. > >> > > >> > Either work out the cancellations analytically, or work with > >> > logarithms of all quantities (Stirlings approximation!), and > >> > exponentiate at the end (if needed). > >> > >> So is this a version issue then? The reply from Thomas seems like his > >> is working correctly. I'm working with version 4.2.5 on OS X 10.6. > >> It's odd that his would work, and yet mine won't. > > > > If anything, this is a platform issue. Quite frankly, > > I was surprised that it worked for anybody. (It doesn't > > for me.) > > > > But this is besides the point: if you need factorials > > of large numbers (>10), then you need to find ways > > to tame overflow issues. Unless you are working in > > infinite precision integer arithmetic, which is not > > something that gnuplot does. > > > >> Tim > >> > >> ------------------------------------------------------------------------ > >>--- --- The Planet: dedicated and managed hosting, cloud storage, > >> colocation Stay online with enterprise data centers and the best network > >> in the business Choose flexible plans and management services without > >> long-term contracts Personal 24x7 support from experience hosting pros > >> just a phone call away. http://p.sf.net/sfu/theplanet-com > >> _______________________________________________ > >> gnuplot-info mailing list > >> gnu...@li... > >> https://lists.sourceforge.net/lists/listinfo/gnuplot-info > > > > ------------------------------------------------------------------------- > >----- The Planet: dedicated and managed hosting, cloud storage, colocation > > Stay online with enterprise data centers and the best network in the > > business Choose flexible plans and management services without long-term > > contracts Personal 24x7 support from experience hosting pros just a phone > > call away. http://p.sf.net/sfu/theplanet-com > > _______________________________________________ > > gnuplot-info mailing list > > gnu...@li... > > https://lists.sourceforge.net/lists/listinfo/gnuplot-info > > --------------------------------------------------------------------------- >--- The Planet: dedicated and managed hosting, cloud storage, colocation > Stay online with enterprise data centers and the best network in the > business Choose flexible plans and management services without long-term > contracts Personal 24x7 support from experience hosting pros just a phone > call away. http://p.sf.net/sfu/theplanet-com > _______________________________________________ > gnuplot-info mailing list > gnu...@li... > https://lists.sourceforge.net/lists/listinfo/gnuplot-info |