README-work

Math::SpecialFunctions

Raku package for mathematical special functions.

Installation

From Zef ecosytem:

zef install Math::SpecialFunctions

From GitHub:

zef install https://github.com/antononcube/Raku-Math-SpecialFunctions.git

Usage examples

The subsections below show example usage for the currently implemented functions.

Factorial

use Math::SpecialFunctions;
.say for (^11) Z=> (^11)ยป.&factorial

The 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 to 0, except B[1] = -1/2.

  • bernoulli-b can be evaluated to arbitrary numerical precision. (Uses FatRat.)

bernoulli-b(60).nude

Gamma function

  • The implementation uses approximation formula with machine numbers.

  • Both function names gamma and ฮ“ 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

Math::SpecialFunctions v0.1.0

Raku package for mathematical special functions.

Authors

  • Anton Antonov

License

Artistic-2.0

Dependencies

Test Dependencies

Provides

  • Math::SpecialFunctions

The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.