Maxima gives incorrect results with ceiling



On Fri, Dec 07, 2007 at 05:18:37PM -0500, Stavros Macrakis wrote:
> On Dec 7, 2007 4:36 PM, Daniel Lakeland <dlakelan at street-artists.org> wrote:
> 
> > I guess I'm suggesting a refinement of the current method
> > which might have better properties, if not perfect ones.
> >
...

> Again, why is this a good criterion? If the correct value is int+epsilon,
> what matters to the floor/ceiling calculation is the sign of epsilon, which
> may be arbitrarily small and arbitrarily badly behaved, and an arbitrarily
> small fraction of int.

Yes. I see now where you're going. But at the very least, by a
combination of direct calculation of the approximate precision and
doubling of the precision for a check, we can limit the error to +- 1
for arbitrarily large integers, as opposed to the current situation
where the original email showed an error of 10^48 and it is easy to
construct a case where the error is arbitrarily large.

I suppose to a number theorist an error of +-1 might be just as bad as
+- 10^48 but to an engineer or physicist the difference is startling!

FWIW


-- 
Daniel Lakeland
dlakelan at street-artists.org
http://www.street-artists.org/~dlakelan