On 5/17/07, Michel <[EMAIL PROTECTED]> wrote: > > Syntax error -- W is not defined. What is W? > > > Sorry. As Justin pointed out W is an arbitrary number field not equal > to the rational numbers. > > > > > > > sage: %timeit ((x+y+z)**3)(1/y,y,y**100) > > > 10 loops, best of 3: 752 ms per loop <=== look here! > > > sage: %timeit ((u+v+w)**3)(1/v,v,v**100) > > > 10 loops, best of 3: 48.2 ms per loop <=== look here! > > > > It's not at all clear to me without further discussion and benchmarking > > what the right optimization is so that rational functions over fields are > > sufficiently fast. > My point was that the above command over a number field is 15 times > as fast as over the rationals. This is so counterintuitive that > I think it is unacceptable. > > > Basically, are you suggesting that one > > not call reduce until, e.g., printing? > > There are several options. > (1) declare reduce to be expensive so require the user to call it > explicitly (this is the approach followed by maxima). > As a refinement this behaviour could be triggered by a new flag for a > ring element: gcd_is_expensive (e.g. > for polynomials in several variables). > (2) call reduce lazily and cache the result (this is what you are > suggesting). > > Originally I had thought of (1) but now I think I like (2) better.
Actualy, I think I mean to do both (1) and (2). I.e., only call reduce when necessary (maybe when printing), but once called cache the result. William --~--~---------~--~----~------------~-------~--~----~ 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/ -~----------~----~----~----~------~----~------~--~---