>
>
> This is half good, I am happy that RLF wraps symbolic constants. But, 
> first of all there can not be any reasonable coercion from SR to RLF 
> as SR is much bigger. Secondly, SR is not consistent with evaluation 
>
> sage: cos(1.).parent() 
> Real Field with 53 bits of precision 
> sage: cos(1).parent() 
> Symbolic Ring 
>
>
I don't see much problem: 1. is a floating point number, and hence an 
inexact element. So it makes sense to compute is cosine as an inexact 
number too.
On the other hand, 1 is an exact element, so it makes sense to keep its 
cosine as an exact number.
 

> I would prefer the second parent to be something like 
> RealSymbolicField or RealNumbers or whatever but not symbolic ring. 
>
> Thirdly, I would like to be able to compare real numbers built from 
> different sources : 
>  - algebraic numbers (built from QQbar and NumberField) 
>  - symbolic constants 
>  - continued fractions 
>  - binary expansions 
>  - ... 
>
> But currently: 
>
> sage: R.<X> = QQ[] 
> sage: K.<a> = NumberField(X^4 - 5*X^2 + 5, embedding=1.17) 
> sage: RLF(a) 
> 1.75570504584947? 
> sage: expr = 2 * cos(3*pi/10) 
> sage: RLF(expr) 
> 1.17557050458946? 
> sage: RLF(a) == RLF(expr)      # does not work in RLF 
> False 
> sage: bool(SR(a) == SR(expr)) # does not work in SR 
> False 
>
> Even if they are equal as real numbers. So what is broken : comparison 
> in SR? comparison in RLF? 
>
>
IIRC  it is not known if that problem is decidable or not. That is, in 
practice, comparison in SR or RLF will always be "broken". It could be 
improved, but there will always be cases where the computer can not 
determine if two expressions are equal or not.

-- 
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 http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to