HNHacker News
TopNewBestAskShowJobs

joelkp

11 karma · joined August 10, 2019

Hobby programmer in Sweden. Interested in audio, some programming language topics, and the BSDs.
submissionscomments
joelkp··on Show HN: Random access noise – counter-based pseudo-random number generator
I've looked around more, and I should probably write a better/fuller comparison of other things with what I experiment with. I think the more unusual thing, and useful observation, is that multiplying with the result of a varying bitrotation (what I thought of as "chaotic waveshaping") can be enough to make it sound like white noise (though more is needed to make all bits decently random). It makes it possible to use a multiplication less.

SplitMix64 uses another multiplication and only fixed bitshifts, and is 64-bit. I've found more about the standard form of its core - a permuting hash function with two multiplications and three xor-right-shifts. There are also 32-bit functions of that type, where the best seem to be listed in this article on the topic: https://nullprogram.com/blog/2018/07/31/

joelkp··on Show HN: Random access noise – counter-based pseudo-random number generator
Maybe it's not so interesting to readers here, audio remaining the main purpose for which it was made. The days after posting, tests and tweaks have however made it better for general purposes. New code and stats now included, more to come.
joelkp··on Modifying Taylor polynomials for better accuracy: sin(x) approximations
Actually, I missed something basic. Maybe it stood out to you, PaulHoule, as it made the 3rd and 4th approximations worse than is possible, but in any case...

The 2nd approximation was minimax, but then I made a non-minimax approximation out of a minimax one, to get rid of error at the end of the input value range. It would have been possible to do that in a minimax way instead, by changing (increasing) the input value range for the approximation. Doing it just enough would move the last place where the error drops down to zero outwards to the end of the old input value range. I didn't think of that earlier.

joelkp··on Modifying Taylor polynomials for better accuracy: sin(x) approximations
I experimented from the starting point I used simply because I felt like trying it, learning as I went. (I'm the author.)

A minimax result is a small improvement on Chebyshev. Though my program is too slow to be good for experimenting with higher-order approximations, for which a Remez algorithm implementation would be far more generally useful.

https://en.wikipedia.org/wiki/Remez_algorithm

I think Remez + the end-point fitting trick I stumbled on would be the practical way to extend the last two parts in the article to higher order approximations. And make it exact instead of only "almost".