[rust-dev] Fast inverse square root in Rust

Jens Nockert jens at nockert.se
Mon Jan 20 08:58:16 PST 2014

Sorry for being late to the party,

On 2014/01/12, at 20:06, Carter Schonwald <carter.schonwald at gmail.com> wrote:

> 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?  

The normal parts of the standard library should strive to be correctly rounded imho, for something like a hypothetical FastMath module, anything goes.

That is the IEEE 754-2008 recommendation, on the other hand, certain numerical languages like OpenCL have other (lower) guarantees that could be followed as well, but that would mean that Rust would give different results on different hardware, which might not be acceptable for certain applications (multiplayer games?)

> 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, float

I think we’ll have to work with the assumption that the * is never commutative or associative. Unfortunately.

More information about the Rust-dev mailing list