[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

# 72. stirling

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

## 72.1 Functions and Variables for stirling

Function: stirling (z,n)

  Replace `gamma(x)` with the O(1/x^(2n-1)) Stirling formula. when n isn't a nonnegative integer, signal an error.

  Reference: Abramowitz & Stegun, " Handbook of mathematical functions", 6.1.40.

  Examples:

      (%i1) load (stirling)$

      (%i2) stirling(gamma(%alpha+x)/gamma(x),1);
             1/2 - x             x + %alpha - 1/2
      (%o2) x        (x + %alpha)
                                         1           1
                                  --------------- - ---- - %alpha
                                  12 (x + %alpha)   12 x
                                %e
      (%i3) taylor(%,x,inf,1);
                          %alpha       2    %alpha
                %alpha   x       %alpha  - x       %alpha
      (%o3)/T/ x       + -------------------------------- + . . .
                                       2 x
      (%i4) map('factor,%);
                                             %alpha - 1
               %alpha   (%alpha - 1) %alpha x
      (%o4)   x       + -------------------------------
                                        2

  The function `stirling` knows the difference between the variable 'gamma' and the function gamma:

      (%i5) stirling(gamma + gamma(x),0);
                                          x - 1/2   - x
      (%o5)    gamma + sqrt(2) sqrt(%pi) x        %e
      (%i6) stirling(gamma(y) + gamma(x),0);
                               y - 1/2   - y
      (%o6) sqrt(2) sqrt(%pi) y        %e
                                                    x - 1/2   - x
                               + sqrt(2) sqrt(%pi) x        %e

  To use this function write first `load("stirling")`.

[ << ] | [ >> ] |  |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

This document was generated by Robert Dodier on August, 25 2007 using texi2html 1.76.