<html><head></head><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px"><div id="yui_3_16_0_ym19_1_1476901994445_5144">> On Wed, Oct 19, 2016 at 4:25 PM, Jonathan Wilkes <<a shape="rect" ymailto="mailto:jancsika@yahoo.com" href="mailto:jancsika@yahoo.com">jancsika@yahoo.com</a>> <br></div><div id="yui_3_16_0_ym19_1_1476901994445_5167">> wrote:</div><div class="qtdSeparateBR"><br><br></div><div style="display: block;" id="yui_3_16_0_ym19_1_1476901994445_5120" class="yahoo_quoted"><div id="yui_3_16_0_ym19_1_1476901994445_5119" style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"><div id="yui_3_16_0_ym19_1_1476901994445_5118" style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"><div id="yui_3_16_0_ym19_1_1476901994445_5168" class="y_msg_container">>> When implemented in C, which approach takes the least amount of time<br clear="none">>> to read, reason about, and fully comprehend?<br clear="none"><br clear="none">> That is an important question. Pd code is full of clever tricks and<br clear="none">> bit hacks for dsp efficiency. What is the origin of q8_rsqrt(), why<br clear="none">> and how does it work? What about PD_BIGORSMALL() in m_pd.h? And the<br clear="none">> mysterious UNITBIT32 number in d_osc.c? Ideally such code should be<br clear="none">> commented not only to denote its function (if necessary) but also to<br clear="none">> reference the origin so you may be able to find info.<br clear="none"><br clear="none">> An approximation for a trig function should go in an (inline)<br clear="none">> function, with a comment if the name can't clarify the function<br clear="none">> sufficiently. But to fully comprehend is a different matter. Dsp code<br clear="none">> in general takes substantial background to understand. You could<br clear="none">> wonder why and how the approximation works, but the same question goes<br clear="none">> for the function that it replaces.<br clear="none"><div id="yui_3_16_0_ym19_1_1476901994445_5353"><br></div><div id="yui_3_16_0_ym19_1_1476901994445_5535" dir="ltr">And if we're not talking hot code then the answer of which answer arrived in less <br></div><div id="yui_3_16_0_ym19_1_1476901994445_5534" dir="ltr">time should (at least in large part) dictate which method to use, shouldn't it?<br> </div><br><div id="yui_3_16_0_ym19_1_1476901994445_6860" dir="ltr">-Jonathan<br></div><div id="yui_3_16_0_ym19_1_1476901994445_6861"><br></div>> Katja</div> </div> </div>  </div></div></body></html>