Re: [sage-devel] Re: sign() and comparison in AA

2014-09-17 Thread Jonas Jermann
Hi Erik [sorry, the first mail was sent to you directly] On 17.09.2014 19:21, Erik Massop wrote: > On Wed, 17 Sep 2014 17:59:49 +0200 >> It doesn't (also note that the polynomials here have deg=4 < 8). > > "the polynomials"? > >sage: el2 = (791264*AA(2*cos(pi/8))^2 - 463492).sqrt() >sage

Re: [sage-devel] Re: sign() and comparison in AA

2014-09-17 Thread Erik Massop
On Wed, 17 Sep 2014 17:59:49 +0200 Jonas Jermann wrote: > On 17.09.2014 17:29, Marc Mezzarobba wrote: > > Jonas Jermann wrote: > >> What would you suggest I do to get a fast exact sign/comparison? > > > > Just a wild guess, but you may want to see if the patch at > > > > http://trac.sagemath.org/

Re: [sage-devel] Re: sign() and comparison in AA

2014-09-17 Thread Jonas Jermann
On 17.09.2014 19:02, Jonas Jermann wrote: Hi again After a closer look it seems that almost all time is spent in the calculation of "el2._exact_field().pari_field()" which occurs in "gen = left._exact_field().union(right._exact_field())" from line 7851 of qqbar.py. One suggestion for a maybe

Re: [sage-devel] Re: sign() and comparison in AA

2014-09-17 Thread Jonas Jermann
Hi again After a closer look it seems that almost all time is spent in the calculation of "el2._exact_field().pari_field()" which occurs in "gen = left._exact_field().union(right._exact_field())" from line 7851 of qqbar.py. One suggestion for a maybe faster algorithm to check equality: 1. Che

Re: [sage-devel] Re: sign() and comparison in AA

2014-09-17 Thread Jonas Jermann
Hi On 17.09.2014 17:29, Marc Mezzarobba wrote: Jonas Jermann wrote: What would you suggest I do to get a fast exact sign/comparison? Just a wild guess, but you may want to see if the patch at http://trac.sagemath.org/ticket/15600 helps. It doesn't (also note that the polynomials here have

[sage-devel] Re: sign() and comparison in AA

2014-09-17 Thread Marc Mezzarobba
Jonas Jermann wrote: > What would you suggest I do to get a fast exact sign/comparison? Just a wild guess, but you may want to see if the patch at http://trac.sagemath.org/ticket/15600 helps. -- Marc -- You received this message because you are subscribed to the Google Groups "sage-devel" g

[sage-devel] Re: sign() and comparison in AA

2014-09-17 Thread Dima Pasechnik
On 2014-09-17, Jonas Jermann wrote: > Hi > > How can I do exact comparison of numbers in AA? > I noticed that this doesn't work very reliably: > > el1 = AA((x^4 - 2238072*x^2 + 44133904).roots()[1][0]) > el2 = (791264*AA(2*cos(pi/8))^2 - 463492).sqrt() > el1 == el2 > > ^- This fails for me (resp.