[L2Ork-dev] Precision of [sqrt~] for double-precision

Jonathan Wilkes jon.w.wilkes at gmail.com
Wed Jun 6 23:34:08 EDT 2018


Hi list,

Looking at a double precision patch here:

https://git.purrdata.net/jwilkes/purr-data/merge_requests/224

And looking at these declarations/definitions from d_math.c:

static float rsqrt_exptab[DUMTAB1SIZE], rsqrt_mantissatab[DUMTAB2SIZE];

So... what happens if we just change "float" to "t_float" here?

At a glance it seems like we can still cast back to "float" to
derive the index in sigsqrt_perform. Then we grab the
t_float from that index and do the remaining multiplications
at double precision instead of single precision.

On the other hand, that would be 8 double-precision float
operations per sample.

Anyhow, as it is this algorithm appears to compute the
same values for both single- and double-precision versions
of Purr Data.

I'm not sure how to judge the importance of realtime
efficiency vs. whatever precision expectations someone
has when running double-precision Purr Data. (I also don't
completely understand the algorithm.)

Any thoughts?


More information about the L2Ork-dev mailing list