<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><br><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 id="yiv240607704"><div><div style="color:#000;background-color:#fff;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 style="font-family:times new roman, new york, times, serif;font-size:12pt;">>On 26.09.2012 12:17, Nozomi Kodama wrote:<br>>> +    ta =0.28209479f * a[0]+ 0.14567312f * a[8]+ 0.12615663f * a[6];<br>>> +    tb =0.28209479f * b[0]+ 0.14567312f * b[8]+ 0.12615663f * b[6];<br>>> +    out[13] += ta * b[13] + tb * a[13];<br><> +    t = a[13] * b[13];<br>>> +   
 out[0] +=0.28209479f *t;<br>>Please use spaces with care.<br>>The preferred way is "x = 123 * a[0] + 456 * b[234]; Mostly one space is enough, only use two or more if >you like to indent something, that's mostly not the case when calculating a value. Even then, please be >consistent across
 your patch.<br><br>oops!!!<br>I will take care of this one.<br><br>>> +    D3DXSHMultiply4(c, a, b);<br>>>What happens if you use something like D3DXSHMultiply4(c, c, c). Is that allowed?<br><br>Tests in native show that D3DXSHMultiply gives what I implemented.<br>We can not reuse a input variable as output (we don't obtain what we expect logically).<br><br>>Also is there a reason why it uses slightly different values than e.g. D3DXSHMultiply3? Why don't we >use defines? A problem might be to find good names... Maybe the Multiply functions could share the >same base? To me it looks like they do share a lot of calculations, And if the order doesn't matter (see >comment above) then it may be possible to rearrange the calculation.<br>><br>>ta = 0.28209479f * a[0] - 0.12615663f * a[6] - 0.21850969f * a[8];<br>>vs<br>>ta = 0.28209479f * a[0] - 0.12615662f * a[6] - 0.21850968f * a[8];<br><br>I do the computations
 with a formal computation software. Unfortunately I did not use the same for D3DXSHMultiply4 and D3DXSHMultiply3 ..... (Xcas vs Maple). And obtain the exact values look beyond the capacities of these softwares.<br><br>And even the worst, since the integrated functions  oscillate, the internal algorithm of the software are not robust to compute the integrals. For a given number of significative digits, that's why we obtain slightly different  values for the both softwares.<br><br>Addind defines will add tons on variables for no gain. But I can simplify slightly the function by calling D3DXSHMultiply3.<br><br>I will give it a try. I worry about efficiency.<br><br>Best regards<br><br>Nozomi<br><br>>Cheers<br>>Rico<br><br><br> </div> </div>  </div></div></div><meta http-equiv="x-dns-prefetch-control" content="on"><br><br> </div> </div>  </div></body></html>