On Friday, 24 May 2019 at 11:45:46 UTC, Ola Fosheim Grøstad wrote:
const double sign =
cast(double)(-cast(uint)((mantissa>>63)&1));
Yep, this was wrong (0 or -1). Should be something like (1 or -1):
const double sign =
cast(double)(1-cast(uint)((mantissa>>62)&2));
You'll have to code it up more carefully than I did, just
following the same principles. (These ±1 errors do not affect
the performance.).
Also, for comparison, just running the 2 lookups in the loop are
at 32ms.
So 3 times that sounds reasonable for extracting the phase,
determining the sign, reversing the phase and doing the linear
interpolation.