Commit Graph

1 Commits

Author SHA1 Message Date
Sebastien Binet
c3a005d255 mathext: add Beta and Lbeta special functions
This CL adds the implementation for the complete Beta and Lbeta
special functions.

Follow the lead of C++17's std::beta(x,y) and cephes.

This CL investigated 2 different implementations, with the following
performances:

BenchmarkBeta-4 	10000000	       221 ns/op
BenchmarkBeta2-4	10000000	       157 ns/op

Beta uses a slower implementation, using:
  exp(lgamma(x)+lgamma(y)-lgamma(x+y))

instead of the faster:
  Γ(a)Γ(b) / Γ(a+b)

The former being numerically more stable at extreme values.
2016-08-11 16:43:57 +02:00