<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><span><br></span></div><div>I agrre with you. I should have keep at most 7 floats.</div><div><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">Nozomi<br></div>  <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div dir="ltr"> <hr size="1">  <font face="Arial" size="2"> <br> </font> </div> <div class="y_msg_container"><br>2013/4/15 Nozomi Kodama <<a ymailto="mailto:nozomi.kodama@yahoo.com" href="mailto:nozomi.kodama@yahoo.com">nozomi.kodama@yahoo.com</a>>:<br>> Hello<br>><br>> thanks for the review.<br>> I don't think that calling defines is the way to go. Indeed, I tested
 my<br>> patch and yours. Yours is about 12% slower than mine in my computer.<br>> And now, we try to take care of efficiency of this dll. So, it is not the<br>> time  to increase latency.<br>><br>><br>> I used 10 digits since there are a lot of computation, I want to avoid as<br>> much as possible big rounding errors. If we want to uniformize, then we<br>> should uniformize d3dxshmultiply 2,3,4 with 10 digits.<br>> But that is for an another patch.<br>><br><br>Just to chip in about float precision. As already discussed, 32-bit<br>float constants have about 7 decimals digits of precision, so<br>extending these constants from 8 to 10 digits should not change<br>anything. You would have to use doubles if you want more accurate<br>values (but I don't think we should use doubles in d3dx9 dlls anyway).<br>What you can do to ensure numeric accuracy is reviewing computations:<br>the order of the operations (e.g. how you
 resolve operators<br>associativity, etc) and storing/reusing intermediate results can make<br>a difference. I wouldn't care about this stuff unless we get<br>significantly different results compared to native.<br><br>> Nozomi.<br>>><br>>><br>>><br>>>Looks pretty much ok, but isn't there a way to reduce the size a bit?<br>>>Just see the dirty hack which is attached. D3DXSHMultiply6 will add a<br>>>lot of lines too...<br>>><br>>>Also is there a reason why we use constants with different accuracy<br>>>(e.g. 0.28209479f in D3DXSHMultiply4 and 0.2820948064f)?<br>>><br>>>Cheers<br>>>Rico<br>><br>><br>><br>><br>><br><br><br></div> </div> </div>  </div></body></html>