Dear Jaume,

The main reason comes from the following very different algorithmic problem:

 1) a one time shot question about an equality of algebraic numbers

 2) a lot of arithmetic operations involving algebraic numbers

Basically your question belongs to 1) and AA is designed for 2). If you want to work harder you should try to use the "composed_op" method of polynomials [1]. Basic versions of the algorithms are implemented but no nice interface proposed yet in Sage!

I am sure that such approach would be incredibly fast with your question (even faster than what is in the symbolic ring).

Best,
Vincent


[1] http://doc.sagemath.org/html/en/reference/polynomial_rings/sage/rings/polynomial/polynomial_element.html#sage.rings.polynomial.polynomial_element.Polynomial.composed_op


On 20/03/2017 12:51, Jaume Aguade wrote:


Let r > a > 0 be real numbers. Let c = a + r, d = sqrt(r^2-a^2). Then, it
is obvious that 2*a*c=c^2-d^2. However, sage crashes when trying to check
this with a and r rather "simple" algebraic numbers.

I've found this while using sage to solve elementary geometric problems
involving circles and intersection of circles, i. e. algebraic numbers
which can be written using only square roots.

The capacity of working over the field AA is one of my favourite features
of sage, so I was disappointed when I found this easy example which
(apparently) cannot be worked out by sage. I would like to know if I'm
missing something or there is some other way to deal with these
computations.

(The trouble persists in QQbar)

Here is the code:

a=AA(sqrt(sqrt(5)))
r=AA(sqrt((AA(sqrt(13))-a)^2+3))
c=a+r

d= AA(sqrt(r^2-a^2))

2*a*c == c^2 - d^2


--
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to