README-work
Math::SpecialFunctions
Raku package for mathematical special functions.
Installation
From Zef ecosytem:
zef install Math::SpecialFunctionsFrom GitHub:
zef install https://github.com/antononcube/Raku-Math-SpecialFunctions.gitUsage examples
The subsections below show example usage for the currently implemented functions.
Factorial
use Math::SpecialFunctions;
.say for (^11) Z=> (^11)ยป.&factorialThe function factorial seems reasonably fast:
my $tstart = now;
for ^1_000 { factorial($_ * (1..6).pick ) }
my $tend = now;
say "Total time {$tend - $tstart}";
say "Average time {($tend - $tstart) / 1_000}";Binomial
Pascal's triangle:
for (^6) -> $n {
say do for (0..$n) -> $k {
binomial($n, $k), " "
}.join
}Bernoulli-B
For odd
n, the Bernoulli numbers are equal to0, exceptB[1] = -1/2.bernoulli-bcan be evaluated to arbitrary numerical precision. (UsesFatRat.)
bernoulli-b(60).nudeGamma function
The implementation uses approximation formula with machine numbers.
Both function names
gammaandฮcan be used.The property
ฮ(z + 1) = z * ฮ(z)holds.
Synonyms demo:
[gamma(0.3), ฮ(0.3)]Show that the property above holds:
gamma(2.3) - 1.3 * gamma(1.3)TODO
TODO Implementation
TODO Incomplete gamma function
TODO Generalized incomplete gamma function
TODO Digamma function