On Dec 11, 2007, at 8:53 AM, William Stein wrote:

> One possible solution would be to call simplify before
> doing float(...) -- but that could greatly slow symbolic calculus
> down in some cases.

This could be attempted only on failure, which wouldn't have a  
performance impact in most cases.

> Another possibility would be to change
> the definition of variables() to return all variables, even the ones
> that are simplified away:
>
> sage: (x - x).variables()   # fake
> (x,)
>
> That would be very confusing.
>
> A third possibility would be to make implicit calling use variables
> in the unsimplified expression if the simplified expression has
> no variables.  This would cleanly deal with your case above.

Anther option would to make zero-variable expressions ignore the  
(single) input value, and return itself (behaving as the constant  
function) or itself evaluated on that value (e.g. if it were an un- 
evaluated trig, sqrt, etc.). This might be a way to remedy the confusing

sage: f = sin + cos
sage: f(3)
sin + cos

too.

- Robert


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to