[vorbis-dev] Another good optimization (for PPC only, though)

Timothy J. Wood tjw at omnigroup.com
Mon Nov 27 07:56:37 PST 2000



>Nonononono! If you got y = 1/sqrt(x), then "y *= x;" will give you y = sqrt(x),
>easier, cheaper & better :-)

  Duh.  I'll put that in.   In my defense, I'd been up for over 24 hours when writing that.  I should have slept first, obviously :)

>>     if (x == 0.0)

>There are separate +0.0 and -0.0, so you better watch out.

   if (fabs(x) == 0.0), then I guess.

>>     /* Second refinement step */
>>     y0 = y1;
>>     y1 = y0 + half*y0*(one - B*y0*y0);
>
>Why the copying?

  The refinement expression takes y0 as an input and produces y1.  The copying assignes the output of the last refinement to the input of the next.  Sure, I could have rewritten the expression to avoid this, but that would be less clear, I think (and the compiler should do this anyway).

-tim

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Vorbis-dev mailing list