2010/5/29 Michael Menegakis <arx...@gmail.com>

> On Sat, May 29, 2010 at 4:55 PM, Thilo Schulz <a...@ats.s.bawue.de> wrote:
> > the max. relative error is 0.175% over all floats.
>
> OK, that's relatively, not completely marginal. If one is going to go
> with a 'safe' approach (since I noticed if it's replaced with sqrt()
> benchmarking doesn't show anything noticeable) do they have to do it
> only on server, the client or both?
> _______________________________________________
> ioquake3 mailing list
> ioquake3@lists.ioquake.org
> http://lists.ioquake.org/listinfo.cgi/ioquake3-ioquake.org
> By sending this message I agree to love ioquake3 and libsdl.
>

The engine uses 32 bit precision floats and approximations for other
function (sin/cos) too, so it has to handle imprecise results anyway. There
are other things that probably have a bigger impact (e.g. most Vectors are
rounded to integers before they are sent over the net, to save net
bandwidth).

Also the "fast" approximate sqrt may not be so fast on current CPUs. The
fast sqrt has to move the value from an FPU or SSE register into an integer
register and back, and these instructions have a high latency, while the
built-in sqrt (or rsqrt) functions have been optimized down to a few cycles.
_______________________________________________
ioquake3 mailing list
ioquake3@lists.ioquake.org
http://lists.ioquake.org/listinfo.cgi/ioquake3-ioquake.org
By sending this message I agree to love ioquake3 and libsdl.

Reply via email to