[rust-dev] Fast inverse square root in Rust

Carter Schonwald carter.schonwald at gmail.com
Sun Jan 12 11:06:38 PST 2014


Note that on modern hardware the fast inv trick, which is a very specific
trick indeed, is just one approach.  Modern intel CPUs do have some special
instructions support that's related.  Note that many of these tricks /
primops do not provide the full available representable precision.

That actually raises a good point: for finite precision real number types
like f64 /f32 etc, what are the desired precision/numerical stability
guarantees of routines included I the std lib?  For operations on IEEE
floating point types, how do these guarantees carry  these composite
operations in the presence of rounding modes?

These are nuanced questions.  And maybe there should different types /
traits depending on the assumptions needed. (A fun question is: "when is
multiplication commutative and associative?", because it's not for
matrices, floats and groups)


Anyways, numerical computation is subtle :-)



On Sunday, January 12, 2014, Carter Schonwald wrote:

>
> http://static.rust-lang.org/doc/0.9/std/num/trait.Algebraic.html
>
> On Sunday, January 12, 2014, Thad Guidry wrote:
>
>> Where is the fast inverse square root function in Rust ?
>> http://en.wikipedia.org/wiki/Fast_inverse_square_root
>>
>> Anyone know if this semi-accurate function is at a hardware level and
>> built in to Intel chipsets since MMX ?
>>
>> How does this affect LLVM and Rust compilation on 64 bit ?
>>
>> Thanks in advance,
>>
>> --
>> -Thad
>> +ThadGuidry <https://www.google.com/+ThadGuidry>
>> Thad on LinkedIn <http://www.linkedin.com/in/thadguidry/>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/rust-dev/attachments/20140112/56c67ce4/attachment.html>


More information about the Rust-dev mailing list