Just Launched: You can now import projects and releases from Google Code onto SourceForge
We are excited to release new functionality to enable a 1-click import from Google Code onto the Allura platform on SourceForge. You can import tickets, wikis, source, releases, and more with a few simple steps. Read More
Thibault Langlois wrote:
>I thought that rationals were made of two bignums and that I could not
>have overflow errors. Am I wrong ?
Well, maybe you should have a look at how large these bignums become, you may be surprised.
Maybe you should have a look at CL's long float type (4 types in CL, only 2 in C et al), and esp. CLISP' settable length of these.
My experience with computing integrals was that using ratios was not better than floats, because
a) the polynomial coefficients, represented as ratios, had huge numerators and denominators (bignums)
b) so computing with them was *orders* of magnitudes slower than with floating point,
c) well-chosen floating-point types gave enough precision.
On Thu, 2004-10-14 at 20:51, Sam Steingold wrote:
> > * Hoehle, Joerg-Cyril <Wbret-Plevy.Ubruyr@...> [2004-10-14 17:39:43 +0200]:
> > Thibault Langlois wrote:
> >>I thought that rationals were made of two bignums and that I could not
> >>have overflow errors. Am I wrong ?
> > Well, maybe you should have a look at how large these bignums become,
> > you may be surprised. Maybe you should have a look at CL's long float
> > type (4 types in CL, only 2 in C et al), and esp. CLISP' settable
> > length of these.
Thanks for your answers.
Clisp's long-floats are really long :-) ! On cmucl and Lispworks
long-float and double-float have the same size.
Using long floats is indeed much more efficient. There is also a variant
of the algorithm I use (Baum-Welch algorithm for the estimation of HMM
to name it) that rescales values during computation but I haven't
implemented it yet.
I just tried the lazy way using rationals. I expected the calculation
eventually last too much time but I was not expecting an overflow error.
Thibault Langlois <tl@...>
FCUL / DI