[sage-devel] Re: Proposed solution to Maxima precision problem

2012-06-15 Thread Nils Bruin
On Jun 15, 2:04 am, Robert Bradshaw wrote: > Perhaps we could set ffprec to be the min of the input precisions > (plus a default, plus anything still in scope?) before doing any > operations. We don't really have a concept of scope, though. For the calculus use of maxima it might be doable, thoug

Re: [sage-devel] Re: Proposed solution to Maxima precision problem

2012-06-15 Thread Robert Bradshaw
On Wed, Jun 13, 2012 at 9:43 PM, rjf wrote: > > > oh, just a note on precision in Maxima with bigfloats. > > If you have 2 numbers of precision N  and M,  and you add them together, the > resulting number will be of precision K  where K is the global value of the > specified precision.  this is fp

[sage-devel] Re: Proposed solution to Maxima precision problem

2012-06-14 Thread rjf
1. the concept that Maxima fails to "preserve precision" that seems to be bandied about here doesn't seem to me to make much sense. You have 2 numbers of different precisions and you operate on them. What is supposed to be preserved? 2. If the MPFR fraction has N bits, then ?fpprec:N will b

[sage-devel] Re: Proposed solution to Maxima precision problem

2012-06-14 Thread Nils Bruin
On Jun 13, 7:32 pm, rjf wrote: > If you want a Sage number X of n (binary) bits precision to be converted to > a Maxima bigfloat of n bits, > then you can do this. > First in Sage compute Xrat  which is an exact rational that is equal to X. > It could be computed > by something like  (some integer

[sage-devel] Re: Proposed solution to Maxima precision problem

2012-06-13 Thread rjf
oh, just a note on precision in Maxima with bigfloats. If you have 2 numbers of precision N and M, and you add them together, the resulting number will be of precision K where K is the global value of the specified precision. this is fpprec [in decimal, approximately] or ?fpprec in binar

[sage-devel] Re: Proposed solution to Maxima precision problem

2012-06-13 Thread rjf
If you want a Sage number X of n (binary) bits precision to be converted to a Maxima bigfloat of n bits, then you can do this. First in Sage compute Xrat which is an exact rational that is equal to X. It could be computed by something like (some integer) times 2^(some power): then in maxima,

[sage-devel] Re: Proposed solution to Maxima precision problem

2012-06-13 Thread Eviatar
Here's a possible way to solve the precision problems with Maxima. This replaces RealNumbers and RealLiterals with variables before simplifying an Expression. from sage.symbolic.expression_conversions import Converter class DoNothing(Converter): def arithmetic(self, ex, operator): r