## baggy.md
role Baggy

Collection of distinct weighted objects

```raku
role Baggy does QuantHash { }
```

A role for collections of weighted objects. See [`Bag`](/type/Bag), [`BagHash`](/type/BagHash), and [`Mixy`](/type/Mixy).

# [Methods](#role_Baggy "go to top of document")[§](#Methods "direct link")

## [method new-from-pairs](#role_Baggy "go to top of document")[§](#method_new-from-pairs "direct link")

```raku
method new-from-pairs(Baggy: *@pairs --> Baggy:D)
```

Constructs a Baggy objects from a list of [`Pair`](/type/Pair) objects given as positional arguments:

```raku
say Mix.new-from-pairs: 'butter' => 0.22, 'sugar' => 0.1, 'sugar' => 0.02;
# OUTPUT: «Mix(butter(0.22) sugar(0.12))␤»
```

**Note:** be sure you aren't accidentally passing the Pairs as positional arguments; the quotes around the keys in the above example are significant.

## [method grab](#role_Baggy "go to top of document")[§](#method_grab "direct link")

```raku
multi method grab(Baggy:D: --> Any)
multi method grab(Baggy:D: $count --> Seq:D)
```

Like [pick](#method_pick), a `grab` returns a random selection of elements, weighted by the values corresponding to each key. Unlike `pick`, it works only on mutable structures, e.g. [`BagHash`](/type/BagHash). Use of `grab` on an immutable structure results in an [`X::Immutable`](/type/X/Immutable) exception. If `*` is passed as `$count`, or `$count` is greater than or equal to the [total](#method_total) of the invocant, then `total` elements from the invocant are returned in a random sequence; i.e. they are returned shuffled.

Grabbing decrements the grabbed key's weight by one (deleting the key when it reaches 0). By definition, the `total` of the invocant also decreases by one, so the probabilities stay consistent through subsequent `grab` operations.

```raku
my $cars = ('Ford' => 2, 'Rover' => 3).BagHash;
say $cars.grab;                                   # OUTPUT: «Ford␤»
say $cars.grab(2);                                # OUTPUT: «(Rover Rover)␤»
say $cars.grab(*);                                # OUTPUT: «(Rover Ford)␤»

my $breakfast = ('eggs' => 2, 'bacon' => 3).Bag;
say $breakfast.grab;
CATCH { default { put .^name, ': ', .Str } };
# OUTPUT: «X::Immutable: Cannot call 'grab' on an immutable 'Bag'␤»
```

## [method grabpairs](#role_Baggy "go to top of document")[§](#method_grabpairs "direct link")

```raku
multi method grabpairs(Baggy:D: --> Any)
multi method grabpairs(Baggy:D: $count --> Seq:D)
```

Returns a [`Pair`](/type/Pair) or a [`Seq`](/type/Seq) of [`Pair`](/type/Pair)s depending on the version of the method being invoked. Each [`Pair`](/type/Pair) returned has an element of the invocant as its key and the element's weight as its value. Unlike [pickpairs](/routine/pickpairs), it works only on mutable structures, e.g. [`BagHash`](/type/BagHash). Use of `grabpairs` on an immutable structure results in an `X::Immutable` exception. If `*` is passed as `$count`, or `$count` is greater than or equal to the number of [elements](#method_elems) of the invocant, then all element/weight [`Pair`](/type/Pair)s from the invocant are returned in a random sequence.

What makes `grabpairs` different from [pickpairs](#method_pickpairs) is that the 'grabbed' elements are in fact removed from the invocant.

```raku
my $breakfast = (eggs => 2, bacon => 3).BagHash;
say $breakfast.grabpairs;                         # OUTPUT: «bacon => 3␤»
say $breakfast;                                   # OUTPUT: «BagHash.new(eggs(2))␤»
say $breakfast.grabpairs(1);                      # OUTPUT: «(eggs => 2)␤»
say $breakfast.grabpairs(*);                      # OUTPUT: «()␤»

my $diet = ('eggs' => 2, 'bacon' => 3).Bag;
say $diet.grabpairs;
CATCH { default { put .^name, ': ', .Str } };
# OUTPUT: «X::Immutable: Cannot call 'grabpairs' on an immutable 'Bag'␤»
```

## [method pick](#role_Baggy "go to top of document")[§](#method_pick "direct link")

```raku
multi method pick(Baggy:D: --> Any)
multi method pick(Baggy:D: $count --> Seq:D)
```

Like an ordinary list [pick](/type/List#routine_pick), but returns keys of the invocant weighted by their values, as if the keys were replicated the number of times indicated by the corresponding value and then list pick used. The underlying metaphor for picking is that you're pulling colored marbles out a bag. (For "picking with replacement" see [roll](#method_roll) instead). If `*` is passed as `$count`, or `$count` is greater than or equal to the [total](#method_total) of the invocant, then `total` elements from the invocant are returned in a random sequence.

Note that each `pick` invocation maintains its own private state and has no effect on subsequent `pick` invocations.

```raku
my $breakfast = bag <eggs bacon bacon bacon>;
say $breakfast.pick;                              # OUTPUT: «eggs␤»
say $breakfast.pick(2);                           # OUTPUT: «(eggs bacon)␤»

say $breakfast.total;                             # OUTPUT: «4␤»
say $breakfast.pick(*);                           # OUTPUT: «(bacon bacon bacon eggs)␤»
```

## [method pickpairs](#role_Baggy "go to top of document")[§](#method_pickpairs "direct link")

```raku
multi method pickpairs(Baggy:D: --> Pair:D)
multi method pickpairs(Baggy:D: $count --> Seq:D)
```

Returns a [`Pair`](/type/Pair) or a [`Seq`](/type/Seq) of [`Pair`](/type/Pair)s depending on the version of the method being invoked. Each [`Pair`](/type/Pair) returned has an element of the invocant as its key and the element's weight as its value. The elements are 'picked' without replacement. If `*` is passed as `$count`, or `$count` is greater than or equal to the number of [elements](#method_elems) of the invocant, then all element/weight [`Pair`](/type/Pair)s from the invocant are returned in a random sequence.

Note that each `pickpairs` invocation maintains its own private state and has no effect on subsequent `pickpairs` invocations.

```raku
my $breakfast = bag <eggs bacon bacon bacon>;
say $breakfast.pickpairs;                         # OUTPUT: «eggs => 1␤»
say $breakfast.pickpairs(1);                      # OUTPUT: «(bacon => 3)␤»
say $breakfast.pickpairs(*);                      # OUTPUT: «(eggs => 1 bacon => 3)␤»
```

## [method roll](#role_Baggy "go to top of document")[§](#method_roll "direct link")

```raku
multi method roll(Baggy:D: --> Any:D)
multi method roll(Baggy:D: $count --> Seq:D)
```

Like an ordinary list [roll](/type/List#routine_roll), but returns keys of the invocant weighted by their values, as if the keys were replicated the number of times indicated by the corresponding value and then list roll used. The underlying metaphor for rolling is that you're throwing `$count` dice that are independent of each other, which (in bag terms) is equivalent to picking a colored marble out your bag and then putting it back, and doing this `$count` times. In dice terms, the number of marbles corresponds to the number of sides, and the number of marbles of the same color corresponds to the number of sides with the same color. (For "picking without replacement" see [pick](#method_pick) instead).

If `*` is passed to `$count`, returns a lazy, infinite sequence of randomly chosen elements from the invocant.

```raku
my $breakfast = bag <eggs bacon bacon bacon>;
say $breakfast.roll;                                  # OUTPUT: «bacon␤»
say $breakfast.roll(3);                               # OUTPUT: «(bacon eggs bacon)␤»

my $random_dishes := $breakfast.roll(*);
say $random_dishes[^5];                               # OUTPUT: «(bacon eggs bacon bacon bacon)␤»
```

## [method pairs](#role_Baggy "go to top of document")[§](#method_pairs "direct link")

```raku
method pairs(Baggy:D: --> Seq:D)
```

Returns all elements and their respective weights as a [`Seq`](/type/Seq) of [`Pair`](/type/Pair)s where the key is the element itself and the value is the weight of that element.

```raku
my $breakfast = bag <bacon eggs bacon>;
my $seq = $breakfast.pairs;
say $seq.sort;                                    # OUTPUT: «(bacon => 2 eggs => 1)␤»
```

## [method antipairs](#role_Baggy "go to top of document")[§](#method_antipairs "direct link")

```raku
method antipairs(Baggy:D: --> Seq:D)
```

Returns all elements and their respective weights as a [`Seq`](/type/Seq) of [`Pair`](/type/Pair)s, where the element itself is the value and the weight of that element is the key, i.e. the opposite of method [pairs](#method_pairs).

```raku
my $breakfast = bag <bacon eggs bacon>;
my $seq = $breakfast.antipairs;
say $seq.sort;                                    # OUTPUT: «(1 => eggs 2 => bacon)␤»
```

## [method invert](#role_Baggy "go to top of document")[§](#method_invert "direct link")

```raku
method invert(Baggy:D: --> Seq:D)
```

Returns all elements and their respective weights as a [`Seq`](/type/Seq) of [`Pair`](/type/Pair)s, where the element itself is the value and the weight of that element is the key, i.e. the opposite of method [pairs](#method_pairs). Except for some esoteric cases, `invert` on a Baggy type returns the same result as [antipairs](#method_antipairs).

```raku
my $breakfast = bag <bacon eggs bacon>;
my $seq = $breakfast.invert;
say $seq.sort;                                    # OUTPUT: «(1 => eggs 2 => bacon)␤»
```

## [method classify-list](#role_Baggy "go to top of document")[§](#method_classify-list "direct link")

```raku
multi method classify-list(&mapper, *@list --> Baggy:D)
multi method classify-list(%mapper, *@list --> Baggy:D)
multi method classify-list(@mapper, *@list --> Baggy:D)
```

Populates a *mutable* `Baggy` by classifying the possibly-empty `@list` of values using the given `mapper`. The `@list` cannot be lazy.

```raku
say BagHash.new.classify-list: { $_ %% 2 ?? 'even' !! 'odd' }, ^10;
# OUTPUT: BagHash(even(5) odd(5))

my @mapper = <zero one two three four five>;
say MixHash.new.classify-list: @mapper, 1, 2, 3, 4, 4, 6;
# OUTPUT: MixHash((Any) two three four(2) one)
```

The mapper can be a [`Callable`](/type/Callable) that takes a single argument, an [`Associative`](/type/Associative), or an [`Iterable`](/type/Iterable). With [`Associative`](/type/Associative) and an [`Iterable`](/type/Iterable) mappers, the values in the `@list` represent the key and index of the mapper's value respectively. A [`Callable`](/type/Callable) mapper will be executed once per each item in the `@list`, with that item as the argument and its return value will be used as the mapper's value.

The mapper's value is used as the key of the `Baggy` that will be incremented by `1`. See [`.categorize-list`](/routine/categorize-list) if you wish to classify an item into multiple categories at once.

**Note:** unlike the [`Hash`](/type/Hash)'s `.classify-list`, returning an [`Iterable`](/type/Iterable) mapper's value will throw, as `Baggy` types do not support nested classification. For the same reason, `Baggy`'s `.classify-list` does not accept `:&as` parameter.

## [method categorize-list](#role_Baggy "go to top of document")[§](#method_categorize-list "direct link")

```raku
multi method categorize-list(&mapper, *@list --> Baggy:D)
multi method categorize-list(%mapper, *@list --> Baggy:D)
multi method categorize-list(@mapper, *@list --> Baggy:D)
```

Populates a *mutable* `Baggy` by categorizing the possibly-empty `@list` of values using the given `mapper`. The `@list` cannot be lazy.

```raku
say BagHash.new.categorize-list: {
    gather {
        take 'largish' if $_ > 5;
        take .is-prime ?? 'prime' !! 'non-prime';
        take $_ %% 2   ?? 'even'  !! 'odd';
    }
}, ^10;
# OUTPUT: BagHash(largish(4) even(5) non-prime(6) prime(4) odd(5))

my %mapper = :sugar<sweet white>, :lemon<sour>, :cake('sweet', 'is-a-lie');
say MixHash.new.categorize-list: %mapper, <sugar lemon cake>;
# OUTPUT: MixHash(is-a-lie sour white sweet(2))
```

The mapper can be a [`Callable`](/type/Callable) that takes a single argument, an [`Associative`](/type/Associative), or an [`Iterable`](/type/Iterable). With [`Associative`](/type/Associative) and an [`Iterable`](/type/Iterable) mappers, the values in the `@list` represent the key and index of the mapper's value respectively. A [`Callable`](/type/Callable) mapper will be executed once per each item in the `@list`, with that item as the argument and its return value will be used as the mapper's value.

The mapper's value is used as a possibly-empty list of keys of the `Baggy` that will be incremented by `1`.

**Note:** unlike the [`Hash`](/type/Hash)'s `.categorize-list`, returning a list of [`Iterables`](/type/Iterable) as mapper's value will throw, as `Baggy` types do not support nested categorization. For the same reason, `Baggy`'s `.categorize-list` does not accept `:&as` parameter.

## [method keys](#role_Baggy "go to top of document")[§](#method_keys "direct link")

```raku
method keys(Baggy:D: --> Seq:D)
```

Returns a [`Seq`](/type/Seq) of all keys in the `Baggy` object without taking their individual weights into account as opposed to [kxxv](#method_kxxv).

```raku
my $breakfast = bag <eggs spam spam spam>;
say $breakfast.keys.sort;                        # OUTPUT: «(eggs spam)␤»

my $n = ("a" => 5, "b" => 2).BagHash;
say $n.keys.sort;                                # OUTPUT: «(a b)␤»
```

## [method values](#role_Baggy "go to top of document")[§](#method_values "direct link")

```raku
method values(Baggy:D: --> Seq:D)
```

Returns a [`Seq`](/type/Seq) of all values, i.e. weights, in the `Baggy` object.

```raku
my $breakfast = bag <eggs spam spam spam>;
say $breakfast.values.sort;                      # OUTPUT: «(1 3)␤»

my $n = ("a" => 5, "b" => 2, "a" => 1).BagHash;
say $n.values.sort;                              # OUTPUT: «(2 6)␤»
```

## [method kv](#role_Baggy "go to top of document")[§](#method_kv "direct link")

```raku
method kv(Baggy:D: --> Seq:D)
```

Returns a [`Seq`](/type/Seq) of keys and values interleaved.

```raku
my $breakfast = bag <eggs spam spam spam>;
say $breakfast.kv;                                # OUTPUT: «(spam 3 eggs 1)␤»

my $n = ("a" => 5, "b" => 2, "a" => 1).BagHash;
say $n.kv;                                        # OUTPUT: «(a 6 b 2)␤»
```

## [method kxxv](#role_Baggy "go to top of document")[§](#method_kxxv "direct link")

```raku
method kxxv(Baggy:D: --> Seq:D)
```

Returns a [`Seq`](/type/Seq) of the keys of the invocant, with each key multiplied by its weight. Note that `kxxv` only works for `Baggy` types which have integer weights, i.e. [`Bag`](/type/Bag) and [`BagHash`](/type/BagHash).

```raku
my $breakfast = bag <spam eggs spam spam bacon>;
say $breakfast.kxxv.sort;                         # OUTPUT: «(bacon eggs spam spam spam)␤»

my $n = ("a" => 0, "b" => 1, "b" => 2).BagHash;
say $n.kxxv;                                      # OUTPUT: «(b b b)␤»
```

## [method elems](#role_Baggy "go to top of document")[§](#method_elems "direct link")

```raku
method elems(Baggy:D: --> Int:D)
```

Returns the number of elements in the `Baggy` object without taking the individual elements' weight into account.

```raku
my $breakfast = bag <eggs spam spam spam>;
say $breakfast.elems;                             # OUTPUT: «2␤»

my $n = ("b" => 9.4, "b" => 2).MixHash;
say $n.elems;                                     # OUTPUT: «1␤»
```

## [method total](#role_Baggy "go to top of document")[§](#method_total "direct link")

```raku
method total(Baggy:D:)
```

Returns the sum of weights for all elements in the `Baggy` object.

```raku
my $breakfast = bag <eggs spam spam bacon>;
say $breakfast.total;                             # OUTPUT: «4␤»

my $n = ("a" => 5, "b" => 1, "b" => 2).BagHash;
say $n.total;                                     # OUTPUT: «8␤»
```

## [method default](#role_Baggy "go to top of document")[§](#method_default "direct link")

```raku
method default(Baggy:D: --> 0)
```

Returns zero.

```raku
my $breakfast = bag <eggs bacon>;
say $breakfast.default;                           # OUTPUT: «0␤»
```

## [method hash](#role_Baggy "go to top of document")[§](#method_hash "direct link")

```raku
method hash(Baggy:D: --> Hash:D)
```

Returns a [`Hash`](/type/Hash) where the elements of the invocant are the keys and their respective weights the values.

```raku
my $breakfast = bag <eggs bacon bacon>;
my $h = $breakfast.hash;
say $h.^name;                    # OUTPUT: «Hash[Any,Any]␤»
say $h;                          # OUTPUT: «{bacon => 2, eggs => 1}␤»
```

## [method Bool](#role_Baggy "go to top of document")[§](#method_Bool "direct link")

```raku
method Bool(Baggy:D: --> Bool:D)
```

Returns `True` if the invocant contains at least one element.

```raku
my $breakfast = ('eggs' => 1).BagHash;
say $breakfast.Bool;                              # OUTPUT: «True␤»
                                                  # (since we have one element)
$breakfast<eggs> = 0;                             # weight == 0 will lead to element removal
say $breakfast.Bool;                              # OUTPUT: «False␤»
```

## [method Set](#role_Baggy "go to top of document")[§](#method_Set "direct link")

```raku
method Set(--> Set:D)
```

Returns a [`Set`](/type/Set) whose elements are the [keys](#method_keys) of the invocant.

```raku
my $breakfast = (eggs => 2, bacon => 3).BagHash;
say $breakfast.Set;                               # OUTPUT: «Set(bacon eggs)␤»
```

## [method SetHash](#role_Baggy "go to top of document")[§](#method_SetHash "direct link")

```raku
method SetHash(--> SetHash:D)
```

Returns a [`SetHash`](/type/SetHash) whose elements are the [keys](#method_keys) of the invocant.

```raku
my $breakfast = (eggs => 2, bacon => 3).BagHash;
my $sh = $breakfast.SetHash;
say $sh.^name;                            # OUTPUT: «SetHash␤»
say $sh.elems;                            # OUTPUT: «2␤»
```

## [method ACCEPTS](#role_Baggy "go to top of document")[§](#method_ACCEPTS "direct link")

```raku
method ACCEPTS($other --> Bool:D)
```

Used in smartmatching if the right-hand side is a `Baggy`.

If the right-hand side is the type object, i.e. `Baggy`, the method returns `True` if `$other` [does](/type/Mu#routine_does) `Baggy` otherwise `False` is returned.

If the right-hand side is a `Baggy` object, `True` is returned only if `$other` has the same elements, with the same weights, as the invocant.

```raku
my $breakfast = bag <eggs bacon>;
say $breakfast ~~ Baggy;                            # OUTPUT: «True␤»
say $breakfast.does(Baggy);                         # OUTPUT: «True␤»

my $second-breakfast = (eggs => 1, bacon => 1).Mix;
say $breakfast ~~ $second-breakfast;                # OUTPUT: «True␤»

my $third-breakfast = (eggs => 1, bacon => 2).Bag;
say $second-breakfast ~~ $third-breakfast;          # OUTPUT: «False␤»
```

# [See Also](#role_Baggy "go to top of document")[§](#See_Also "direct link")

[Sets, Bags, and Mixes](/language/setbagmix)

# [Typegraph](# "go to top of document")[§](#typegraphrelations "direct link")

Type relations for `Baggy`

raku-type-graph

Baggy
Baggy

QuantHash
QuantHash

Baggy->QuantHash

Associative
Associative

QuantHash->Associative

Mu
Mu

Any
Any

Any->Mu

Bag
Bag

Bag->Baggy

Bag->Any

BagHash
BagHash

BagHash->Baggy

BagHash->Any

Mixy
Mixy

Mixy->Baggy

Mix
Mix

Mix->Any

Mix->Mixy

MixHash
MixHash

MixHash->Any

MixHash->Mixy

[Expand chart above](/assets/typegraphs/Baggy.svg)


## dist_zef-masukomi-UUID-V4.md
# NAME

UUID::V4 - generates a random v4 UUID (Universally Unique IDentifier)

## SYNOPSIS

```
use UUID::V4;

# generate a uuid
my $uuid = uuid-v4(); # 62353163-3235-4165-b337-316436626539

# validate a string against uuid-v4 regexp
my $confirmation = is-uuid-v4($uuid); # True

```

## DESCRIPTION

UUID::V4 generates a random v4 UUID (Universally Unique IDentifier). See [the RFC 4122 specification](https://www.ietf.org/rfc/rfc4122.txt) for details.

## AUTHOR

masukomi (a.k.a Kay Rhodes) based on Nobuyoshi Nakada's work in Ruby.

## COPYRIGHT AND LICENSE

Copyright 2022

This library is free software; you can redistribute it and/or modify it under the MIT license.

## WHY

Unfortunately [LibUUID](https://github.com/CurtTilmes/perl6-libuuid) requires the `uuid` dynamic library which didn't exist on my mac. This library uses [Crypt::Random](https://github.com/skinkade/crypt-random) which doesn't suffer from that problem and should work on all Unix / Linux systems and Windows.

### sub uuid-v4

```
sub uuid-v4() returns Str

```

Generate a UUID in V4 format.

### sub is-uuid-v4

```
sub is-uuid-v4(
    Str $maybe_uuid
) returns Bool

```

Test if a string matches the UUID v4 format.


## dist_github-MadcapJake-App-P6Dx.md
> Bring your Perl 6 workflow to the next level!

[![](https://raw.githubusercontent.com/MadcapJake/p6dx/master/workout-camelia.png)](http://github.com/madcapjake/p6dx)

[![Coverage Status](https://img.shields.io/coveralls/MadcapJake/p6dx.svg)](https://coveralls.io/r/MadcapJake/p6dx)[![Build Status](https://img.shields.io/travis/MadcapJake/p6dx.svg)](https://travis-ci.org/MadcapJake/p6dx)[![Issues](https://img.shields.io/github/issues/MadcapJake/p6dx.svg)](https://github.com/MadcapJake/p6dx/issues)[![License](https://img.shields.io/github/license/MadcapJake/p6dx.svg)](https://github.com/MadcapJake/p6dx/blob/master/LICENSE)[![Slack](http://perl6.bestforever.com/badge.svg)](http://perl6.bestforever.com)

**[About](#about)**
|
**[Usage](#usage)**
|
**[Documentation](/docs/README.md)**
|
**[Rules](https://github.com/MadcapJake/p6dx/wiki#rules)**
|
**[Contributing](#contributing)**

## About

*P6Dx* provides a platform for leveraging language workflow tools in any text editor. The included `p6dx` bin script provides several flags with easy access to:

* Code completions (per file, per package, even required packages)
* Syntax checking (cascading rule declarations)
* And more? (Code coverage? ctags? let me know!)

## Usage

### Install

```
panda install p6dx

```

```
zef install p6dx

```

### Config

Mostly TBD. You will be able to specify syntax rules in either a user's home folder, the project's base path, a manually supplied file, or via a special comment syntax.

### Command Line

```
p6dx # displays help
p6dx --complete="$part_of_string" --file=$file_or_dir # completions
p6dx --tags --json # prints json format of all tags
p6dx --tags --ctag # prints ctag representation
p6dx --examine=$file_or_dir # syntax check [NOT YET IMPLEMENTED]

```

### Editors

Currently no editors are using P6Dx, however after I've finalized some of the data design, I plan to integrate this into `linter-perl6` for Atom Editor and then I'll try my hand at writing a Gedit plugin.

# Contributing

I'm gonna try and keep some high-level issues for each feature. Right now, I mostly need help hashing out conventions and solving bugs in my really early code. Feel free to submit PRs too though!

# Ideas

* code coverage
* ctags generation
* code formatter

# Acknowledgements

* [Camelia](https://github.com/perl6/mu/blob/master/misc/camelia.txt)
* [Kettlebell by TMD from the Noun Project](https://thenounproject.com/term/kettlebell/253682)


## dist_zef-lizmat-Hash-LRU.md
[![Actions Status](https://github.com/lizmat/Hash-LRU/actions/workflows/linux.yml/badge.svg)](https://github.com/lizmat/Hash-LRU/actions) [![Actions Status](https://github.com/lizmat/Hash-LRU/actions/workflows/macos.yml/badge.svg)](https://github.com/lizmat/Hash-LRU/actions) [![Actions Status](https://github.com/lizmat/Hash-LRU/actions/workflows/windows.yml/badge.svg)](https://github.com/lizmat/Hash-LRU/actions)

# NAME

Hash::LRU - trait for limiting number of keys in hashes by usage

# SYNOPSIS

```
use Hash::LRU;  # Least Recently Used

my %h is LRU;   # defaults to elements => 100

my %h is LRU(elements => 42);  # note: value must be known at compile time!

my %h{Any} is LRU;  # object hashes also supported

```

# DESCRIPTION

Hash::LRU provides a `is LRU` trait on `Hash`es as an easy way to limit the number of keys kept in the `Hash`. Keys will be added as long as the number of keys is under the limit. As soon as a new key is added that would exceed the limit, the least recently used key is removed from the `Hash`.

Both "normal" as well as object hashes are supported.

# EXAMPLE

```
use Hash::LRU;

my %h is LRU(elements => 3);

%h<name>       = "Alex";
%h<language>   = "Raku";
%h<occupation> = "devops";
%h<location>   = "Russia";

say %h.raku;
# {:location("Russia"), :occupation("devops"), :language("Raku")}

```

# COMPATIBILITY

## Cache::LRU

```
#my $cache = Cache::LRU.new(size => 3);
my $cache = my % is LRU(elements  => 3);

```

If your code depended on the now obsolete `Cache::LRU` module, you can use this module instead provided the cache size is known at compile time.

In that case, the above statement change is enough to keep your code working using a maintained module.

# AUTHOR

Elizabeth Mattijsen [liz@raku.rocks](mailto:liz@raku.rocks)

Source can be located at: <https://github.com/lizmat/Hash-LRU> . Comments and Pull Requests are welcome.

If you like this module, or what I’m doing more generally, committing to a [small sponsorship](https://github.com/sponsors/lizmat/) would mean a great deal to me!

# COPYRIGHT AND LICENSE

Copyright 2018, 2020, 2021, 2024 Elizabeth Mattijsen

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.


## dist_zef-FRITH-Math-Libgsl-Function.md
## Chunk 1 of 3
[![Actions Status](https://github.com/frithnanth/raku-Math-Libgsl-Function/workflows/test/badge.svg)](https://github.com/frithnanth/raku-Math-Libgsl-Function/actions)

# NAME

Math::Libgsl::Function - An interface to libgsl, the Gnu Scientific Library - Special functions.

# SYNOPSIS

```
use Math::Libgsl::Raw::Function :ALL;

use Math::Libgsl::Function :ALL;

```

# DESCRIPTION

Math::Libgsl::Function provides an interface to special function evaluation in libgsl, the GNU Scientific Library.

Math::Libgsl::Function makes these tags available:

* :airy
* :bessel
* :coulomb
* :coupling
* :dawson
* :debye
* :dilog
* :mult
* :ellint
* :ellfun
* :err
* :exp
* :fermidirac
* :gammabeta
* :gegen
* :hermite
* :hyperg
* :laguerre
* :lambert
* :legendre
* :log
* :mathieu
* :pow
* :psi
* :sync
* :transport
* :trig
* :zeta

Throughout this module the subs whose name ends with "-e" return a List of two values: the result and its associated error.

### sub Ai(Num(Cool) $x, UInt $mode --> Num) is export(:airy)

### sub Ai-e(Num(Cool) $x, UInt $mode --> List) is export(:airy)

These routines compute the Airy function Ai(x) with an accuracy specified by mode.

### sub Bi(Num(Cool) $x, UInt $mode --> Num) is export(:airy)

### sub Bi-e(Num(Cool) $x, UInt $mode --> List) is export(:airy)

These routines compute the Airy function Bi(x) with an accuracy specified by mode.

### sub Ai-scaled(Num(Cool) $x, UInt $mode --> Num) is export(:airy)

### sub Ai-scaled-e(Num(Cool) $x, UInt $mode --> List) is export(:airy)

These routines compute the scaled value of the Airy function Ai(x) with an accuracy specified by mode.

### sub Bi-scaled(Num(Cool) $x, UInt $mode --> Num) is export(:airy)

### sub Bi-scaled-e(Num(Cool) $x, UInt $mode --> List) is export(:airy)

These routines compute the scaled value of the Airy function Bi(x) with an accuracy specified by mode.

### sub Ai-deriv(Num(Cool) $x, UInt $mode --> Num) is export(:airy)

### sub Ai-deriv-e(Num(Cool) $x, UInt $mode --> List) is export(:airy)

These routines compute the scaled value of the Airy function derivative A'i(x) with an accuracy specified by mode.

### sub Bi-deriv(Num(Cool) $x, UInt $mode --> Num) is export(:airy)

### sub Bi-deriv-e(Num(Cool) $x, UInt $mode --> List) is export(:airy)

These routines compute the scaled value of the Airy function derivative B'i(x) with an accuracy specified by mode.

### sub Ai-deriv-scaled(Num(Cool) $x, UInt $mode --> Num) is export(:airy)

### sub Ai-deriv-scaled-e(Num(Cool) $x, UInt $mode --> List) is export(:airy)

These routines compute the scaled value of the Airy function derivative A'i(x) with an accuracy specified by mode.

### sub Bi-deriv-scaled(Num(Cool) $x, UInt $mode --> Num) is export(:airy)

### sub Bi-deriv-scaled-e(Num(Cool) $x, UInt $mode --> List) is export(:airy)

These routines compute the scaled value of the Airy function derivative B'i(x) with an accuracy specified by mode.

### sub Ai-zero(UInt $s --> Num) is export(:airy)

### sub Ai-zero-e(UInt $s --> List) is export(:airy)

These routines compute the location of the s-th zero of the Airy function Ai(x).

### sub Bi-zero(UInt $s --> Num) is export(:airy)

### sub Bi-zero-e(UInt $s --> List) is export(:airy)

These routines compute the location of the s-th zero of the Airy function Bi(x).

### sub Ai-deriv-zero(UInt $s --> Num) is export(:airy)

### sub Ai-deriv-zero-e(UInt $s --> List) is export(:airy)

These routines compute the location of the s-th zero of the Airy function derivative A'i(x).

### sub Bi-deriv-zero(UInt $s --> Num) is export(:airy)

### sub Bi-deriv-zero-e(UInt $s --> List) is export(:airy)

These routines compute the location of the s-th zero of the Airy function derivative B'i(x).

### sub J0(Num(Cool) $x --> Num) is export(:bessel)

### sub J0-e(Num(Cool) $x --> List) is export(:bessel)

These routines compute the regular cylindrical Bessel function of zeroth order, J₀(x).

### sub J1(Num(Cool) $x --> Num) is export(:bessel)

### sub J1-e(Num(Cool) $x --> List) is export(:bessel)

These routines compute the regular cylindrical Bessel function of first order, J₁(x).

### sub Jn(Int $n, Num(Cool) $x --> Num) is export(:bessel)

### sub Jn-e(Int $n, Num(Cool) $x --> List) is export(:bessel)

These routines compute the regular cylindrical Bessel function of order n, Jₙ(x).

### sub Jn-array(Int $nmin, Int $nmax where $nmin < $nmax, Num(Cool) $x --> List) is export(:bessel)

This routine computes the values of the regular cylindrical Bessel functions Jₙ(x) for n from nmin to nmax inclusive.

### sub Y0(Num(Cool) $x where \* > 0 --> Num) is export(:bessel)

### sub Y0-e(Num(Cool) $x where \* > 0 --> List) is export(:bessel)

These routines compute the irregular cylindrical Bessel function of zeroth order, Y₀(x).

### sub Y1(Num(Cool) $x where \* > 0 --> Num) is export(:bessel)

### sub Y1-e(Num(Cool) $x where \* > 0 --> List) is export(:bessel)

These routines compute the irregular cylindrical Bessel function of first order, Y₁(x).

### sub Yn(Int $n, Num(Cool) $x where \* > 0 --> Num) is export(:bessel)

### sub Yn-e(Int $n, Num(Cool) $x where \* > 0 --> List) is export(:bessel)

These routines compute the irregular cylindrical Bessel function of order n, Yₙ(x).

### sub Yn-array(Int $nmin, Int $nmax where $nmin < $nmax, Num(Cool) $x --> List) is export(:bessel)

This routine computes the values of the irregular cylindrical Bessel functions Yₙ(x) for n from nmin to nmax inclusive.

### sub I0(Num(Cool) $x --> Num) is export(:bessel)

### sub I0-e(Num(Cool) $x --> List) is export(:bessel)

These routines compute the regular modified cylindrical Bessel function of zeroth order, I₀(x).

### sub I1(Num(Cool) $x --> Num) is export(:bessel)

### sub I1-e(Num(Cool) $x --> List) is export(:bessel)

These routines compute the regular modified cylindrical Bessel function of first order, I₁(x).

### sub In(Int $n, Num(Cool) $x --> Num) is export(:bessel)

### sub In-e(Int $n, Num(Cool) $x --> List) is export(:bessel)

These routines compute the regular modified cylindrical Bessel function of order n, Iₙ(x).

### sub In-array(UInt $nmin, UInt $nmax where $nmin < $nmax, Num(Cool) $x --> List) is export(:bessel)

This routine computes the values of the regular modified cylindrical Bessel functions Iₙ(x) for n from nmin to nmax inclusive.

### sub I0-scaled(Num(Cool) $x --> Num) is export(:bessel)

### sub I0-scaled-e(Num(Cool) $x --> List) is export(:bessel)

These routines compute the scaled regular modified cylindrical Bessel function of zeroth order exp(−|x|)I₀(x).

### sub I1-scaled(Num(Cool) $x --> Num) is export(:bessel)

### sub I1-scaled-e(Num(Cool) $x --> List) is export(:bessel)

These routines compute the scaled regular modified cylindrical Bessel function of first order exp(−|x|)I₁(x).

### sub In-scaled(Int $n, Num(Cool) $x --> Num) is export(:bessel)

### sub In-scaled-e(Int $n, Num(Cool) $x --> List) is export(:bessel)

These routines compute the scaled regular modified cylindrical Bessel function of order n exp(−|x|)Iₙ(x).

### sub In-scaled-array(UInt $nmin, UInt $nmax where $nmin < $nmax, Num(Cool) $x --> List) is export(:bessel)

This routine computes the values of the scaled regular cylindrical Bessel functions exp(−|x|)Iₙ(x) for n from nmin to nmax inclusive.

### sub K0(Num(Cool) $x where \* > 0 --> Num) is export(:bessel)

### sub K0-e(Num(Cool) $x where \* > 0 --> List) is export(:bessel)

These routines compute the irregular modified cylindrical Bessel function of zeroth order, K₀(x).

### sub K1(Num(Cool) $x where \* > 0 --> Num) is export(:bessel)

### sub K1-e(Num(Cool) $x where \* > 0 --> List) is export(:bessel)

These routines compute the irregular modified cylindrical Bessel function of first order, K₁(x).

### sub Kn(Int $n, Num(Cool) $x where \* > 0 --> Num) is export(:bessel)

### sub Kn-e(Int $n, Num(Cool) $x where \* > 0 --> List) is export(:bessel)

These routines compute the irregular modified cylindrical Bessel function of order n, Kₙ(x).

### sub Kn-array(UInt $nmin, UInt $nmax where $nmin < $nmax, Num(Cool) $x where \* > 0 --> List) is export(:bessel)

This routine computes the values of the irregular modified cylindrical Bessel functions K n (x) for n from nmin to nmax inclusive.

### sub K0-scaled(Num(Cool) $x where \* > 0 --> Num) is export(:bessel)

### sub K0-scaled-e(Num(Cool) $x where \* > 0 --> List) is export(:bessel)

These routines compute the scaled irregular modified cylindrical Bessel function of zeroth order exp(x)K₀(x).

### sub K1-scaled(Num(Cool) $x where \* > 0 --> Num) is export(:bessel)

### sub K1-scaled-e(Num(Cool) $x where \* > 0 --> List) is export(:bessel)

These routines compute the scaled irregular modified cylindrical Bessel function of first order exp(x)K₁(x).

### sub Kn-scaled(Int $n, Num(Cool) $x where \* > 0 --> Num) is export(:bessel)

### sub Kn-scaled-e(Int $n, Num(Cool) $x where \* > 0 --> List) is export(:bessel)

These routines compute the scaled irregular modified cylindrical Bessel function of order n exp(x)Kₙ(x).

### sub Kn-scaled-array(UInt $nmin, UInt $nmax where $nmin < $nmax, Num(Cool) $x where \* > 0 --> List) is export(:bessel)

This routine computes the values of the scaled irregular cylindrical Bessel functions exp(x)Kₙ(x) for n from nmin to nmax inclusive.

### sub j0(Num(Cool) $x --> Num) is export(:bessel)

### sub j0-e(Num(Cool) $x --> List) is export(:bessel)

These routines compute the regular spherical Bessel function of zeroth order, j₀(x).

### sub j1(Num(Cool) $x --> Num) is export(:bessel)

### sub j1-e(Num(Cool) $x --> List) is export(:bessel)

These routines compute the regular spherical Bessel function of first order, j₁(x).

### sub j2(Num(Cool) $x --> Num) is export(:bessel)

### sub j2-e(Num(Cool) $x --> List) is export(:bessel)

These routines compute the regular spherical Bessel function of second order, j₂(x).

### sub jl(UInt $l, Num(Cool) $x where \* ≥ 0 --> Num) is export(:bessel)

### sub jl-e(UInt $l, Num(Cool) $x where \* ≥ 0 --> List) is export(:bessel)

These routines compute the regular spherical Bessel function of order l, jₗ(x).

### sub jl-array(UInt $lmax, Num(Cool) $x where \* ≥ 0 --> List) is export(:bessel)

This routine computes the values of the regular spherical Bessel functions jₗ(x) for l from 0 to lmax inclusive.

### sub jl-steed-array(UInt $lmax, Num(Cool) $x where \* ≥ 0 --> List) is export(:bessel)

This routine uses Steed’s method to compute the values of the regular spherical Bessel functions jₗ(x) for l from 0 to lmax inclusive.

### sub y0(Num(Cool) $x --> Num) is export(:bessel)

### sub y0-e(Num(Cool) $x --> List) is export(:bessel)

These routines compute the irregular spherical Bessel function of zeroth order, y₀(x).

### sub y1(Num(Cool) $x --> Num) is export(:bessel)

### sub y1-e(Num(Cool) $x --> List) is export(:bessel)

These routines compute the irregular spherical Bessel function of first order, y₁(x).

### sub y2(Num(Cool) $x --> Num) is export(:bessel)

### sub y2-e(Num(Cool) $x --> List) is export(:bessel)

These routines compute the irregular spherical Bessel function of second order, y₂(x).

### sub yl(UInt $l, Num(Cool) $x --> Num) is export(:bessel)

### sub yl-e(UInt $l, Num(Cool) $x --> List) is export(:bessel)

These routines compute the irregular spherical Bessel function of order l, yₗ(x).

### sub yl-array(UInt $lmax, Num(Cool) $x --> List) is export(:bessel)

This routine computes the values of the irregular spherical Bessel functions yₗ(x) for l from 0 to lmax inclusive.

### sub i0-scaled(Num(Cool) $x --> Num) is export(:bessel)

### sub i0-scaled-e(Num(Cool) $x --> List) is export(:bessel)

These routines compute the scaled regular modified spherical Bessel function of zeroth order.

### sub i1-scaled(Num(Cool) $x --> Num) is export(:bessel)

### sub i1-scaled-e(Num(Cool) $x --> List) is export(:bessel)

These routines compute the scaled regular modified spherical Bessel function of first order.

### sub i2-scaled(Num(Cool) $x --> Num) is export(:bessel)

### sub i2-scaled-e(Num(Cool) $x --> List) is export(:bessel)

These routines compute the scaled regular modified spherical Bessel function of second order.

### sub il-scaled(UInt $l, Num(Cool) $x --> Num) is export(:bessel)

### sub il-scaled-e(UInt $l, Num(Cool) $x --> List) is export(:bessel)

These routines compute the scaled regular modified spherical Bessel function of order l.

### sub il-scaled-array(UInt $lmax, Num(Cool) $x --> List) is export(:bessel)

This routine computes the values of the scaled regular modified spherical Bessel functions for l from 0 to lmax inclusive.

### sub k0-scaled(Num(Cool) $x where \* > 0 --> Num) is export(:bessel)

### sub k0-scaled-e(Num(Cool) $x where \* > 0 --> List) is export(:bessel)

These routines compute the scaled irregular modified spherical Bessel function of zeroth order.

### sub k1-scaled(Num(Cool) $x where \* > 0 --> Num) is export(:bessel)

### sub k1-scaled-e(Num(Cool) $x where \* > 0 --> List) is export(:bessel)

These routines compute the scaled irregular modified spherical Bessel function of first order.

### sub k2-scaled(Num(Cool) $x where \* > 0 --> Num) is export(:bessel)

### sub k2-scaled-e(Num(Cool) $x where \* > 0 --> List) is export(:bessel)

These routines compute the scaled irregular modified spherical Bessel function of second order.

### sub kl-scaled(UInt $l, Num(Cool) $x where \* > 0 --> Num) is export(:bessel)

### sub kl-scaled-e(UInt $l, Num(Cool) $x where \* > 0 --> List) is export(:bessel)

These routines compute the scaled irregular modified spherical Bessel function of order l.

### sub kl-scaled-array(UInt $lmax, Num(Cool) $x where \* > 0 --> List) is export(:bessel)

This routine computes the values of the scaled irregular modified spherical Bessel functions for l from 0 to lmax inclusive.

### sub Jnu(Num(Cool) $ν, Num(Cool) $x --> Num) is export(:bessel)

### sub Jnu-e(Num(Cool) $ν, Num(Cool) $x --> List) is export(:bessel)

These routines compute the regular cylindrical Bessel function of fractional order ν, Jν(x).

### sub Jnu-sequence(Num(Cool) $ν, UInt $mode, Positional $x --> List) is export(:bessel)

This function computes the regular cylindrical Bessel function of fractional order ν, Jν(x), with an accuracy specified by $mode, evaluated at a series of x values.

### sub Ynu(Num(Cool) $ν, Num(Cool) $x --> Num) is export(:bessel)

### sub Ynu-e(Num(Cool) $ν, Num(Cool) $x --> List) is export(:bessel)

These routines compute the irregular cylindrical Bessel function of fractional order ν, Yν(x).

### sub Inu(Num(Cool) $ν where \* > 0, Num(Cool) $x where \* > 0--> Num) is export(:bessel)

### sub Inu-e(Num(Cool) $ν where \* > 0, Num(Cool) $x where \* > 0 --> List) is export(:bessel)

These routines compute the regular modified Bessel function of fractional order ν, Iν(x).

### sub Inu-scaled(Num(Cool) $ν where \* > 0, Num(Cool) $x where \* > 0 --> Num) is export(:bessel)

### sub Inu-scaled-e(Num(Cool) $ν where \* > 0, Num(Cool) $x where \* > 0 --> List) is export(:bessel)

These routines compute the scaled regular modified Bessel function of fractional order ν.

### sub Knu(Num(Cool) $ν where \* > 0, Num(Cool) $x where \* > 0 --> Num) is export(:bessel)

### sub Knu-e(Num(Cool) $ν where \* > 0, Num(Cool) $x where \* > 0 --> List) is export(:bessel)

These routines compute the irregular modified Bessel function of fractional order ν, Kν(x).

### sub lnKnu(Num(Cool) $ν where \* > 0, Num(Cool) $x where \* > 0 --> Num) is export(:bessel)

### sub lnKnu-e(Num(Cool) $ν where \* > 0, Num(Cool) $x where \* > 0 --> List) is export(:bessel)

These routines compute the logarithm of the irregular modified Bessel function of fractional order ν, ln(Kν(x)).

### sub Knu-scaled(Num(Cool) $ν where \* > 0, Num(Cool) $x where \* > 0 --> Num) is export(:bessel)

### sub Knu-scaled-e(Num(Cool) $ν where \* > 0, Num(Cool) $x where \* > 0 --> List) is export(:bessel)

These routines compute the scaled irregular modified Bessel function of fractional order ν.

### sub J0-zero(UInt $s --> Num) is export(:bessel)

### sub J0-zero-e(UInt $s --> List) is export(:bessel)

These routines compute the location of the s-th positive zero of the Bessel function J₀(x).

### sub J1-zero(UInt $s --> Num) is export(:bessel)

### sub J1-zero-e(UInt $s --> List) is export(:bessel)

These routines compute the location of the s-th positive zero of the Bessel function J₁(x).

### sub Jnu-zero(Num(Cool) $ν where \* ≥ 0, UInt $s --> Num) is export(:bessel)

### sub Jnu-zero-e(Num(Cool) $ν where \* ≥ 0, UInt $s --> List) is export(:bessel)

These routines compute the location of the s-th positive zero of the Bessel function Jν(x).

### sub clausen(Num(Cool) $x --> Num) is export(:clausen)

### sub clausen-e(Num(Cool) $x --> List) is export(:clausen)

These routines compute the Clausen integral Cl₂(x).

### sub hydrogenic-R1(Num(Cool) $Z, Num(Cool) $r --> Num) is export(:coulomb)

### sub hydrogenic-R1-e(Num(Cool) $Z, Num(Cool) $r --> List) is export(:coulomb)

These √ routines compute the lowest-order normalized hydrogenic bound state radial wavefunction R₁.

### sub hydrogenic-R(Int $n, Int $l, Num(Cool) $Z, Num(Cool) $r --> Num) is export(:coulomb)

### sub hydrogenic-R-e(Int $n, Int $l, Num(Cool) $Z, Num(Cool) $r --> List) is export(:coulomb)

These routines compute the n-th normalized hydrogenic bound state radial wavefunction Rₙ.

### sub coulomb-wave-FG-e(Num(Cool) $eta, Num(Cool) $x where \* > 0, Num(Cool) $LF where \* > -½, Int $k --> List) is export(:coulomb)

This function computes the Coulomb wave functions Fₗ(η, x), Gₗ₋ₖ(η, x) and their derivatives Fₗ’(η, x), Gₗ₋ₖ’(η, x) with respect to x. It returns a List of Pairs (that can be read as a Hash):

* :Fval the Fₗ(η, x) value
* :Ferr the Fₗ(η, x) error
* :Fpval the Fₗ’(η, x) value
* :Fperr the Fₗ’(η, x) error
* :Gval the Gₗ₋ₖ(η, x) value
* :Gerr the Gₗ₋ₖ(η, x) error
* :Gpval the Gₗ₋ₖ’(η, x) value
* :Gperr the Gₗ₋ₖ’(η, x) error
* :overflow Bool: if an overflow occurred, this is True, otherwise False
* :expF if an overflow occurred, this is the scaling exponent for Fₗ(η, x)
* :expG if an overflow occurred, this is the scaling exponent for Gₗ₋ₖ(η, x)

```
my %res = coulomb-wave-FG-e(1, 5, 0, 0);
say %res<Fval>;
say %res<Fpval>;
say %res<Gval>;
say %res<Gpval>;

```

### sub coulomb-wave-F-array(Num(Cool) $lmin, UInt $kmax, Num(Cool) $eta, Num(Cool) $x where \* > 0 --> List) is export(:coulomb)

This function computes the Coulomb wave function Fₗ(η, x) for l = lmin … lmin + kmax. It returns a List of Pairs (that can be read as a Hash):

* :outF array of Fₗ(η, x) values
* :overflow Bool: if an overflow occurred, this is True, otherwise False
* :expF if an overflow occurred, this is the scaling exponent for Fₗ(η, x)

### sub coulomb-wave-FG-array(Num(Cool) $lmin, UInt $kmax, Num(Cool) $eta, Num(Cool) $x where \* > 0 --> List) is export(:coulomb)

This function computes the functions Fₗ(η, x), Gₗ(η, x) for l = lmin … lmin + kmax. It returns a List of Pairs (that can be read as a Hash):

* :outF array of Fₗ(η, x) values
* :outG array of Gₗ(η, x) values
* :overflow Bool: if an overflow occurred, this is True, otherwise False
* :expF if an overflow occurred, this is the scaling exponent for Fₗ(η, x)
* :expG if an overflow occurred, this is the scaling exponent for Gₗ₋ₖ(η, x)

### sub coulomb-wave-FGp-array(Num(Cool) $lmin, UInt $kmax, Num(Cool) $eta, Num(Cool) $x where \* > 0 --> List) is export(:coulomb)

This function computes the functions Fₗ(η, x), Gₗ(η, x) and their derivatives F’ₗ(η, x), G’ₗ(η, x) for l = lmin … lmin + kmax It returns a List of Pairs (that can be read as a Hash):

* :outF array of Fₗ(η, x) values
* :outG array of Gₗ(η, x) values
* :outFp array of Fₗ’(η, x) values
* :outGp array of Gₗ’(η, x) values
* :overflow Bool: if an overflow occurred, this is True, otherwise False
* :expF if an overflow occurred, this is the scaling exponent for Fₗ(η, x)
* :expG if an overflow occurred, this is the scaling exponent for Gₗ₋ₖ(η, x)

### sub coulomb-wave-sphF-array(Num(Cool) $lmin, UInt $kmax, Num(Cool) $eta, Num(Cool) $x where \* > 0 --> List) is export(:coulomb)

This function computes the Coulomb wave function divided by the argument Fₗ(η, x)/x for l = lmin… lmin + kmax It returns a List of Pairs (that can be read as a Hash):

* :outF array of Fₗ(η, x) values
* :overflow Bool: if an overflow occurred, this is True, otherwise False
* :expF if an overflow occurred, this is the scaling exponent for Fₗ(η, x)

### sub coulomb-CL-e(Num(Cool) $L where \* > -1, Num(Cool) $eta --> List) is export(:coulomb)

This function computes the Coulomb wave function normalization constant Cₗ(η).

### sub coulomb-CL-array(Num(Cool) $lmin where \* > -1, UInt $kmax, Num(Cool) $eta --> List) is export(:coulomb)

This function computes the Coulomb wave function normalization constant C L (η) for l = lmin … lmin + kmax.

### sub coupling3j(Int $two-ja, Int $two-jb, Int $two-jc, Int $two-ma, Int $two-mb, Int $two-mc --> Num) is export(:coupling)

### sub coupling3j-e(Int $two-ja, Int $two-jb, Int $two-jc, Int $two-ma, Int $two-mb, Int $two-mc --> List) is export(:coupling)

These routines compute the Wigner 3-j coefficient. The arguments are given in half-integer units: two\_ja/2, two\_ma/2, etc.

### sub coupling6j(Int $two-ja, Int $two-jb, Int $two-jc, Int $two-jd, Int $two-je, Int $two-jf --> Num) is export(:coupling)

### sub coupling6j-e(Int $two-ja, Int $two-jb, Int $two-jc, Int $two-jd, Int $two-je, Int $two-jf --> List) is export(:coupling)

These routines compute the Wigner 6-j coefficient. The arguments are given in half-integer units: two\_ja/2, two\_ma/2, etc.

### sub coupling9j(Int $two-ja, Int $two-jb, Int $two-jc, Int $two-jd, Int $two-je, Int $two-jf, Int $two-jg, Int $two-jh, Int $two-ji --> Num) is export(:coupling)

### sub coupling9j-e(Int $two-ja, Int $two-jb, Int $two-jc, Int $two-jd, Int $two-je, Int $two-jf, Int $two-jg, Int $two-jh, Int $two-ji --> List) is export(:coupling)

These routines compute the Wigner 9-j coefficient. The arguments are given in half-integer units: two\_ja/2, two\_ma/2, etc.

### sub dawson(Num(Cool) $x --> Num) is export(:dawson)

### sub dawson-e(Num(Cool) $x --> List) is export(:dawson)

These routines compute the value of Dawson’s integral for x.

### sub debye1(Num(Cool) $x --> Num) is export(:debye)

### sub debye1-e(Num(Cool) $x --> List) is export(:debye)

These routines compute the first-order Debye function D₁(x).

### sub debye2(Num(Cool) $x --> Num) is export(:debye)

### sub debye2-e(Num(Cool) $x --> List) is export(:debye)

These routines compute the first-order Debye function D₂(x).

### sub debye3(Num(Cool) $x --> Num) is export(:debye)

### sub debye3-e(Num(Cool) $x --> List) is export(:debye)

These routines compute the first-order Debye function D₃(x).

### sub debye4(Num(Cool) $x --> Num) is export(:debye)

### sub debye4-e(Num(Cool) $x --> List) is export(:debye)

These routines compute the first-order Debye function D₄(x).

### sub debye5(Num(Cool) $x --> Num) is export(:debye)

### sub debye5-e(Num(Cool) $x --> List) is export(:debye)

These routines compute the first-order Debye function D₅(x).

### sub debye6(Num(Cool) $x --> Num) is export(:debye)

### sub debye6-e(Num(Cool) $x --> List) is export(:debye)

These routines compute the first-order Debye function D₆(x).

### sub dilog(Num(Cool) $x --> Num) is export(:dilog)

### sub dilog-e(Num(Cool) $x --> List) is export(:dilog)

These routines compute the dilogarithm for a real argument.

### sub complex-dilog-xy-e(Num(Cool) $x, Num(Cool) $y --> List) is export(:dilog)

### sub complex-dilog-e(Num(Cool) $r, Num(Cool) $θ --> List) is export(:dilog)

This function computes the full complex-valued dilogarithm for the complex argument z = r exp(iθ).

### sub complex-spence-xy-e(Num(Cool) $x, Num(Cool) $y --> List) is export(:dilog)

This function computes the full complex-valued Spence integral. It returns a List: the first element is the value as a Raku’s Complex datatype, the following are the errors on the real and imaginary part.

### sub multiply(Num(Cool) $x, Num(Cool) $y --> Num) is export(:mult)

### sub multiply-e(Num(Cool) $x, Num(Cool) $y --> List) is export(:mult)

These functions multiply x and y, allowing for the propagation of errors.

### sub multiply-err-e(Num(Cool) $x, Num(Cool) $dx, Num(Cool) $y, Num(Cool) $dy --> List) is export(:mult)

This function multiplies x and y with associated absolute errors dx and dy.

### sub Kcomp(Num(Cool) $k, UInt $mode --> Num) is export(:ellint)

### sub Kcomp-e(Num(Cool) $k, UInt $mode --> List) is export(:ellint)

These routines compute the complete elliptic integral K(k) to the accuracy specified by the mode variable mode.

### sub Ecomp(Num(Cool) $k, UInt $mode --> Num) is export(:ellint)

### sub Ecomp-e(Num(Cool) $k, UInt $mode --> List) is export(:ellint)

These routines compute the complete elliptic integral E(k) to the accuracy specified by the mode variable mode.

### sub Pcomp(Num(Cool) $k, Num(Cool) $n, UInt $mode --> Num) is export(:ellint)

### sub Pcomp-e(Num(Cool) $k, Num(Cool) $n, UInt $mode --> List) is export(:ellint)

These routines compute the complete elliptic integral Π(k,n) to the accuracy specified by the mode variable mode.

### sub Dcomp(Num(Cool) $k, UInt $mode --> Num) is export(:ellint)

### sub Dcomp-e(Num(Cool) $k, UInt $mode --> List) is export(:ellint)

These routines compute the complete elliptic integral D(k) to the accuracy specified by the mode variable mode.

### sub F(Num(Cool) $Φ, Num(Cool) $k, UInt $mode --> Num) is export(:ellint)

### sub F-e(Num(Cool) $Φ, Num(Cool) $k, UInt $mode --> List) is export(:ellint)

These routines compute the incomplete elliptic integral F(φ, k) to the accuracy specified by the mode variable mode.

### sub E(Num(Cool) $Φ, Num(Cool) $k, UInt $mode --> Num) is export(:ellint)

### sub E-e(Num(Cool) $Φ, Num(Cool) $k, UInt $mode --> List) is export(:ellint)

These routines compute the incomplete elliptic integral E(φ, k) to the accuracy specified by the mode variable mode.

### sub P(Num(Cool) $Φ, Num(Cool) $k, Num(Cool) $n, UInt $mode --> Num) is export(:ellint)

### sub P-e(Num(Cool) $Φ, Num(Cool) $k, Num(Cool) $n, UInt $mode --> List


## dist_zef-FRITH-Math-Libgsl-Function.md
## Chunk 2 of 3
) is export(:ellint)

These routines compute the incomplete elliptic integral P(φ, k) to the accuracy specified by the mode variable mode.

### sub D(Num(Cool) $Φ, Num(Cool) $k, UInt $mode --> Num) is export(:ellint)

### sub D-e(Num(Cool) $Φ, Num(Cool) $k, UInt $mode --> List) is export(:ellint)

These routines compute the incomplete elliptic integral D(φ, k) to the accuracy specified by the mode variable mode.

### sub RC(Num(Cool) $x, Num(Cool) $y, UInt $mode --> Num) is export(:ellint)

### sub RC-e(Num(Cool) $x, Num(Cool) $y, UInt $mode --> List) is export(:ellint)

These routines compute the incomplete elliptic integral RC(x, y) to the accuracy specified by the mode variable mode.

### sub RD(Num(Cool) $x, Num(Cool) $y, Num(Cool) $z, UInt $mode --> Num) is export(:ellint)

### sub RD-e(Num(Cool) $x, Num(Cool) $y, Num(Cool) $z, UInt $mode --> List) is export(:ellint)

These routines compute the incomplete elliptic integral RD(x, y, z) to the accuracy specified by the mode variable mode.

### sub RF(Num(Cool) $x, Num(Cool) $y, Num(Cool) $z, UInt $mode --> Num) is export(:ellint)

### sub RF-e(Num(Cool) $x, Num(Cool) $y, Num(Cool) $z, UInt $mode --> List) is export(:ellint)

These routines compute the incomplete elliptic integral RF(x, y, z) to the accuracy specified by the mode variable mode.

### sub RJ(Num(Cool) $x, Num(Cool) $y, Num(Cool) $z, Num(Cool) $p, UInt $mode --> Num) is export(:ellint)

### sub RJ-e(Num(Cool) $x, Num(Cool) $y, Num(Cool) $z, Num(Cool) $p, UInt $mode --> List) is export(:ellint)

These routines compute the incomplete elliptic integral RJ(x, y, z, p) to the accuracy specified by the mode variable mode.

### sub elljac-e(Num(Cool) $u, Num(Cool) $m --> List) is export(:ellfun)

This function computes the Jacobian elliptic functions sn(u|m), cn(u|m), dn(u|m) by descending Landen transformations.

### sub erf(Num(Cool) $x --> Num) is export(:err)

### sub erf-e(Num(Cool) $x --> List) is export(:err)

These routines compute the error function erf(x).

### sub erfc(Num(Cool) $x --> Num) is export(:err)

### sub erfc-e(Num(Cool) $x --> List) is export(:err)

These routines compute the complementary error function erfc(x) = 1 − erf(x).

### sub log-erfc(Num(Cool) $x --> Num) is export(:err)

### sub log-erfc-e(Num(Cool) $x --> List) is export(:err)

These routines compute the logarithm of the complementary error function log(erfc(x)).

### sub erf-Z(Num(Cool) $x --> Num) is export(:err)

### sub erf-Z-e(Num(Cool) $x --> List) is export(:err)

These routines compute the Gaussian probability density function Z(x).

### sub erf-Q(Num(Cool) $x --> Num) is export(:err)

### sub erf-Q-e(Num(Cool) $x --> List) is export(:err)

These routines compute the upper tail of the Gaussian probability function Q(x).

### sub hazard(Num(Cool) $x --> Num) is export(:err)

### sub hazard-e(Num(Cool) $x --> List) is export(:err)

These routines compute the hazard function for the normal distribution.

### sub gexp(Num(Cool) $x --> Num) is export(:exp)

### sub gexp-e(Num(Cool) $x --> List) is export(:exp)

These routines provide an exponential function exp(x) using GSL semantics and error checking.

### sub gexp-e10(Num(Cool) $x --> List) is export(:exp)

This function computes the exponential exp(x) and returns a result with extended range. This function may be useful if the value of exp(x) would overflow the numeric range of double. It returns a list of three numbers: the value, the error, and the scaling exponent.

### sub gexp-mult(Num(Cool) $x, Num(Cool) $y --> Num) is export(:exp)

### sub gexp-mult-e(Num(Cool) $x, Num(Cool) $y --> List) is export(:exp)

These routines exponentiate x and multiply by the factor y to return the product y exp(x).

### sub gexp-mult-e10(Num(Cool) $x, Num(Cool) $y --> List) is export(:exp)

This function computes the product y exp(x) and returns a result with extended range. This function may be useful if the value of exp(x) would overflow the numeric range of double. It returns a list of three numbers: the value, the error, and the scaling exponent.

### sub gexpm1(Num(Cool) $x --> Num) is export(:exp)

### sub gexpm1-e(Num(Cool) $x --> List) is export(:exp)

These routines compute the quantity exp(x) − 1 using an algorithm that is accurate for small x.

### sub gexprel(Num(Cool) $x --> Num) is export(:exp)

### sub gexprel-e(Num(Cool) $x --> List) is export(:exp)

These routines compute the quantity (exp(x) − 1)/x using an algorithm that is accurate for small x.

### sub gexprel2(Num(Cool) $x --> Num) is export(:exp)

### sub gexprel2-e(Num(Cool) $x --> List) is export(:exp)

These routines compute the quantity 2(exp(x) − 1 − x)/x 2 using an algorithm that is accurate for small x.

### sub gexprel-n(Int $n, Num(Cool) $x --> Num) is export(:exp)

### sub gexprel-n-e(Int $n, Num(Cool) $x --> List) is export(:exp)

These routines compute the N -relative exponential, which is the n-th generalization of the functions gexprel, gexprel2, gexprel-e, and gexprel2-e.

### sub gexp-err-e(Num(Cool) $x, Num(Cool) $dx --> List) is export(:exp)

This function exponentiates x with an associated absolute error dx.

### sub gexp-err-e10(Num(Cool) $x, Num(Cool) $dx --> List) is export(:exp)

This function exponentiates a quantity x with an associated absolute error dx and returns a result with extended range. This function may be useful if the value of exp(x) would overflow the numeric range of double. It returns a list of three numbers: the value, the error, and the scaling exponent.

### sub gexp-mult-err-e(Num(Cool) $x, Num(Cool) $dx, Num(Cool) $y, Num(Cool) $dy --> List) is export(:exp)

This routine computes the product y exp(x) for the quantities x, y with associated absolute errors dx, dy.

### sub gexp-mult-err-e10(Num(Cool) $x, Num(Cool) $dx, Num(Cool) $y, Num(Cool) $dy --> List) is export(:exp)

This routine computes the product y exp(x) for the quantities x, y with associated absolute errors dx, dy and returns a result with extended range. This function may be useful if the value of exp(x) would overflow the numeric range of double. It returns a list of three numbers: the value, the error, and the scaling exponent.

### sub E1(Num(Cool) $x --> Num) is export(:expint)

### sub E1-e(Num(Cool) $x --> List) is export(:expint)

These routines compute the exponential integral E₁(x).

### sub E2(Num(Cool) $x --> Num) is export(:expint)

### sub E2-e(Num(Cool) $x --> List) is export(:expint)

These routines compute the exponential integral E₂(x).

### sub En(Int $n, Num(Cool) $x --> Num) is export(:expint)

### sub En-e(Int $n, Num(Cool) $x --> List) is export(:expint)

These routines compute the exponential integral Eₙ(x) of order n.

### sub Ei(Num(Cool) $x --> Num) is export(:expint)

### sub Ei-e(Num(Cool) $x --> List) is export(:expint)

These routines compute the exponential integral Ei(x).

### sub Shi(Num(Cool) $x --> Num) is export(:expint)

### sub Shi-e(Num(Cool) $x --> List) is export(:expint)

These routines compute the hyperbolic integral Shi(x).

### sub Chi(Num(Cool) $x --> Num) is export(:expint)

### sub Chi-e(Num(Cool) $x --> List) is export(:expint)

These routines compute the hyperbolic integral Chi(x).

### sub expint3(Num(Cool) $x where \* ≥ 0 --> Num) is export(:expint)

### sub expint3-e(Num(Cool) $x where \* ≥ 0 --> List) is export(:expint)

These routines compute the third-order exponential integral Ei₃(x).

### sub Si(Num(Cool) $x --> Num) is export(:expint)

### sub Si-e(Num(Cool) $x --> List) is export(:expint)

These routines compute the Sine integral Si(x).

### sub Ci(Num(Cool) $x where \* > 0 --> Num) is export(:expint)

### sub Ci-e(Num(Cool) $x where \* > 0 --> List) is export(:expint)

These routines compute the Cosine integral Ci(x).

### sub atanint(Num(Cool) $x --> Num) is export(:expint)

### sub atanint-e(Num(Cool) $x --> List) is export(:expint)

These routines compute the Arctangent integral.

### sub fd-m1(Num(Cool) $x --> Num) is export(:fermidirac)

### sub fd-m1-e(Num(Cool) $x --> List) is export(:fermidirac)

These routines compute the complete Fermi-Dirac integral with an index of −1.

### sub fd0(Num(Cool) $x --> Num) is export(:fermidirac)

### sub fd0-e(Num(Cool) $x --> List) is export(:fermidirac)

These routines compute the complete Fermi-Dirac integral with an index of 0.

### sub fd1(Num(Cool) $x --> Num) is export(:fermidirac)

### sub fd1-e(Num(Cool) $x --> List) is export(:fermidirac)

These routines compute the complete Fermi-Dirac integral with an index of 1.

### sub fd2(Num(Cool) $x --> Num) is export(:fermidirac)

### sub fd2-e(Num(Cool) $x --> List) is export(:fermidirac)

These routines compute the complete Fermi-Dirac integral with an index of 2.

### sub fd-int(Int $j, Num(Cool) $x --> Num) is export(:fermidirac)

### sub fd-int-e(Int $j, Num(Cool) $x --> List) is export(:fermidirac)

These routines compute the complete Fermi-Dirac integral with an integer index j.

### sub fd-mhalf(Num(Cool) $x --> Num) is export(:fermidirac)

### sub fd-mhalf-e(Num(Cool) $x --> List) is export(:fermidirac)

These routines compute the complete Fermi-Dirac integral F₋₁/₂(x).

### sub fd-half(Num(Cool) $x --> Num) is export(:fermidirac)

### sub fd-half-e(Num(Cool) $x --> List) is export(:fermidirac)

These routines compute the complete Fermi-Dirac integral F₁/₂(x).

### sub fd-half3(Num(Cool) $x --> Num) is export(:fermidirac)

### sub fd-half3-e(Num(Cool) $x --> List) is export(:fermidirac)

These routines compute the complete Fermi-Dirac integral F₃/₂(x).

### sub fd-inc0(Num(Cool) $x, Num(Cool) $b --> Num) is export(:fermidirac)

### sub fd-inc0-e(Num(Cool) $x, Num(Cool) $b --> List) is export(:fermidirac)

These routines compute the incomplete Fermi-Dirac integral with an index of zero, F₀(x, b).

### sub gamma(Num(Cool) $x where { $\_ > 0 || ($\_ < 0 && $\_ ≠ $\_.Int) } --> Num) is export(:gammabeta)

### sub gamma-e(Num(Cool) $x where { $\_ > 0 || ($\_ < 0 && $\_ ≠ $\_.Int) } --> List) is export(:gammabeta)

These routines compute the Gamma function Γ(x).

### sub lngamma(Num(Cool) $x where { $\_ > 0 || ($\_ < 0 && $\_ ≠ $\_.Int) } --> Num) is export(:gammabeta)

### sub lngamma-e(Num(Cool) $x where { $\_ > 0 || ($\_ < 0 && $\_ ≠ $\_.Int) } --> List) is export(:gammabeta)

These routines compute the logarithm of the Gamma function, log(Γ(x)).

### sub lngamma-sgn-e(Num(Cool) $x where { $\_ > 0 || ($\_ < 0 && $\_ ≠ $\_.Int) } --> List) is export(:gammabeta)

This routine computes the sign of the gamma function and the logarithm of its magnitude. It returns three numbers: the value, its associated error, and the sign.

### sub gammastar(Num(Cool) $x where \* > 0 --> Num) is export(:gammabeta)

### sub gammastar-e(Num(Cool) $x where \* > 0 --> List) is export(:gammabeta)

These routines compute the regulated Gamma Function Γ\*(x).

### sub gammainv(Num(Cool) $x where { $\_ > 0 || ($\_ < 0 && $\_ ≠ $\_.Int) } --> Num) is export(:gammabeta)

### sub gammainv-e(Num(Cool) $x where { $\_ > 0 || ($\_ < 0 && $\_ ≠ $\_.Int) } --> List) is export(:gammabeta)

These routines compute the reciprocal of the gamma function, 1/Γ(x) using the real Lanczos method.

### sub lngamma-complex-e(Num(Cool) $zr where { $\_ > 0 || ($\_ < 0 && $\_ ≠ $\_.Int) }, Num(Cool) $zi where { $\_ > 0 || ($\_ < 0 && $\_ ≠ $\_.Int) } --> List) is export(:gammabeta)

This routine computes log(Γ(z)) for complex z = zᵣ + izᵢ. The returned parameters are lnr = log |Γ(z)|, its error, arg = arg(Γ(z)) in (−π, π], and its error.

### sub fact(UInt $n where \* ≤ GSL\_SF\_FACT\_NMAX --> Num) is export(:gammabeta)

### sub fact-e(UInt $n where \* ≤ GSL\_SF\_FACT\_NMAX --> List) is export(:gammabeta)

These routines compute the factorial n!.

### sub doublefact(UInt $n where \* ≤ GSL\_SF\_DOUBLEFACT\_NMAX --> Num) is export(:gammabeta)

### sub doublefact-e(UInt $n where \* ≤ GSL\_SF\_DOUBLEFACT\_NMAX --> List) is export(:gammabeta)

These routines compute the double factorial n!! = n(n − 2)(n − 4)…

### sub lnfact(UInt $n --> Num) is export(:gammabeta)

### sub lnfact-e(UInt $n --> List) is export(:gammabeta)

These routines compute the logarithm of the factorial of n, log(n!).

### sub lndoublefact(UInt $n --> Num) is export(:gammabeta)

### sub lndoublefact-e(UInt $n --> List) is export(:gammabeta)

These routines compute the logarithm of the double factorial of n, log(n!!).

### sub choose(UInt $n, UInt $m --> Num) is export(:gammabeta)

### sub choose-e(UInt $n, UInt $m --> List) is export(:gammabeta)o

These routines compute the combinatorial factor n choose m = n!/(m!(n − m)!).

### sub lnchoose(UInt $n, UInt $m --> Num) is export(:gammabeta)

### sub lnchoose-e(UInt $n, UInt $m --> List) is export(:gammabeta)

These routines compute the logarithm of n choose m.

### sub taylorcoeff(UInt $n, Num(Cool) $x where \* ≥ 0 --> Num) is export(:gammabeta)

### sub taylorcoeff-e(UInt $n, Num(Cool) $x where \* ≥ 0 --> List) is export(:gammabeta)

These routines compute the Taylor coefficient xⁿ/n!.

### sub poch(Num(Cool) $a, Num(Cool) $x --> Num) is export(:gammabeta)

### sub poch-e(Num(Cool) $a, Num(Cool) $x --> List) is export(:gammabeta)

These routines compute the Pochhammer symbol (a)ₓ = Γ(a + x)/Γ(a).

### sub lnpoch(Num(Cool) $a, Num(Cool) $x --> Num) is export(:gammabeta)

### sub lnpoch-e(Num(Cool) $a, Num(Cool) $x --> List) is export(:gammabeta)

These routines compute the Pochhammer symbol log((a)ₓ) = log(Γ(a + x)/Γ(a)).

### sub lnpoch-sgn-e(Num(Cool) $a, Num(Cool) $x --> List) is export(:gammabeta)

These routines compute the sign of the Pochhammer symbol and the logarithm of its magnitude. It returns three numbers: the value, its associated error, and the sign.

### sub pochrel(Num(Cool) $a, Num(Cool) $x --> Num) is export(:gammabeta)

### sub pochrel-e(Num(Cool) $a, Num(Cool) $x --> List) is export(:gammabeta)

These routines compute the relative Pochhammer symbol ((a)ₓ − 1)/x

### sub gamma-inc(Num(Cool) $a where \* > 0, Num(Cool) $x where \* ≥ 0 --> Num) is export(:gammabeta)

### sub gamma-inc-e(Num(Cool) $a, Num(Cool) $x where \* ≥ 0 --> List) is export(:gammabeta)

These functions compute the unnormalized incomplete Gamma Function Γ(a, x).

### sub gamma-inc-Q(Num(Cool) $a where \* > 0, Num(Cool) $x where \* ≥ 0 --> Num) is export(:gammabeta)

### sub gamma-inc-Q-e(Num(Cool) $a where \* > 0, Num(Cool) $x where \* ≥ 0 --> List) is export(:gammabeta)

These routines compute the normalized incomplete Gamma Function Q(a, x) = 1/Γ(a).

### sub gamma-inc-P(Num(Cool) $a where \* > 0, Num(Cool) $x where \* ≥ 0 --> Num) is export(:gammabeta)

### sub gamma-inc-P-e(Num(Cool) $a where \* > 0, Num(Cool) $x where \* ≥ 0 --> List) is export(:gammabeta)

These routines compute the complementary normalized incomplete Gamma Function P (a, x).

### sub beta(Num(Cool) $a where \* > 0, Num(Cool) $b where \* > 0 --> Num) is export(:gammabeta)

### sub beta-e(Num(Cool) $a where \* > 0, Num(Cool) $b where \* > 0 --> List) is export(:gammabeta)

These routines compute the Beta Function, B(a, b).

### sub lnbeta(Num(Cool) $a where \* > 0, Num(Cool) $b where \* > 0 --> Num) is export(:gammabeta)

### sub lnbeta-e(Num(Cool) $a where \* > 0, Num(Cool) $b where \* > 0 --> List) is export(:gammabeta)

These routines compute the logarithm of the Beta Function, log(B(a, b)).

### sub beta-inc(Num(Cool) $a where \* > 0, Num(Cool) $b where \* > 0, Num(Cool) $x where 0 ≤ \* ≤ 1 --> Num) is export(:gammabeta)

### sub beta-inc-e(Num(Cool) $a where \* > 0, Num(Cool) $b where \* > 0, Num(Cool) $x where 0 ≤ \* ≤ 1 --> List) is export(:gammabeta)

These routines compute the normalized incomplete Beta function I x (a, b).

### sub gegenpoly1(Num(Cool) $lambda, Num(Cool) $x --> Num) is export(:gegen)

### sub gegenpoly1-e(Num(Cool) $lambda, Num(Cool) $x --> List) is export(:gegen)

### sub gegenpoly2(Num(Cool) $lambda, Num(Cool) $x --> Num) is export(:gegen)

### sub gegenpoly2-e(Num(Cool) $lambda, Num(Cool) $x --> List) is export(:gegen)

### sub gegenpoly3(Num(Cool) $lambda, Num(Cool) $x --> Num) is export(:gegen)

### sub gegenpoly3-e(Num(Cool) $lambda, Num(Cool) $x --> List) is export(:gegen)

These functions evaluate the Gegenbauer polynomials Cₙλ(x) using explicit representations for n = 1, 2, 3.

### sub gegenpolyn(UInt $n, Num(Cool) $lambda where \* > -½, Num(Cool) $x --> Num) is export(:gegen)

### sub gegenpolyn-e(UInt $n, Num(Cool) $lambda where \* > -½, Num(Cool) $x --> List) is export(:gegen)

These functions evaluate the Gegenbauer polynomials Cₙλ(x) for a specific value of n, λ, x.

### sub gegenpoly-array(UInt $nmax, Num(Cool) $lambda where \* > -½, Num(Cool) $x --> List) is export(:gegen)

This function computes an array of Gegenbauer polynomials Cₙλ(x) for n = 0, 1, 2 … $nmax.

### sub hermite(Int $n, Num(Cool) $x --> Num) is export(:hermite)

### sub hermite-e(Int $n, Num(Cool) $x --> List) is export(:hermite)

These routines evaluate the physicist Hermite polynomial H n (x) of order n at position x.

### sub hermite-array(Int $nmax, Num(Cool) $x --> List) is export(:hermite)

This routine evaluates all physicist Hermite polynomials H n up to order nmax at position x.

### sub hermite-series(Int $n, Num(Cool) $x, \*@a --> Num) is export(:hermite)

### sub hermite-series-e(Int $n, Num(Cool) $x, \*@a --> List) is export(:hermite)

These routines evaluate the series Σ aⱼHⱼ(x) for j = 0 … n.

### sub hermite-prob(Int $n, Num(Cool) $x --> Num) is export(:hermite)

### sub hermite-prob-e(Int $n, Num(Cool) $x --> List) is export(:hermite)

These routines evaluate the probabilist Hermite polynomial He n (x) of order n at position x.

### sub hermite-prob-array(Int $nmax, Num(Cool) $x --> List) is export(:hermite)

This routine evaluates all probabilist Hermite polynomials Heₙ(x) up to order nmax at position x.

### sub hermite-prob-series(Int $n, Num(Cool) $x, \*@a --> Num) is export(:hermite)

### sub hermite-prob-series-e(Int $n, Num(Cool) $x, \*@a --> List) is export(:hermite)

These routines evaluate the series Σ aⱼHeⱼ(x) for j = 0 … n.

### sub hermite-der(Int $n, Int $m, Num(Cool) $x --> Num) is export(:hermite)

### sub hermite-der-e(Int $n, Int $m, Num(Cool) $x --> List) is export(:hermite)

These routines evaluate the m-th derivative of the physicist Hermite polynomial Hₙ(x) of order n at position x.

### sub hermite-array-der(Int $m, Int $nmax, Num(Cool) $x --> List) is export(:hermite)

This routine evaluates the m-th derivative of all physicist Hermite polynomials Hₙ(x) from orders 0 … nmax at position x.

### sub hermite-der-array(Int $mmax, Int $n, Num(Cool) $x --> List) is export(:hermite)

This routine evaluates all derivative orders from 0 … mmax of the physicist Hermite polynomial of order n, Hₙ, at position x.

### sub hermite-prob-der(Int $m, Int $n, Num(Cool) $x --> Num) is export(:hermite)

### sub hermite-prob-der-e(Int $m, Int $n, Num(Cool) $x --> List) is export(:hermite)

These routines evaluate the m-th derivative of the probabilist Hermite polynomial Heₙ(x) of order n at position x.

### sub hermite-prob-array-der(Int $m, Int $nmax, Num(Cool) $x --> List) is export(:hermite)

This routine evaluates the m-th derivative of all probabilist Hermite polynomials Heₙ(x) from orders 0 … nmax at position x.

### sub hermite-prob-der-array(Int $mmax, Int $n, Num(Cool) $x --> List) is export(:hermite)

This routine evaluates all derivative orders from 0 … mmax of the probabilist Hermite polynomial of order n, Heₙ, at position x.

### sub hermite-func(Int $n, Num(Cool) $x --> Num) is export(:hermite)

### sub hermite-func-e(Int $n, Num(Cool) $x --> List) is export(:hermite)

These routines evaluate the Hermite function ψₙ(x) of order n at position x.

### sub hermite-func-array(Int $nmax, Num(Cool) $x --> List) is export(:hermite)

This routine evaluates all Hermite functions ψₙ(x) for orders n = 0 … nmax at position x.

### sub hermite-func-series(Int $n, Num(Cool) $x, \*@a --> Num) is export(:hermite)

### sub hermite-func-series-e(Int $n, Num(Cool) $x, \*@a --> List) is export(:hermite)

These routines evaluate the series Σ aⱼψⱼ(x) for j = 0 … n.

### sub hermite-func-der(Int $m, Int $n, Num(Cool) $x --> Num) is export(:hermite)

### sub hermite-func-der-e(Int $m, Int $n, Num(Cool) $x --> List) is export(:hermite)

These routines evaluate the m-th derivative of the Hermite function ψₙ(x) of order n at position x.

### sub hermite-zero(Int $n, Int $s --> Num) is export(:hermite)

### sub hermite-zero-e(Int $n, Int $s --> List) is export(:hermite)

These routines evaluate the s-th zero of the physicist Hermite polynomial Hₙ(x) of order n.

### sub hermite-prob-zero(Int $n, Int $s --> Num) is export(:hermite)

### sub hermite-prob-zero-e(Int $n, Int $s --> List) is export(:hermite)

These routines evaluate the s-th zero of the probabilist Hermite polynomial Heₙ(x) of order n.

### sub hermite-func-zero(Int $n, Int $s --> Num) is export(:hermite)

### sub hermite-func-zero-e(Int $n, Int $s --> List) is export(:hermite)

These routines evaluate the s-th zero of the Hermite function ψₙ(x) of order n.

### sub F01(Num(Cool) $c, Num(Cool) $x --> Num) is export(:hyperg)

### sub F01-e(Num(Cool) $c, Num(Cool) $x --> List) is export(:hyperg)

These routines compute the hypergeometric function ₀F₁(c, x).

### sub F11(Num(Cool) $a, Num(Cool) $b, Num(Cool) $x --> Num) is export(:hyperg)

### sub F11-e(Num(Cool) $a, Num(Cool) $b, Num(Cool) $x --> List) is export(:hyperg)

These routines compute the confluent hypergeometric function ₁F₁(a, b, x).

### sub F11-int(Int $m, Int $n, Num(Cool) $x --> Num) is export(:hyperg)

### sub F11-int-e(Int $m, Int $n, Num(Cool) $x --> List) is export(:hyperg)

These routines compute the confluent hypergeometric function ₁F₁(m, n, x) for integer parameters m, n.

### sub U(Num(Cool) $a, Num(Cool) $b, Num(Cool) $x --> Num) is export(:hyperg)

### sub U-e(Num(Cool) $a, Num(Cool) $b, Num(Cool) $x --> List) is export(:hyperg)

These routines compute the confluent hypergeometric function U(a, b, x).

### sub U-e10(Num(Cool) $a, Num(Cool) $b, Num(Cool) $x --> List) is export(:hyperg)

This routine computes the confluent hypergeometric function U(a, b, x) and returns a result with extended range. It returns a list of three numbers: the value, the error, and the scaling exponent.

### sub U-int(Int $m, Int $n, Num(Cool) $x --> Num) is export(:hyperg)

### sub U-int-e(Int $m, Int $n, Num(Cool) $x --> List) is export(:hyperg)

These routines compute the confluent hypergeometric function U(m, n, x) for integer parameters m, n.

### sub U-int-e10(Int $m, Int $n, Num(Cool) $x --> List) is export(:hyperg)

This routine computes the confluent hypergeometric function U(m, n, x) for integer parameters m, n and returns a result with extended range. It returns a list of three numbers: the value, the error, and the scaling exponent.

### sub F21(Num(Cool) $a, Num(Cool) $b, Num(Cool) $c, Num(Cool) $x --> Num) is export(:hyperg)

### sub F21-e(Num(Cool) $a, Num(Cool) $b, Num(Cool) $c, Num(Cool) $x --> List) is export(:hyperg)

These routines compute the Gauss hypergeometric function ₂F₁(a, b, c, x).

### sub F21-conj(Num(Cool) $aR, Num(Cool) $aI, Num(Cool) $c, Num(Cool) $x where -1 < \* < 1 --> Num) is export(:hyperg)

### sub F21-conj-e(Num(Cool) $aR, Num(Cool) $aI, Num(Cool) $c, Num(Cool) $x where -1 < \* < 1 --> List) is export(:hyperg)

These routines compute the Gauss hypergeometric function ₂F₁(aᵣ + iaᵢ, aᵣ − iaᵢ, c, x).

### sub F21-renorm(Num(Cool) $a, Num(Cool) $b, Num(Cool) $c, Num(Cool) $x where -1 < \* < 1 --> Num) is export(:hyperg)

### sub F21-renorm-e(Num(Cool) $a, Num(Cool) $b, Num(Cool) $c, Num(Cool) $x where -1 < \* < 1 --> List) is export(:hyperg)

These routines compute the renormalized Gauss hypergeometric function ₂F₁(a, b, c, x)/Γ(c).

### sub F21-conj-renorm(Num(Cool) $aR, Num(Cool) $aI, Num(Cool) $c, Num(Cool) $x where -1 < \* < 1 --> Num) is export(:hyperg)

### sub F21-conj-renorm-e(Num(Cool) $aR, Num(Cool) $aI, Num(Cool) $c, Num(Cool) $x where -1 < \* < 1 --> List) is export(:hyperg)

These routines compute the renormalized Gauss hypergeometric function ₂F₁(aᵣ + iaᵢ, aᵣ − iaᵢ, c, x)/Γ(c).

### sub F20(Num(Cool) $a, Num(Cool) $b, Num(Cool) $x --> Num) is export(:hyperg)

### sub F20-e(Num(Cool) $a, Num(Cool) $b, Num(Cool) $x --> List) is export(:hyperg)

These routines compute the hypergeometric function ₂F₀(a, b, x).

### sub laguerre1(Num(Cool) $a, Num(Cool) $x --> Num) is export(:laguerre)

### sub laguerre1-e(Num(Cool) $a, Num(Cool) $x --> List) is export(:laguerre)

### sub laguerre2(Num(Cool) $a, Num(Cool) $x --> Num) is export(:laguerre)

### sub laguerre2-e(Num(Cool) $a, Num(Cool) $x --> List) is export(:laguerre)

### sub laguerre3(Num(Cool) $a, Num(Cool) $x --> Num) is export(:laguerre)

### sub laguerre3-e(Num(Cool) $a, Num(Cool) $x --> List) is export(:laguerre)

These routines evaluate the generalized Laguerre polynomials L₁a(x), L₂a(x), L₃a(x) using explicit representations.

### sub laguerre-n(UInt $n, Num(Cool) $a where \* > -1, Num(Cool) $x --> Num) is export(:laguerre)

### sub laguerre-n-e(UInt $n, Num(Cool) $a where \* > -1, Num(Cool) $x --> List) is export(:laguerre)

These routines evaluate the generalized Laguerre polynomials Lₙa(x).

### sub lambert-W0(Num(Cool) $x --> Num) is export(:lambert)

### sub lambert-W0-e(Num(Cool) $x --> List


## dist_zef-FRITH-Math-Libgsl-Function.md
## Chunk 3 of 3
) is export(:lambert)

These compute the principal branch of the Lambert W function, W₀(x).

### sub lambert-Wm1(Num(Cool) $x --> Num) is export(:lambert)

### sub lambert-Wm1-e(Num(Cool) $x --> List) is export(:lambert)

These compute the principal branch of the Lambert W function, W₋₁(x).

### sub legendre-P1(Num(Cool) $x --> Num) is export(:legendre)

### sub legendre-P1-e(Num(Cool) $x --> List) is export(:legendre)

### sub legendre-P2(Num(Cool) $x --> Num) is export(:legendre)

### sub legendre-P2-e(Num(Cool) $x --> List) is export(:legendre)

### sub legendre-P3(Num(Cool) $x --> Num) is export(:legendre)

### sub legendre-P3-e(Num(Cool) $x --> List) is export(:legendre)

These functions evaluate the Legendre polynomials Pₗ(x) using explicit representations for l = 1, 2, 3.

### sub legendre-Pl(UInt $l, Num(Cool) $x where -1 ≤ \* ≤ 1 --> Num) is export(:legendre)

### sub legendre-Pl-e(UInt $l, Num(Cool) $x where -1 ≤ \* ≤ 1 --> List) is export(:legendre)

These functions evaluate the Legendre polynomial Pₗ(x) for a specific value of l, x.

### sub legendre-Pl-array(UInt $lmax, Num(Cool) $x where -1 ≤ \* ≤ 1 --> List) is export(:legendre)

### sub legendre-Pl-deriv-array(UInt $lmax, Num(Cool) $x where -1 ≤ \* ≤ 1 --> List) is export(:legendre)

These functions compute arrays of Legendre polynomials Pₗ(x) and derivatives dPₗ(x)/dx for l = 0 … lmax.

### sub legendre-Q0(Num(Cool) $x where

### sub legendre-Q0-e(Num(Cool) $x where

These routines compute the Legendre function Q₀(x).

### sub legendre-Q1(Num(Cool) $x where

### sub legendre-Q1-e(Num(Cool) $x where

These routines compute the Legendre function Q₁(x).

### sub legendre-Ql(UInt $l, Num(Cool) $x where { $\_ > -1 && $\_ ≠ 1 } --> Num) is export(:legendre)

### sub legendre-Ql-e(UInt $l, Num(Cool) $x where { $\_ > -1 && $\_ ≠ 1 } --> List) is export(:legendre)

These routines compute the Legendre function Qₗ(x).

### sub legendre-array-index(UInt $l, UInt $n --> UInt) is export(:legendre)

This function returns the index into the result array, corresponding to Pⁿₗ(x), P’ⁿₗ, or P”ⁿₗ(x).

### sub legendre-array(Int $norm, size\_t $lmax where \* ≤ 150, Num(Cool) $x where -1 ≤ \* ≤ 1 --> List) is export(:legendre)

### sub legendre-array-e(Int $norm, UInt $lmax, Num(Cool) $x where -1 ≤ \* ≤ 1, Num(Cool) $csphase where \* == 1|-1 --> List) is export(:legendre)

These functions calculate all normalized associated Legendre polynomials. The parameter norm specifies the normalization to be used.

### sub legendre-deriv-array(Int $norm, size\_t $lmax where \* ≤ 150, Num(Cool) $x where -1 ≤ \* ≤ 1 --> List) is export(:legendre)

### sub legendre-deriv-array-e(Int $norm, UInt $lmax, Num(Cool) $x where -1 ≤ \* ≤ 1, Num(Cool) $csphase where \* == 1|-1 --> List) is export(:legendre)

These functions calculate all normalized associated Legendre functions and their first derivatives up to degree lmax. The parameter norm specifies the normalization to be used. They return a List of Pairs (that can be read as a Hash):

* :out array of Pⁿₗ(x) values
* :derout array of dPⁿₗ(x)/dx values

### sub legendre-deriv-alt-array(Int $norm, size\_t $lmax where \* ≤ 150, Num(Cool) $x where -1 ≤ \* ≤ 1 --> List) is export(:legendre)

### sub legendre-deriv-alt-array-e(Int $norm, UInt $lmax, Num(Cool) $x where -1 ≤ \* ≤ 1, Num(Cool) $csphase where \* == 1|-1 --> List) is export(:legendre)

These functions calculate all normalized associated Legendre functions and their (alternate) first derivatives up to degree lmax. The parameter norm specifies the normalization to be used. To include or exclude the Condon-Shortley phase factor of (−1)ⁿ, set the parameter csphase to either −1 or 1 respectively. They return a List of Pairs (that can be read as a Hash):

* :out array of Pⁿₗ(x) values
* :derout array of dPⁿₗ(x)/dx values

### sub legendre-deriv2-array(Int $norm, size\_t $lmax where \* ≤ 150, Num(Cool) $x where -1 ≤ \* ≤ 1 --> List) is export(:legendre)

### sub legendre-deriv2-array-e(Int $norm, UInt $lmax, Num(Cool) $x where -1 ≤ \* ≤ 1, Num(Cool) $csphase where \* == 1|-1 --> List) is export(:legendre)

These functions calculate all normalized associated Legendre functions and their first and second derivatives up to degree lmax. The parameter norm specifies the normalization to be used. They return a List of Pairs (that can be read as a Hash):

* :out array of Pⁿₗ(x) values
* :derout array of dPⁿₗ(x)/dx values
* :derout2 array of d²Pⁿₗ(x)/d²x values

### sub legendre-deriv2-alt-array(Int $norm, size\_t $lmax where \* ≤ 150, Num(Cool) $x where -1 ≤ \* ≤ 1 --> List) is export(:legendre)

### sub legendre-deriv2-alt-array-e(Int $norm, UInt $lmax, Num(Cool) $x where -1 ≤ \* ≤ 1, Num(Cool) $csphase where \* == 1|-1 --> List) is export(:legendre)

These functions calculate all normalized associated Legendre functions and their (alternate) first and second derivatives up to degree lmax. The parameter norm specifies the normalization to be used. To include or exclude the Condon-Shortley phase factor of (−1)ⁿ, set the parameter csphase to either −1 or 1 respectively. They return a List of Pairs (that can be read as a Hash):

* :out array of normalized Pⁿₗ(x) values
* :derout array of dPⁿₗ(cos(θ))/dθ values
* :derout2 array of d²Pⁿₗ(cos(θ))/d²θ values

### sub legendre-Plm(UInt $l, UInt $n, Num(Cool) $x where -1 ≤ \* ≤ 1 --> Num) is export(:legendre)

### sub legendre-Plm-e(UInt $l, UInt $n, Num(Cool) $x where -1 ≤ \* ≤ 1 --> List) is export(:legendre)

These routines compute the associated Legendre polynomial Pⁿₗ(x).

### sub legendre-sphPlm(UInt $l, UInt $m, Num(Cool) $x where -1 ≤ \* ≤ 1 --> Num) is export(:legendre)

### sub legendre-sphPlm-e(UInt $l, UInt $m, Num(Cool) $x where -1 ≤ \* ≤ 1 --> List) is export(:legendre)

These routines compute the normalized associated Legendre polynomial.

### sub conicalP-half(Num(Cool) $lambda, Num(Cool) $x where \* > -1 --> Num) is export(:legendre)

### sub conicalP-half-e(Num(Cool) $lambda, Num(Cool) $x where \* > -1 --> List) is export(:legendre)

These routines compute the irregular Spherical Conical Function.

### sub conicalP-mhalf(Num(Cool) $lambda, Num(Cool) $x where \* > -1 --> Num) is export(:legendre)

### sub conicalP-mhalf-e(Num(Cool) $lambda, Num(Cool) $x where \* > -1 --> List) is export(:legendre)

These routines compute the regular Spherical Conical Function.

### sub conicalP0(Num(Cool) $lambda, Num(Cool) $x where \* > -1 --> Num) is export(:legendre)

### sub conicalP0-e(Num(Cool) $lambda, Num(Cool) $x where \* > -1 --> List) is export(:legendre)

These routines compute the conical function P⁰.

### sub conicalP1(Num(Cool) $lambda, Num(Cool) $x where \* > -1 --> Num) is export(:legendre)

### sub conicalP1-e(Num(Cool) $lambda, Num(Cool) $x where \* > -1 --> List) is export(:legendre)

These routines compute the conical function P¹.

### sub conicalP-sph-reg(Int $l where \* ≥ -1, Num(Cool) $lambda, Num(Cool) $x where \* > -1 --> Num) is export(:legendre)

### sub conicalP-sph-reg-e(Int $l where \* ≥ -1, Num(Cool) $lambda, Num(Cool) $x where \* > -1 --> List) is export(:legendre)

These routines compute the Regular Spherical Conical Function.

### sub conicalP-cyl-reg(Int $m where \* ≥ -1, Num(Cool) $lambda, Num(Cool) $x where \* > -1 --> Num) is export(:legendre)

### sub conicalP-cyl-reg-e(Int $m where \* ≥ -1, Num(Cool) $lambda, Num(Cool) $x where \* > -1 --> List) is export(:legendre)

These routines compute the Regular Cylindrical Conical Function.

### sub legendre-H3d0(Num(Cool) $lambda, Num(Cool) $eta where \* ≥ 0 --> Num) is export(:legendre)

### sub legendre-H3d0-e(Num(Cool) $lambda, Num(Cool) $eta where \* ≥ 0 --> List) is export(:legendre)

These routines compute the zeroth radial eigenfunction of the Laplacian on the 3-dimensional hyperbolic space.

### sub legendre-H3d1(Num(Cool) $lambda, Num(Cool) $eta where \* ≥ 0 --> Num) is export(:legendre)

### sub legendre-H3d1-e(Num(Cool) $lambda, Num(Cool) $eta where \* ≥ 0 --> List) is export(:legendre)

These routines compute the first radial eigenfunction of the Laplacian on the 3-dimensional hyperbolic space.

### sub legendre-H3d(UInt $l, Num(Cool) $lambda, Num(Cool) $eta where \* ≥ 0 --> Num) is export(:legendre)

### sub legendre-H3d-e(UInt $l, Num(Cool) $lambda, Num(Cool) $eta where \* ≥ 0 --> List) is export(:legendre)

These routines compute the l-th radial eigenfunction of the Laplacian on the 3-dimensional hyperbolic space.

### sub legendre-H3d-array(UInt $lmax, Num(Cool) $lambda, Num(Cool) $eta where \* ≥ 0 --> List) is export(:legendre)

This function computes an array of radial eigenfunctions.

### sub gsl-log(Num(Cool) $x where \* > 0 --> Num) is export(:log)

### sub gsl-log-e(Num(Cool) $x where \* > 0 --> List) is export(:log)

These routines compute the logarithm of x.

### sub gsl-log-abs(Num(Cool) $x where \* ≠ 0 --> Num) is export(:log)

### sub gsl-log-abs-e(Num(Cool) $x where \* ≠ 0 --> List) is export(:log)

These routines compute the logarithm of the magnitude of x.

### sub gsl-log-complex-e(Num(Cool) $zr, Num(Cool) $zi --> List) is export(:log)

This routine computes the complex logarithm of z = zᵣ + izᵢ. The returned parameters are the radial part, its error, θ in the range [−π, π], and its error.

### sub gsl-log1plusx(Num(Cool) $x where \* > -1 --> Num) is export(:log)

### sub gsl-log1plusx-e(Num(Cool) $x where \* > -1 --> List) is export(:log)

These routines compute log(1 + x).

### sub gsl-log1plusx-mx(Num(Cool) $x where \* > -1 --> Num) is export(:log)

### sub gsl-log1plusx-mx-e(Num(Cool) $x where \* > -1 --> List) is export(:log)

These routines compute log(1 + x) − x.

### sub mathieu-a(Int $n, Num(Cool) $q --> Num) is export(:mathieu)

### sub mathieu-a-e(Int $n, Num(Cool) $q --> List) is export(:mathieu)

### sub mathieu-b(Int $n, Num(Cool) $q --> Num) is export(:mathieu)

### sub mathieu-b-e(Int $n, Num(Cool) $q --> List) is export(:mathieu)

These routines compute the characteristic values aₙ(q), bₙ(q) of the Mathieu functions ceₙ(q, x) and seₙ(q, x), respectively.

### sub mathieu-a-array(Int $order-min, Int $order-max, Num(Cool) $q --> List) is export(:mathieu)

### sub mathieu-b-array(Int $order-min, Int $order-max, Num(Cool) $q --> List) is export(:mathieu)

These routines compute a series of Mathieu characteristic values aₙ(q), bₙ(q) for n from order\_min to order\_max inclusive.

### sub mathieu-ce(Int $n, Num(Cool) $q, Num(Cool) $x --> Num) is export(:mathieu)

### sub mathieu-ce-e(Int $n, Num(Cool) $q, Num(Cool) $x --> List) is export(:mathieu)

### sub mathieu-se(Int $n, Num(Cool) $q, Num(Cool) $x --> Num) is export(:mathieu)

### sub mathieu-se-e(Int $n, Num(Cool) $q, Num(Cool) $x --> List) is export(:mathieu)

These routines compute the angular Mathieu functions ceₙ(q, x) and seₙ(q, x), respectively.

### sub mathieu-ce-array(Int $order-min, Int $order-max, Num(Cool) $q, Num(Cool) $x --> List) is export(:mathieu)

### sub mathieu-se-array(Int $order-min, Int $order-max, Num(Cool) $q, Num(Cool) $x --> List) is export(:mathieu)

These routines compute a series of the angular Mathieu functions ceₙ(q, x) and seₙ(q, x) of order n from nmin to nmax inclusive.

### sub mathieu-Mc(Int $j where \* == 1|2, Int $n, Num(Cool) $q, Num(Cool) $x --> Num) is export(:mathieu)

### sub mathieu-Mc-e(Int $j where \* == 1|2, Int $n, Num(Cool) $q, Num(Cool) $x --> List) is export(:mathieu)

### sub mathieu-Ms(Int $j where \* == 1|2, Int $n, Num(Cool) $q, Num(Cool) $x --> Num) is export(:mathieu)

### sub mathieu-Ms-e(Int $j where \* == 1|2, Int $n, Num(Cool) $q, Num(Cool) $x --> List) is export(:mathieu)

These routines compute the radial j-th kind Mathieu functions Mcₙ(q, x) and Msₙ(q, x) of order n.

### sub mathieu-Mc-array(Int $j where \* == 1|2, Int $nmin, Int $nmax, Num(Cool) $q, Num(Cool) $x --> List) is export(:mathieu)

### sub mathieu-Ms-array(Int $j where \* == 1|2, Int $nmin, Int $nmax, Num(Cool) $q, Num(Cool) $x --> List) is export(:mathieu)

These routines compute a series of the radial Mathieu functions of kind j, with order from nmin to nmax inclusive.

### sub pow-int(Num(Cool) $x, Int $n --> Num) is export(:pow)

### sub pow-int-e(Num(Cool) $x, Int $n --> List) is export(:pow)

These routines compute the power xⁿ for integer n.

### sub psi-int(UInt $n where \* > 0 --> Num) is export(:psi)

### sub psi-int-e(UInt $n where \* > 0 --> List) is export(:psi)

These routines compute the Digamma function ψ(n) for positive integer n.

### sub psi(Num(Cool) $x where \* ≠ 0 --> Num) is export(:psi)

### sub psi-e(Num(Cool) $x where \* ≠ 0 --> List) is export(:psi)

These routines compute the Digamma function ψ(x) for general x.

### sub psi1piy(Num(Cool) $y --> Num) is export(:psi)

### sub psi1piy-e(Num(Cool) $y --> List) is export(:psi)

These routines compute the real part of the Digamma function on the line 1 + iy.

### sub psi1-int(UInt $n where \* > 0 --> Num) is export(:psi)

### sub psi1-int-e(UInt $n where \* > 0 --> List) is export(:psi)

These routines compute the Trigamma function ψ’(n) for positive integer n.

### sub psi1(Num(Cool) $x --> Num) is export(:psi)

### sub psi1-e(Num(Cool) $x --> List) is export(:psi)

These routines compute the Trigamma function ψ’(x) for general x.

### sub psin(UInt $n, Num(Cool) $x where \* > 0 --> Num) is export(:psi)

### sub psin-e(UInt $n, Num(Cool) $x where \* > 0 --> List) is export(:psi)

These routines compute the polygamma function ψ⁽ⁿ⁾(x).

### sub synchrotron1(Num(Cool) $x where \* ≥ 0 --> Num) is export(:sync)

### sub synchrotron1-e(Num(Cool) $x where \* ≥ 0 --> List) is export(:sync)

These routines compute the first synchrotron function.

### sub synchrotron2(Num(Cool) $x where \* ≥ 0 --> Num) is export(:sync)

### sub synchrotron2-e(Num(Cool) $x where \* ≥ 0 --> List) is export(:sync)

These routines compute the second synchrotron function.

### sub transport2(Num(Cool) $x where \* ≥ 0 --> Num) is export(:transport)

### sub transport2-e(Num(Cool) $x where \* ≥ 0 --> List) is export(:transport)

These routines compute the transport function J(2, x).

### sub transport3(Num(Cool) $x where \* ≥ 0 --> Num) is export(:transport)

### sub transport3-e(Num(Cool) $x where \* ≥ 0 --> List) is export(:transport)

These routines compute the transport function J(3, x).

### sub transport4(Num(Cool) $x where \* ≥ 0 --> Num) is export(:transport)

### sub transport4-e(Num(Cool) $x where \* ≥ 0 --> List) is export(:transport)

These routines compute the transport function J(4, x).

### sub transport5(Num(Cool) $x where \* ≥ 0 --> Num) is export(:transport)

### sub transport5-e(Num(Cool) $x where \* ≥ 0 --> List) is export(:transport)

These routines compute the transport function J(5, x).

### sub gsl-sin(Num(Cool) $x --> Num) is export(:trig)

### sub gsl-sin-e(Num(Cool) $x --> List) is export(:trig)

These routines compute the sine function sin(x).

### sub gsl-cos(Num(Cool) $x --> Num) is export(:trig)

### sub gsl-cos-e(Num(Cool) $x --> List) is export(:trig)

These routines compute the cosine function cos(x).

### sub gsl-hypot(Num(Cool) $x, Num(Cool) $y --> Num) is export(:trig)

### sub gsl-hypot-e(Num(Cool) $x, Num(Cool) $y --> List) is export(:trig)

These routines compute the hypotenuse function.

### sub gsl-sinc(Num(Cool) $x --> Num) is export(:trig)

### sub gsl-sinc-e(Num(Cool) $x --> List) is export(:trig)

These routines compute sinc(x) = sin(πx)/(πx).

### sub gsl-complex-sin-e(Num(Cool) $zr, Num(Cool) $zi --> List) is export(:trig)

This function computes the complex sine.

### sub gsl-complex-cos-e(Num(Cool) $zr, Num(Cool) $zi --> List) is export(:trig)

This function computes the complex cosine.

### sub gsl-complex-logsin-e(Num(Cool) $zr, Num(Cool) $zi --> List) is export(:trig)

This function computes the logarithm of the complex sine.

### sub gsl-lnsinh(Num(Cool) $x where \* > 0 --> Num) is export(:trig)

### sub gsl-lnsinh-e(Num(Cool) $x where \* > 0 --> List) is export(:trig)

These routines compute log(sinh(x)).

### sub gsl-lncosh(Num(Cool) $x --> Num) is export(:trig)

### sub gsl-lncosh-e(Num(Cool) $x --> List) is export(:trig)

These routines compute log(cosinh(x)).

### sub polar-to-rect(Num(Cool) $r, Num(Cool) $θ where -π ≤ \* ≤ π --> List) is export(:trig)

This function converts the polar coordinates (r, θ) to rectilinear coordinates (x, y).

### sub rect-to-polar(Num(Cool) $x, Num(Cool) $y --> List) is export(:trig)

This function converts the rectilinear coordinates (x, y) to polar coordinates (r, θ).

### sub angle-restrict-symm(Num(Cool) $θ --> Num) is export(:trig)

### sub angle-restrict-symm-e(Num(Cool) $θ --> Num) is export(:trig)

These routines force the angle θ to lie in the range (−π, π].

### sub angle-restrict-pos(Num(Cool) $θ --> Num) is export(:trig)

### sub angle-restrict-pos-e(Num(Cool) $θ --> Num) is export(:trig)

These routines force the angle θ to lie in the range [0, 2π).

### sub gsl-sin-err-e(Num(Cool) $x, Num(Cool) $dx --> List) is export(:trig)

This routine computes the sine of an angle x with an associated absolute error dx, sin(x ± dx).

### sub gsl-cos-err-e(Num(Cool) $x, Num(Cool) $dx --> List) is export(:trig)

This routine computes the cosine of an angle x with an associated absolute error dx, cosin(x ± dx).

### sub zeta-int(Int $n where \* ≠ 1 --> Num) is export(:zeta)

### sub zeta-int-e(Int $n where \* ≠ 1 --> List) is export(:zeta)

These routines compute the Riemann zeta function ζ(n).

### sub zeta(Num(Cool) $s where \* ≠ 1 --> Num) is export(:zeta)

### sub zeta-e(Num(Cool) $s where \* ≠ 1 --> List) is export(:zeta)

These routines compute the Riemann zeta function ζ(s) for arbitrary s.

### sub zetam1-int(Int $n where \* ≠ 1 --> Num) is export(:zeta)

### sub zetam1-int-e(Int $n where \* ≠ 1 --> List) is export(:zeta)

These routines compute ζ(n) − 1 for integer n.

### sub zetam1(Num(Cool) $s where \* ≠ 1 --> Num) is export(:zeta)

### sub zetam1-e(Num(Cool) $s where \* ≠ 1 --> List) is export(:zeta)

These routines compute ζ(s) − 1 for arbitrary s.

### sub hzeta(Num(Cool) $t where \* > 1, Num(Cool) $q where \* > 0 --> Num) is export(:zeta)

### sub hzeta-e(Num(Cool) $t where \* > 1, Num(Cool) $q where \* > 0 --> List) is export(:zeta)

These routines compute the Hurwitz zeta function ζ(t, q).

### sub eta-int(Int $n --> Num) is export(:zeta)

### sub eta-int-e(Int $n --> List) is export(:zeta)

These routines compute the eta function η(n) for integer n.

### sub eta(Num(Cool) $s --> Num) is export(:zeta)

### sub eta-e(Num(Cool) $s --> List) is export(:zeta)

These routines compute the eta function η(s) for arbitrary s.

# C Library Documentation

For more details on libgsl see <https://www.gnu.org/software/gsl/>. The excellent C Library manual is available here <https://www.gnu.org/software/gsl/doc/html/index.html>, or here <https://www.gnu.org/software/gsl/doc/latex/gsl-ref.pdf> in PDF format.

# Prerequisites

This module requires the libgsl library to be installed. Please follow the instructions below based on your platform:

## Debian Linux and Ubuntu 20.04

```
sudo apt install libgsl23 libgsl-dev libgslcblas0

```

That command will install libgslcblas0 as well, since it's used by the GSL.

## Ubuntu 18.04

libgsl23 and libgslcblas0 have a missing symbol on Ubuntu 18.04. I solved the issue installing the Debian Buster version of those three libraries:

* <http://http.us.debian.org/debian/pool/main/g/gsl/libgslcblas0_2.5+dfsg-6_amd64.deb>
* <http://http.us.debian.org/debian/pool/main/g/gsl/libgsl23_2.5+dfsg-6_amd64.deb>
* <http://http.us.debian.org/debian/pool/main/g/gsl/libgsl-dev_2.5+dfsg-6_amd64.deb>

# Installation

To install it using zef (a module management tool):

```
$ zef install Math::Libgsl::Function

```

# AUTHOR

Fernando Santagata [nando.santagata@gmail.com](mailto:nando.santagata@gmail.com)

# COPYRIGHT AND LICENSE

Copyright 2020 Fernando Santagata

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.


## dist_zef-jonathanstowe-FastCGI-NativeCall-Async.md
# FastCGI::NativeCall::Async

An asynchronous wrapper for [FastCGI::NativeCall](https://github.com/jonathanstowe/raku-fcgi-nativecall)

![Build Status](https://github.com/jonathanstowe/FastCGI-NativeCall-Async/workflows/CI/badge.svg)

## Synopsis

```
use FastCGI::NativeCall::Async;

my $fna = FastCGI::NativeCall::Async.new(path => "/tmp/fastcgi.sock", backlog => 32 );

my $count = 0;

react {
    whenever $fna -> $fcgi {
	    say $fcgi.env;
        $fcgi.Print("Content-Type: text/html\r\n\r\n{++$count}");
    }
}

```

## Description

The rationale behind this module is to help
[FastCGI::NativeCall](https://github.com/jonathanstowe/raku-fcgi-nativecall)
play nicely in a larger program by managing the blocking accept loop as
a Supply that can for instance be used in a `react` block as above.
It doesn't actually allow more than one FastCGI request to be processed at
once for the same URI as the protocol itself precludes that. However it
does allow more than one FastCGI handler to be present in the same Raku
program, potentially sharing data and other resources.

## Installation

You will need a working HTTP server that can handle FastCGI to be able to
use this properly.

Assuming you have a working Rakudo installation you should be able to install this with *zef* :

```
 zef install FastCGI::NativeCall::Async

 # Or from a local clone

 zef install .

```

## Support

This module itself is fairly simple, but does depend on both other modules and the configuration of
of your HTTP Server.

Please send any suggestions/patches etc to [github](https://github.com/jonathanstowe/FastCGI-NativeCall-Async/issues)

I'd be interested in working configurations for various HTTP servers.

## Licence & Copyright

This is free software see the <LICENCE> file in the distribution.

© 2017 - 2021 Jonathan Stowe