2014-03-14 10:45 UTC+01:00, mmarco <[email protected]>:
>
>> I would advocate that RLF is a very good approximation of what should
>> be RR. Perhaps one good direction to take is to try to make RLF
>> smarter and contains all constants from pi to cos(42^e).
>>
>> Somehow, it already does (i.e. internally it keeps track of their
> symbollic nature):
>
> {{{
>  sage: b=RLF(cos(42^e))
> sage: b
> 0.9578837974?
> sage: b.eval(SR)
> cos(42^e)
> }}}
>
> Maybe the issue is that there is no coercion between SR and RLF (there is
> conversion from SR to RLF, and the .eval() method that can take elements
> from RLF to SR, though).

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 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?

Vincent

-- 
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 [email protected].
To post to this group, send email to [email protected].
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