## Maxima – 98- Funzioni speciali – 4

Continuo da qui, copio dal Reference Manual, PDF scaricabile da qui, sono a p.297.

Funzioni gamma e fattoriali

The gamma function and the related beta, psi and incomplete gamma functions are defined in Abramowitz and Stegun, Handbook of Mathematical Functions, Chapter 6.

`bffac (expr, n)`
Bigfloat version of the factorial (shifted gamma) function. The second argument is how many digits to retain and return, it’s a good idea to request a couple of extra.

`bfpsi (n, z, fpprec)`
`bfpsi0 (z, fpprec)`
`bfpsi` is the polygamma function of real argument `z` and integer order `n`. `bfpsi0` is the digamma function. `bfpsi0(z, fpprec)` is equivalent to `bfpsi(0, z, fpprec)`.

These functions return bigfloat values. `fpprec` is the bigfloat precision of the return value.

`cbffac (z, fpprec)`
Complex bigfloat factorial.

`load("bffac")` loads this function.

`gamma (z)`
The basic definition of the gamma function is

Maxima simplifies `gamma` for positive integer and positive and negative rational numbers. For half integral values the result is a rational number times `sqrt(%pi)`.

The simplification for integer values is controlled by `factlim`. For integers greater than `factlim` the numerical result of the factorial function, which is used to calculate `gamma`, will overflow. The simplification for rational numbers is controlled by `gammalim` to avoid internal overflow. See `factlim` and `gammalim`.

For negative integers gamma is not defined.

Maxima can evalute `gamma` numerically for real and complex values in float and bigfloat precision.

`gamma` has mirror symmetry.

When `gamma_expand` is `true`, Maxima expands `gamma` for arguments `z+n` and `z-n` where `n` is an integer.

Maxima knows the derivate of `gamma`.

Simplification for integer, half integral, and rational numbers:

``````(%i1) map('gamma,[1,2,3,4,5,6,7,8,9]);
(%o1)               [1, 1, 2, 6, 24, 120, 720, 5040, 40320]
(%i2) map('gamma,[1/2,3/2,5/2,7/2]);
sqrt(%pi)  3 sqrt(%pi)  15 sqrt(%pi)
(%o2)          [sqrt(%pi), ---------, -----------, ------------]
2           4            8
(%i3) map('gamma,[2/3,5/3,7/3]);
2           1
2 gamma(-)  4 gamma(-)
2           3           3
(%o3)                 [gamma(-), ----------, ----------]
3       3           9``````

Numerical evaluation for real and complex values:

``````(%i4) map('gamma,[2.5,2.5b0]);
(%o4)              [1.329340388179137, 1.329340388179137b0]
(%i5) map('gamma,[1.0+%i,1.0b0+%i]);
(%o5) [0.4980156681183561 - 0.1549498283018106 %i,
4.980156681183561b-1 - 1.549498283018107b-1 %i]``````

`gamma` has mirror symmetry:

``````(%i6) declare(z,complex)\$

(%i7) conjugate(gamma(z));
(%o7)                         gamma(conjugate(z))``````

Maxima expands `gamma(z+n)` and `gamma(z-n)`, when `gamma_expand` is `true`:

``````(%i1) gamma_expand:true\$

(%i2) [gamma(z+1),gamma(z-1),gamma(z+2)/gamma(z+1)];
gamma(z)
(%o2)                    [z gamma(z), --------, z + 1]
z - 1``````

The deriviative of `gamma`:

``````(%i3) diff(gamma(z),z);
(%o3)                          psi (z) gamma(z)
0
``````

See also `makegamma`.

The Euler-Mascheroni constant is `%gamma`.

``````(%i1) float (%gamma);
(%o1)                         0.5772156649015329``````

`log_gamma (z)`
The natural logarithm of the gamma function.

`gamma_incomplete_lower (a, z)`
The lower incomplete gamma function:

See also `gamma_incomplete` (upper incomplete gamma function).

`gamma_incomplete (a, z)`
The incomplete upper gamma function:

See also `gamma_expand` for controlling how `gamma_incomplete` is expressed in terms of elementary functions and `erfc`.

Also see the related functions `gamma_incomplete_regularized` and `gamma_incomplete_generalized`.

`gamma_incomplete_regularized (a, z)`
The regularized incomplete upper gamma function:

See also `gamma_expand` for controlling how `gamma_incomplete` is expressed in terms of elementary functions and `erfc`. Also see `gamma_incomplete`.

`gamma_incomplete_generalized (a, z1, z2)`
The generalized incomplete gamma function.

Also see `gamma_incomplete` and `gamma_incomplete_regularized`.

`gamma_expand`
Default value: `false`.

`gamma_expand` controls expansion of `gamma_incomplete`. When `gamma_expand` is `true`, `gamma_incomplete(v,z)` is expanded in terms of `z`, `exp(z)`, `and erfc(z)` when possible.

``````(%i1) gamma_incomplete(2,z);
(%o1)                       gamma_incomplete(2, z)
(%i2) gamma_expand:true;
(%o2)                                true
(%i3) gamma_incomplete(2,z);
- z
(%o3)                            (z + 1) %e
(%i4) gamma_incomplete(3/2,z);
- z   sqrt(%pi) erfc(sqrt(z))
(%o4)               sqrt(z) %e    + -----------------------
2``````

`gammalim`
Default value: `10000`.

`gammalim` controls simplification of the gamma function for integral and rational number arguments. If the absolute value of the argument is not greater than `gammalim`, then simplification will occur. Note that the `factlim` switch controls simplification of the result of gamma of an integer argument as well.

pausa 😋

Posta un commento o usa questo indirizzo per il trackback.