On Dec 11, 2007 12:17 PM, Robert Bradshaw <[EMAIL PROTECTED]> wrote:
>
> 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.
Keep in mind
http://trac.sagemath.org/sage_trac/ticket/553
I.e., students who forget to put a * in get very confused by this:
sage: (5 + 2^(1/3))(x^2 + 1)
2^(1/3) + 5
?! It would be better to get an error...
William
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
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/
-~----------~----~----~----~------~----~------~--~---