On Nov 12, 2008, at 5:52 PM, kcrisman wrote:

>> put those three lines in where indicated and it will be orders of
>> magnitude faster for most cases, plus will handle constants, lambda
>> functions, etc., automatically.
>>
>> fast_float is one of Sage's coolest "secrets".

Thanks :)

> That brings up a question I've had for a while.  When is it good to
> use fast_float (I've seen a lot of code over the last few months which
> replaces other calls with it) and when is it not good, or for instance
> when might RR be better, or just nothing?  E.g. William's examples on
> the interact wiki use it, but the others don't.  Given the limitations
> of our Sage server, something like that could really help things if it
> really speeded it up.  Unfortunately, as a non-CS type the
> documentation just doesn't compute for me, and just seeing a couple of
> examples where it is good to use it and where it isn't would be very
> helpful.
>
> For instance, should it only be used in .py files, or is it worthwhile
> in the command line or notebook?  Is it worth using if something is
> evaluated fewer than (say) 100 times?  Can it be interspersed with ZZ
> (I assume not) or RR(n), say RR(1000) (I have no idea)?  Thanks for
> any examples, especially from non-high-performance situations where it
> still might speed things up considerably (or do something bad).

The fast_float functionality is mostly for internal use, and is  
useful when one wants to evaluate an expression to double floating- 
point (i.e. 53-bits using the machine's native arithmetic) lots of  
times. "Lots" depends on the application, but is probably in the  
neighborhood of 10-100+, depending on the complexity of the equation  
and whether or not it has any symbolic values like pi (which slow  
down "normal" evaluation via maxima a huge amount). Thus it is suited  
to things like plotting or numerical integration. However, most such  
functions internally construct fast_float objects, so there usually  
is no need for the user to do so.

That being said, there are plenty of use cases for it for end users.  
On the interact wiki (looking at the calculus page) it seems that  
fast_float is used when the function is evaluated a lot, and not when  
it is just passed off to something else (e.g. to contour_plot which  
(should) use the fast_float internally). The usage in "Coordinate  
Transformations" is probably redundant, as parametric_plot should be  
calling fast_float itself.

Not sure it completely answers your question, but hopefully it helps.

- Robert


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@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-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to