[sage-support] Arbitrary precision in cython

2008-12-23 Thread Paul Zimmermann

   Hi,

as a followup on the Arbitrary precision in cython thread, I'd like to
mention that one can directly use mpfr's implementation from within Sage:

sage: RealField(150)(10).eint()
2492.2289762418777591384401439985248489896471

It only works for real numbers, but has the advantage to guarantee correct
rounding (for the 150-bit binary result; if you are using the decimal
result above, you have to take into account the binary-decimal conversion
error, which is at most 1/2 ulp).

Paul Zimmermann

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Arbitrary precision in cython

2008-12-23 Thread John Cremona

Thanks Paul, that is very helpful;  it means that all the discussion
of conversion to and from pari is redundant.

John

2008/12/23 Paul Zimmermann paul.zimmerm...@loria.fr:

   Hi,

 as a followup on the Arbitrary precision in cython thread, I'd like to
 mention that one can directly use mpfr's implementation from within Sage:

 sage: RealField(150)(10).eint()
 2492.2289762418777591384401439985248489896471

 It only works for real numbers, but has the advantage to guarantee correct
 rounding (for the 150-bit binary result; if you are using the decimal
 result above, you have to take into account the binary-decimal conversion
 error, which is at most 1/2 ulp).

 Paul Zimmermann

 


--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Arbitrary precision in cython

2008-12-23 Thread Jason Grout

Paul Zimmermann wrote:
Hi,
 
 as a followup on the Arbitrary precision in cython thread, I'd like to
 mention that one can directly use mpfr's implementation from within Sage:
 
 sage: RealField(150)(10).eint()
 2492.2289762418777591384401439985248489896471
 
 It only works for real numbers, but has the advantage to guarantee correct
 rounding (for the 150-bit binary result; if you are using the decimal
 result above, you have to take into account the binary-decimal conversion
 error, which is at most 1/2 ulp).


Just a note:

sage: pari(RealField(500)(10)).eint1().python()
4.15696892968532427740285981027818038434629008241953313262759569712786222819608803586147163177527802101305497591041862309918139192016097135380721447598904e-6
sage: RealField(500)(10).eint()
2492.22897624187775913844014399852484898964710143094234538818526713774122742888744417794599665663156560488342454657568480015672868779475213684965774390
sage:
sage: pari(RealField(500)(-10)).eint1().python()
-2492.22897624187775913844014399852484898964710143094234538818526713774122742888744417794599665663156560488342454657568480015672868779475213684965774390402
sage: RealField(500)(-10).eint()
NaN



Jason


--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] about knowledge of other packages for usage of sage

2008-12-23 Thread freewill1729

Hi

I am new to sage and hence, not very familiar.

However, while going through the documentation, I saw some examples of
usage of functions that are provided by other packages like maxima,
octave etc.

I am bit confused, about whether I have to know all those packages
before being able to use sage to its full advantage, or is it the case
that, sage automatically chooses one of these packages (maxima etc.)
and solves the required problem.

And if this is the case, how do I know which package has been selected
for execution.

Thanking you.


--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Convert a SymbolicEquation into a MaximaElement

2008-12-23 Thread bsdz

Hi,

Is it possible to convert a SymbolicEquation into a MaximaElement
easily? The opposite to: -

maxima('x^2 + y^2 = 0').sage()

Something like this: -

x, y = var('x y')
b = x^2 + y^2 == 0
b.maxima()

I would like to do some manipulations on an equation by breaking it
down into terms and parts.

Thanks
Blair


--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Convert a SymbolicEquation into a MaximaElement

2008-12-23 Thread John Cremona

2008/12/23 bsdz blai...@googlemail.com:

 Hi,

 Is it possible to convert a SymbolicEquation into a MaximaElement
 easily? The opposite to: -

 maxima('x^2 + y^2 = 0').sage()

 Something like this: -

 x, y = var('x y')
 b = x^2 + y^2 == 0
 b.maxima()


Is this what you need?

sage: eqn = maxima(x^2 + y^2 = 0)
sage: eqn.lhs()
y^2+x^2
sage: eqn.rhs()
0

eqn.tab offers 2160 possible ways to go...!

John Cremona

 I would like to do some manipulations on an equation by breaking it
 down into terms and parts.

 Thanks
 Blair


 


--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Convert a SymbolicEquation into a MaximaElement

2008-12-23 Thread Mike Hansen

Hi Blair,

On Tue, Dec 23, 2008 at 7:43 AM, bsdz blai...@googlemail.com wrote:

 Hi,

 Is it possible to convert a SymbolicEquation into a MaximaElement
 easily? The opposite to: -

 maxima('x^2 + y^2 = 0').sage()

 Something like this: -

 x, y = var('x y')
 b = x^2 + y^2 == 0
 b.maxima()

I think this is what you're after:

sage: x, y = var('x y')
sage: b = x^2 + y^2 == 0
sage: maxima(b)
y^2+x^2=0
sage: type(_)
class 'sage.interfaces.maxima.MaximaElement'

Note that maxima(b) works by (eventually) calling b._maxima_()

sage: b._maxima_()
y^2+x^2=0

--Mike

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---