[tim-janik/beast] BSE: bsemathsignal: add approximations: Bse::fast_log2 and Bse::fast_exp2 (#124)

2019-09-10 Thread Stefan Westerfeld via beast
First of all, this adds a function that was missing in bsemathsignal: a `fast_log2` implementation. It works by using the float exponent and approximating the rest of the value using a polynomial. I found a tool that gives optimal polynomial coefficients for a given order:

Re: [tim-janik/beast] BSE: bsemathsignal: add approximations: Bse::fast_log2 and Bse::fast_exp2 (#124)

2019-09-10 Thread Tim Janik
On 10.09.19 23:54, Tim Janik via beast wrote: > Error samples, compared to LOG2L(3): > > +0.0, -0.0231613294631 Sorry, the first line was bogus, a "%+.1f" format string printed 0.01 as +0.0. It should instead read: Error samples, compared to LOG2L(3): +0.1, +0.775829903

Re: [tim-janik/beast] BSE: bsemathsignal: add approximations: Bse::fast_log2 and Bse::fast_exp2 (#124)

2019-09-10 Thread Tim Janik via beast
As mentioned on IRC, enabling optimizations with MODE=release and picking clang++ (6.0 here) vs g++ (7.4 here) makes major differences when benchmarking exp2f and log2f from glibc against our approximations. On a modern AMD64 processor, glibc is often faster. Internally it also uses polynomials

Re: [tim-janik/beast] Force alsa default device (#123)

2019-09-10 Thread Tim Janik via beast
A bit of evaluation on Ubuntu 18.04: - Bitwig defaults to opening JACK and issues a warning if that fails. It provides JACK, ALSA and PulseAudio drivers. For the ALSA driver, the user has to select one of the available ALSA hardware drivers (hw:*). - Reaper defaults to opening JACK and issues

Re: [tim-janik/beast] BSE: bsemathsignal: add approximations: Bse::fast_log2 and Bse::fast_exp2 (#124)

2019-09-10 Thread Tim Janik via beast
> Relative `exp2(x)` approximation errors in interval [-1:1]: That's a miniscule range to approximate, given the valid range of this function. Here are the errors of bse_approx3_exp2() at mostly integer steps with some omissions for brevity: -2.0, +0.0 -1.5,