This is not intended to be a completed transition since it leaves the
libraries unusable to external client code, but rather as a step towards
use of math/rand/v2. This initial step allows repair of sequence change
failures without having to worry about API difference.
The links have been redirecting to `pkg.go.dev` for a while now. In the
case of the main README, that made the badge a virtual duplicate of the
"go.dev reference" one.
Tests run repeatedly do not reinitialise state, meaning that a second run
of the tests will have leftover state from the previous run. This ensures
that repeated runs are identical with the exception of map iteration order.
Changes made in dsp/fourier/internal/fftpack break the formatting used
there, so these are reverted. There will be complaints in CI.
[git-generate]
gofmt -w .
go generate gonum.org/v1/gonum/blas
go generate gonum.org/v1/gonum/blas/gonum
go generate gonum.org/v1/gonum/unit
go generate gonum.org/v1/gonum/unit/constant
go generate gonum.org/v1/gonum/graph/formats/dot
go generate gonum.org/v1/gonum/graph/formats/rdf
go generate gonum.org/v1/gonum/stat/card
git checkout -- dsp/fourier/internal/fftpack
Ruleguard run with ruleguard -c=0 -rules ruleguard.rules.go ./... from
https://github.com/dgryski/semgrep-go with the following rules inactivated
to reduce noise:
- unconvert for floating point values
- oddcomparisons
- floateq
The paper cited in the comment for the a > 1 (now a >= smallAlphaThresh) case mentions this approach as a small note on the final page, so there is no need to update the comments.
I also looked into numpy's logic for this case, but a) couldn't determine a source for it, except for what appears to be a more complex variant (Algorithm GS), and b) it's slightly slower than this method, at least for a >= 0.2.
benchstat:
```
name old time/op new time/op delta
GammaRand/case_0 89.4ns ± 5% 90.2ns ± 3% ~ (p=0.084 n=20+20)
GammaRand/case_1 212ns ± 3% 101ns ± 5% -52.28% (p=0.000 n=20+20)
GammaRand/case_2 25.4ns ± 3% 25.3ns ± 4% ~ (p=0.369 n=20+20)
GammaRand/case_3 48.6ns ± 6% 48.8ns ± 6% ~ (p=0.702 n=20+20)
GammaRand/case_4 47.1ns ± 6% 47.6ns ± 3% ~ (p=0.147 n=20+20)
```